address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0xea38c95b650d2145cf96eab2988ac9d0f0b0e387 | pragma solidity ^0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract Erc20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
* @dev (from OpenZeppelin)
*/
library LibSafeMath {
/**
* @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;
}
/**
* @dev Safe a * b / c
*/
function mulDiv(uint256 a, uint256 b, uint256 c) internal pure returns (uint256) {
uint256 d = mul(a, b);
return div(d, c);
}
}
contract OwnedToken {
using LibSafeMath for uint256;
/**
* ERC20 info
*/
string public name = 'Altty';
string public symbol = 'LTT';
uint8 public decimals = 18;
/**
* Allowence list
*/
mapping (address => mapping (address => uint256)) private allowed;
/**
* Count of token at each account
*/
mapping(address => uint256) private shares;
/**
* Total amount
*/
uint256 private shareCount_;
/**
* Owner (main admin)
*/
address public owner = msg.sender;
/**
* List of admins
*/
mapping(address => bool) public isAdmin;
/**
* List of address on hold
*/
mapping(address => bool) public holded;
/**
* Events
*/
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Burn(address indexed owner, uint256 amount);
event Mint(address indexed to, uint256 amount);
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Throws if not admin
*/
modifier onlyAdmin() {
require(isAdmin[msg.sender]);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner
* @param newOwner The address to transfer ownership to
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0)); // if omittet addres, default is 0
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* Empower/fire admin
*/
function empowerAdmin(address _user) onlyOwner public {
isAdmin[_user] = true;
}
function fireAdmin(address _user) onlyOwner public {
isAdmin[_user] = false;
}
/**
* Hold account
*/
function hold(address _user) onlyOwner public {
holded[_user] = true;
}
/**
* Unhold account
*/
function unhold(address _user) onlyOwner public {
holded[_user] = false;
}
/**
* Edit token info
*/
function setName(string _name) onlyOwner public {
name = _name;
}
function setSymbol(string _symbol) onlyOwner public {
symbol = _symbol;
}
function setDecimals(uint8 _decimals) onlyOwner public {
decimals = _decimals;
}
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return shareCount_;
}
/**
* @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 shares[_owner];
}
/**
* @dev Internal transfer tokens from one address to another
* @dev if adress is zero - mint or destroy tokens
* @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 shareTransfer(address _from, address _to, uint256 _value) internal returns (bool) {
require(!holded[_from]);
if(_from == address(0)) {
emit Mint(_to, _value);
shareCount_ =shareCount_.add(_value);
} else {
require(_value <= shares[_from]);
shares[_from] = shares[_from].sub(_value);
}
if(_to == address(0)) {
emit Burn(msg.sender, _value);
shareCount_ =shareCount_.sub(_value);
} else {
shares[_to] =shares[_to].add(_value);
}
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to
* @param _value The amount to be transferred
*/
function transfer(address _to, uint256 _value) public returns (bool) {
return shareTransfer(msg.sender, _to, _value);
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_value <= allowed[_from][msg.sender]);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
return shareTransfer(_from, _to, _value);
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _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;
}
/**
* @dev Withdraw ethereum for a specified address
* @param _to The address to transfer to
* @param _value The amount to be transferred
*/
function withdraw(address _to, uint256 _value) onlyOwner public returns (bool) {
require(_to != address(0));
require(_value <= address(this).balance);
_to.transfer(_value);
return true;
}
/**
* @dev Withdraw token (assets of our contract) for a specified address
* @param token The address of token for transfer
* @param _to The address to transfer to
* @param amount The amount to be transferred
*/
function withdrawToken(address token, address _to, uint256 amount) onlyOwner public returns (bool) {
require(token != address(0));
require(Erc20Basic(token).balanceOf(address(this)) >= amount);
bool transferOk = Erc20Basic(token).transfer(_to, amount);
require(transferOk);
return true;
}
}
contract TenderToken is OwnedToken {
// dividends
uint256 public price = 3 ether / 1000000;
uint256 public sellComission = 2900; // 2.9%
uint256 public buyComission = 2900; // 2.9%
// dividers
uint256 public priceUnits = 1 ether;
uint256 public sellComissionUnits = 100000;
uint256 public buyComissionUnits = 100000;
/**
* Orders structs
*/
struct SellOrder {
address user;
uint256 shareNumber;
}
struct BuyOrder {
address user;
uint256 amountWei;
}
/**
* Current orders list and total amounts in order
*/
SellOrder[] public sellOrder;
BuyOrder[] public buyOrder;
uint256 public sellOrderTotal;
uint256 public buyOrderTotal;
/**
* Magic buy-order create
* NB!!! big gas cost (non standart), see docs
*/
function() public payable {
if(!isAdmin[msg.sender]) {
buyOrder.push(BuyOrder(msg.sender, msg.value));
buyOrderTotal += msg.value;
}
}
/**
* Magic sell-order create
*/
function shareTransfer(address _from, address _to, uint256 _value) internal returns (bool) {
if(_to == address(this)) {
sellOrder.push(SellOrder(msg.sender, _value));
sellOrderTotal += _value;
}
return super.shareTransfer(_from, _to, _value);
}
/**
* Configurate current price/comissions
*/
function setPrice(uint256 _price) onlyAdmin public {
price = _price;
}
function setSellComission(uint _sellComission) onlyOwner public {
sellComission = _sellComission;
}
function setBuyComission(uint _buyComission) onlyOwner public {
buyComission = _buyComission;
}
function setPriceUnits(uint256 _priceUnits) onlyOwner public {
priceUnits = _priceUnits;
}
function setSellComissionUnits(uint _sellComissionUnits) onlyOwner public {
sellComissionUnits = _sellComissionUnits;
}
function setBuyComissionUnits(uint _buyComissionUnits) onlyOwner public {
buyComissionUnits = _buyComissionUnits;
}
/**
* @dev Calculate default price for selected number of shares
* @param shareNumber number of shares
* @return amount
*/
function shareToWei(uint256 shareNumber) public view returns (uint256) {
uint256 amountWei = shareNumber.mulDiv(price, priceUnits);
uint256 comissionWei = amountWei.mulDiv(sellComission, sellComissionUnits);
return amountWei.sub(comissionWei);
}
/**
* @dev Calculate count of shares what can buy with selected amount for default price
* @param amountWei amount for buy share
* @return number of shares
*/
function weiToShare(uint256 amountWei) public view returns (uint256) {
uint256 shareNumber = amountWei.mulDiv(priceUnits, price);
uint256 comissionShare = shareNumber.mulDiv(buyComission, buyComissionUnits);
return shareNumber.sub(comissionShare);
}
/**
* Confirm all buys/sells
*/
function confirmAllBuys() external onlyAdmin {
while(buyOrder.length > 0) {
_confirmOneBuy();
}
}
function confirmAllSells() external onlyAdmin {
while(sellOrder.length > 0) {
_confirmOneSell();
}
}
/**
* Confirm one sell/buy (for problems fix)
*/
function confirmOneBuy() external onlyAdmin {
if(buyOrder.length > 0) {
_confirmOneBuy();
}
}
function confirmOneSell() external onlyAdmin {
_confirmOneSell();
}
/**
* Cancel one sell (for problem fix)
*/
function cancelOneSell() internal {
uint256 i = sellOrder.length-1;
shareTransfer(address(this), sellOrder[i].user, sellOrder[i].shareNumber);
sellOrderTotal -= sellOrder[i].shareNumber;
delete sellOrder[sellOrder.length-1];
sellOrder.length--;
}
/**
* Internal buy/sell
*/
function _confirmOneBuy() internal {
uint256 i = buyOrder.length-1;
uint256 amountWei = buyOrder[i].amountWei;
uint256 shareNumber = weiToShare(amountWei);
address user = buyOrder[i].user;
shareTransfer(address(0), user, shareNumber);
buyOrderTotal -= amountWei;
delete buyOrder[buyOrder.length-1];
buyOrder.length--;
}
function _confirmOneSell() internal {
uint256 i = sellOrder.length-1;
uint256 shareNumber = sellOrder[i].shareNumber;
uint256 amountWei = shareToWei(shareNumber);
address user = sellOrder[i].user;
shareTransfer(address(this), address(0), shareNumber);
sellOrderTotal -= shareNumber;
user.transfer(amountWei);
delete sellOrder[sellOrder.length-1];
sellOrder.length--;
}
} | 0x60806040526004361061022f5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301e3366781146102f757806306279d721461033557806306fdde031461035c578063095ea7b3146103e657806309dd4eea1461040a578063103e81541461042b57806317adfa081461044057806318160ddd146104555780631a70388f1461046a578063212e25961461048257806322f85eaa1461049757806323b872dd146104d257806324d7806c146104fc578063313ce5671461051d5780634556611e146105485780634925480e146105605780635bfface4146105815780636529abba1461059957806366188463146105b157806370a08231146105d5578063730a0d80146105f65780637702b8e4146106175780637a1395aa1461062c5780638b00299b146106475780638da5cb5b1461065f57806391b7f5ed14610690578063928993dd146106a857806395d89b41146106c057806397514d90146106d5578063a035b1fe146106ed578063a62e5a7d14610702578063a7e21e8014610717578063a9059cbb14610738578063adc8b4cf1461075c578063b47f817e1461077d578063b84c824614610792578063c0981285146107eb578063c47f002714610800578063c9cc049814610859578063d73dd6231461086e578063dd62ed3e14610892578063e9dc438e146108b9578063f0342179146108ce578063f2fde38b146108e6578063f316ea7814610907578063f3fef3a31461091c575b3360009081526007602052604090205460ff1615156102f5576040805180820190915233815234602082018181526010805460018101825560009190915292517f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae6726002909402938401805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055517f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae673909201919091556012805490910190555b005b34801561030357600080fd5b50610321600160a060020a0360043581169060243516604435610940565b604080519115158252519081900360200190f35b34801561034157600080fd5b5061034a610acd565b60408051918252519081900360200190f35b34801561036857600080fd5b50610371610ad3565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103ab578181015183820152602001610393565b50505050905090810190601f1680156103d85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103f257600080fd5b50610321600160a060020a0360043516602435610b61565b34801561041657600080fd5b50610321600160a060020a0360043516610bc7565b34801561043757600080fd5b5061034a610bdc565b34801561044c57600080fd5b506102f5610be2565b34801561046157600080fd5b5061034a610c15565b34801561047657600080fd5b5061034a600435610c1c565b34801561048e57600080fd5b5061034a610c6f565b3480156104a357600080fd5b506104af600435610c75565b60408051600160a060020a03909316835260208301919091528051918290030190f35b3480156104de57600080fd5b50610321600160a060020a0360043581169060243516604435610cab565b34801561050857600080fd5b50610321600160a060020a0360043516610d3e565b34801561052957600080fd5b50610532610d53565b6040805160ff9092168252519081900360200190f35b34801561055457600080fd5b5061034a600435610d5c565b34801561056c57600080fd5b506102f5600160a060020a0360043516610d95565b34801561058d57600080fd5b506102f5600435610dcd565b3480156105a557600080fd5b506102f5600435610de9565b3480156105bd57600080fd5b50610321600160a060020a0360043516602435610e05565b3480156105e157600080fd5b5061034a600160a060020a0360043516610ef7565b34801561060257600080fd5b506102f5600160a060020a0360043516610f12565b34801561062357600080fd5b506102f5610f4a565b34801561063857600080fd5b506102f560ff60043516610f70565b34801561065357600080fd5b506102f5600435610f9d565b34801561066b57600080fd5b50610674610fb9565b60408051600160a060020a039092168252519081900360200190f35b34801561069c57600080fd5b506102f5600435610fc8565b3480156106b457600080fd5b506102f5600435610feb565b3480156106cc57600080fd5b50610371611007565b3480156106e157600080fd5b506104af600435611061565b3480156106f957600080fd5b5061034a61106f565b34801561070e57600080fd5b5061034a611075565b34801561072357600080fd5b506102f5600160a060020a036004351661107b565b34801561074457600080fd5b50610321600160a060020a03600435166024356110b6565b34801561076857600080fd5b506102f5600160a060020a03600435166110ca565b34801561078957600080fd5b506102f5611105565b34801561079e57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102f594369492936024939284019190819084018382808284375094975061113b9650505050505050565b3480156107f757600080fd5b5061034a611169565b34801561080c57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102f594369492936024939284019190819084018382808284375094975061116f9650505050505050565b34801561086557600080fd5b5061034a611199565b34801561087a57600080fd5b50610321600160a060020a036004351660243561119f565b34801561089e57600080fd5b5061034a600160a060020a0360043581169060243516611238565b3480156108c557600080fd5b506102f5611263565b3480156108da57600080fd5b506102f5600435611299565b3480156108f257600080fd5b506102f5600160a060020a03600435166112b5565b34801561091357600080fd5b5061034a61134a565b34801561092857600080fd5b50610321600160a060020a0360043516602435611350565b6006546000908190600160a060020a0316331461095c57600080fd5b600160a060020a038516151561097157600080fd5b604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290518491600160a060020a038816916370a08231916024808201926020929091908290030181600087803b1580156109d557600080fd5b505af11580156109e9573d6000803e3d6000fd5b505050506040513d60208110156109ff57600080fd5b50511015610a0c57600080fd5b84600160a060020a031663a9059cbb85856040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015610a8857600080fd5b505af1158015610a9c573d6000803e3d6000fd5b505050506040513d6020811015610ab257600080fd5b50519050801515610ac257600080fd5b506001949350505050565b600c5481565b6000805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610b595780601f10610b2e57610100808354040283529160200191610b59565b820191906000526020600020905b815481529060010190602001808311610b3c57829003601f168201915b505050505081565b336000818152600360209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60086020526000908152604090205460ff1681565b600d5481565b3360009081526007602052604090205460ff161515610c0057600080fd5b60105460001015610c1357610c136113cd565b565b6005545b90565b6000806000610c3a600954600c54866114a09092919063ffffffff16565b9150610c55600a54600d54846114a09092919063ffffffff16565b9050610c67828263ffffffff6114c216565b949350505050565b60115481565b6010805482908110610c8357fe5b600091825260209091206002909102018054600190910154600160a060020a03909116915082565b600160a060020a0383166000908152600360209081526040808320338452909152812054821115610cdb57600080fd5b600160a060020a0384166000908152600360209081526040808320338452909152902054610d0f908363ffffffff6114c216565b600160a060020a0385166000908152600360209081526040808320338452909152902055610c678484846114d4565b60076020526000908152604090205460ff1681565b60025460ff1681565b6000806000610d7a600c54600954866114a09092919063ffffffff16565b9150610c55600b54600e54846114a09092919063ffffffff16565b600654600160a060020a03163314610dac57600080fd5b600160a060020a03166000908152600760205260409020805460ff19169055565b600654600160a060020a03163314610de457600080fd5b600b55565b600654600160a060020a03163314610e0057600080fd5b600a55565b336000908152600360209081526040808320600160a060020a038616845290915281205480831115610e5a57336000908152600360209081526040808320600160a060020a0388168452909152812055610e8f565b610e6a818463ffffffff6114c216565b336000908152600360209081526040808320600160a060020a03891684529091529020555b336000818152600360209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a3600191505b5092915050565b600160a060020a031660009081526004602052604090205490565b600654600160a060020a03163314610f2957600080fd5b600160a060020a03166000908152600860205260409020805460ff19169055565b3360009081526007602052604090205460ff161515610f6857600080fd5b610c1361159a565b600654600160a060020a03163314610f8757600080fd5b6002805460ff191660ff92909216919091179055565b600654600160a060020a03163314610fb457600080fd5b600d55565b600654600160a060020a031681565b3360009081526007602052604090205460ff161515610fe657600080fd5b600955565b600654600160a060020a0316331461100257600080fd5b600e55565b60018054604080516020600284861615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610b595780601f10610b2e57610100808354040283529160200191610b59565b600f805482908110610c8357fe5b60095481565b600a5481565b600654600160a060020a0316331461109257600080fd5b600160a060020a03166000908152600860205260409020805460ff19166001179055565b60006110c33384846114d4565b9392505050565b600654600160a060020a031633146110e157600080fd5b600160a060020a03166000908152600760205260409020805460ff19166001179055565b3360009081526007602052604090205460ff16151561112357600080fd5b60105460001015610c13576111366113cd565b611123565b600654600160a060020a0316331461115257600080fd5b80516111659060019060208401906118e0565b5050565b600e5481565b600654600160a060020a0316331461118657600080fd5b80516111659060009060208401906118e0565b600b5481565b336000908152600360209081526040808320600160a060020a03861684529091528120546111d3908363ffffffff61169e16565b336000818152600360209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b3360009081526007602052604090205460ff16151561128157600080fd5b600f5460001015610c135761129461159a565b611281565b600654600160a060020a031633146112b057600080fd5b600c55565b600654600160a060020a031633146112cc57600080fd5b600160a060020a03811615156112e157600080fd5b600654604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60125481565b600654600090600160a060020a0316331461136a57600080fd5b600160a060020a038316151561137f57600080fd5b303182111561138d57600080fd5b604051600160a060020a0384169083156108fc029084906000818181858888f193505050501580156113c3573d6000803e3d6000fd5b5060019392505050565b6010805460001981019160009182918291859081106113e857fe5b906000526020600020906002020160010154925061140583610d5c565b915060108481548110151561141657fe5b60009182526020822060029091020154600160a060020a0316915061143c9082846114d4565b5060128054849003905560108054600019810190811061145857fe5b600091825260208220600290910201805473ffffffffffffffffffffffffffffffffffffffff1916815560010155601080549061149990600019830161195e565b5050505050565b6000806114ad85856116ad565b90506114b981846116d8565b95945050505050565b6000828211156114ce57fe5b50900390565b6000600160a060020a03831630141561158f576040805180820190915233815260208101838152600f805460018101825560009190915291517f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac8026002909302928301805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055517f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac8039091015560118054830190555b610c678484846116ef565b600f805460001981019160009182918291859081106115b557fe5b90600052602060002090600202016001015492506115d283610c1c565b9150600f848154811015156115e357fe5b60009182526020822060029091020154600160a060020a0316915061160a903090856114d4565b50601180548490039055604051600160a060020a0382169083156108fc029084906000818181858888f1935050505015801561164a573d6000803e3d6000fd5b50600f8054600019810190811061165d57fe5b600091825260208220600290910201805473ffffffffffffffffffffffffffffffffffffffff1916815560010155600f80549061149990600019830161195e565b6000828201838110156110c357fe5b6000808315156116c05760009150610ef0565b508282028284828115156116d057fe5b04146110c357fe5b60008082848115156116e657fe5b04949350505050565b600160a060020a03831660009081526008602052604081205460ff161561171557600080fd5b600160a060020a038416151561177f57604080518381529051600160a060020a038516917f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885919081900360200190a2600554611777908363ffffffff61169e16565b6005556117e7565b600160a060020a0384166000908152600460205260409020548211156117a457600080fd5b600160a060020a0384166000908152600460205260409020546117cd908363ffffffff6114c216565b600160a060020a0385166000908152600460205260409020555b600160a060020a03831615156118485760408051838152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2600554611840908363ffffffff6114c216565b60055561188b565b600160a060020a038316600090815260046020526040902054611871908363ffffffff61169e16565b600160a060020a0384166000908152600460205260409020555b82600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35060019392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061192157805160ff191683800117855561194e565b8280016001018555821561194e579182015b8281111561194e578251825591602001919060010190611933565b5061195a92915061198f565b5090565b81548183558181111561198a5760020281600202836000526020600020918201910161198a91906119a9565b505050565b610c1991905b8082111561195a5760008155600101611995565b610c1991905b8082111561195a57805473ffffffffffffffffffffffffffffffffffffffff19168155600060018201556002016119af5600a165627a7a723058202a2acc48cb2e2b0a18befd206cc84763dcf9aed11eb9d5818c9424ebf22556b20029 | {"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 1,800 |
0x28ed891240c2b005f34e89e3219d05cc106c1c7e | /**
*Submitted for verification at Etherscan.io on 2022-02-17
*/
// SPDX-License-Identifier: Unlicensed
/*
TG: https://t.me/shibaoero
*/
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract SHIBOREO is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Shib Oreo";
string private constant _symbol = "SHIBOREO";
uint private constant _decimals = 9;
uint256 private _teamFee = 9;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
// Uniswap Pair
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case.");
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(13).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(25).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(25).div(100);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (20 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 15, "not larger than 15%");
_teamFee = fee;
}
function setSnipper(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
} | 0x60806040526004361061011f5760003560e01c806306d8ea6b1461012b57806306fdde0314610142578063095ea7b31461018657806318160ddd146101b657806323b872dd146101dc578063313ce567146101fc57806331c2d847146102105780633bbac57914610230578063437823ec14610269578063476343ee146102895780635342acb41461029e57806370a08231146102d7578063715018a6146102f75780638da5cb5b1461030c57806390d49b9d1461033957806395d89b4114610359578063994680081461038a578063a9059cbb146103aa578063c9567bf9146103ca578063cf0848f7146103df578063cf9d4afa146103ff578063dd62ed3e1461041f578063e6ec64ec14610465578063f2fde38b1461048557600080fd5b3661012657005b600080fd5b34801561013757600080fd5b506101406104a5565b005b34801561014e57600080fd5b5060408051808201909152600981526853686962204f72656f60b81b60208201525b60405161017d9190611907565b60405180910390f35b34801561019257600080fd5b506101a66101a1366004611981565b6104f6565b604051901515815260200161017d565b3480156101c257600080fd5b50683635c9adc5dea000005b60405190815260200161017d565b3480156101e857600080fd5b506101a66101f73660046119ad565b61050d565b34801561020857600080fd5b5060096101ce565b34801561021c57600080fd5b5061014061022b366004611a04565b610576565b34801561023c57600080fd5b506101a661024b366004611ac8565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561027557600080fd5b50610140610284366004611ac8565b610611565b34801561029557600080fd5b50610140610664565b3480156102aa57600080fd5b506101a66102b9366004611ac8565b6001600160a01b031660009081526004602052604090205460ff1690565b3480156102e357600080fd5b506101ce6102f2366004611ac8565b61069e565b34801561030357600080fd5b506101406106c0565b34801561031857600080fd5b506103216106fb565b6040516001600160a01b03909116815260200161017d565b34801561034557600080fd5b50610140610354366004611ac8565b61070a565b34801561036557600080fd5b50604080518082019091526008815267534849424f52454f60c01b6020820152610170565b34801561039657600080fd5b506101406103a5366004611a04565b610789565b3480156103b657600080fd5b506101a66103c5366004611981565b6108a7565b3480156103d657600080fd5b506101406108b4565b3480156103eb57600080fd5b506101406103fa366004611ac8565b610971565b34801561040b57600080fd5b5061014061041a366004611ac8565b6109c1565b34801561042b57600080fd5b506101ce61043a366004611ae5565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561047157600080fd5b50610140610480366004611b1e565b610c21565b34801561049157600080fd5b506101406104a0366004611ac8565b610c9c565b336104ae6106fb565b6001600160a01b0316146104dd5760405162461bcd60e51b81526004016104d490611b37565b60405180910390fd5b60006104e83061069e565b90506104f381610d39565b50565b6000610503338484610eb3565b5060015b92915050565b600061051a848484610fd7565b61056c843361056785604051806060016040528060288152602001611cb2602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113f3565b610eb3565b5060019392505050565b3361057f6106fb565b6001600160a01b0316146105a55760405162461bcd60e51b81526004016104d490611b37565b60005b815181101561060d576000600560008484815181106105c9576105c9611b6c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061060581611b98565b9150506105a8565b5050565b3361061a6106fb565b6001600160a01b0316146106405760405162461bcd60e51b81526004016104d490611b37565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561060d573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546105079061142d565b336106c96106fb565b6001600160a01b0316146106ef5760405162461bcd60e51b81526004016104d490611b37565b6106f960006114b1565b565b6000546001600160a01b031690565b336107136106fb565b6001600160a01b0316146107395760405162461bcd60e51b81526004016104d490611b37565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b336107926106fb565b6001600160a01b0316146107b85760405162461bcd60e51b81526004016104d490611b37565b60005b815181101561060d57600c5482516001600160a01b03909116908390839081106107e7576107e7611b6c565b60200260200101516001600160a01b0316141580156108385750600b5482516001600160a01b039091169083908390811061082457610824611b6c565b60200260200101516001600160a01b031614155b156108955760016005600084848151811061085557610855611b6c565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061089f81611b98565b9150506107bb565b6000610503338484610fd7565b336108bd6106fb565b6001600160a01b0316146108e35760405162461bcd60e51b81526004016104d490611b37565b600c54600160a01b900460ff166109475760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104d4565b600c805460ff60b81b1916600160b81b17905542600d81905561096c906104b0611bb3565b600e55565b3361097a6106fb565b6001600160a01b0316146109a05760405162461bcd60e51b81526004016104d490611b37565b6001600160a01b03166000908152600460205260409020805460ff19169055565b336109ca6106fb565b6001600160a01b0316146109f05760405162461bcd60e51b81526004016104d490611b37565b600c54600160a01b900460ff1615610a585760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104d4565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad39190611bcb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b449190611bcb565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb59190611bcb565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b33610c2a6106fb565b6001600160a01b031614610c505760405162461bcd60e51b81526004016104d490611b37565b600f811115610c975760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b60448201526064016104d4565b600855565b33610ca56106fb565b6001600160a01b031614610ccb5760405162461bcd60e51b81526004016104d490611b37565b6001600160a01b038116610d305760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104d4565b6104f3816114b1565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d8157610d81611b6c565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfe9190611bcb565b81600181518110610e1157610e11611b6c565b6001600160a01b039283166020918202929092010152600b54610e379130911684610eb3565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e70908590600090869030904290600401611be8565b600060405180830381600087803b158015610e8a57600080fd5b505af1158015610e9e573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610f155760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104d4565b6001600160a01b038216610f765760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104d4565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661103b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104d4565b6001600160a01b03821661109d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104d4565b600081116110ff5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104d4565b6001600160a01b03831660009081526005602052604090205460ff16156111a75760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104d4565b6001600160a01b03831660009081526004602052604081205460ff161580156111e957506001600160a01b03831660009081526004602052604090205460ff16155b80156111ff5750600c54600160a81b900460ff16155b801561122f5750600c546001600160a01b038581169116148061122f5750600c546001600160a01b038481169116145b156113e157600c54600160b81b900460ff1661128d5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104d4565b50600c546001906001600160a01b0385811691161480156112bc5750600b546001600160a01b03848116911614155b80156112c9575042600e54115b156113115760006112d98461069e565b90506112fa60646112f4683635c9adc5dea00000600d611501565b90611580565b61130484836115bf565b111561130f57600080fd5b505b600d5442141561133f576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061134a3061069e565b600c54909150600160b01b900460ff161580156113755750600c546001600160a01b03868116911614155b156113df5780156113df57600c546113a9906064906112f4906019906113a3906001600160a01b031661069e565b90611501565b8111156113d657600c546113d3906064906112f4906019906113a3906001600160a01b031661069e565b90505b6113df81610d39565b505b6113ed8484848461161c565b50505050565b600081848411156114175760405162461bcd60e51b81526004016104d49190611907565b5060006114248486611c59565b95945050505050565b60006006548211156114945760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104d4565b600061149e61171f565b90506114aa8382611580565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008261151057506000610507565b600061151c8385611c70565b9050826115298583611c8f565b146114aa5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104d4565b60006114aa83836040518060400160405280601a815260200179536166654d6174683a206469766973696f6e206279207a65726f60301b815250611742565b6000806115cc8385611bb3565b9050838110156114aa5760405162461bcd60e51b815260206004820152601b60248201527a536166654d6174683a206164646974696f6e206f766572666c6f7760281b60448201526064016104d4565b808061162a5761162a611770565b6000806000806116398761178c565b6001600160a01b038d166000908152600160205260409020549397509195509350915061166690856117d3565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461169590846115bf565b6001600160a01b0389166000908152600160205260409020556116b781611815565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116fc91815260200190565b60405180910390a3505050508061171857611718600954600855565b5050505050565b600080600061172c61185f565b909250905061173b8282611580565b9250505090565b600081836117635760405162461bcd60e51b81526004016104d49190611907565b5060006114248486611c8f565b60006008541161177f57600080fd5b6008805460095560009055565b6000806000806000806117a1876008546118a1565b9150915060006117af61171f565b90506000806117bf8a85856118ce565b909b909a5094985092965092945050505050565b60006114aa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113f3565b600061181f61171f565b9050600061182d8383611501565b3060009081526001602052604090205490915061184a90826115bf565b30600090815260016020526040902055505050565b6006546000908190683635c9adc5dea0000061187b8282611580565b82101561189857505060065492683635c9adc5dea0000092509050565b90939092509050565b600080806118b460646112f48787611501565b905060006118c286836117d3565b96919550909350505050565b600080806118dc8685611501565b905060006118ea8686611501565b905060006118f883836117d3565b92989297509195505050505050565b600060208083528351808285015260005b8181101561193457858101830151858201604001528201611918565b81811115611946576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104f357600080fd5b803561197c8161195c565b919050565b6000806040838503121561199457600080fd5b823561199f8161195c565b946020939093013593505050565b6000806000606084860312156119c257600080fd5b83356119cd8161195c565b925060208401356119dd8161195c565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a1757600080fd5b82356001600160401b0380821115611a2e57600080fd5b818501915085601f830112611a4257600080fd5b813581811115611a5457611a546119ee565b8060051b604051601f19603f83011681018181108582111715611a7957611a796119ee565b604052918252848201925083810185019188831115611a9757600080fd5b938501935b82851015611abc57611aad85611971565b84529385019392850192611a9c565b98975050505050505050565b600060208284031215611ada57600080fd5b81356114aa8161195c565b60008060408385031215611af857600080fd5b8235611b038161195c565b91506020830135611b138161195c565b809150509250929050565b600060208284031215611b3057600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611bac57611bac611b82565b5060010190565b60008219821115611bc657611bc6611b82565b500190565b600060208284031215611bdd57600080fd5b81516114aa8161195c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c385784516001600160a01b031683529383019391830191600101611c13565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c6b57611c6b611b82565b500390565b6000816000190483118215151615611c8a57611c8a611b82565b500290565b600082611cac57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d60d68a42d3d05e16cd325fcc775c4a30a8eef02f71642ca35bf65a47c20094c64736f6c634300080b0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,801 |
0x008692a1683b7751af28ea22b96569606f5260b2 | /**
*Submitted for verification at Etherscan.io on 2021-07-03
*/
// 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 USDoge is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string public constant _name = "United States of Doge";
string public constant _symbol = "USDOGE 🇺🇸";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 1 * 10**12 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c3c8cd8011610064578063c3c8cd80146106d2578063c9567bf9146106e9578063d28d885214610700578063d543dbeb14610790578063dd62ed3e146107cb5761012a565b80638da5cb5b1461043b57806395d89b411461047c578063a9059cbb1461050c578063b09f12661461057d578063b515566a1461060d5761012a565b8063313ce567116100e7578063313ce5671461033d5780635932ead11461036b5780636fc3eaec146103a857806370a08231146103bf578063715018a6146104245761012a565b806306fdde031461012f578063095ea7b3146101bf57806318160ddd1461023057806323b872dd1461025b578063273123b7146102ec5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610850565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610184578082015181840152602081019050610169565b50505050905090810190601f1680156101b15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cb57600080fd5b50610218600480360360408110156101e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061088d565b60405180821515815260200191505060405180910390f35b34801561023c57600080fd5b506102456108ab565b6040518082815260200191505060405180910390f35b34801561026757600080fd5b506102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108bc565b60405180821515815260200191505060405180910390f35b3480156102f857600080fd5b5061033b6004803603602081101561030f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610995565b005b34801561034957600080fd5b50610352610ab8565b604051808260ff16815260200191505060405180910390f35b34801561037757600080fd5b506103a66004803603602081101561038e57600080fd5b81019080803515159060200190929190505050610ac1565b005b3480156103b457600080fd5b506103bd610ba6565b005b3480156103cb57600080fd5b5061040e600480360360208110156103e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c18565b6040518082815260200191505060405180910390f35b34801561043057600080fd5b50610439610d03565b005b34801561044757600080fd5b50610450610e89565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561048857600080fd5b50610491610eb2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d15780820151818401526020810190506104b6565b50505050905090810190601f1680156104fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561051857600080fd5b506105656004803603604081101561052f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eef565b60405180821515815260200191505060405180910390f35b34801561058957600080fd5b50610592610f0d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d25780820151818401526020810190506105b7565b50505050905090810190601f1680156105ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061957600080fd5b506106d06004803603602081101561063057600080fd5b810190808035906020019064010000000081111561064d57600080fd5b82018360208201111561065f57600080fd5b8035906020019184602083028401116401000000008311171561068157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610f46565b005b3480156106de57600080fd5b506106e7611096565b005b3480156106f557600080fd5b506106fe611110565b005b34801561070c57600080fd5b5061071561178e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561075557808201518184015260208101905061073a565b50505050905090810190601f1680156107825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079c57600080fd5b506107c9600480360360208110156107b357600080fd5b81019080803590602001909291905050506117c7565b005b3480156107d757600080fd5b5061083a600480360360408110156107ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611976565b6040518082815260200191505060405180910390f35b60606040518060400160405280601581526020017f556e6974656420537461746573206f6620446f67650000000000000000000000815250905090565b60006108a161089a6119fd565b8484611a05565b6001905092915050565b6000683635c9adc5dea00000905090565b60006108c9848484611bfc565b61098a846108d56119fd565b61098585604051806060016040528060288152602001613ee960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093b6119fd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245b9092919063ffffffff16565b611a05565b600190509392505050565b61099d6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610ac96119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610be76119fd565b73ffffffffffffffffffffffffffffffffffffffff1614610c0757600080fd5b6000479050610c158161251b565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610cb357600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610cfe565b610cfb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612616565b90505b919050565b610d0b6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dcb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600f81526020017f5553444f474520f09f87baf09f87b80000000000000000000000000000000000815250905090565b6000610f03610efc6119fd565b8484611bfc565b6001905092915050565b6040518060400160405280600f81526020017f5553444f474520f09f87baf09f87b8000000000000000000000000000000000081525081565b610f4e6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461100e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b81518110156110925760016007600084848151811061102c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611011565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110d76119fd565b73ffffffffffffffffffffffffffffffffffffffff16146110f757600080fd5b600061110230610c18565b905061110d8161269a565b50565b6111186119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff161561125b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506112eb30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611a05565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561133157600080fd5b505afa158015611345573d6000803e3d6000fd5b505050506040513d602081101561135b57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ce57600080fd5b505afa1580156113e2573d6000803e3d6000fd5b505050506040513d60208110156113f857600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561147257600080fd5b505af1158015611486573d6000803e3d6000fd5b505050506040513d602081101561149c57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061153630610c18565b600080611541610e89565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b1580156115c657600080fd5b505af11580156115da573d6000803e3d6000fd5b50505050506040513d60608110156115f157600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff021916908315150217905550683635c9adc5dea000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561174f57600080fd5b505af1158015611763573d6000803e3d6000fd5b505050506040513d602081101561177957600080fd5b81019080805190602001909291905050505050565b6040518060400160405280601581526020017f556e6974656420537461746573206f6620446f6765000000000000000000000081525081565b6117cf6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461188f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611905576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b611934606461192683683635c9adc5dea0000061298490919063ffffffff16565b612a0a90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613f5f6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613ea66022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613f3a6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e596023913960400191505060405180910390fd5b60008111611d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613f116029913960400191505060405180910390fd5b611d69610e89565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611dd75750611da7610e89565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561239857601360179054906101000a900460ff161561203d573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e5957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611eb35750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f0d5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561203c57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f536119fd565b73ffffffffffffffffffffffffffffffffffffffff161480611fc95750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fb16119fd565b73ffffffffffffffffffffffffffffffffffffffff16145b61203b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461212d5760145481111561207f57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156121235750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61212c57600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121d85750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561222e5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156122465750601360179054906101000a900460ff165b156122de5742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061229657600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006122e930610c18565b9050601360159054906101000a900460ff161580156123565750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561236e5750601360169054906101000a900460ff165b156123965761237c8161269a565b60004790506000811115612394576123934761251b565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061243f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561244957600090505b61245584848484612a54565b50505050565b6000838311158290612508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124cd5780820151818401526020810190506124b2565b50505050905090810190601f1680156124fa5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61256b600284612a0a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612596573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125e7600284612a0a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612612573d6000803e3d6000fd5b5050565b6000600a54821115612673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613e7c602a913960400191505060405180910390fd5b600061267d612cab565b90506126928184612a0a90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156126cf57600080fd5b506040519080825280602002602001820160405280156126fe5781602001602082028036833780820191505090505b509050308160008151811061270f57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156127b157600080fd5b505afa1580156127c5573d6000803e3d6000fd5b505050506040513d60208110156127db57600080fd5b8101908080519060200190929190505050816001815181106127f957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061286030601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a05565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612924578082015181840152602081019050612909565b505050509050019650505050505050600060405180830381600087803b15801561294d57600080fd5b505af1158015612961573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156129975760009050612a04565b60008284029050828482816129a857fe5b04146129ff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ec86021913960400191505060405180910390fd5b809150505b92915050565b6000612a4c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612cd6565b905092915050565b80612a6257612a61612d9c565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612b1a57612b15848484612ddf565b612c97565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612bbd5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bd257612bcd84848461303f565b612c96565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612c745750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612c8957612c8484848461329f565b612c95565b612c94848484613594565b5b5b5b80612ca557612ca461375f565b5b50505050565b6000806000612cb8613773565b91509150612ccf8183612a0a90919063ffffffff16565b9250505090565b60008083118290612d82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d47578082015181840152602081019050612d2c565b50505050905090810190601f168015612d745780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612d8e57fe5b049050809150509392505050565b6000600c54148015612db057506000600d54145b15612dba57612ddd565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612df187613a20565b955095509550955095509550612e4f87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ee486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f7985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fc581613b5a565b612fcf8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061305187613a20565b9550955095509550955095506130af86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061314483600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131d985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061322581613b5a565b61322f8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806132b187613a20565b95509550955095509550955061330f87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133a486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061343983600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134ce85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061351a81613b5a565b6135248483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806135a687613a20565b95509550955095509550955061360486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061369985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506136e581613b5a565b6136ef8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156139d5578260026000600984815481106137ad57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180613894575081600360006009848154811061382c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156138b257600a54683635c9adc5dea0000094509450505050613a1c565b61393b60026000600984815481106138c657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613a8890919063ffffffff16565b92506139c6600360006009848154811061395157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613a8890919063ffffffff16565b9150808060010191505061378e565b506139f4683635c9adc5dea00000600a54612a0a90919063ffffffff16565b821015613a1357600a54683635c9adc5dea00000935093505050613a1c565b81819350935050505b9091565b6000806000806000806000806000613a3d8a600c54600d54613d39565b9250925092506000613a4d612cab565b90506000806000613a608e878787613dcf565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613aca83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061245b565b905092915050565b600080828401905083811015613b50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613b64612cab565b90506000613b7b828461298490919063ffffffff16565b9050613bcf81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613cfa57613cb683600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613d1482600a54613a8890919063ffffffff16565b600a81905550613d2f81600b54613ad290919063ffffffff16565b600b819055505050565b600080600080613d656064613d57888a61298490919063ffffffff16565b612a0a90919063ffffffff16565b90506000613d8f6064613d81888b61298490919063ffffffff16565b612a0a90919063ffffffff16565b90506000613db882613daa858c613a8890919063ffffffff16565b613a8890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613de8858961298490919063ffffffff16565b90506000613dff868961298490919063ffffffff16565b90506000613e16878961298490919063ffffffff16565b90506000613e3f82613e318587613a8890919063ffffffff16565b613a8890919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212208bc86ec8d518257e3146e11fba4553221f0965419e2a232ac9c1d7edb0f87b7364736f6c634300060c0033 | {"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"}]}} | 1,802 |
0x866e8b862329c5cc4b4c8c2f46407694beb7c7fa | //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 Kyoku is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1 = 5;
uint256 private _feeAddr2 = 5;
address payable private _feeAddrWallet1 = payable(0x8BA406c0390da8f87cB72A4c7aE882AF20e9684B);
address payable private _feeAddrWallet2 = payable(0x8BA406c0390da8f87cB72A4c7aE882AF20e9684B);
string private constant _name = "Kyoku Inu";
string private constant _symbol = "KYOKU INU";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function setFeeAmountOne(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr1 = fee;
}
function setFeeAmountTwo(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr2 = fee;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 50000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612b4b565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190612675565b610492565b6040516101839190612b30565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612ccd565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190612622565b6104c2565b6040516101eb9190612b30565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612588565b61059b565b005b34801561022957600080fd5b5061023261068b565b60405161023f9190612d42565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a91906126fe565b610694565b005b34801561027d57600080fd5b50610286610746565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612588565b6107b8565b6040516102bc9190612ccd565b60405180910390f35b3480156102d157600080fd5b506102da610809565b005b3480156102e857600080fd5b5061030360048036038101906102fe9190612758565b61095c565b005b34801561031157600080fd5b5061031a6109fd565b6040516103279190612a62565b60405180910390f35b34801561033c57600080fd5b50610345610a26565b6040516103529190612b4b565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d9190612675565b610a63565b60405161038f9190612b30565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba91906126b5565b610a81565b005b3480156103cd57600080fd5b506103d6610bab565b005b3480156103e457600080fd5b506103ed610c25565b005b3480156103fb57600080fd5b5061041660048036038101906104119190612758565b611185565b005b34801561042457600080fd5b5061043f600480360381019061043a91906125e2565b611226565b60405161044c9190612ccd565b60405180910390f35b60606040518060400160405280600a81526020017f4b796f6b752020496e7500000000000000000000000000000000000000000000815250905090565b60006104a661049f6112ad565b84846112b5565b6001905092915050565b600069d3c21bcecceda1000000905090565b60006104cf848484611480565b610590846104db6112ad565b61058b8560405180606001604052806028815260200161342060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105416112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195e9092919063ffffffff16565b6112b5565b600190509392505050565b6105a36112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610630576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062790612c2d565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069c6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072090612c2d565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107876112ad565b73ffffffffffffffffffffffffffffffffffffffff16146107a757600080fd5b60004790506107b5816119c2565b50565b6000610802600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abd565b9050919050565b6108116112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461089e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089590612c2d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099d6112ad565b73ffffffffffffffffffffffffffffffffffffffff16146109f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ea90612b8d565b60405180910390fd5b80600a8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4b594f4b5520494e550000000000000000000000000000000000000000000000815250905090565b6000610a77610a706112ad565b8484611480565b6001905092915050565b610a896112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0d90612c2d565b60405180910390fd5b60005b8151811015610ba757600160066000848481518110610b3b57610b3a61308a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610b9f90612fe3565b915050610b19565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bec6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610c0c57600080fd5b6000610c17306107b8565b9050610c2281611b2b565b50565b610c2d6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb190612c2d565b60405180910390fd5b600f60149054906101000a900460ff1615610d0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0190612cad565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d9b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669d3c21bcecceda10000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610de157600080fd5b505afa158015610df5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1991906125b5565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e7b57600080fd5b505afa158015610e8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb391906125b5565b6040518363ffffffff1660e01b8152600401610ed0929190612a7d565b602060405180830381600087803b158015610eea57600080fd5b505af1158015610efe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2291906125b5565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fab306107b8565b600080610fb66109fd565b426040518863ffffffff1660e01b8152600401610fd896959493929190612acf565b6060604051808303818588803b158015610ff157600080fd5b505af1158015611005573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061102a9190612785565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161112f929190612aa6565b602060405180830381600087803b15801561114957600080fd5b505af115801561115d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611181919061272b565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111c66112ad565b73ffffffffffffffffffffffffffffffffffffffff161461121c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121390612b8d565b60405180910390fd5b80600b8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612c8d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612bcd565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612ccd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612c6d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612b6d565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612c4d565b60405180910390fd5b6115ab6109fd565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161957506115e96109fd565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561194e57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116c25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116cb57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117765750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117cc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117e45750600f60179054906101000a900460ff165b15611894576010548111156117f857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061184357600080fd5b601e426118509190612e03565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061189f306107b8565b9050600f60159054906101000a900460ff1615801561190c5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119245750600f60169054906101000a900460ff165b1561194c5761193281611b2b565b6000479050600081111561194a57611949476119c2565b5b505b505b611959838383611db3565b505050565b60008383111582906119a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199d9190612b4b565b60405180910390fd5b50600083856119b59190612ee4565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a12600284611dc390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a3d573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a8e600284611dc390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ab9573d6000803e3d6000fd5b5050565b6000600854821115611b04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afb90612bad565b60405180910390fd5b6000611b0e611e0d565b9050611b238184611dc390919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611b6357611b626130b9565b5b604051908082528060200260200182016040528015611b915781602001602082028036833780820191505090505b5090503081600081518110611ba957611ba861308a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611c4b57600080fd5b505afa158015611c5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8391906125b5565b81600181518110611c9757611c9661308a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611cfe30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611d62959493929190612ce8565b600060405180830381600087803b158015611d7c57600080fd5b505af1158015611d90573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611dbe838383611e38565b505050565b6000611e0583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612003565b905092915050565b6000806000611e1a612066565b91509150611e318183611dc390919063ffffffff16565b9250505090565b600080600080600080611e4a876120cb565b955095509550955095509550611ea886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461213390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f3d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461217d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f89816121db565b611f938483612298565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611ff09190612ccd565b60405180910390a3505050505050505050565b6000808311829061204a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120419190612b4b565b60405180910390fd5b50600083856120599190612e59565b9050809150509392505050565b60008060006008549050600069d3c21bcecceda1000000905061209e69d3c21bcecceda1000000600854611dc390919063ffffffff16565b8210156120be5760085469d3c21bcecceda10000009350935050506120c7565b81819350935050505b9091565b60008060008060008060008060006120e88a600a54600b546122d2565b92509250925060006120f8611e0d565b9050600080600061210b8e878787612368565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061217583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061195e565b905092915050565b600080828461218c9190612e03565b9050838110156121d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c890612bed565b60405180910390fd5b8091505092915050565b60006121e5611e0d565b905060006121fc82846123f190919063ffffffff16565b905061225081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461217d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6122ad8260085461213390919063ffffffff16565b6008819055506122c88160095461217d90919063ffffffff16565b6009819055505050565b6000806000806122fe60646122f0888a6123f190919063ffffffff16565b611dc390919063ffffffff16565b90506000612328606461231a888b6123f190919063ffffffff16565b611dc390919063ffffffff16565b9050600061235182612343858c61213390919063ffffffff16565b61213390919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061238185896123f190919063ffffffff16565b9050600061239886896123f190919063ffffffff16565b905060006123af87896123f190919063ffffffff16565b905060006123d8826123ca858761213390919063ffffffff16565b61213390919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156124045760009050612466565b600082846124129190612e8a565b90508284826124219190612e59565b14612461576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245890612c0d565b60405180910390fd5b809150505b92915050565b600061247f61247a84612d82565b612d5d565b905080838252602082019050828560208602820111156124a2576124a16130ed565b5b60005b858110156124d257816124b888826124dc565b8452602084019350602083019250506001810190506124a5565b5050509392505050565b6000813590506124eb816133da565b92915050565b600081519050612500816133da565b92915050565b600082601f83011261251b5761251a6130e8565b5b813561252b84826020860161246c565b91505092915050565b600081359050612543816133f1565b92915050565b600081519050612558816133f1565b92915050565b60008135905061256d81613408565b92915050565b60008151905061258281613408565b92915050565b60006020828403121561259e5761259d6130f7565b5b60006125ac848285016124dc565b91505092915050565b6000602082840312156125cb576125ca6130f7565b5b60006125d9848285016124f1565b91505092915050565b600080604083850312156125f9576125f86130f7565b5b6000612607858286016124dc565b9250506020612618858286016124dc565b9150509250929050565b60008060006060848603121561263b5761263a6130f7565b5b6000612649868287016124dc565b935050602061265a868287016124dc565b925050604061266b8682870161255e565b9150509250925092565b6000806040838503121561268c5761268b6130f7565b5b600061269a858286016124dc565b92505060206126ab8582860161255e565b9150509250929050565b6000602082840312156126cb576126ca6130f7565b5b600082013567ffffffffffffffff8111156126e9576126e86130f2565b5b6126f584828501612506565b91505092915050565b600060208284031215612714576127136130f7565b5b600061272284828501612534565b91505092915050565b600060208284031215612741576127406130f7565b5b600061274f84828501612549565b91505092915050565b60006020828403121561276e5761276d6130f7565b5b600061277c8482850161255e565b91505092915050565b60008060006060848603121561279e5761279d6130f7565b5b60006127ac86828701612573565b93505060206127bd86828701612573565b92505060406127ce86828701612573565b9150509250925092565b60006127e483836127f0565b60208301905092915050565b6127f981612f18565b82525050565b61280881612f18565b82525050565b600061281982612dbe565b6128238185612de1565b935061282e83612dae565b8060005b8381101561285f57815161284688826127d8565b975061285183612dd4565b925050600181019050612832565b5085935050505092915050565b61287581612f2a565b82525050565b61288481612f6d565b82525050565b600061289582612dc9565b61289f8185612df2565b93506128af818560208601612f7f565b6128b8816130fc565b840191505092915050565b60006128d0602383612df2565b91506128db8261310d565b604082019050919050565b60006128f3600c83612df2565b91506128fe8261315c565b602082019050919050565b6000612916602a83612df2565b915061292182613185565b604082019050919050565b6000612939602283612df2565b9150612944826131d4565b604082019050919050565b600061295c601b83612df2565b915061296782613223565b602082019050919050565b600061297f602183612df2565b915061298a8261324c565b604082019050919050565b60006129a2602083612df2565b91506129ad8261329b565b602082019050919050565b60006129c5602983612df2565b91506129d0826132c4565b604082019050919050565b60006129e8602583612df2565b91506129f382613313565b604082019050919050565b6000612a0b602483612df2565b9150612a1682613362565b604082019050919050565b6000612a2e601783612df2565b9150612a39826133b1565b602082019050919050565b612a4d81612f56565b82525050565b612a5c81612f60565b82525050565b6000602082019050612a7760008301846127ff565b92915050565b6000604082019050612a9260008301856127ff565b612a9f60208301846127ff565b9392505050565b6000604082019050612abb60008301856127ff565b612ac86020830184612a44565b9392505050565b600060c082019050612ae460008301896127ff565b612af16020830188612a44565b612afe604083018761287b565b612b0b606083018661287b565b612b1860808301856127ff565b612b2560a0830184612a44565b979650505050505050565b6000602082019050612b45600083018461286c565b92915050565b60006020820190508181036000830152612b65818461288a565b905092915050565b60006020820190508181036000830152612b86816128c3565b9050919050565b60006020820190508181036000830152612ba6816128e6565b9050919050565b60006020820190508181036000830152612bc681612909565b9050919050565b60006020820190508181036000830152612be68161292c565b9050919050565b60006020820190508181036000830152612c068161294f565b9050919050565b60006020820190508181036000830152612c2681612972565b9050919050565b60006020820190508181036000830152612c4681612995565b9050919050565b60006020820190508181036000830152612c66816129b8565b9050919050565b60006020820190508181036000830152612c86816129db565b9050919050565b60006020820190508181036000830152612ca6816129fe565b9050919050565b60006020820190508181036000830152612cc681612a21565b9050919050565b6000602082019050612ce26000830184612a44565b92915050565b600060a082019050612cfd6000830188612a44565b612d0a602083018761287b565b8181036040830152612d1c818661280e565b9050612d2b60608301856127ff565b612d386080830184612a44565b9695505050505050565b6000602082019050612d576000830184612a53565b92915050565b6000612d67612d78565b9050612d738282612fb2565b919050565b6000604051905090565b600067ffffffffffffffff821115612d9d57612d9c6130b9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e0e82612f56565b9150612e1983612f56565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612e4e57612e4d61302c565b5b828201905092915050565b6000612e6482612f56565b9150612e6f83612f56565b925082612e7f57612e7e61305b565b5b828204905092915050565b6000612e9582612f56565b9150612ea083612f56565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612ed957612ed861302c565b5b828202905092915050565b6000612eef82612f56565b9150612efa83612f56565b925082821015612f0d57612f0c61302c565b5b828203905092915050565b6000612f2382612f36565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612f7882612f56565b9050919050565b60005b83811015612f9d578082015181840152602081019050612f82565b83811115612fac576000848401525b50505050565b612fbb826130fc565b810181811067ffffffffffffffff82111715612fda57612fd96130b9565b5b80604052505050565b6000612fee82612f56565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156130215761302061302c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6133e381612f18565b81146133ee57600080fd5b50565b6133fa81612f2a565b811461340557600080fd5b50565b61341181612f56565b811461341c57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122029501fc9acd2baeb4ad520d3db88fe33c2b53b5f8286d9cd30c50dea86e3ff7c64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,803 |
0x5928A6E5f02c8AA495602990c12C125c4F89eB90 | /*
Join our telegram: https://t.me/ethspring
Spring is a season of flowers which arrives after winter and before the summer,
During the spring season, weather becomes pleasant and the days grow longer.
It is the season of fragrance, beauty, fresh leaves, and flowers.
Ethereum finally met the Spring!!!!
In crypto saying:
"Spring is a season of altcoins which arrives after bearish market and before the bullish market,
During the alt season, the market becomes profitable and the chart looks green.
It is the season of POMP, SHILL, GREEN CHART, and MEME"
The project is a fair launch. Liquidity locked and 25% will be burned.
Powerful bot protection + reflection & redistribution.
Token Information
1. 100,000,000,000 Total Supply
2. 25% Burned
3. Developer provides LP
4. Buy limit
5. Fair launch for everyone
6. 5% redistribution to holders
7. Developer fee 10%
*/
// 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 EthereumSpring is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Ethereum Spring";
string private constant _symbol = "eSpring";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
mapping(address => uint256) private cooldown;
address payable private _devAddress;
address payable private _ownerAddress;
address private uniswapV2Pair;
IUniswapV2Router02 private uniswapV2Router;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _maxTxAmount = _tTotal;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_devAddress = addr1;
_ownerAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_devAddress] = true;
_isExcludedFromFee[_ownerAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_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()) {
require(amount <= _maxTxAmount);
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));
_ownerAddress.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "opened already");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
_maxTxAmount = 3250000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function collectToken() external {
require(_msgSender() == _devAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
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**3);
}
}
| 0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb1461026d578063cc4cc05f1461028d578063d543dbeb146102a2578063dd62ed3e146102c257600080fd5b8063715018a6146102005780638da5cb5b1461021557806395d89b411461023d57600080fd5b806323b872dd116100bb57806323b872dd1461018d578063293230b8146101ad578063313ce567146101c457806370a08231146101e057600080fd5b806306fdde03146100ed578063095ea7b31461013757806318160ddd1461016757600080fd5b366100e857005b600080fd5b3480156100f957600080fd5b5060408051808201909152600f81526e457468657265756d20537072696e6760881b60208201525b60405161012e91906114f2565b60405180910390f35b34801561014357600080fd5b50610157610152366004611462565b610308565b604051901515815260200161012e565b34801561017357600080fd5b50683635c9adc5dea000005b60405190815260200161012e565b34801561019957600080fd5b506101576101a8366004611422565b61031f565b3480156101b957600080fd5b506101c2610388565b005b3480156101d057600080fd5b506040516009815260200161012e565b3480156101ec57600080fd5b5061017f6101fb3660046113b2565b610747565b34801561020c57600080fd5b506101c2610769565b34801561022157600080fd5b506000546040516001600160a01b03909116815260200161012e565b34801561024957600080fd5b5060408051808201909152600781526665537072696e6760c81b6020820152610121565b34801561027957600080fd5b50610157610288366004611462565b6107dd565b34801561029957600080fd5b506101c26107ea565b3480156102ae57600080fd5b506101c26102bd3660046114ad565b610830565b3480156102ce57600080fd5b5061017f6102dd3660046113ea565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103153384846108cf565b5060015b92915050565b600061032c8484846109f3565b61037e843361037985604051806060016040528060288152602001611687602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610c25565b6108cf565b5060019392505050565b6000546001600160a01b031633146103bb5760405162461bcd60e51b81526004016103b290611545565b60405180910390fd5b600e54600160a01b900460ff16156104065760405162461bcd60e51b815260206004820152600e60248201526d6f70656e656420616c726561647960901b60448201526064016103b2565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556104433082683635c9adc5dea000006108cf565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561047c57600080fd5b505afa158015610490573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b491906113ce565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156104fc57600080fd5b505afa158015610510573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053491906113ce565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561057c57600080fd5b505af1158015610590573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b491906113ce565b600d80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306105e481610747565b6000806105f96000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561065c57600080fd5b505af1158015610670573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061069591906114c5565b5050600e8054672d1a51c7e0050000600f5562ff00ff60a01b1981166201000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561070b57600080fd5b505af115801561071f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610743919061148d565b5050565b6001600160a01b03811660009081526002602052604081205461031990610c5f565b6000546001600160a01b031633146107935760405162461bcd60e51b81526004016103b290611545565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103153384846109f3565b600b546001600160a01b0316336001600160a01b03161461080a57600080fd5b600061081530610747565b905061082081610ce3565b4780156107435761074381610e88565b6000546001600160a01b0316331461085a5760405162461bcd60e51b81526004016103b290611545565b600081116108aa5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103b2565b6108c96103e86108c3683635c9adc5dea0000084610f0d565b90610f8c565b600f5550565b6001600160a01b0383166109315760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103b2565b6001600160a01b0382166109925760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103b2565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610a575760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103b2565b6001600160a01b038216610ab95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103b2565b60008111610b1b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103b2565b6000546001600160a01b03848116911614801590610b4757506000546001600160a01b03838116911614155b15610bc857600f54811115610b5b57600080fd5b6000610b6630610747565b600e54909150600160a81b900460ff16158015610b915750600d546001600160a01b03858116911614155b8015610ba65750600e54600160b01b900460ff165b15610bc657610bb481610ce3565b478015610bc457610bc447610e88565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610c0a57506001600160a01b03831660009081526005602052604090205460ff165b15610c13575060005b610c1f84848484610fce565b50505050565b60008184841115610c495760405162461bcd60e51b81526004016103b291906114f2565b506000610c568486611641565b95945050505050565b6000600654821115610cc65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103b2565b6000610cd0610ffa565b9050610cdc8382610f8c565b9392505050565b600e805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d3957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610d8d57600080fd5b505afa158015610da1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc591906113ce565b81600181518110610de657634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e54610e0c91309116846108cf565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e4590859060009086903090429060040161157a565b600060405180830381600087803b158015610e5f57600080fd5b505af1158015610e73573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b600b546001600160a01b03166108fc610ea2836002610f8c565b6040518115909202916000818181858888f19350505050158015610eca573d6000803e3d6000fd5b50600c546001600160a01b03166108fc610ee5836002610f8c565b6040518115909202916000818181858888f19350505050158015610743573d6000803e3d6000fd5b600082610f1c57506000610319565b6000610f288385611622565b905082610f358583611602565b14610cdc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103b2565b6000610cdc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061101d565b80610fdb57610fdb61104b565b610fe684848461106e565b80610c1f57610c1f6005600855600a600955565b6000806000611007611165565b90925090506110168282610f8c565b9250505090565b6000818361103e5760405162461bcd60e51b81526004016103b291906114f2565b506000610c568486611602565b60085415801561105b5750600954155b1561106257565b60006008819055600955565b600080600080600080611080876111a7565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506110b29087611204565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546110e19086611246565b6001600160a01b038916600090815260026020526040902055611103816112a5565b61110d84836112ef565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161115291815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006111818282610f8c565b82101561119e57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006111c48a600854600954611313565b92509250925060006111d4610ffa565b905060008060006111e78e878787611362565b919e509c509a509598509396509194505050505091939550919395565b6000610cdc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c25565b60008061125383856115ea565b905083811015610cdc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103b2565b60006112af610ffa565b905060006112bd8383610f0d565b306000908152600260205260409020549091506112da9082611246565b30600090815260026020526040902055505050565b6006546112fc9083611204565b60065560075461130c9082611246565b6007555050565b600080808061132760646108c38989610f0d565b9050600061133a60646108c38a89610f0d565b905060006113528261134c8b86611204565b90611204565b9992985090965090945050505050565b60008080806113718886610f0d565b9050600061137f8887610f0d565b9050600061138d8888610f0d565b9050600061139f8261134c8686611204565b939b939a50919850919650505050505050565b6000602082840312156113c3578081fd5b8135610cdc8161166e565b6000602082840312156113df578081fd5b8151610cdc8161166e565b600080604083850312156113fc578081fd5b82356114078161166e565b915060208301356114178161166e565b809150509250929050565b600080600060608486031215611436578081fd5b83356114418161166e565b925060208401356114518161166e565b929592945050506040919091013590565b60008060408385031215611474578182fd5b823561147f8161166e565b946020939093013593505050565b60006020828403121561149e578081fd5b81518015158114610cdc578182fd5b6000602082840312156114be578081fd5b5035919050565b6000806000606084860312156114d9578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561151e57858101830151858201604001528201611502565b8181111561152f5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156115c95784516001600160a01b0316835293830193918301916001016115a4565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156115fd576115fd611658565b500190565b60008261161d57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561163c5761163c611658565b500290565b60008282101561165357611653611658565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461168357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220192d191021f621d6e1d46a586aef13779794886dfda36ce92aac3b736357745764736f6c63430008040033 | {"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"}]}} | 1,804 |
0x5ed2da0bb8a22e519ab7ddc582a5b8bd7542e3a6 | pragma solidity ^0.5.0;
library SafeMath {
uint256 constant internal MAX_UINT = 2 ** 256 - 1; // max uint256
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns(uint256) {
if (_a == 0) {
return 0;
}
require(MAX_UINT / _a >= _b);
return _a * _b;
}
/**
* @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);
return _a / _b;
}
/**
* @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);
return _a - _b;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns(uint256) {
require(MAX_UINT - _a >= _b);
return _a + _b;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @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 {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
}
contract StandardToken {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
mapping(address => mapping(address => uint256)) internal allowed;
uint256 internal totalSupply_;
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 vaule
);
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns(uint256) {
return totalSupply_;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns(uint256) {
return balances[_owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns(uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) 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 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 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 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;
}
function _burn(address account, uint256 value) internal {
require(account != address(0));
totalSupply_ = totalSupply_.sub(value);
balances[account] = balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
// 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 BurnableToken is StandardToken {
/**
* @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 PausableToken is StandardToken, Pausable {
function transfer(
address _to,
uint256 _value
)
public
whenNotPaused
returns(bool) {
return super.transfer(_to, _value);
}
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns(bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(
address _spender,
uint256 _value
)
public
whenNotPaused
returns(bool) {
return super.approve(_spender, _value);
}
function increaseApproval(
address _spender,
uint _addedValue
)
public
whenNotPaused
returns(bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
whenNotPaused
returns(bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract TestToken is PausableToken, BurnableToken {
string public name; // name of Token
string public symbol; // symbol of Token
uint8 public decimals;
constructor(string memory _name, string memory _symbol, uint8 _decimals, uint256 _INIT_TOTALSUPPLY, address _owner) public {
require(_owner != address(0));
totalSupply_ = _INIT_TOTALSUPPLY * 10 ** uint256(_decimals);
balances[_owner] = totalSupply_;
name = _name;
symbol = _symbol;
decimals = _decimals;
owner = _owner;
emit Transfer(address(0), owner, totalSupply_);
}
} | 0x6080604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610100578063095ea7b31461018a57806318160ddd146101d757806323b872dd146101fe578063313ce567146102415780633f4ba83a1461026c57806342966c68146102835780635c975abb146102ad57806366188463146102c257806370a08231146102fb57806379cc67901461032e5780638456cb59146103675780638da5cb5b1461037c57806395d89b41146103ad578063a9059cbb146103c2578063d73dd623146103fb578063dd62ed3e14610434578063f2fde38b1461046f575b600080fd5b34801561010c57600080fd5b506101156104a2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014f578181015183820152602001610137565b50505050905090810190601f16801561017c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019657600080fd5b506101c3600480360360408110156101ad57600080fd5b50600160a060020a038135169060200135610530565b604080519115158252519081900360200190f35b3480156101e357600080fd5b506101ec61055b565b60408051918252519081900360200190f35b34801561020a57600080fd5b506101c36004803603606081101561022157600080fd5b50600160a060020a03813581169160208101359091169060400135610561565b34801561024d57600080fd5b5061025661058e565b6040805160ff9092168252519081900360200190f35b34801561027857600080fd5b50610281610597565b005b34801561028f57600080fd5b50610281600480360360208110156102a657600080fd5b503561060f565b3480156102b957600080fd5b506101c361061c565b3480156102ce57600080fd5b506101c3600480360360408110156102e557600080fd5b50600160a060020a03813516906020013561062c565b34801561030757600080fd5b506101ec6004803603602081101561031e57600080fd5b5035600160a060020a0316610650565b34801561033a57600080fd5b506102816004803603604081101561035157600080fd5b50600160a060020a03813516906020013561066b565b34801561037357600080fd5b50610281610679565b34801561038857600080fd5b506103916106f6565b60408051600160a060020a039092168252519081900360200190f35b3480156103b957600080fd5b50610115610705565b3480156103ce57600080fd5b506101c3600480360360408110156103e557600080fd5b50600160a060020a038135169060200135610760565b34801561040757600080fd5b506101c36004803603604081101561041e57600080fd5b50600160a060020a038135169060200135610784565b34801561044057600080fd5b506101ec6004803603604081101561045757600080fd5b50600160a060020a03813581169160200135166107a8565b34801561047b57600080fd5b506102816004803603602081101561049257600080fd5b5035600160a060020a03166107d3565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105285780601f106104fd57610100808354040283529160200191610528565b820191906000526020600020905b81548152906001019060200180831161050b57829003601f168201915b505050505081565b60035460009060a060020a900460ff161561054a57600080fd5b61055483836107f3565b9392505050565b60025490565b60035460009060a060020a900460ff161561057b57600080fd5b610586848484610859565b949350505050565b60065460ff1681565b600354600160a060020a031633146105ae57600080fd5b60035460a060020a900460ff1615156105c657600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b61061933826109d0565b50565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff161561064657600080fd5b6105548383610a79565b600160a060020a031660009081526020819052604090205490565b6106758282610b68565b5050565b600354600160a060020a0316331461069057600080fd5b60035460a060020a900460ff16156106a757600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105285780601f106104fd57610100808354040283529160200191610528565b60035460009060a060020a900460ff161561077a57600080fd5b6105548383610bca565b60035460009060a060020a900460ff161561079e57600080fd5b6105548383610cab565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600354600160a060020a031633146107ea57600080fd5b61061981610d44565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a038316151561087057600080fd5b600160a060020a03841660009081526020819052604090205482111561089557600080fd5b600160a060020a03841660009081526001602090815260408083203384529091529020548211156108c557600080fd5b600160a060020a0384166000908152602081905260409020546108ee908363ffffffff610dc216565b600160a060020a038086166000908152602081905260408082209390935590851681522054610923908363ffffffff610dd716565b600160a060020a03808516600090815260208181526040808320949094559187168152600182528281203382529091522054610965908363ffffffff610dc216565b600160a060020a03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600160a060020a03821615156109e557600080fd5b6002546109f8908263ffffffff610dc216565b600255600160a060020a038216600090815260208190526040902054610a24908263ffffffff610dc216565b600160a060020a038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050565b336000908152600160209081526040808320600160a060020a0386168452909152812054808310610acd57336000908152600160209081526040808320600160a060020a0388168452909152812055610b02565b610add818463ffffffff610dc216565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a0382166000908152600160209081526040808320338452909152902054610b9c908263ffffffff610dc216565b600160a060020a038316600090815260016020908152604080832033845290915290205561067582826109d0565b6000600160a060020a0383161515610be157600080fd5b33600090815260208190526040902054821115610bfd57600080fd5b33600090815260208190526040902054610c1d908363ffffffff610dc216565b3360009081526020819052604080822092909255600160a060020a03851681522054610c4f908363ffffffff610dd716565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600160209081526040808320600160a060020a0386168452909152812054610cdf908363ffffffff610dd716565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a0381161515610d5957600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610dd157600080fd5b50900390565b600081836000190310151515610dec57600080fd5b50019056fea165627a7a7230582090e3c4be6c0abf9d71073d3fdec4397607688dcb6077a021e9917c94ecc0a32a0029 | {"success": true, "error": null, "results": {}} | 1,805 |
0xf0cdb03eeb1027bcaea7b7648293339c5bb12c58 | pragma solidity ^0.4.21;
/**
* @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;
}
}
contract owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is owned {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
require(false == paused);
_;
}
/**
* @dev modifier to allow actions only when the contract IS NOT paused
*/
modifier whenPaused {
require(true == paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public returns (bool) {
paused = true;
emit Pause();
return true;
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public returns (bool) {
paused = false;
emit Unpause();
return true;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract CustomToken is Pausable{
using SafeMath for uint256;
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals;
// 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;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function CustomToken (
string tokenName,
string tokenSymbol
) public {
decimals = 18;
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
/**
* 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) whenNotPaused public {
_transfer(msg.sender, _to, _value);
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to].add(_value) > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from].add(balanceOf[_to]);
// Subtract from the sender
balanceOf[_from] = balanceOf[_from].sub(_value);
// Add the same to the recipient
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
}
/******************************************/
/* ADVANCED TOKEN STARTS HERE */
/******************************************/
contract GMCToken is CustomToken {
string tokenName = "GMCToken"; // Set the name for display purposes
string tokenSymbol = "GMC"; // Set the symbol for display purposes
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/* Initializes contract with initial supply tokens to the creator of the contract */
function GMCToken() CustomToken(tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the sender
balanceOf[_to] = balanceOf[_to].add(_value); // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
/// @notice Create `mintedAmount` tokens and send it to `msg.sender`
/// @param mintedAmount the amount of tokens it will receive
function mintToken(uint256 mintedAmount) onlyOwner public {
uint256 mintSupply = mintedAmount.mul(10 ** uint256(decimals));
balanceOf[msg.sender] = balanceOf[msg.sender].add(mintSupply);
totalSupply = totalSupply.add(mintSupply);
emit Transfer(0, this, mintSupply);
emit Transfer(this, msg.sender, mintSupply);
}
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
emit FrozenFunds(target, freeze);
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) onlyOwner public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] = 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) onlyOwner public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the targeted balance
totalSupply = totalSupply.sub(_value); // Update totalSupply
emit Burn(_from, _value);
return true;
}
} | 0x6060604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100ea57806318160ddd14610174578063313ce567146101995780633f4ba83a146101c257806342966c68146101e95780635c975abb146101ff57806370a082311461021257806379cc6790146102315780638456cb59146102535780638da5cb5b1461026657806395d89b4114610295578063a9059cbb146102a8578063b414d4b6146102cc578063c634d032146102eb578063e724529c14610301578063f2fde38b14610325575b600080fd5b34156100f557600080fd5b6100fd610344565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610139578082015183820152602001610121565b50505050905090810190601f1680156101665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017f57600080fd5b6101876103e2565b60405190815260200160405180910390f35b34156101a457600080fd5b6101ac6103e8565b60405160ff909116815260200160405180910390f35b34156101cd57600080fd5b6101d56103f1565b604051901515815260200160405180910390f35b34156101f457600080fd5b6101d5600435610478565b341561020a57600080fd5b6101d5610557565b341561021d57600080fd5b610187600160a060020a0360043516610567565b341561023c57600080fd5b6101d5600160a060020a0360043516602435610579565b341561025e57600080fd5b6101d5610659565b341561027157600080fd5b6102796106e2565b604051600160a060020a03909116815260200160405180910390f35b34156102a057600080fd5b6100fd6106f1565b34156102b357600080fd5b6102ca600160a060020a036004351660243561075c565b005b34156102d757600080fd5b6101d5600160a060020a0360043516610782565b34156102f657600080fd5b6102ca600435610797565b341561030c57600080fd5b6102ca600160a060020a036004351660243515156108b2565b341561033057600080fd5b6102ca600160a060020a036004351661093e565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103da5780601f106103af576101008083540402835291602001916103da565b820191906000526020600020905b8154815290600101906020018083116103bd57829003601f168201915b505050505081565b60045481565b60035460ff1681565b6000805433600160a060020a0390811691161461040d57600080fd5b60005460a060020a900460ff16151560011461042857600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a150600190565b6000805433600160a060020a0390811691161461049457600080fd5b600160a060020a033316600090815260056020526040902054829010156104ba57600080fd5b600160a060020a0333166000908152600560205260409020546104e3908363ffffffff61098816565b600160a060020a03331660009081526005602052604090205560045461050f908363ffffffff61098816565b600455600160a060020a0333167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a2506001919050565b60005460a060020a900460ff1681565b60056020526000908152604090205481565b6000805433600160a060020a0390811691161461059557600080fd5b600160a060020a038316600090815260056020526040902054829010156105bb57600080fd5b600160a060020a0383166000908152600560205260409020546105e4908363ffffffff61098816565b600160a060020a038416600090815260056020526040902055600454610610908363ffffffff61098816565b600455600160a060020a0383167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a250600192915050565b6000805433600160a060020a0390811691161461067557600080fd5b60005460a060020a900460ff161561068c57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a150600190565b600054600160a060020a031681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103da5780601f106103af576101008083540402835291602001916103da565b60005460a060020a900460ff161561077357600080fd5b61077e33838361099a565b5050565b60086020526000908152604090205460ff1681565b6000805433600160a060020a039081169116146107b357600080fd5b6003546107cd90839060ff16600a0a63ffffffff610b0116565b600160a060020a0333166000908152600560205260409020549091506107f9908263ffffffff610b3716565b600160a060020a033316600090815260056020526040902055600454610825908263ffffffff610b3716565b600455600160a060020a03301660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a333600160a060020a031630600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a35050565b60005433600160a060020a039081169116146108cd57600080fd5b600160a060020a03821660009081526008602052604090819020805460ff19168315151790557f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a5908390839051600160a060020a039092168252151560208201526040908101905180910390a15050565b60005433600160a060020a0390811691161461095957600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008282111561099457fe5b50900390565b600160a060020a03821615156109af57600080fd5b600160a060020a038316600090815260056020526040902054819010156109d557600080fd5b600160a060020a038216600090815260056020526040902054818101116109fb57600080fd5b600160a060020a03831660009081526008602052604090205460ff1615610a2157600080fd5b600160a060020a03821660009081526008602052604090205460ff1615610a4757600080fd5b600160a060020a038316600090815260056020526040902054610a70908263ffffffff61098816565b600160a060020a038085166000908152600560205260408082209390935590841681522054610aa5908263ffffffff610b3716565b600160a060020a03808416600081815260056020526040908190209390935591908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a3505050565b600080831515610b145760009150610b30565b50828202828482811515610b2457fe5b0414610b2c57fe5b8091505b5092915050565b600082820183811015610b2c57fe00a165627a7a72305820305f3bb21e230016bbc35b4d13cdc198eaa626c2472db8ae2d4c86ef88408b2c0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 1,806 |
0x24431a037ff58f63f21d5bea78a65448cda95e11 | // SPDX-License-Identifier: MIT
pragma solidity 0.7.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Context {
constructor () { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-call-value
(bool success, ) = recipient.call{ value : amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract pPYLONVault {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
struct RewardDivide {
mapping (address => uint256) amount;
uint256 time;
}
IERC20 public token = IERC20(0xD7B7d3C0bdA57723Fb54ab95Fd8F9EA033AF37f2);
uint256 public totalDeposit;
mapping(address => uint256) public depositBalances;
address[] public addressIndices;
mapping(uint256 => RewardDivide) public _rewards;
uint256 public _rewardCount = 0;
event Withdrawn(address indexed user, uint256 amount);
constructor () {}
function balance() public view returns (uint) {
return token.balanceOf(address(this));
}
function depositAll() external {
deposit(token.balanceOf(msg.sender));
}
function deposit(uint256 _amount) public {
require(_amount > 0, "can't deposit 0");
uint arrayLength = addressIndices.length;
bool found = false;
for (uint i = 0; i < arrayLength; i++) {
if(addressIndices[i]==msg.sender){
found=true;
break;
}
}
if(!found){
addressIndices.push(msg.sender);
}
token.safeTransferFrom(msg.sender, address(this), _amount);
totalDeposit = totalDeposit.add(_amount);
depositBalances[msg.sender] = depositBalances[msg.sender].add(_amount);
}
function reward(uint256 _amount) external {
require(_amount > 0, "can't reward 0");
require(totalDeposit > 0, "totalDeposit must bigger than 0");
token.safeTransferFrom(msg.sender, address(this), _amount);
uint arrayLength = addressIndices.length;
for (uint i = 0; i < arrayLength; i++) {
_rewards[_rewardCount].amount[addressIndices[i]] = _amount.mul(depositBalances[addressIndices[i]]).div(totalDeposit);
depositBalances[addressIndices[i]] = depositBalances[addressIndices[i]].add(_rewards[_rewardCount].amount[addressIndices[i]]);
}
totalDeposit = totalDeposit.add(_amount);
_rewards[_rewardCount].time = block.timestamp;
_rewardCount++;
}
function withdrawAll() external {
withdraw(depositBalances[msg.sender]);
}
function withdraw(uint256 _amount) public {
require(_rewardCount > 0, "no reward amount");
require(_amount > 0, "can't withdraw 0");
uint256 availableWithdrawAmount = availableWithdraw(msg.sender);
if (_amount > availableWithdrawAmount) {
_amount = availableWithdrawAmount;
}
token.safeTransfer(msg.sender, _amount);
depositBalances[msg.sender] = depositBalances[msg.sender].sub(_amount);
totalDeposit = totalDeposit.sub(_amount);
emit Withdrawn(msg.sender, _amount);
}
function availableWithdraw(address owner) public view returns(uint256){
uint256 availableWithdrawAmount = depositBalances[owner];
for (uint256 i = _rewardCount - 1; block.timestamp < _rewards[i].time.add(7 days); --i) {
availableWithdrawAmount = availableWithdrawAmount.sub(_rewards[i].amount[owner].mul(_rewards[i].time.add(7 days).sub(block.timestamp)).div(7 days));
if (i == 0) break;
}
return availableWithdrawAmount;
}
} | 0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063a9fb763c1161008c578063de5f626811610066578063de5f6268146101f1578063e2aa2a85146101f9578063f6153ccd14610201578063fc0c546a14610209576100cf565b8063a9fb763c146101af578063b69ef8a8146101cc578063b6b55f25146101d4576100cf565b80631eb903cf146100d45780632e1a7d4d1461010c5780633df2c6d31461012b578063853828b6146101515780638f1e940514610159578063a7df8c5714610176575b600080fd5b6100fa600480360360208110156100ea57600080fd5b50356001600160a01b0316610211565b60408051918252519081900360200190f35b6101296004803603602081101561012257600080fd5b5035610223565b005b6100fa6004803603602081101561014157600080fd5b50356001600160a01b0316610359565b610129610435565b6100fa6004803603602081101561016f57600080fd5b5035610450565b6101936004803603602081101561018c57600080fd5b5035610465565b604080516001600160a01b039092168252519081900360200190f35b610129600480360360208110156101c557600080fd5b503561048c565b6100fa6106f0565b610129600480360360208110156101ea57600080fd5b503561076d565b6101296108a6565b6100fa610923565b6100fa610929565b61019361092f565b60026020526000908152604090205481565b60006005541161026d576040805162461bcd60e51b815260206004820152601060248201526f1b9bc81c995dd85c9908185b5bdd5b9d60821b604482015290519081900360640190fd5b600081116102b5576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b60006102c033610359565b9050808211156102ce578091505b6000546102e5906001600160a01b0316338461093e565b336000908152600260205260409020546102ff9083610995565b3360009081526002602052604090205560015461031c9083610995565b60015560408051838152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a25050565b6001600160a01b038116600090815260026020526040812054600554600019015b6000818152600460205260409020600101546103999062093a806109e0565b42101561042e5761041961041262093a8061040c6103e3426103dd62093a80600460008a8152602001908152602001600020600101546109e090919063ffffffff16565b90610995565b60008681526004602090815260408083206001600160a01b038d16845290915290205490610a3a565b90610a93565b8390610995565b9150806104255761042e565b6000190161037a565b5092915050565b3360009081526002602052604090205461044e90610223565b565b60046020526000908152604090206001015481565b6003818154811061047257fe5b6000918252602090912001546001600160a01b0316905081565b600081116104d2576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b600060015411610529576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b600054610541906001600160a01b0316333084610ad5565b60035460005b818110156106bb5761059560015461040c600260006003868154811061056957fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548690610a3a565b600554600090815260046020526040812060038054919291859081106105b757fe5b60009182526020808320909101546001600160a01b031683528281019390935260409182018120939093556005548352600490915281206003805461067d9391908590811061060257fe5b9060005260206000200160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002054600260006003858154811061065257fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054906109e0565b600260006003848154811061068e57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902055600101610547565b506001546106c990836109e0565b60019081556005805460009081526004602052604090204290830155805490910190555050565b60008054604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561073c57600080fd5b505afa158015610750573d6000803e3d6000fd5b505050506040513d602081101561076657600080fd5b5051905090565b600081116107b4576040805162461bcd60e51b815260206004820152600f60248201526e063616e2774206465706f736974203608c1b604482015290519081900360640190fd5b6003546000805b8281101561080657336001600160a01b0316600382815481106107da57fe5b6000918252602090912001546001600160a01b031614156107fe5760019150610806565b6001016107bb565b508061084f57600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b031916331790555b600054610867906001600160a01b0316333086610ad5565b60015461087490846109e0565b6001553360009081526002602052604090205461089190846109e0565b33600090815260026020526040902055505050565b600054604080516370a0823160e01b8152336004820152905161044e926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156108f257600080fd5b505afa158015610906573d6000803e3d6000fd5b505050506040513d602081101561091c57600080fd5b505161076d565b60055481565b60015481565b6000546001600160a01b031681565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610990908490610b35565b505050565b60006109d783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ced565b90505b92915050565b6000828201838110156109d7576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082610a49575060006109da565b82820282848281610a5657fe5b04146109d75760405162461bcd60e51b8152600401808060200182810382526021815260200180610e266021913960400191505060405180910390fd5b60006109d783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610d84565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610b2f908590610b35565b50505050565b610b47826001600160a01b0316610de9565b610b98576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310610bd65780518252601f199092019160209182019101610bb7565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610c38576040519150601f19603f3d011682016040523d82523d6000602084013e610c3d565b606091505b509150915081610c94576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115610b2f57808060200190516020811015610cb057600080fd5b5051610b2f5760405162461bcd60e51b815260040180806020018281038252602a815260200180610e47602a913960400191505060405180910390fd5b60008184841115610d7c5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610d41578181015183820152602001610d29565b50505050905090810190601f168015610d6e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183610dd35760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610d41578181015183820152602001610d29565b506000838581610ddf57fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590610e1d5750808214155b94935050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220c238aec61816b15430d07e1115a3175d20d7665e8db3a94e7f07014a9234d96764736f6c63430007000033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 1,807 |
0x075a5d77E17502ABa0388746aA229BB33682f521 | pragma solidity ^0.4.11;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/**
* @title Authorizable
* @dev Allows to authorize access to certain function calls
*
* ABI
* [{"constant":true,"inputs":[{"name":"authorizerIndex","type":"uint256"}],"name":"getAuthorizer","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_addr","type":"address"}],"name":"addAuthorized","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_addr","type":"address"}],"name":"isAuthorized","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"}]
*/
contract Authorizable {
address[] authorizers;
mapping(address => uint) authorizerIndex;
/**
* @dev Throws if called by any account tat is not authorized.
*/
modifier onlyAuthorized {
require(isAuthorized(msg.sender));
_;
}
/**
* @dev Contructor that authorizes the msg.sender.
*/
function Authorizable() {
authorizers.length = 2;
authorizers[1] = msg.sender;
authorizerIndex[msg.sender] = 1;
}
/**
* @dev Function to get a specific authorizer
* @param authorizerIndex index of the authorizer to be retrieved.
* @return The address of the authorizer.
*/
function getAuthorizer(uint authorizerIndex) external constant returns(address) {
return address(authorizers[authorizerIndex + 1]);
}
/**
* @dev Function to check if an address is authorized
* @param _addr the address to check if it is authorized.
* @return boolean flag if address is authorized.
*/
function isAuthorized(address _addr) constant returns(bool) {
return authorizerIndex[_addr] > 0;
}
/**
* @dev Function to add a new authorizer
* @param _addr the address to add as a new authorizer.
*/
function addAuthorized(address _addr) external onlyAuthorized {
authorizerIndex[_addr] = authorizers.length;
authorizers.length++;
authorizers[authorizers.length - 1] = _addr;
}
}
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint a, uint b) internal returns (uint) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint a, uint b) internal returns (uint) {
assert(b <= a);
return a - b;
}
function add(uint a, uint b) internal returns (uint) {
uint c = a + b;
assert(c >= a);
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;
}
function assert(bool assertion) internal {
require(assertion);
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20Basic {
uint public totalSupply;
function balanceOf(address who) constant returns (uint);
function transfer(address to, uint value);
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) constant returns (uint);
function transferFrom(address from, address to, uint value);
function approve(address spender, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint;
mapping(address => uint) balances;
/**
* @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) onlyPayloadSize(2 * 32) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
}
/**
* @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) constant returns (uint balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implemantation of the basic standart 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 BasicToken, ERC20 {
mapping (address => mapping (address => uint)) 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 uint the amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint _value) 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;
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
}
/**
* @dev Aprove the passed address to spend the specified amount of tokens on beahlf 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) {
// 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 specifing the amount of tokens still avaible for the spender.
*/
function allowance(address _owner, address _spender) constant returns (uint remaining) {
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, Ownable {
event Mint(address indexed to, uint value);
event MintFinished();
bool public mintingFinished = false;
uint public totalSupply = 0;
modifier canMint() {
require(! mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will recieve the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint _amount) onlyOwner canMint returns (bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
/**
* @title TopChainToken
* @dev The main TPC token contract
*
* ABI
* [{"constant":true,"inputs":[],"name":"mintingFinished","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"startTrading","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"mint","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"tradingStarted","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"finishMinting","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[],"name":"MintFinished","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}]
*/
contract TopCoin is MintableToken {
string public name = "TopCoin";
string public symbol = "TPC";
uint public decimals = 6;
bool public tradingStarted = false;
/**
* @dev modifier that throws if trading has not started yet
*/
modifier hasStartedTrading() {
require(tradingStarted);
_;
}
/**
* @dev Allows the owner to enable the trading. This can not be undone
*/
function startTrading() onlyOwner {
tradingStarted = true;
}
/**
* @dev Allows anyone to transfer the PAY tokens once trading has started
* @param _to the recipient address of the tokens.
* @param _value number of tokens to be transfered.
*/
function transfer(address _to, uint _value) hasStartedTrading {
super.transfer(_to, _value);
}
/**
* @dev Allows anyone to transfer the PAY tokens once trading has started
* @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 amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint _value) hasStartedTrading {
super.transferFrom(_from, _to, _value);
}
}
/**
* @title TopCoinDistribution
* @dev The main TPC token sale contract
*
* ABI
*/
contract TopCoinDistribution is Ownable, Authorizable {
using SafeMath for uint;
event TokenSold(address recipient, uint ether_amount, uint pay_amount, uint exchangerate);
event AuthorizedCreate(address recipient, uint pay_amount);
event TopCoinSaleClosed();
TopCoin public token = new TopCoin();
address public multisigVault;
uint public hardcap = 87500 ether;
uint public rate = 3600*(10 ** 6); //1 ether : 3600 tpc
uint totalToken = 2100000000 * (10 ** 6); //tpc
uint public authorizeMintToken = 210000000 * (10 ** 6); //tpc
uint public altDeposits = 0; //ether
uint public start = 1504008000; //new Date("Aug 29 2017 20:00:00 GMT+8").getTime() / 1000;
address partenersAddress = 0x6F3c01E350509b98665bCcF7c7D88C120C1762ef; //totalToken * 20%
address operationAddress = 0xb5B802F753bEe90C969aD27a94Da5C179Eaa3334; //totalToken * 20%
address technicalAddress = 0x62C1eC256B7bb10AA53FD4208454E1BFD533b7f0; //totalToken * 30%
/**
* @dev modifier to allow token creation only when the sale IS ON
*/
modifier saleIsOn() {
require(now > start && now < start + 28 days);
_;
}
/**
* @dev modifier to allow token creation only when the hardcap has not been reached
*/
modifier isUnderHardCap() {
require(multisigVault.balance + msg.value + altDeposits <= hardcap);
_;
}
function isContract(address _addr) constant internal returns(bool) {
uint size;
if (_addr == 0) return false;
assembly {
size := extcodesize(_addr)
}
return size > 0;
}
/**
* @dev Allows anyone to create tokens by depositing ether.
* @param recipient the recipient to receive tokens.
*/
function createTokens(address recipient) public isUnderHardCap saleIsOn payable {
require(!isContract(recipient));
uint tokens = rate.mul(msg.value).div(1 ether);
token.mint(recipient, tokens);
require(multisigVault.send(msg.value));
TokenSold(recipient, msg.value, tokens, rate);
}
/**
* @dev Allows to set the authorize mint token
* @param _authorizeMintToken total amount ETH equivalent
*/
function setAuthorizeMintToken(uint _authorizeMintToken) public onlyOwner {
authorizeMintToken = _authorizeMintToken;
}
/**
* @dev Allows to set the total alt deposit measured in ETH to make sure the hardcap includes other deposits
* @param totalAltDeposits total amount ETH equivalent
*/
function setAltDeposit(uint totalAltDeposits) public onlyOwner {
altDeposits = totalAltDeposits;
}
/**
* @dev set eth : tpc rate
* @param _rate eth:tpc rate
*/
function setRate(uint _rate) public onlyOwner {
rate = _rate;
}
/**
* @dev Allows authorized access to create tokens. This is used for Bitcoin and ERC20 deposits
* @param recipient the recipient to receive tokens.
* @param _tokens number of tokens to be created.
*/
function authorizedCreateTokens(address recipient, uint _tokens) public onlyAuthorized {
uint tokens = _tokens * (10 ** 6);
uint totalSupply = token.totalSupply();
require(totalSupply + tokens <= authorizeMintToken);
token.mint(recipient, tokens);
AuthorizedCreate(recipient, tokens);
}
/**
* @dev Allows the owner to set the hardcap.
* @param _hardcap the new hardcap
*/
function setHardCap(uint _hardcap) public onlyOwner {
hardcap = _hardcap;
}
/**
* @dev Allows the owner to set the starting time.
* @param _start the new _start
*/
function setStart(uint _start) public onlyOwner {
start = _start;
}
/**
* @dev Allows the owner to set the multisig contract.
* @param _multisigVault the multisig contract address
*/
function setMultisigVault(address _multisigVault) public onlyOwner {
if (_multisigVault != address(0)) {
multisigVault = _multisigVault;
}
}
/**
* @dev Allows the owner to finish the minting. This will create the
* restricted tokens and then close the minting.
* Then the ownership of the YES token contract is transfered
* to this owner.
*/
function finishMinting() public onlyOwner {
uint issuedTokenSupply = token.totalSupply();
uint partenersTokens = totalToken.mul(20).div(100);
uint technicalTokens = totalToken.mul(30).div(100);
uint operationTokens = totalToken.mul(20).div(100);
token.mint(partenersAddress, partenersTokens);
token.mint(technicalAddress, technicalTokens);
token.mint(operationAddress, operationTokens);
uint restrictedTokens = totalToken.sub(issuedTokenSupply).sub(partenersTokens).sub(technicalTokens).sub(operationTokens);
token.mint(multisigVault, restrictedTokens);
token.finishMinting();
token.transferOwnership(owner);
TopCoinSaleClosed();
}
/**
* @dev Allows the owner to transfer ERC20 tokens to the multi sig vault
* @param _token the contract address of the ERC20 contract
*/
function retrieveTokens(address _token) public onlyOwner {
ERC20 token = ERC20(_token);
token.transfer(multisigVault, token.balanceOf(this));
}
/**
* @dev Fallback function which receives ether and created the appropriate number of tokens for the
* msg.sender.
*/
function() external payable {
createTokens(msg.sender);
}
} | 0x6060604052361561010c5763ffffffff60e060020a60003504166314f80083811461011e5780632c4e722e1461013f57806334fcf437146101645780633a3e8e841461017c5780634a88eb89146101ae578063528d4156146101d35780637d64bcb4146101f75780638da5cb5b1461020c578063ac4ddd9f1461023b578063b071cbe61461025c578063b7efc1cd14610281578063bad4d623146102a6578063be9a6555146102be578063c7725426146102e3578063cedbbeee146102fb578063cf1c316a14610311578063d0c03f3514610332578063d18d944b14610361578063f2fde38b14610379578063f6a03ebf1461039a578063fc0c546a146103b2578063fe9fbb80146103e1575b61011c5b61011933610414565b5b565b005b341561012957600080fd5b61011c600160a060020a03600435166105b9565b005b341561014a57600080fd5b610152610611565b60405190815260200160405180910390f35b341561016f57600080fd5b61011c600435610617565b005b341561018757600080fd5b61019260043561063c565b604051600160a060020a03909116815260200160405180910390f35b34156101b957600080fd5b610152610678565b60405190815260200160405180910390f35b34156101de57600080fd5b61011c600160a060020a036004351660243561067e565b005b341561020257600080fd5b61011c6107db565b005b341561021757600080fd5b610192610c30565b604051600160a060020a03909116815260200160405180910390f35b341561024657600080fd5b61011c600160a060020a0360043516610c3f565b005b341561026757600080fd5b610152610d3a565b60405190815260200160405180910390f35b341561028c57600080fd5b610152610d40565b60405190815260200160405180910390f35b34156102b157600080fd5b61011c600435610d46565b005b34156102c957600080fd5b610152610d6b565b60405190815260200160405180910390f35b34156102ee57600080fd5b61011c600435610d71565b005b61011c600160a060020a0360043516610414565b005b341561031c57600080fd5b61011c600160a060020a0360043516610d96565b005b341561033d57600080fd5b610192610e21565b604051600160a060020a03909116815260200160405180910390f35b341561036c57600080fd5b61011c600435610e30565b005b341561038457600080fd5b61011c600160a060020a0360043516610e55565b005b34156103a557600080fd5b61011c600435610ead565b005b34156103bd57600080fd5b610192610ed2565b604051600160a060020a03909116815260200160405180910390f35b34156103ec57600080fd5b610400600160a060020a0360043516610ee1565b604051901515815260200160405180910390f35b600554600954600454600092600160a060020a03909116313401909101111561043c57600080fd5b600a54421180156104535750600a546224ea000142105b151561045e57600080fd5b61046782610f01565b1561047157600080fd5b61049e670de0b6b3a764000061049234600654610f2e90919063ffffffff16565b9063ffffffff610f5d16565b600354909150600160a060020a03166340c10f19838360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561050057600080fd5b6102c65a03f1151561051157600080fd5b50505060405180515050600454600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561054f57600080fd5b7f8323bebb324b6e1a1d4886a1f210640461bb275263dae69967f001d053ab0b2b8234836006546040518085600160a060020a0316600160a060020a0316815260200184815260200183815260200182815260200194505050505060405180910390a15b5b5b5050565b60005433600160a060020a039081169116146105d457600080fd5b600160a060020a0381161561060c576004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b60065481565b60005433600160a060020a0390811691161461063257600080fd5b60068190555b5b50565b600060018260010181548110151561065057fe5b906000526020600020900160005b9054906101000a9004600160a060020a031690505b919050565b60095481565b60008061068a33610ee1565b151561069557600080fd5b600354620f424084029250600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156106e557600080fd5b6102c65a03f115156106f657600080fd5b50505060405180516008549092508383011115905061071457600080fd5b600354600160a060020a03166340c10f19858460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561077357600080fd5b6102c65a03f1151561078457600080fd5b50505060405180519050507fd5280c283678e8bc2841d06cde20967334f270d803700a194cfb24468c2e92e28483604051600160a060020a03909216825260208201526040908101905180910390a15b5b50505050565b60008054819081908190819033600160a060020a039081169116146107ff57600080fd5b600354600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561084757600080fd5b6102c65a03f1151561085857600080fd5b50505060405180519050945061088b60646104926014600754610f2e90919063ffffffff16565b9063ffffffff610f5d16565b93506108b46064610492601e600754610f2e90919063ffffffff16565b9063ffffffff610f5d16565b92506108dd60646104926014600754610f2e90919063ffffffff16565b9063ffffffff610f5d16565b600354600b54919350600160a060020a03908116916340c10f1991168660006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561094657600080fd5b6102c65a03f1151561095757600080fd5b50505060405180515050600354600d54600160a060020a03918216916340c10f1991168560006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156109c757600080fd5b6102c65a03f115156109d857600080fd5b50505060405180515050600354600c54600160a060020a03918216916340c10f1991168460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610a4857600080fd5b6102c65a03f11515610a5957600080fd5b5050506040518051905050610aa982610a8585610a8588610a858b600754610f7990919063ffffffff16565b9063ffffffff610f7916565b9063ffffffff610f7916565b9063ffffffff610f7916565b600354600454919250600160a060020a03908116916340c10f1991168360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610b1257600080fd5b6102c65a03f11515610b2357600080fd5b50505060405180515050600354600160a060020a0316637d64bcb46000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610b7557600080fd5b6102c65a03f11515610b8657600080fd5b50505060405180515050600354600054600160a060020a039182169163f2fde38b911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b1515610be757600080fd5b6102c65a03f11515610bf857600080fd5b5050507f0e2350ba30b8860982b58401d32403ff37aeb7ed2966bf7b97f5d098d3e0201560405160405180910390a15b5b5050505050565b600054600160a060020a031681565b6000805433600160a060020a03908116911614610c5b57600080fd5b506004548190600160a060020a038083169163a9059cbb9116826370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610cc257600080fd5b6102c65a03f11515610cd357600080fd5b5050506040518051905060405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b1515610d2057600080fd5b6102c65a03f11515610c2857600080fd5b5050505b5b5050565b60055481565b60085481565b60005433600160a060020a03908116911614610d6157600080fd5b60098190555b5b50565b600a5481565b60005433600160a060020a03908116911614610d8c57600080fd5b60088190555b5b50565b610d9f33610ee1565b1515610daa57600080fd5b60018054600160a060020a038316600090815260026020526040902081905590610dd690828101610fa2565b50600180548291906000198101908110610dec57fe5b906000526020600020900160005b6101000a815481600160a060020a030219169083600160a060020a031602179055505b5b50565b600454600160a060020a031681565b60005433600160a060020a03908116911614610e4b57600080fd5b60058190555b5b50565b60005433600160a060020a03908116911614610e7057600080fd5b600160a060020a0381161561060c576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b60005433600160a060020a03908116911614610ec857600080fd5b600a8190555b5b50565b600354600160a060020a031681565b600160a060020a038116600090815260026020526040812054115b919050565b600080600160a060020a0383161515610f1d5760009150610f28565b823b90506000811191505b50919050565b6000828202610f52841580610f4d5750838583811515610f4a57fe5b04145b610f92565b8091505b5092915050565b6000808284811515610f6b57fe5b0490508091505b5092915050565b6000610f8783831115610f92565b508082035b92915050565b80151561060c57600080fd5b5b50565b815481835581811511610fc657600083815260209020610fc6918101908301610fcc565b5b505050565b610fea91905b80821115610fe65760008155600101610fd2565b5090565b905600a165627a7a72305820f4b997896305e8359d6f6e0e171c6ca94802bc4fc2d858d15b418a64b3befe9f0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 1,808 |
0x3f50e6cc943351f00971a9d01ac32739895df826 | pragma solidity ^0.4.24;
// File: contracts/token/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: contracts/misc/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @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 Multiplies two signed integers, reverts on overflow.
*/
function mul(int256 a, int256 b) internal pure returns (int256) {
// 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;
}
require(!(a == -1 && b == INT256_MIN)); // This is the only case of overflow not detected by the check below
int256 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 Integer division of two signed integers truncating the quotient, reverts on division by zero.
*/
function div(int256 a, int256 b) internal pure returns (int256) {
require(b != 0); // Solidity only automatically asserts when dividing by 0
require(!(b == -1 && a == INT256_MIN)); // This is the only case of overflow
int256 c = a / b;
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 Subtracts two signed integers, reverts on overflow.
*/
function sub(int256 a, int256 b) internal pure returns (int256) {
int256 c = a - b;
require((b >= 0 && c <= a) || (b < 0 && c > a));
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 Adds two signed integers, reverts on overflow.
*/
function add(int256 a, int256 b) internal pure returns (int256) {
int256 c = a + b;
require((b >= 0 && c >= a) || (b < 0 && c < a));
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
// File: contracts/token/ERC20.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Originally based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @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), "Cannot approve for 0x0 address");
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) public returns (bool) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
emit Approval(from, msg.sender, _allowed[from][msg.sender]);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
require(spender != address(0), "Cannot increaseAllowance for 0x0 address");
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
require(spender != address(0), "Cannot decreaseAllowance for 0x0 address");
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0), "Cannot transfer to 0x0 address");
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0), "Cannot mint to 0x0 address");
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
}
// File: contracts\CoineruGold.sol
/**
* @title CoineruGold
* @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator.
* Note they can later distribute these tokens as they wish using `transfer` and other
* `ERC20` functions.
*/
contract CoineruGold is ERC20 {
string public constant name = "Coineru Gold";
string public constant symbol = "CGLD";
uint8 public constant decimals = 8;
// twenty six billions + 8 decimals
uint256 public constant INITIAL_SUPPLY = 26000000000 * (10 ** uint256(decimals));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor () public {
_mint(msg.sender, INITIAL_SUPPLY);
}
} | 0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df5780632ff2e9dc14610264578063313ce5671461028f57806339509351146102c057806370a082311461032557806395d89b411461037c578063a457c2d71461040c578063a9059cbb14610471578063dd62ed3e146104d6575b600080fd5b3480156100cb57600080fd5b506100d461054d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610586565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c961071c565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610726565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b5061027961092e565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102a4610940565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102cc57600080fd5b5061030b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610945565b604051808215151515815260200191505060405180910390f35b34801561033157600080fd5b50610366600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c0b565b6040518082815260200191505060405180910390f35b34801561038857600080fd5b50610391610c53565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d15780820151818401526020810190506103b6565b50505050905090810190601f1680156103fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041857600080fd5b50610457600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c8c565b604051808215151515815260200191505060405180910390f35b34801561047d57600080fd5b506104bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f52565b604051808215151515815260200191505060405180910390f35b3480156104e257600080fd5b50610537600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f69565b6040518082815260200191505060405180910390f35b6040805190810160405280600c81526020017f436f696e65727520476f6c64000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561062c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f43616e6e6f7420617070726f766520666f72203078302061646472657373000081525060200191505060405180910390fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b60006107b782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ff090919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610842848484611011565b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509392505050565b600860ff16600a0a64060db884000281565b600881565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610a11576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f43616e6e6f7420696e637265617365416c6c6f77616e636520666f722030783081526020017f206164647265737300000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b610aa082600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461124690919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600481526020017f43474c440000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d58576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f43616e6e6f74206465637265617365416c6c6f77616e636520666f722030783081526020017f206164647265737300000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b610de782600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ff090919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000610f5f338484611011565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008083831115151561100257600080fd5b82840390508091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156110b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f43616e6e6f74207472616e7366657220746f203078302061646472657373000081525060200191505060405180910390fd5b611107816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ff090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061119a816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461124690919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015151561125d57600080fd5b80915050929150505600a165627a7a72305820b943db6551102210e3f28c3388be7d858a32706944e767ce6137a2ba898cc9ae0029 | {"success": true, "error": null, "results": {}} | 1,809 |
0x28abd09c6d153d8ce7b9c07569cc96e08f38e142 | pragma solidity ^0.4.15;
/// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig.
/// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="85f6f1e0e3e4ebabe2e0eaf7e2e0c5e6eaebf6e0ebf6fcf6abebe0f1">[email protected]</a>>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
/*
* Constants
*/
uint constant public MAX_OWNER_COUNT = 50;
/*
* Storage
*/
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
/*
* Modifiers
*/
modifier onlyWallet() {
require(msg.sender == address(this));
_;
}
modifier ownerDoesNotExist(address owner) {
require(!isOwner[owner]);
_;
}
modifier ownerExists(address owner) {
require(isOwner[owner]);
_;
}
modifier transactionExists(uint transactionId) {
require(transactions[transactionId].destination != 0);
_;
}
modifier confirmed(uint transactionId, address owner) {
require(confirmations[transactionId][owner]);
_;
}
modifier notConfirmed(uint transactionId, address owner) {
require(!confirmations[transactionId][owner]);
_;
}
modifier notExecuted(uint transactionId) {
require(!transactions[transactionId].executed);
_;
}
modifier notNull(address _address) {
require(_address != 0);
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
require(ownerCount <= MAX_OWNER_COUNT
&& _required <= ownerCount
&& _required != 0
&& ownerCount != 0);
_;
}
/// @dev Fallback function allows to deposit ether.
function()
payable
{
if (msg.value > 0)
Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
function MultiSigWallet(address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
require(!isOwner[_owners[i]] && _owners[i] != 0);
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param newOwner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction storage txn = transactions[transactionId];
txn.executed = true;
if (external_call(txn.destination, txn.value, txn.data.length, txn.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txn.executed = false;
}
}
}
// call has been separated into its own function in order to take advantage
// of the Solidity's code generator to produce a loop that copies tx.data into memory.
function external_call(address destination, uint value, uint dataLength, bytes data) private returns (bool) {
bool result;
assembly {
let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention)
let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that
result := call(
sub(gas, 34710), // 34710 is the value that solidity is currently emitting
// It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +
// callNewAccountGas (25000, in case the destination address does not exist and needs creating)
destination,
value,
d,
dataLength, // Size of the input (in bytes) - this is what fixes the padding problem
x,
0 // Output is ignored, therefore the output size is zero
)
}
return result;
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
}
contract MultiSigWalletWithDailyLimit is MultiSigWallet {
/*
* Events
*/
event DailyLimitChange(uint dailyLimit);
/*
* Storage
*/
uint public dailyLimit;
uint public lastDay;
uint public spentToday;
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
/// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis.
function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit)
public
MultiSigWallet(_owners, _required)
{
dailyLimit = _dailyLimit;
}
/// @dev Allows to change the daily limit. Transaction has to be sent by wallet.
/// @param _dailyLimit Amount in wei.
function changeDailyLimit(uint _dailyLimit)
public
onlyWallet
{
dailyLimit = _dailyLimit;
DailyLimitChange(_dailyLimit);
}
/// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
Transaction storage txn = transactions[transactionId];
bool _confirmed = isConfirmed(transactionId);
if (_confirmed || txn.data.length == 0 && isUnderLimit(txn.value)) {
txn.executed = true;
if (!_confirmed)
spentToday += txn.value;
if (txn.destination.call.value(txn.value)(txn.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txn.executed = false;
if (!_confirmed)
spentToday -= txn.value;
}
}
}
/*
* Internal functions
*/
/// @dev Returns if amount is within daily limit and resets spentToday after one day.
/// @param amount Amount to withdraw.
/// @return Returns if amount is under daily limit.
function isUnderLimit(uint amount)
internal
returns (bool)
{
if (now > lastDay + 24 hours) {
lastDay = now;
spentToday = 0;
}
if (spentToday + amount > dailyLimit || spentToday + amount < spentToday)
return false;
return true;
}
/*
* Web3 call functions
*/
/// @dev Returns maximum withdraw amount.
/// @return Returns amount.
function calcMaxWithdraw()
public
constant
returns (uint)
{
if (now > lastDay + 24 hours)
return dailyLimit;
if (dailyLimit < spentToday)
return 0;
return dailyLimit - spentToday;
}
} | 0x6080604052600436106101535763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c278114610195578063173825d9146101c957806320ea8d86146101ea5780632f54bf6e146102025780633411c81c146102375780634bc9fdc21461025b578063547415251461028257806367eeba0c146102a15780636b0c932d146102b65780637065cb48146102cb578063784547a7146102ec5780638b51d13f146103045780639ace38c21461031c578063a0e67e2b146103d7578063a8abe69a1461043c578063b5dc40c314610461578063b77bf60014610479578063ba51a6df1461048e578063c01a8c84146104a6578063c6427474146104be578063cea0862114610527578063d74f8edd1461053f578063dc8452cd14610554578063e20056e614610569578063ee22610b14610590578063f059cf2b146105a8575b60003411156101935760408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b3480156101a157600080fd5b506101ad6004356105bd565b60408051600160a060020a039092168252519081900360200190f35b3480156101d557600080fd5b50610193600160a060020a03600435166105e5565b3480156101f657600080fd5b5061019360043561075c565b34801561020e57600080fd5b50610223600160a060020a0360043516610816565b604080519115158252519081900360200190f35b34801561024357600080fd5b50610223600435600160a060020a036024351661082b565b34801561026757600080fd5b5061027061084b565b60408051918252519081900360200190f35b34801561028e57600080fd5b5061027060043515156024351515610885565b3480156102ad57600080fd5b506102706108f1565b3480156102c257600080fd5b506102706108f7565b3480156102d757600080fd5b50610193600160a060020a03600435166108fd565b3480156102f857600080fd5b50610223600435610a22565b34801561031057600080fd5b50610270600435610aa6565b34801561032857600080fd5b50610334600435610b15565b6040518085600160a060020a0316600160a060020a031681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b83811015610399578181015183820152602001610381565b50505050905090810190601f1680156103c65780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b3480156103e357600080fd5b506103ec610bd3565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610428578181015183820152602001610410565b505050509050019250505060405180910390f35b34801561044857600080fd5b506103ec60043560243560443515156064351515610c35565b34801561046d57600080fd5b506103ec600435610d6e565b34801561048557600080fd5b50610270610ee7565b34801561049a57600080fd5b50610193600435610eed565b3480156104b257600080fd5b50610193600435610f6c565b3480156104ca57600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610270948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506110379650505050505050565b34801561053357600080fd5b50610193600435611056565b34801561054b57600080fd5b5061027061109d565b34801561056057600080fd5b506102706110a2565b34801561057557600080fd5b50610193600160a060020a03600435811690602435166110a8565b34801561059c57600080fd5b50610193600435611232565b3480156105b457600080fd5b50610270611448565b60038054829081106105cb57fe5b600091825260209091200154600160a060020a0316905081565b60003330146105f357600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561061c57600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156106f75782600160a060020a031660038381548110151561066657fe5b600091825260209091200154600160a060020a031614156106ec5760038054600019810190811061069357fe5b60009182526020909120015460038054600160a060020a0390921691849081106106b957fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055506106f7565b60019091019061063f565b60038054600019019061070a9082611586565b5060035460045411156107235760035461072390610eed565b604051600160a060020a038416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a2505050565b3360008181526002602052604090205460ff16151561077a57600080fd5b60008281526001602090815260408083203380855292529091205483919060ff1615156107a657600080fd5b600084815260208190526040902060030154849060ff16156107c757600080fd5b6000858152600160209081526040808320338085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b600060075462015180014211156108655750600654610882565b600854600654101561087957506000610882565b50600854600654035b90565b6000805b6005548110156108ea578380156108b2575060008181526020819052604090206003015460ff16155b806108d657508280156108d6575060008181526020819052604090206003015460ff165b156108e2576001820191505b600101610889565b5092915050565b60065481565b60075481565b33301461090957600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561093157600080fd5b81600160a060020a038116151561094757600080fd5b600380549050600101600454603282111580156109645750818111155b801561096f57508015155b801561097a57508115155b151561098557600080fd5b600160a060020a038516600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b600354811015610a9f5760008481526001602052604081206003805491929184908110610a5057fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610a84576001820191505b600454821415610a975760019250610a9f565b600101610a27565b5050919050565b6000805b600354811015610b0f5760008381526001602052604081206003805491929184908110610ad357fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610b07576001820191505b600101610aaa565b50919050565b6000602081815291815260409081902080546001808301546002808501805487516101009582161595909502600019011691909104601f8101889004880284018801909652858352600160a060020a0390931695909491929190830182828015610bc05780601f10610b9557610100808354040283529160200191610bc0565b820191906000526020600020905b815481529060010190602001808311610ba357829003601f168201915b5050506003909301549192505060ff1684565b60606003805480602002602001604051908101604052809291908181526020018280548015610c2b57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610c0d575b5050505050905090565b606080600080600554604051908082528060200260200182016040528015610c67578160200160208202803883390190505b50925060009150600090505b600554811015610cee57858015610c9c575060008181526020819052604090206003015460ff16155b80610cc05750848015610cc0575060008181526020819052604090206003015460ff165b15610ce657808383815181101515610cd457fe5b60209081029091010152600191909101905b600101610c73565b878703604051908082528060200260200182016040528015610d1a578160200160208202803883390190505b5093508790505b86811015610d63578281815181101515610d3757fe5b9060200190602002015184898303815181101515610d5157fe5b60209081029091010152600101610d21565b505050949350505050565b606080600080600380549050604051908082528060200260200182016040528015610da3578160200160208202803883390190505b50925060009150600090505b600354811015610e605760008581526001602052604081206003805491929184908110610dd857fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610e58576003805482908110610e1357fe5b6000918252602090912001548351600160a060020a0390911690849084908110610e3957fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610daf565b81604051908082528060200260200182016040528015610e8a578160200160208202803883390190505b509350600090505b81811015610edf578281815181101515610ea857fe5b906020019060200201518482815181101515610ec057fe5b600160a060020a03909216602092830290910190910152600101610e92565b505050919050565b60055481565b333014610ef957600080fd5b6003548160328211801590610f0e5750818111155b8015610f1957508015155b8015610f2457508115155b1515610f2f57600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b3360008181526002602052604090205460ff161515610f8a57600080fd5b6000828152602081905260409020548290600160a060020a03161515610faf57600080fd5b60008381526001602090815260408083203380855292529091205484919060ff1615610fda57600080fd5b6000858152600160208181526040808420338086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a361103085611232565b5050505050565b600061104484848461144e565b905061104f81610f6c565b9392505050565b33301461106257600080fd5b60068190556040805182815290517fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca29181900360200190a150565b603281565b60045481565b60003330146110b657600080fd5b600160a060020a038316600090815260026020526040902054839060ff1615156110df57600080fd5b600160a060020a038316600090815260026020526040902054839060ff161561110757600080fd5b600092505b6003548310156111985784600160a060020a031660038481548110151561112f57fe5b600091825260209091200154600160a060020a0316141561118d578360038481548110151561115a57fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550611198565b60019092019161110c565b600160a060020a03808616600081815260026020526040808220805460ff1990811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a2604051600160a060020a038516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b336000818152600260205260408120549091829160ff16151561125457600080fd5b60008481526001602090815260408083203380855292529091205485919060ff16151561128057600080fd5b600086815260208190526040902060030154869060ff16156112a157600080fd5b600087815260208190526040902095506112ba87610a22565b945084806112ed57506002808701546000196101006001831615020116041580156112ed57506112ed866001015461153e565b1561143f5760038601805460ff191660011790558415156113175760018601546008805490910190555b8560000160009054906101000a9004600160a060020a0316600160a060020a031686600101548760020160405180828054600181600116156101000203166002900480156113a65780601f1061137b576101008083540402835291602001916113a6565b820191906000526020600020905b81548152906001019060200180831161138957829003601f168201915b505091505060006040518083038185875af192505050156113f15760405187907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a261143f565b60405187907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038601805460ff1916905584151561143f576001860154600880549190910390555b50505050505050565b60085481565b600083600160a060020a038116151561146657600080fd5b60055460408051608081018252600160a060020a0388811682526020808301898152838501898152600060608601819052878152808452959095208451815473ffffffffffffffffffffffffffffffffffffffff1916941693909317835551600183015592518051949650919390926114e69260028501929101906115af565b50606091909101516003909101805460ff191691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b60006007546201518001421115611559574260075560006008555b600654826008540111806115705750600854828101105b1561157d57506000611581565b5060015b919050565b8154818355818111156115aa576000838152602090206115aa91810190830161162d565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106115f057805160ff191683800117855561161d565b8280016001018555821561161d579182015b8281111561161d578251825591602001919060010190611602565b5061162992915061162d565b5090565b61088291905b8082111561162957600081556001016116335600a165627a7a72305820e41a7f272cc0196618330cbf9559cfa8672fc584f69e532c1830e66844904fe30029 | {"success": true, "error": null, "results": {}} | 1,810 |
0xe6eeec0a34b26b61a7dbbd2a65066ccf0dd50938 | /*
DogeTok
Twitter: https://twitter.com/Dogetok_
TG: https://t.me/DogetokOfficial
*/
// 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 DogeTok is Context, IERC20, Ownable {///////////////////////////////////////////////////////////
using SafeMath for uint256;
string private constant _name = "DogeTok";//////////////////////////
string private constant _symbol = "DogeTok";//////////////////////////////////////////////////////////////////////////
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnBuy = 10;//////////////////////////////////////////////////////////////////////
//Sell Fee
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) private cooldown;
address payable private _developmentAddress = payable(0x50b90418C91ED698f771E19dC6EF06a6b26C61E2);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0x50b90418C91ED698f771E19dC6EF06a6b26C61E2);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 200000 * 10**9; //1%
uint256 public _maxWalletSize = 200000 * 10**9; //1%
uint256 public _swapTokensAtAmount = 40000 * 10**9; //.4%
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;
}
}
} | 0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f046146104e9578063dd62ed3e14610509578063ea1644d51461054f578063f2fde38b1461056f57600080fd5b8063a2a957bb14610464578063a9059cbb14610484578063bfd79284146104a4578063c3c8cd80146104d457600080fd5b80638f70ccf7116100d15780638f70ccf71461040e5780638f9a55c01461042e57806395d89b41146101f357806398a5c3151461044457600080fd5b806374010ece146103ba5780637d1db4a5146103da5780638da5cb5b146103f057600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103505780636fc3eaec1461037057806370a0823114610385578063715018a6146103a557600080fd5b8063313ce567146102f457806349bd5a5e146103105780636b9990531461033057600080fd5b80631694505e116101a05780631694505e1461026257806318160ddd1461029a57806323b872dd146102be5780632fd689e3146102de57600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023257600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ab3565b61058f565b005b3480156101ff57600080fd5b506040805180820182526007815266446f6765546f6b60c81b602082015290516102299190611bdd565b60405180910390f35b34801561023e57600080fd5b5061025261024d366004611a09565b61063c565b6040519015158152602001610229565b34801561026e57600080fd5b50601454610282906001600160a01b031681565b6040516001600160a01b039091168152602001610229565b3480156102a657600080fd5b50662386f26fc100005b604051908152602001610229565b3480156102ca57600080fd5b506102526102d93660046119c9565b610653565b3480156102ea57600080fd5b506102b060185481565b34801561030057600080fd5b5060405160098152602001610229565b34801561031c57600080fd5b50601554610282906001600160a01b031681565b34801561033c57600080fd5b506101f161034b366004611959565b6106bc565b34801561035c57600080fd5b506101f161036b366004611b7a565b610707565b34801561037c57600080fd5b506101f161074f565b34801561039157600080fd5b506102b06103a0366004611959565b61079a565b3480156103b157600080fd5b506101f16107bc565b3480156103c657600080fd5b506101f16103d5366004611b94565b610830565b3480156103e657600080fd5b506102b060165481565b3480156103fc57600080fd5b506000546001600160a01b0316610282565b34801561041a57600080fd5b506101f1610429366004611b7a565b61085f565b34801561043a57600080fd5b506102b060175481565b34801561045057600080fd5b506101f161045f366004611b94565b6108a7565b34801561047057600080fd5b506101f161047f366004611bac565b6108d6565b34801561049057600080fd5b5061025261049f366004611a09565b610914565b3480156104b057600080fd5b506102526104bf366004611959565b60106020526000908152604090205460ff1681565b3480156104e057600080fd5b506101f1610921565b3480156104f557600080fd5b506101f1610504366004611a34565b610975565b34801561051557600080fd5b506102b0610524366004611991565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561055b57600080fd5b506101f161056a366004611b94565b610a24565b34801561057b57600080fd5b506101f161058a366004611959565b610a53565b6000546001600160a01b031633146105c25760405162461bcd60e51b81526004016105b990611c30565b60405180910390fd5b60005b8151811015610638576001601060008484815181106105f457634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063081611d43565b9150506105c5565b5050565b6000610649338484610b3d565b5060015b92915050565b6000610660848484610c61565b6106b284336106ad85604051806060016040528060288152602001611da0602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061119d565b610b3d565b5060019392505050565b6000546001600160a01b031633146106e65760405162461bcd60e51b81526004016105b990611c30565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107315760405162461bcd60e51b81526004016105b990611c30565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061078457506013546001600160a01b0316336001600160a01b0316145b61078d57600080fd5b47610797816111d7565b50565b6001600160a01b03811660009081526002602052604081205461064d9061125c565b6000546001600160a01b031633146107e65760405162461bcd60e51b81526004016105b990611c30565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461085a5760405162461bcd60e51b81526004016105b990611c30565b601655565b6000546001600160a01b031633146108895760405162461bcd60e51b81526004016105b990611c30565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108d15760405162461bcd60e51b81526004016105b990611c30565b601855565b6000546001600160a01b031633146109005760405162461bcd60e51b81526004016105b990611c30565b600893909355600a91909155600955600b55565b6000610649338484610c61565b6012546001600160a01b0316336001600160a01b0316148061095657506013546001600160a01b0316336001600160a01b0316145b61095f57600080fd5b600061096a3061079a565b9050610797816112e0565b6000546001600160a01b0316331461099f5760405162461bcd60e51b81526004016105b990611c30565b60005b82811015610a1e5781600560008686858181106109cf57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906109e49190611959565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a1681611d43565b9150506109a2565b50505050565b6000546001600160a01b03163314610a4e5760405162461bcd60e51b81526004016105b990611c30565b601755565b6000546001600160a01b03163314610a7d5760405162461bcd60e51b81526004016105b990611c30565b6001600160a01b038116610ae25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105b9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610b9f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105b9565b6001600160a01b038216610c005760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105b9565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cc55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105b9565b6001600160a01b038216610d275760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105b9565b60008111610d895760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105b9565b6000546001600160a01b03848116911614801590610db557506000546001600160a01b03838116911614155b1561109657601554600160a01b900460ff16610e4e576000546001600160a01b03848116911614610e4e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105b9565b601654811115610ea05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105b9565b6001600160a01b03831660009081526010602052604090205460ff16158015610ee257506001600160a01b03821660009081526010602052604090205460ff16155b610f3a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105b9565b6015546001600160a01b03838116911614610fbf5760175481610f5c8461079a565b610f669190611cd5565b10610fbf5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105b9565b6000610fca3061079a565b601854601654919250821015908210610fe35760165491505b808015610ffa5750601554600160a81b900460ff16155b801561101457506015546001600160a01b03868116911614155b80156110295750601554600160b01b900460ff165b801561104e57506001600160a01b03851660009081526005602052604090205460ff16155b801561107357506001600160a01b03841660009081526005602052604090205460ff16155b1561109357611081826112e0565b47801561109157611091476111d7565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110d857506001600160a01b03831660009081526005602052604090205460ff165b8061110a57506015546001600160a01b0385811691161480159061110a57506015546001600160a01b03848116911614155b1561111757506000611191565b6015546001600160a01b03858116911614801561114257506014546001600160a01b03848116911614155b1561115457600854600c55600954600d555b6015546001600160a01b03848116911614801561117f57506014546001600160a01b03858116911614155b1561119157600a54600c55600b54600d555b610a1e84848484611485565b600081848411156111c15760405162461bcd60e51b81526004016105b99190611bdd565b5060006111ce8486611d2c565b95945050505050565b6012546001600160a01b03166108fc6111f18360026114b3565b6040518115909202916000818181858888f19350505050158015611219573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112348360026114b3565b6040518115909202916000818181858888f19350505050158015610638573d6000803e3d6000fd5b60006006548211156112c35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105b9565b60006112cd6114f5565b90506112d983826114b3565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138a57600080fd5b505afa15801561139e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c29190611975565b816001815181106113e357634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546114099130911684610b3d565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611442908590600090869030904290600401611c65565b600060405180830381600087803b15801561145c57600080fd5b505af1158015611470573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061149257611492611518565b61149d848484611546565b80610a1e57610a1e600e54600c55600f54600d55565b60006112d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061163d565b600080600061150261166b565b909250905061151182826114b3565b9250505090565b600c541580156115285750600d54155b1561152f57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611558876116a9565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061158a9087611706565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115b99086611748565b6001600160a01b0389166000908152600260205260409020556115db816117a7565b6115e584836117f1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162a91815260200190565b60405180910390a3505050505050505050565b6000818361165e5760405162461bcd60e51b81526004016105b99190611bdd565b5060006111ce8486611ced565b6006546000908190662386f26fc1000061168582826114b3565b8210156116a057505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116c68a600c54600d54611815565b92509250925060006116d66114f5565b905060008060006116e98e87878761186a565b919e509c509a509598509396509194505050505091939550919395565b60006112d983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061119d565b6000806117558385611cd5565b9050838110156112d95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105b9565b60006117b16114f5565b905060006117bf83836118ba565b306000908152600260205260409020549091506117dc9082611748565b30600090815260026020526040902055505050565b6006546117fe9083611706565b60065560075461180e9082611748565b6007555050565b600080808061182f606461182989896118ba565b906114b3565b9050600061184260646118298a896118ba565b9050600061185a826118548b86611706565b90611706565b9992985090965090945050505050565b600080808061187988866118ba565b9050600061188788876118ba565b9050600061189588886118ba565b905060006118a7826118548686611706565b939b939a50919850919650505050505050565b6000826118c95750600061064d565b60006118d58385611d0d565b9050826118e28583611ced565b146112d95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105b9565b803561194481611d8a565b919050565b8035801515811461194457600080fd5b60006020828403121561196a578081fd5b81356112d981611d8a565b600060208284031215611986578081fd5b81516112d981611d8a565b600080604083850312156119a3578081fd5b82356119ae81611d8a565b915060208301356119be81611d8a565b809150509250929050565b6000806000606084860312156119dd578081fd5b83356119e881611d8a565b925060208401356119f881611d8a565b929592945050506040919091013590565b60008060408385031215611a1b578182fd5b8235611a2681611d8a565b946020939093013593505050565b600080600060408486031215611a48578283fd5b833567ffffffffffffffff80821115611a5f578485fd5b818601915086601f830112611a72578485fd5b813581811115611a80578586fd5b8760208260051b8501011115611a94578586fd5b602092830195509350611aaa9186019050611949565b90509250925092565b60006020808385031215611ac5578182fd5b823567ffffffffffffffff80821115611adc578384fd5b818501915085601f830112611aef578384fd5b813581811115611b0157611b01611d74565b8060051b604051601f19603f83011681018181108582111715611b2657611b26611d74565b604052828152858101935084860182860187018a1015611b44578788fd5b8795505b83861015611b6d57611b5981611939565b855260019590950194938601938601611b48565b5098975050505050505050565b600060208284031215611b8b578081fd5b6112d982611949565b600060208284031215611ba5578081fd5b5035919050565b60008060008060808587031215611bc1578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c0957858101830151858201604001528201611bed565b81811115611c1a5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cb45784516001600160a01b031683529383019391830191600101611c8f565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ce857611ce8611d5e565b500190565b600082611d0857634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d2757611d27611d5e565b500290565b600082821015611d3e57611d3e611d5e565b500390565b6000600019821415611d5757611d57611d5e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461079757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d1ca37dbe8e8c118b7048c49ba026fdf839ec32d1c9610ccffb2c7ff0898e20164736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,811 |
0xd6ea6522a51d1702d8b080fd6983c93e16a3d20a | // SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract EverPro is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
struct lockDetail{
uint256 amountToken;
uint256 lockUntil;
}
mapping (address => uint256) private _balances;
mapping (address => bool) private _blacklist;
mapping (address => bool) private _isAdmin;
mapping (address => lockDetail) private _lockInfo;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event PutToBlacklist(address indexed target, bool indexed status);
event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil);
constructor (string memory name, string memory symbol, uint256 amount) {
_name = name;
_symbol = symbol;
_setupDecimals(18);
address msgSender = _msgSender();
_owner = msgSender;
_isAdmin[msgSender] = true;
_mint(msgSender, amount);
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function isAdmin(address account) public view returns (bool) {
return _isAdmin[account];
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
modifier onlyAdmin() {
require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
function promoteAdmin(address newAdmin) public virtual onlyOwner {
require(_isAdmin[newAdmin] == false, "Ownable: address is already admin");
require(newAdmin != address(0), "Ownable: new admin is the zero address");
_isAdmin[newAdmin] = true;
}
function demoteAdmin(address oldAdmin) public virtual onlyOwner {
require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin");
require(oldAdmin != address(0), "Ownable: old admin is the zero address");
_isAdmin[oldAdmin] = false;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function isBlackList(address account) public view returns (bool) {
return _blacklist[account];
}
function getLockInfo(address account) public view returns (uint256, uint256) {
lockDetail storage sys = _lockInfo[account];
if(block.timestamp > sys.lockUntil){
return (0,0);
}else{
return (
sys.amountToken,
sys.lockUntil
);
}
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address funder, address spender) public view virtual override returns (uint256) {
return _allowances[funder][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) {
_transfer(_msgSender(), recipient, amount);
_wantLock(recipient, amount, lockUntil);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){
_wantLock(targetaddress, amount, lockUntil);
return true;
}
function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){
_wantUnlock(targetaddress);
return true;
}
function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){
_burn(targetaddress, amount);
return true;
}
function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){
_wantblacklist(targetaddress);
return true;
}
function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){
_wantunblacklist(targetaddress);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
lockDetail storage sys = _lockInfo[sender];
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(_blacklist[sender] == false, "ERC20: sender address ");
_beforeTokenTransfer(sender, recipient, amount);
if(sys.amountToken > 0){
if(block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
}else{
uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance");
_balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = _balances[sender].add(sys.amountToken);
_balances[recipient] = _balances[recipient].add(amount);
}
}else{
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
}
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
require(_balances[account] >= sys.amountToken.add(amountLock), "ERC20: You can't lock more than account balances");
if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
}
sys.lockUntil = unlockDate;
sys.amountToken = sys.amountToken.add(amountLock);
emit LockUntil(account, sys.amountToken, unlockDate);
}
function _wantUnlock(address account) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
sys.lockUntil = 0;
sys.amountToken = 0;
emit LockUntil(account, 0, 0);
}
function _wantblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == false, "ERC20: Address already in blacklist");
_blacklist[account] = true;
emit PutToBlacklist(account, true);
}
function _wantunblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == true, "ERC20: Address not blacklisted");
_blacklist[account] = false;
emit PutToBlacklist(account, false);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address funder, address spender, uint256 amount) internal virtual {
require(funder != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[funder][spender] = amount;
emit Approval(funder, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de57806395d89b4111610097578063b36d691911610071578063b36d6919146108b2578063dd62ed3e1461090c578063df698fc914610984578063f2fde38b146109c857610173565b806395d89b4114610767578063a457c2d7146107ea578063a9059cbb1461084e57610173565b806370a08231146105aa578063715018a6146106025780637238ccdb1461060c578063787f02331461066b57806384d5d944146106c55780638da5cb5b1461073357610173565b8063313ce56711610130578063313ce567146103b557806339509351146103d65780633d72d6831461043a57806352a97d521461049e578063569abd8d146104f85780635e558d221461053c57610173565b806306fdde0314610178578063095ea7b3146101fb57806318160ddd1461025f57806319f9a20f1461027d57806323b872dd146102d757806324d7806c1461035b575b600080fd5b610180610a0c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c05780820151818401526020810190506101a5565b50505050905090810190601f1680156101ed5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102476004803603604081101561021157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aae565b60405180821515815260200191505060405180910390f35b610267610acc565b6040518082815260200191505060405180910390f35b6102bf6004803603602081101561029357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ad6565b60405180821515815260200191505060405180910390f35b610343600480360360608110156102ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b9a565b60405180821515815260200191505060405180910390f35b61039d6004803603602081101561037157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c73565b60405180821515815260200191505060405180910390f35b6103bd610cc9565b604051808260ff16815260200191505060405180910390f35b610422600480360360408110156103ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ce0565b60405180821515815260200191505060405180910390f35b6104866004803603604081101561045057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d93565b60405180821515815260200191505060405180910390f35b6104e0600480360360208110156104b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e73565b60405180821515815260200191505060405180910390f35b61053a6004803603602081101561050e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f51565b005b6105926004803603606081101561055257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506111a5565b60405180821515815260200191505060405180910390f35b6105ec600480360360208110156105c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061126d565b6040518082815260200191505060405180910390f35b61060a6112b5565b005b61064e6004803603602081101561062257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611440565b604051808381526020018281526020019250505060405180910390f35b6106ad6004803603602081101561068157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114b4565b60405180821515815260200191505060405180910390f35b61071b600480360360608110156106db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611592565b60405180821515815260200191505060405180910390f35b61073b61166c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61076f611696565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107af578082015181840152602081019050610794565b50505050905090810190601f1680156107dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6108366004803603604081101561080057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611738565b60405180821515815260200191505060405180910390f35b61089a6004803603604081101561086457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611805565b60405180821515815260200191505060405180910390f35b6108f4600480360360208110156108c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611823565b60405180821515815260200191505060405180910390f35b61096e6004803603604081101561092257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611879565b6040518082815260200191505060405180910390f35b6109c66004803603602081101561099a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611900565b005b610a0a600480360360208110156109de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b71565b005b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aa45780601f10610a7957610100808354040283529160200191610aa4565b820191906000526020600020905b815481529060010190602001808311610a8757829003601f168201915b5050505050905090565b6000610ac2610abb611e09565b8484611e11565b6001905092915050565b6000600554905090565b60006001151560026000610ae8611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610b88576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b610b9182612008565b60019050919050565b6000610ba784848461214c565b610c6884610bb3611e09565b610c638560405180606001604052806028815260200161330660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610c19611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b600190509392505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600860009054906101000a900460ff16905090565b6000610d89610ced611e09565b84610d848560046000610cfe611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b611e11565b6001905092915050565b6000610d9d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e5f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610e69838361295d565b6001905092915050565b6000610e7d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610f4882612b21565b60019050919050565b610f59611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133e06021913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561114a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132886026913960400191505060405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600060011515600260006111b7611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611257576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b611262848484612cf1565b600190509392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6112bd611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461137f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000806000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806001015442111561149f5760008092509250506114af565b8060000154816001015492509250505b915091565b60006114be611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611580576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61158982612f2c565b60019050919050565b600060011515600260006115a4611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611644576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b61165661164f611e09565b858561214c565b611661848484612cf1565b600190509392505050565b6000600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561172e5780601f106117035761010080835404028352916020019161172e565b820191906000526020600020905b81548152906001019060200180831161171157829003601f168201915b5050505050905090565b60006117fb611745611e09565b846117f6856040518060600160405280602581526020016133bb602591396004600061176f611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b6001905092915050565b6000611819611812611e09565b848461214c565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611908611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611a90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f776e61626c653a2061646472657373206973206e6f742061646d696e00000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b16576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132626026913960400191505060405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611b79611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c3b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611cc1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131d26026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611dff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e97576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806133746024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806131f86022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156120ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b60008160010181905550600081600001819055506000808373ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a45050565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061334f6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561229b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061316a6023913960400191505060405180910390fd5b60001515600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612361576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f45524332303a2073656e6465722061646472657373200000000000000000000081525060200191505060405180910390fd5b61236c84848461311a565b6000816000015411156126f15780600101544211156124de5760008160010181905550600081600001819055506124048260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612497826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126ec565b600061254f826000015460405180606001604052806022815260200161321a602291396000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b905061257e8360405180606001604052806026815260200161323c602691398361289d9092919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061261582600001546000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126a8836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b612832565b61275c8260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ef826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600083831115829061294a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561290f5780820151818401526020810190506128f4565b50505050905090810190601f16801561293c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156129e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061332e6021913960400191505060405180910390fd5b6129ef8260008361311a565b612a5a816040518060600160405280602281526020016131b0602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ab18160055461311f90919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612ba7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612c50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061318d6023913960400191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600115158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612dd7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b612dee838260000154611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015612e84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806132ae6030913960400191505060405180910390fd5b60008160010154118015612e9b5750806001015442115b15612eb55760008160010181905550600081600001819055505b818160010181905550612ed5838260000154611d8190919063ffffffff16565b81600001819055508181600001548573ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a450505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612fb2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514613078576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2041646472657373206e6f7420626c61636b6c6973746564000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600015158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b505050565b600061316183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061289d565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea2646970667358221220ad36fbd8c5ca065b2fb4cac334f6168a192fa5f8dd1d406110ec83fed9ea1f9764736f6c63430007030033 | {"success": true, "error": null, "results": {}} | 1,812 |
0x6615e67b8b6b6375d38a0a3f937cd8c1a1e96386 | /**
*Submitted for verification at Etherscan.io on 2021-09-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();
}
} | 0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220fe02bd6176670a8456bd97607503d8a0438ecec7fad240c0f60d78a9f087d3be64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,813 |
0x5D5D6C19D5ebfdC8Da5E43669cC9D2A94bC78D63 | pragma solidity ^0.6.6;
//SPDX-License-Identifier: UNLICENSED
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a + b;
require(c >= a);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
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 Owned {
address public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
owner = msg.sender;
}
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;
emit OwnershipTransferred(owner, newOwner);
}
}
}
// ----------------------------------------------------------------------------
//Tokenlock trade
// ----------------------------------------------------------------------------
contract Tokenlock is Owned {
uint8 isLocked = 0;
event Freezed();
event UnFreezed();
modifier validLock {
require(isLocked == 0);
_;
}
function freeze() public onlyOwner {
isLocked = 1;
emit Freezed();
}
function unfreeze() public onlyOwner {
isLocked = 0;
emit UnFreezed();
}
mapping(address => bool) blacklist;
event LockUser(address indexed who);
event UnlockUser(address indexed who);
modifier permissionCheck {
require(!blacklist[msg.sender]);
_;
}
function lockUser(address who) public onlyOwner {
blacklist[who] = true;
emit LockUser(who);
}
function unlockUser(address who) public onlyOwner {
blacklist[who] = false;
emit UnlockUser(who);
}
}
contract Timi is Tokenlock {
using SafeMath for uint;
string public name = "Timi Finance";
string public symbol = "Timi";
uint8 public decimals = 18;
uint internal _rate=100;
uint internal _amount;
uint256 public totalSupply;
//bank
mapping(address => uint) bank_balances;
//eth
mapping(address => uint) activeBalances;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Transfer(address indexed _from, address indexed _to, uint256 value);
event Burn(address indexed _from, uint256 value);
// Called when new token are issued
event Issue(uint amount);
// Called when tokens are redeemed
event Redeem(uint amount);
//Called when sent
event Sent(address from, address to, uint amount);
event FallbackCalled(address sent, uint amount);
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
require(!(msg.data.length < size + 4));
_;
}
constructor (uint totalAmount) public{
totalSupply = totalAmount * 10**uint256(decimals);
balances[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
/* function totalSupply() public view returns (uint) {
return _totalSupply.sub(balances[address(0)]);
}*/
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOfBank(address tokenOwner) public view returns (uint balance) {
return bank_balances[tokenOwner];
}
function balanceOfReg(address tokenOwner) public view returns (uint balance) {
return activeBalances[tokenOwner];
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// 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;
emit 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;
emit Redeem(amount);
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public validLock permissionCheck onlyPayloadSize(2 * 32) returns (bool success) {
require(to != address(0));
require(balances[msg.sender] >= tokens && tokens > 0);
require(balances[to] + tokens >= balances[to]);
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public validLock permissionCheck onlyPayloadSize(3 * 32) returns (bool success) {
require(to != address(0));
require(balances[from] >= tokens && tokens > 0);
require(balances[to] + tokens >= balances[to]);
balances[from] = balances[from].sub(tokens);
if(allowed[from][msg.sender] > 0)
{
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
}
balances[to] = balances[to].add(tokens);
emit Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferStore(address from, address to, uint tokens) public validLock permissionCheck onlyPayloadSize(3 * 32) returns (bool success) {
require(to != address(0));
require(balances[from] >= tokens && tokens > 0);
require(balances[to] + tokens >= balances[to]);
balances[from] = balances[from].sub(tokens);
if(allowed[from][msg.sender] > 0)
{
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
}
balances[to] = balances[to].add(tokens);
bank_balances[from] = bank_balances[from].add(tokens);
emit Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner {
// return ERC20Interface(tokenAddress).transfer(owner, tokens);
address(uint160(tokenAddress)).transfer(tokens);
emit Sent(owner,tokenAddress,tokens);
}
// ------------------------------------------------------------------------
// ERC20 withdraw
// -----------------------------------------
function withdraw() onlyOwner public {
msg.sender.transfer(address(this).balance);
_amount = 0;
}
function showAmount() onlyOwner public view returns (uint) {
return _amount;
}
function showBalance() onlyOwner public view returns (uint) {
return owner.balance;
}
// ------------------------------------------------------------------------
// ERC20 set rate
// -----------------------------------------
function set_rate(uint _vlue) public onlyOwner{
require(_vlue > 0);
_rate = _vlue;
}
// ------------------------------------------------------------------------
// ERC20 tokens
// -----------------------------------------
receive() external payable{
/* require(balances[owner] >= msg.value && msg.value > 0);
balances[msg.sender] = balances[msg.sender].add(msg.value * _rate);
balances[owner] = balances[owner].sub(msg.value * _rate); */
_amount=_amount.add(msg.value);
activeBalances[msg.sender] = activeBalances[msg.sender].add(msg.value);
}
// ------------------------------------------------------------------------
// ERC20 recharge
// -----------------------------------------
function recharge() public payable{
_amount=_amount.add(msg.value);
activeBalances[msg.sender] = activeBalances[msg.sender].add(msg.value);
}
} | 0x6080604052600436106101855760003560e01c806381b2d07b116100d1578063d4387a991161008a578063dc39d06d11610064578063dc39d06d146105c2578063dd62ed3e146105fb578063f2fde38b14610636578063f9d528f014610669576101d2565b8063d4387a991461053b578063d797258014610565578063db006a7514610598576101d2565b806381b2d07b1461044a5780638da5cb5b1461045f57806395d89b4114610490578063a9059cbb146104a5578063bd1870a3146104de578063cc872b6614610511576101d2565b8063440ab7101161013e5780635cfb5ff5116101185780635cfb5ff5146103d857806362a5af3b146103ed5780636a28f0001461040257806370a0823114610417576101d2565b8063440ab7101461035a5780634cddae281461039d578063514276e5146103a5576101d2565b806306fdde03146101d7578063095ea7b31461026157806318160ddd146102ae57806323b872dd146102d5578063313ce567146103185780633ccfd60b14610343576101d2565b366101d25760065461019d903463ffffffff61069c16565b600655336000908152600960205260409020546101c0903463ffffffff61069c16565b33600090815260096020526040902055005b600080fd5b3480156101e357600080fd5b506101ec6106c1565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561022657818101518382015260200161020e565b50505050905090810190601f1680156102535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026d57600080fd5b5061029a6004803603604081101561028457600080fd5b506001600160a01b03813516906020013561074c565b604080519115158252519081900360200190f35b3480156102ba57600080fd5b506102c36107b2565b60408051918252519081900360200190f35b3480156102e157600080fd5b5061029a600480360360608110156102f857600080fd5b506001600160a01b038135811691602081013590911690604001356107b8565b34801561032457600080fd5b5061032d6109a7565b6040805160ff9092168252519081900360200190f35b34801561034f57600080fd5b506103586109b0565b005b34801561036657600080fd5b5061029a6004803603606081101561037d57600080fd5b506001600160a01b038135811691602081013590911690604001356109fb565b610358610c28565b3480156103b157600080fd5b506102c3600480360360208110156103c857600080fd5b50356001600160a01b0316610c70565b3480156103e457600080fd5b506102c3610c8b565b3480156103f957600080fd5b50610358610caa565b34801561040e57600080fd5b50610358610cfd565b34801561042357600080fd5b506102c36004803603602081101561043a57600080fd5b50356001600160a01b0316610d4a565b34801561045657600080fd5b506102c3610d65565b34801561046b57600080fd5b50610474610d8e565b604080516001600160a01b039092168252519081900360200190f35b34801561049c57600080fd5b506101ec610d9d565b3480156104b157600080fd5b5061029a600480360360408110156104c857600080fd5b506001600160a01b038135169060200135610df8565b3480156104ea57600080fd5b506103586004803603602081101561050157600080fd5b50356001600160a01b0316610f50565b34801561051d57600080fd5b506103586004803603602081101561053457600080fd5b5035610fb0565b34801561054757600080fd5b506103586004803603602081101561055e57600080fd5b503561105b565b34801561057157600080fd5b506103586004803603602081101561058857600080fd5b50356001600160a01b0316611084565b3480156105a457600080fd5b50610358600480360360208110156105bb57600080fd5b50356110ea565b3480156105ce57600080fd5b50610358600480360360408110156105e557600080fd5b506001600160a01b038135169060200135611195565b34801561060757600080fd5b506102c36004803603604081101561061e57600080fd5b506001600160a01b0381358116916020013516611234565b34801561064257600080fd5b506103586004803603602081101561065957600080fd5b50356001600160a01b031661125f565b34801561067557600080fd5b506102c36004803603602081101561068c57600080fd5b50356001600160a01b03166112d4565b60008082116106aa57600080fd5b50818101828110156106bb57600080fd5b92915050565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156107445780601f1061071957610100808354040283529160200191610744565b820191906000526020600020905b81548152906001019060200180831161072757829003601f168201915b505050505081565b336000818152600b602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60075481565b60008054600160a01b900460ff16156107d057600080fd5b3360009081526001602052604090205460ff16156107ed57600080fd5b606060643610156107fd57600080fd5b6001600160a01b03841661081057600080fd5b6001600160a01b0385166000908152600a602052604090205483118015906108385750600083115b61084157600080fd5b6001600160a01b0384166000908152600a6020526040902054838101101561086857600080fd5b6001600160a01b0385166000908152600a6020526040902054610891908463ffffffff6112ef16565b6001600160a01b0386166000908152600a6020908152604080832093909355600b8152828220338352905220541561091c576001600160a01b0385166000908152600b602090815260408083203384529091529020546108f7908463ffffffff6112ef16565b6001600160a01b0386166000908152600b602090815260408083203384529091529020555b6001600160a01b0384166000908152600a6020526040902054610945908463ffffffff61069c16565b6001600160a01b038086166000818152600a602090815260409182902094909455805187815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3506001949350505050565b60045460ff1681565b6000546001600160a01b031633146109c757600080fd5b60405133904780156108fc02916000818181858888f193505050501580156109f3573d6000803e3d6000fd5b506000600655565b60008054600160a01b900460ff1615610a1357600080fd5b3360009081526001602052604090205460ff1615610a3057600080fd5b60606064361015610a4057600080fd5b6001600160a01b038416610a5357600080fd5b6001600160a01b0385166000908152600a60205260409020548311801590610a7b5750600083115b610a8457600080fd5b6001600160a01b0384166000908152600a60205260409020548381011015610aab57600080fd5b6001600160a01b0385166000908152600a6020526040902054610ad4908463ffffffff6112ef16565b6001600160a01b0386166000908152600a6020908152604080832093909355600b81528282203383529052205415610b5f576001600160a01b0385166000908152600b60209081526040808320338452909152902054610b3a908463ffffffff6112ef16565b6001600160a01b0386166000908152600b602090815260408083203384529091529020555b6001600160a01b0384166000908152600a6020526040902054610b88908463ffffffff61069c16565b6001600160a01b038086166000908152600a6020908152604080832094909455918816815260089091522054610bc4908463ffffffff61069c16565b6001600160a01b0380871660008181526008602090815260409182902094909455805187815290519288169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3506001949350505050565b600654610c3b903463ffffffff61069c16565b60065533600090815260096020526040902054610c5e903463ffffffff61069c16565b33600090815260096020526040902055565b6001600160a01b031660009081526008602052604090205490565b600080546001600160a01b03163314610ca357600080fd5b5060065490565b6000546001600160a01b03163314610cc157600080fd5b6000805460ff60a01b1916600160a01b1781556040517f962a6139ca22015759d0878e2cf5d770dcb8152e1d5ba08e46a969dd9b154a9c9190a1565b6000546001600160a01b03163314610d1457600080fd5b6000805460ff60a01b191681556040517ff0daac2271a735ea786b9adf80dfcbd6a3cbd52f3cab0a78337114692d5faf5d9190a1565b6001600160a01b03166000908152600a602052604090205490565b600080546001600160a01b03163314610d7d57600080fd5b506000546001600160a01b03163190565b6000546001600160a01b031681565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107445780601f1061071957610100808354040283529160200191610744565b60008054600160a01b900460ff1615610e1057600080fd5b3360009081526001602052604090205460ff1615610e2d57600080fd5b60406044361015610e3d57600080fd5b6001600160a01b038416610e5057600080fd5b336000908152600a60205260409020548311801590610e6f5750600083115b610e7857600080fd5b6001600160a01b0384166000908152600a60205260409020548381011015610e9f57600080fd5b336000908152600a6020526040902054610ebf908463ffffffff6112ef16565b336000908152600a6020526040808220929092556001600160a01b03861681522054610ef1908463ffffffff61069c16565b6001600160a01b0385166000818152600a60209081526040918290209390935580518681529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b6000546001600160a01b03163314610f6757600080fd5b6001600160a01b038116600081815260016020526040808220805460ff19169055517f687691c08a3e67a160ba20a32cb1c56791955f12c5ff5d5fcf62bc456ad79ea19190a250565b6000546001600160a01b03163314610fc757600080fd5b60075481810111610fd757600080fd5b600080546001600160a01b03168152600a602052604090205481810111610ffd57600080fd5b600080546001600160a01b03168152600a60209081526040918290208054840190556007805484019055815183815291517fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a9281900390910190a150565b6000546001600160a01b0316331461107257600080fd5b6000811161107f57600080fd5b600555565b6000546001600160a01b0316331461109b57600080fd5b6001600160a01b0381166000818152600160208190526040808320805460ff1916909217909155517f169aadf55dc2098830ccf9f334e3ce3933b6e895b9114fc9f49242f2be61fe8e9190a250565b6000546001600160a01b0316331461110157600080fd5b80600754101561111057600080fd5b600080546001600160a01b03168152600a602052604090205481111561113557600080fd5b600780548290039055600080546001600160a01b03168152600a602090815260409182902080548490039055815183815291517f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a449281900390910190a150565b6000546001600160a01b031633146111ac57600080fd5b6040516001600160a01b0383169082156108fc029083906000818181858888f193505050501580156111e2573d6000803e3d6000fd5b50600054604080516001600160a01b0392831681529184166020830152818101839052517f3990db2d31862302a685e8086b5755072a6e2b5b780af1ee81ece35ee3cd33459181900360600190a15050565b6001600160a01b039182166000908152600b6020908152604080832093909416825291909152205490565b6000546001600160a01b0316331461127657600080fd5b6001600160a01b038116156112d157600080546001600160a01b0319166001600160a01b0383811691821780845560405192939116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35b50565b6001600160a01b031660009081526009602052604090205490565b60008082116112fd57600080fd5b8282111561130a57600080fd5b5090039056fea2646970667358221220e4afc53ddb75f225d3a50078bdb3a2be31c8fdd97c056afec5ac66353d7654d564736f6c63430006060033 | {"success": true, "error": null, "results": {}} | 1,814 |
0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | 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 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();
}
}
contract ContractReceiver {
function tokenFallback(address _from, uint _value, bytes _data);
}
contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
event FrozenFunds(address target, bool frozen);
event Approval(address indexed owner, address indexed spender, uint256 value);
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
constructor(string _name, string _symbol, uint8 _decimals, uint256 _supply)
{
name = _name;
symbol = _symbol;
decimals = _decimals;
totalSupply = _supply;
balances[msg.sender] = totalSupply;
}
// Function to access name of token .
function name() constant returns (string _name) {
return name;
}
// Function to access symbol of token .
function symbol() constant returns (string _symbol) {
return symbol;
}
// Function to access decimals of token .
function decimals() constant returns (uint8 _decimals) {
return decimals;
}
// Function to access total supply of tokens .
function totalSupply() constant returns (uint256 _totalSupply) {
return totalSupply;
}
function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
emit FrozenFunds(target, freeze);
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data, string _custom_fallback)
whenNotPaused
returns (bool success)
{
require(_to != address(0));
require(!frozenAccount[_to]);
require(!frozenAccount[msg.sender]);
if(isContract(_to)) {
require(balanceOf(msg.sender) >= _value);
balances[_to] = balanceOf(_to).sub(_value);
balances[_to] = balanceOf(_to).add(_value);
assert(_to.call.value(0)(bytes4(sha3(_custom_fallback)), msg.sender, _value, _data));
emit Transfer(msg.sender, _to, _value, _data);
return true;
}
else {
return transferToAddress(_to, _value, _data);
}
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data)
whenNotPaused
returns (bool success) {
require(_to != address(0));
require(!frozenAccount[_to]);
require(!frozenAccount[msg.sender]);
if(isContract(_to)) {
return transferToContract(_to, _value, _data);
}
else {
return transferToAddress(_to, _value, _data);
}
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint _value)
whenNotPaused
returns (bool success) {
require(_to != address(0));
require(!frozenAccount[_to]);
require(!frozenAccount[msg.sender]);
//standard function transfer similar to ERC20 transfer with no _data
//added due to backwards compatibility reasons
bytes memory empty;
if(isContract(_to)) {
return transferToContract(_to, _value, empty);
}
else {
return transferToAddress(_to, _value, empty);
}
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private returns (bool is_contract) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length>0);
}
//function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
require(_to != address(0));
require(!frozenAccount[_to]);
require(balanceOf(msg.sender) >= _value);
require(!frozenAccount[msg.sender]);
balances[msg.sender] = balanceOf(msg.sender).sub(_value);
balances[_to] = balanceOf(_to).add(_value);
emit Transfer(msg.sender, _to, _value, _data);
return true;
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
require(_to != address(0));
require(!frozenAccount[_to]);
require(balanceOf(msg.sender) >= _value);
require(!frozenAccount[msg.sender]);
balances[msg.sender] = balanceOf(msg.sender).sub(_value);
balances[_to] = balanceOf(_to).add(_value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
emit Transfer(msg.sender, _to, _value, _data);
return true;
}
function balanceOf(address _owner) constant 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, uint256 _value)
public
whenNotPaused
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
whenNotPaused
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
whenNotPaused
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;
}
function distributeAirdrop(address[] addresses, uint256 amount) onlyOwner public returns (bool seccess) {
require(amount > 0);
require(addresses.length > 0);
require(!frozenAccount[msg.sender]);
uint256 totalAmount = amount.mul(addresses.length);
require(balances[msg.sender] >= totalAmount);
bytes memory empty;
for (uint i = 0; i < addresses.length; i++) {
require(addresses[i] != address(0));
require(!frozenAccount[addresses[i]]);
balances[addresses[i]] = balances[addresses[i]].add(amount);
emit Transfer(msg.sender, addresses[i], amount, empty);
}
balances[msg.sender] = balances[msg.sender].sub(totalAmount);
return true;
}
function distributeAirdrop(address[] addresses, uint256[] amounts) public returns (bool) {
require(addresses.length > 0);
require(addresses.length == amounts.length);
require(!frozenAccount[msg.sender]);
uint256 totalAmount = 0;
for(uint i = 0; i < addresses.length; i++){
require(amounts[i] > 0);
require(addresses[i] != address(0));
require(!frozenAccount[addresses[i]]);
totalAmount = totalAmount.add(amounts[i]);
}
require(balances[msg.sender] >= totalAmount);
bytes memory empty;
for (i = 0; i < addresses.length; i++) {
balances[addresses[i]] = balances[addresses[i]].add(amounts[i]);
emit Transfer(msg.sender, addresses[i], amounts[i], empty);
}
balances[msg.sender] = balances[msg.sender].sub(totalAmount);
return true;
}
/**
* @dev Function to collect tokens from the list of addresses
*/
function collectTokens(address[] addresses, uint256[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0);
require(addresses.length == amounts.length);
uint256 totalAmount = 0;
bytes memory empty;
for (uint j = 0; j < addresses.length; j++) {
require(amounts[j] > 0);
require(addresses[j] != address(0));
require(!frozenAccount[addresses[j]]);
require(balances[addresses[j]] >= amounts[j]);
balances[addresses[j]] = balances[addresses[j]].sub(amounts[j]);
totalAmount = totalAmount.add(amounts[j]);
emit Transfer(addresses[j], msg.sender, amounts[j], empty);
}
balances[msg.sender] = balances[msg.sender].add(totalAmount);
return true;
}
} | 0x6080604052600436106101195763ffffffff60e060020a60003504166306fdde03811461011e578063095ea7b3146101a857806318160ddd146101e0578063313ce567146102075780633f4ba83a146102325780635c975abb14610249578063661884631461025e57806370a0823114610282578063715018a6146102a35780638456cb59146102b85780638da5cb5b146102cd57806394594625146102fe57806395d89b4114610355578063a9059cbb1461036a578063b414d4b61461038e578063be45fd62146103af578063d73dd62314610418578063dd62ed3e1461043c578063dd92459414610463578063e724529c146104f1578063f0dc417114610517578063f2fde38b146105a5578063f6368f8a146105c6575b600080fd5b34801561012a57600080fd5b5061013361066d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561016d578181015183820152602001610155565b50505050905090810190601f16801561019a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b457600080fd5b506101cc600160a060020a0360043516602435610703565b604080519115158252519081900360200190f35b3480156101ec57600080fd5b506101f5610782565b60408051918252519081900360200190f35b34801561021357600080fd5b5061021c610788565b6040805160ff9092168252519081900360200190f35b34801561023e57600080fd5b50610247610791565b005b34801561025557600080fd5b506101cc61080b565b34801561026a57600080fd5b506101cc600160a060020a036004351660243561081b565b34801561028e57600080fd5b506101f5600160a060020a036004351661092f565b3480156102af57600080fd5b5061024761094a565b3480156102c457600080fd5b506102476109ba565b3480156102d957600080fd5b506102e2610a39565b60408051600160a060020a039092168252519081900360200190f35b34801561030a57600080fd5b50604080516020600480358082013583810280860185019096528085526101cc953695939460249493850192918291850190849080828437509497505093359450610a489350505050565b34801561036157600080fd5b50610133610cf3565b34801561037657600080fd5b506101cc600160a060020a0360043516602435610d54565b34801561039a57600080fd5b506101cc600160a060020a0360043516610dfb565b3480156103bb57600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101cc948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610e109650505050505050565b34801561042457600080fd5b506101cc600160a060020a0360043516602435610ebb565b34801561044857600080fd5b506101f5600160a060020a0360043581169060243516610f73565b34801561046f57600080fd5b50604080516020600480358082013583810280860185019096528085526101cc95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610f9e9650505050505050565b3480156104fd57600080fd5b50610247600160a060020a03600435166024351515611236565b34801561052357600080fd5b50604080516020600480358082013583810280860185019096528085526101cc95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506112b59650505050505050565b3480156105b157600080fd5b50610247600160a060020a0360043516611598565b3480156105d257600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101cc948235600160a060020a031694602480359536959460649492019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506116309650505050505050565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106f95780601f106106ce576101008083540402835291602001916106f9565b820191906000526020600020905b8154815290600101906020018083116106dc57829003601f168201915b5050505050905090565b6000805460a060020a900460ff161561071b57600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294825291829020869055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060015b92915050565b60075490565b60065460ff1690565b60005433600160a060020a039081169116146107ac57600080fd5b60005460a060020a900460ff1615156107c457600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b60005460a060020a900460ff1681565b60008054819060a060020a900460ff161561083557600080fd5b50600160a060020a033381166000908152600260209081526040808320938716835292905220548083111561089157600160a060020a0333811660009081526002602090815260408083209388168352929052908120556108c8565b6108a1818463ffffffff61190916565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3600191505b5092915050565b600160a060020a031660009081526001602052604090205490565b60005433600160a060020a0390811691161461096557600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60005433600160a060020a039081169116146109d557600080fd5b60005460a060020a900460ff16156109ec57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a031681565b600080548190606090829033600160a060020a03908116911614610a6b57600080fd5b60008511610a7857600080fd5b8551600010610a8657600080fd5b600160a060020a03331660009081526003602052604090205460ff1615610aac57600080fd5b8551610abf90869063ffffffff61191b16565b600160a060020a033316600090815260016020526040902054909350831115610ae757600080fd5b5060005b8551811015610ca1578551600090879083908110610b0557fe5b60209081029091010151600160a060020a03161415610b2357600080fd5b600360008783815181101515610b3557fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff1615610b6557600080fd5b610baa85600160008985815181101515610b7b57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff61194416565b600160008884815181101515610bbc57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558551869082908110610bed57fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020611d3b83398151915287856040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610c5e578181015183820152602001610c46565b50505050905090810190601f168015610c8b5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3600101610aeb565b600160a060020a033316600090815260016020526040902054610cca908463ffffffff61190916565b33600160a060020a03166000908152600160208190526040909120919091559695505050505050565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106f95780601f106106ce576101008083540402835291602001916106f9565b6000805460609060a060020a900460ff1615610d6f57600080fd5b600160a060020a0384161515610d8457600080fd5b600160a060020a03841660009081526003602052604090205460ff1615610daa57600080fd5b600160a060020a03331660009081526003602052604090205460ff1615610dd057600080fd5b610dd984611951565b15610df057610de9848483611959565b9150610928565b610de9848483611bb9565b60036020526000908152604090205460ff1681565b6000805460a060020a900460ff1615610e2857600080fd5b600160a060020a0384161515610e3d57600080fd5b600160a060020a03841660009081526003602052604090205460ff1615610e6357600080fd5b600160a060020a03331660009081526003602052604090205460ff1615610e8957600080fd5b610e9284611951565b15610ea957610ea2848484611959565b9050610eb4565b610ea2848484611bb9565b9392505050565b6000805460a060020a900460ff1615610ed357600080fd5b600160a060020a03338116600090815260026020908152604080832093871683529290522054610f09908363ffffffff61194416565b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b6000806000606060008651111515610fb557600080fd5b8451865114610fc357600080fd5b600160a060020a03331660009081526003602052604090205460ff1615610fe957600080fd5b60009250600091505b85518210156110c5576000858381518110151561100b57fe5b602090810290910101511161101f57600080fd5b855160009087908490811061103057fe5b60209081029091010151600160a060020a0316141561104e57600080fd5b60036000878481518110151561106057fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff161561109057600080fd5b6110b885838151811015156110a157fe5b60209081029091010151849063ffffffff61194416565b9250600190910190610ff2565b600160a060020a0333166000908152600160205260409020548311156110ea57600080fd5b600091505b8551821015610ca157611125858381518110151561110957fe5b90602001906020020151600160008986815181101515610b7b57fe5b60016000888581518110151561113757fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055855186908390811061116857fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020611d3b83398151915287858151811015156111a257fe5b90602001906020020151846040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156111f05781810151838201526020016111d8565b50505050905090810190601f16801561121d5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a36001909101906110ef565b60005433600160a060020a0390811691161461125157600080fd5b600160a060020a038216600081815260036020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b600080548190606090829033600160a060020a039081169116146112d857600080fd5b85516000106112e657600080fd5b84518651146112f457600080fd5b5060009150815b855181101561156f576000858281518110151561131457fe5b602090810290910101511161132857600080fd5b855160009087908390811061133957fe5b60209081029091010151600160a060020a0316141561135757600080fd5b60036000878381518110151561136957fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff161561139957600080fd5b84818151811015156113a757fe5b906020019060200201516001600088848151811015156113c357fe5b6020908102909101810151600160a060020a031682528101919091526040016000205410156113f157600080fd5b61144d858281518110151561140257fe5b9060200190602002015160016000898581518110151561141e57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff61190916565b60016000888481518110151561145f57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558451611494908690839081106110a157fe5b925033600160a060020a031686828151811015156114ae57fe5b90602001906020020151600160a060020a0316600080516020611d3b83398151915287848151811015156114de57fe5b90602001906020020151856040518083815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561152c578181015183820152602001611514565b50505050905090810190601f1680156115595780820380516001836020036101000a031916815260200191505b50935050505060405180910390a36001016112fb565b600160a060020a033316600090815260016020526040902054610cca908463ffffffff61194416565b60005433600160a060020a039081169116146115b357600080fd5b600160a060020a03811615156115c857600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000805460a060020a900460ff161561164857600080fd5b600160a060020a038516151561165d57600080fd5b600160a060020a03851660009081526003602052604090205460ff161561168357600080fd5b600160a060020a03331660009081526003602052604090205460ff16156116a957600080fd5b6116b285611951565b156118f357836116c13361092f565b10156116cc57600080fd5b6116e5846116d98761092f565b9063ffffffff61190916565b600160a060020a0386166000908152600160205260409020556117178461170b8761092f565b9063ffffffff61194416565b600160a060020a038616600081815260016020908152604080832094909455925185519293919286928291908401908083835b602083106117695780518252601f19909201916020918201910161174a565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b838110156117fb5781810151838201526020016117e3565b50505050905090810190601f1680156118285780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af19350505050151561184857fe5b84600160a060020a031633600160a060020a0316600080516020611d3b83398151915286866040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156118b0578181015183820152602001611898565b50505050905090810190601f1680156118dd5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3506001611901565b6118fe858585611bb9565b90505b949350505050565b60008282111561191557fe5b50900390565b600082151561192c5750600061077c565b5081810281838281151561193c57fe5b041461077c57fe5b8181018281101561077c57fe5b6000903b1190565b600080600160a060020a038516151561197157600080fd5b600160a060020a03851660009081526003602052604090205460ff161561199757600080fd5b836119a13361092f565b10156119ac57600080fd5b600160a060020a03331660009081526003602052604090205460ff16156119d257600080fd5b6119df846116d93361092f565b600160a060020a033316600090815260016020526040902055611a058461170b8761092f565b600160a060020a0380871660008181526001602090815260408083209590955593517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523393841660048201908152602482018a90526060604483019081528951606484015289518c9850949663c0ee0b8a96958c958c9560840192860191908190849084905b83811015611aa5578181015183820152602001611a8d565b50505050905090810190601f168015611ad25780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015611af357600080fd5b505af1158015611b07573d6000803e3d6000fd5b5050505084600160a060020a031633600160a060020a0316600080516020611d3b83398151915286866040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611b73578181015183820152602001611b5b565b50505050905090810190601f168015611ba05780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3506001949350505050565b6000600160a060020a0384161515611bd057600080fd5b600160a060020a03841660009081526003602052604090205460ff1615611bf657600080fd5b82611c003361092f565b1015611c0b57600080fd5b600160a060020a03331660009081526003602052604090205460ff1615611c3157600080fd5b611c3e836116d93361092f565b600160a060020a033316600090815260016020526040902055611c648361170b8661092f565b6001600086600160a060020a0316600160a060020a031681526020019081526020016000208190555083600160a060020a031633600160a060020a0316600080516020611d3b83398151915285856040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611cf5578181015183820152602001611cdd565b50505050905090810190601f168015611d225780820380516001836020036101000a031916815260200191505b50935050505060405180910390a350600193925050505600e19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16a165627a7a7230582025025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd20029 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 1,815 |
0x25aa6bc7d8b73e8d7a22c2f29c216d1aa1d2aad1 | pragma solidity ^0.4.13;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal 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 returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal 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() {
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 {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value) returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) returns (bool) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint256);
function transferFrom(address from, address to, uint256 value) returns (bool);
function approve(address spender, uint256 value) returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint256 _value) returns (bool) {
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) returns (bool) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifing the amount of tokens still avaible for the spender.
*/
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
contract GeneBTC is StandardToken, Ownable {
using SafeMath for uint256;
// Token Info.
string public constant name = "Gene BTC";
string public constant symbol = "GBC";
uint8 public constant decimals = 18;
// Sale period.
uint256 public startDate;
uint256 public endDate;
// Token Cap for each rounds
uint256 public saleCap;
// Address where funds are collected.
address public wallet;
// Amount of raised money in wei.
uint256 public weiRaised;
// GeneBlockChain user ID
mapping(address => bytes32) public GeneBlockChainUserIDs;
// Event
event TokenPurchase(address indexed purchaser, uint256 value,
uint256 amount);
event PreICOTokenPushed(address indexed buyer, uint256 amount);
event UserIDChanged(address owner, bytes32 user_id);
// Modifiers
modifier uninitialized() {
require(wallet == 0x0);
_;
}
function GeneBTC() {
}
function initialize(address _wallet, uint256 _start, uint256 _end,
uint256 _saleCap, uint256 _totalSupply)
onlyOwner uninitialized {
require(_start >= getCurrentTimestamp());
require(_start < _end);
require(_wallet != 0x0);
require(_totalSupply > _saleCap);
startDate = _start;
endDate = _end;
saleCap = _saleCap;
wallet = _wallet;
totalSupply = _totalSupply;
balances[wallet] = _totalSupply.sub(saleCap);
balances[0xb1] = saleCap;
}
function supply() internal returns (uint256) {
return balances[0xb1];
}
function getCurrentTimestamp() internal returns (uint256) {
return now;
}
function getRateAt(uint256 at) constant returns (uint256) {
if (at < startDate) {
return 0;
} else if (at < (startDate + 7 days)) {
return 840;
} else if (at < (startDate + 37 days)) {
return 770;
} else if (at <= endDate) {
return 700;
} else {
return 0;
}
}
// Fallback function can be used to buy tokens
function () payable {
buyTokens(msg.sender, msg.value);
}
// For pushing pre-ICO records
function push(address buyer, uint256 amount) onlyOwner {
require(balances[wallet] >= amount);
// Transfer
balances[wallet] = balances[wallet].sub(amount);
balances[buyer] = balances[buyer].add(amount);
PreICOTokenPushed(buyer, amount);
}
function buyTokens(address sender, uint256 value) internal {
require(saleActive());
require(value >= 0.1 ether);
uint256 weiAmount = value;
uint256 updatedWeiRaised = weiRaised.add(weiAmount);
// Calculate token amount to be purchased
uint256 actualRate = getRateAt(getCurrentTimestamp());
uint256 amount = weiAmount.mul(actualRate);
// We have enough token to sale
require(supply() >= amount);
// Transfer
balances[0xb1] = balances[0xb1].sub(amount);
balances[sender] = balances[sender].add(amount);
TokenPurchase(sender, weiAmount, amount);
// Update state.
weiRaised = updatedWeiRaised;
// Forward the fund to fund collection wallet.
wallet.transfer(msg.value);
}
function finalize() onlyOwner {
require(!saleActive());
// Transfer the rest of token to GeneBlockChain
balances[wallet] = balances[wallet].add(balances[0xb1]);
balances[0xb1] = 0;
}
function saleActive() public constant returns (bool) {
return (getCurrentTimestamp() >= startDate &&
getCurrentTimestamp() < endDate && supply() > 0);
}
function setUserID(bytes32 user_id) {
GeneBlockChainUserIDs[msg.sender] = user_id;
UserIDChanged(msg.sender, user_id);
}
} | 0x606060405236156101305763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610143578063078fd9ea146101ce578063095ea7b3146101f35780630b97bc861461022957806318160ddd1461024e57806323b872dd14610273578063313ce567146102af5780634042b66f146102d85780634bb278f3146102fd578063521eb2731461031257806368428a1b1461034157806370a08231146103685780638499bc63146103995780638da5cb5b146103ca57806395d89b41146103f9578063a9059cbb14610484578063b52e0dc8146104ba578063b753a98c146104e2578063c24a0f8b14610506578063c3262dfd1461052b578063dd62ed3e14610543578063f2fde38b1461057a578063f92ad2191461059b575b6101415b61013e33346105c8565b5b565b005b341561014e57600080fd5b610156610745565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101935780820151818401525b60200161017a565b50505050905090810190601f1680156101c05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d957600080fd5b6101e161077c565b60405190815260200160405180910390f35b34156101fe57600080fd5b610215600160a060020a0360043516602435610782565b604051901515815260200160405180910390f35b341561023457600080fd5b6101e1610829565b60405190815260200160405180910390f35b341561025957600080fd5b6101e161082f565b60405190815260200160405180910390f35b341561027e57600080fd5b610215600160a060020a0360043581169060243516604435610835565b604051901515815260200160405180910390f35b34156102ba57600080fd5b6102c261094a565b60405160ff909116815260200160405180910390f35b34156102e357600080fd5b6101e161094f565b60405190815260200160405180910390f35b341561030857600080fd5b610141610955565b005b341561031d57600080fd5b6103256109f2565b604051600160a060020a03909116815260200160405180910390f35b341561034c57600080fd5b610215610a01565b604051901515815260200160405180910390f35b341561037357600080fd5b6101e1600160a060020a0360043516610a3d565b60405190815260200160405180910390f35b34156103a457600080fd5b6101e1600160a060020a0360043516610a5c565b60405190815260200160405180910390f35b34156103d557600080fd5b610325610a6e565b604051600160a060020a03909116815260200160405180910390f35b341561040457600080fd5b610156610a7d565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101935780820151818401525b60200161017a565b50505050905090810190601f1680156101c05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561048f57600080fd5b610215600160a060020a0360043516602435610ab4565b604051901515815260200160405180910390f35b34156104c557600080fd5b6101e1600435610b74565b60405190815260200160405180910390f35b34156104ed57600080fd5b610141600160a060020a0360043516602435610bdb565b005b341561051157600080fd5b6101e1610cd9565b60405190815260200160405180910390f35b341561053657600080fd5b610141600435610cdf565b005b341561054e57600080fd5b6101e1600160a060020a0360043581169060243516610d45565b60405190815260200160405180910390f35b341561058557600080fd5b610141600160a060020a0360043516610d72565b005b34156105a657600080fd5b610141600160a060020a0360043516602435604435606435608435610dca565b005b6000806000806105d6610a01565b15156105e157600080fd5b67016345785d8a00008510156105f657600080fd5b60085485945061060c908563ffffffff610ec216565b925061061e610619610edc565b610b74565b9150610630848363ffffffff610ee116565b90508061063b610f10565b101561064657600080fd5b60b16000526001602052600080516020610f4683398151915254610670908263ffffffff610f2e16565b6001602052600080516020610f4683398151915255600160a060020a038616600090815260409020546106a9908263ffffffff610ec216565b600160a060020a0387166000818152600160205260409081902092909255907fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f90869084905191825260208201526040908101905180910390a26008839055600754600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561073c57600080fd5b5b505050505050565b60408051908101604052600881527f47656e6520425443000000000000000000000000000000000000000000000000602082015281565b60065481565b60008115806107b45750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b15156107bf57600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60045481565b60005481565b600160a060020a03808416600090815260026020908152604080832033851684528252808320549386168352600190915281205490919061087c908463ffffffff610ec216565b600160a060020a0380861660009081526001602052604080822093909355908716815220546108b1908463ffffffff610f2e16565b600160a060020a0386166000908152600160205260409020556108da818463ffffffff610f2e16565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b509392505050565b601281565b60085481565b60035433600160a060020a0390811691161461097057600080fd5b610978610a01565b1561098257600080fd5b6001602052600080516020610f4683398151915254600754600160a060020a0316600090815260409020546109bc9163ffffffff610ec216565b600754600160a060020a031660009081526001602052604081209190915560b18152600080516020610f46833981519152555b5b565b600754600160a060020a031681565b6000600454610a0e610edc565b10158015610a245750600554610a22610edc565b105b8015610a3757506000610a35610f10565b115b90505b90565b600160a060020a0381166000908152600160205260409020545b919050565b60096020526000908152604090205481565b600354600160a060020a031681565b60408051908101604052600381527f4742430000000000000000000000000000000000000000000000000000000000602082015281565b600160a060020a033316600090815260016020526040812054610add908363ffffffff610f2e16565b600160a060020a033381166000908152600160205260408082209390935590851681522054610b12908363ffffffff610ec216565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060015b92915050565b6000600454821015610b8857506000610a57565b60045462093a8001821015610ba05750610348610a57565b6004546230c78001821015610bb85750610302610a57565b6005548211610bca57506102bc610a57565b506000610a57565b5b5b5b5b919050565b60035433600160a060020a03908116911614610bf657600080fd5b600754600160a060020a031660009081526001602052604090205481901015610c1e57600080fd5b600754600160a060020a0316600090815260016020526040902054610c49908263ffffffff610f2e16565b600754600160a060020a039081166000908152600160205260408082209390935590841681522054610c81908263ffffffff610ec216565b600160a060020a0383166000818152600160205260409081902092909255907fdb2d10a559cb6e14fee5a7a2d8c216314e11c22404e85a4f9af45f07c87192bb9083905190815260200160405180910390a25b5b5050565b60055481565b33600160a060020a038116600090815260096020526040908190208390557fa1a3e4c7b21b6004c77b4fe18bdd0d1bd1be31dbb88112463524daa9abacb8369190839051600160a060020a03909216825260208201526040908101905180910390a15b50565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60035433600160a060020a03908116911614610d8d57600080fd5b600160a060020a03811615610d42576003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b60035433600160a060020a03908116911614610de557600080fd5b600754600160a060020a031615610dfb57600080fd5b610e03610edc565b841015610e0f57600080fd5b828410610e1b57600080fd5b600160a060020a0385161515610e3057600080fd5b818111610e3c57600080fd5b6004849055600583905560068290556007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0387161790556000819055610e828183610f2e565b600754600160a060020a031660009081526001602052604081209190915560065460b1909152600080516020610f46833981519152555b5b5b5050505050565b600082820183811015610ed157fe5b8091505b5092915050565b425b90565b6000828202831580610efd5750828482811515610efa57fe5b04145b1515610ed157fe5b8091505b5092915050565b60b16000526001602052600080516020610f46833981519152545b90565b600082821115610f3a57fe5b508082035b9291505056007ff6d99ecf17df3f1097d877fba82682b40f191db7daded98d658129a21865e6a165627a7a72305820806d76ca2d341cbb0d62adbeef03290e1499535d0d754fcaa9c667c970ca205f0029 | {"success": true, "error": null, "results": {}} | 1,816 |
0x002023a26f956a1b770051ab5d8163cdca2fe22d | /**
*Submitted for verification at Etherscan.io on 2021-12-06
*/
/*
🚨 STEALTH LAUNCHING 🔜🚨
@Mewinuofficial is stealth launching soon!
Mew Inu is a decentralized ERC-20 meme coin that will take over!
🗓#StealthLaunch🗓 Join TG for date~
💬Decentralized meme coin
🖼NFTs
🔒Liquidity Locked
🔥Marketing wallet will be used for CEX listings / influencers
✅Total Supply: 70,000,000,000
✅Token Name: Mew Inu
✅Network: ETH (ERC-20)
✅Ticker: $MEW
✅6% tax: 1% Reflection 5% Marketing
Taxes:
1% Redistribution of $MEW
5% Marketing
Telegram: https://t.me/MewInuOfficial
Twitter: https://twitter.com/mewinuofficial
Web: mewinutoken.com
*/
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 MewInu 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 = 70* 10**9* 10**18;
string private _name = 'Mew Inu ' ;
string private _symbol = 'MEW';
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);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122097cb31aad2071730f899353a6c5ede6fd7754682d9779673ab8906c58ab062db64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,817 |
0x4134d0452c9ab873dbdc435c1a4231cead17fd21 | /**
*Submitted for verification at Etherscan.io on 2020-12-04
*/
pragma solidity ^0.7.0;
//SPDX-License-Identifier: UNLICENSED
interface IERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address who) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function transfer(address to, uint value) external returns (bool);
function approve(address spender, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
interface IUNIv2 {
function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline)
external
payable
returns (uint amountToken, uint amountETH, uint liquidity);
function WETH() external pure returns (address);
}
interface IUnicrypt {
event onDeposit(address, uint256, uint256);
event onWithdraw(address, uint256);
function depositToken(address token, uint256 amount, uint256 unlock_date) external payable;
function withdrawToken(address token, uint256 amount) external;
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
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 ATH is IERC20, Context {
using SafeMath for uint;
IUNIv2 uniswap = IUNIv2(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
IUniswapV2Factory uniswapFactory = IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f);
IUnicrypt unicrypt = IUnicrypt(0x17e00383A843A9922bCA3B280C0ADE9f8BA48449);
string public _symbol;
string public _name;
uint8 public _decimals;
uint _totalSupply;
address payable owner;
address public pool;
uint256 public liquidityUnlock;
bool transferPaused;
uint256 public lockedLiquidityAmount;
bool public burning;
// Timeframes
uint256 public firstFee;
uint256 public secondFee;
uint256 maxBuyAmount = 50 ether;
uint256 antiBotsTime;
mapping(address => uint) _balances;
mapping(address => mapping(address => uint)) _allowances;
modifier onlyOwner() {
require(msg.sender == owner, "You are not the owner");
_;
}
constructor() {
owner = msg.sender;
_symbol = "ATH";
_name = "AllTimeHype";
_decimals = 18;
_totalSupply = 1000 ether;
_balances[owner] = _totalSupply;
transferPaused = true;
liquidityUnlock = block.timestamp.add(30 days);
emit Transfer(address(0),owner, _totalSupply);
setUniswapPool();
}
receive() external payable {
}
function withdrawETHInCaseOfNotLaunching() external onlyOwner {
owner.transfer(address(this).balance);
}
function calculateFee(uint256 amount) public view returns (uint256) {
if (block.timestamp < firstFee)
return amount.mul(30).div(100);
if (block.timestamp < secondFee && block.timestamp >= firstFee)
return amount.mul(20).div(100);
return amount.mul(10).div(100);
}
function lockWithUnicrypt() external onlyOwner {
IERC20 liquidityTokens = IERC20(pool);
uint256 liquidityBalance = liquidityTokens.balanceOf(address(this));
uint256 timeToLuck = liquidityUnlock;
liquidityTokens.approve(address(unicrypt), liquidityBalance);
unicrypt.depositToken{value: 0} (pool, liquidityBalance, timeToLuck);
lockedLiquidityAmount = lockedLiquidityAmount.add(liquidityBalance);
}
function withdrawFromUnicrypt(uint256 amount) external onlyOwner{
unicrypt.withdrawToken(pool, amount);
}
function setUniswapPool() public {
require(pool == address(0), "the pool already created");
pool = uniswapFactory.createPair(address(this), uniswap.WETH());
}
function moonMissionStart() external onlyOwner {
uint256 ETH = address(this).balance;
transferPaused = false;
this.approve(address(uniswap), balanceOf(address(this)));
uniswap.addLiquidityETH
{ value: ETH }
(
address(this),
balanceOf(address(this)),
balanceOf(address(this)),
ETH,
address(this),
block.timestamp + 5 minutes
);
firstFee = block.timestamp.add(20 minutes);
secondFee = block.timestamp.add(40 minutes);
antiBotsTime = block.timestamp.add(2 minutes);
burning = true;
}
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");
require(!transferPaused || msg.sender == owner, "Transfer is paused");
if (amount > maxBuyAmount && sender == pool && block.timestamp < antiBotsTime){
revert();
}
if (recipient == pool && burning){
uint256 ToBurn = calculateFee(amount);
uint256 ToTransfer = amount.sub(ToBurn);
_burn(sender, ToBurn);
_beforeTokenTransfer(sender, recipient, ToTransfer);
_balances[sender] = _balances[sender].sub(ToTransfer, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(ToTransfer);
emit Transfer(sender, recipient, ToTransfer);
}
else {
_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);
}
}
// in case something happens and the address is wrong
function setPool(address _pool) public onlyOwner{
pool = _pool;
}
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 burnMyTokens(uint256 amount) external {
require(amount > 0);
address account = msg.sender;
_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);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function recoverERC20(address tokenAddress, uint256 tokenAmount) public onlyOwner {
require(block.timestamp >= liquidityUnlock);
IERC20(tokenAddress).transfer(owner, tokenAmount);
}
}
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;
}
} | 0x6080604052600436106101c65760003560e01c80634c12b33f116100f757806399a5d74711610095578063b09f126611610064578063b09f126614610903578063d28d885214610993578063dd62ed3e14610a23578063e84657d414610aa8576101cd565b806399a5d747146107bb578063a457c2d71461080a578063a566d54a1461087b578063a9059cbb14610892576101cd565b8063724b6f43116100d1578063724b6f431461067e5780638980f11f1461069557806395d89b41146106f05780639876fdfa14610780576101cd565b80634c12b33f146105b15780636764765d146105de57806370a0823114610619576101cd565b80632150c0ea1161016457806332424aa31161013e57806332424aa31461049657806339509351146104c45780634437152a146105355780634b9d11eb14610586576101cd565b80632150c0ea146103c057806323b872dd146103d7578063313ce56714610468576101cd565b8063095ea7b3116101a0578063095ea7b3146102b857806311e453f91461032957806316f0115b1461035457806318160ddd14610395576101cd565b8063052c30bc146101d257806306fdde03146101fd5780630768bd671461028d576101cd565b366101cd57005b600080fd5b3480156101de57600080fd5b506101e7610abf565b6040518082815260200191505060405180910390f35b34801561020957600080fd5b50610212610ac5565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610252578082015181840152602081019050610237565b50505050905090810190601f16801561027f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561029957600080fd5b506102a2610b67565b6040518082815260200191505060405180910390f35b3480156102c457600080fd5b50610311600480360360408110156102db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b6d565b60405180821515815260200191505060405180910390f35b34801561033557600080fd5b5061033e610b8b565b6040518082815260200191505060405180910390f35b34801561036057600080fd5b50610369610b91565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103a157600080fd5b506103aa610bb7565b6040518082815260200191505060405180910390f35b3480156103cc57600080fd5b506103d5610bc1565b005b3480156103e357600080fd5b50610450600480360360608110156103fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cef565b60405180821515815260200191505060405180910390f35b34801561047457600080fd5b5061047d610dc8565b604051808260ff16815260200191505060405180910390f35b3480156104a257600080fd5b506104ab610ddf565b604051808260ff16815260200191505060405180910390f35b3480156104d057600080fd5b5061051d600480360360408110156104e757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610df2565b60405180821515815260200191505060405180910390f35b34801561054157600080fd5b506105846004803603602081101561055857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ea5565b005b34801561059257600080fd5b5061059b610fac565b6040518082815260200191505060405180910390f35b3480156105bd57600080fd5b506105c6610fb2565b60405180821515815260200191505060405180910390f35b3480156105ea57600080fd5b506106176004803603602081101561060157600080fd5b8101908080359060200190929190505050610fc5565b005b34801561062557600080fd5b506106686004803603602081101561063c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611117565b6040518082815260200191505060405180910390f35b34801561068a57600080fd5b50610693611160565b005b3480156106a157600080fd5b506106ee600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114bd565b005b3480156106fc57600080fd5b50610705611662565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561074557808201518184015260208101905061072a565b50505050905090810190601f1680156107725780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561078c57600080fd5b506107b9600480360360208110156107a357600080fd5b8101908080359060200190929190505050611704565b005b3480156107c757600080fd5b506107f4600480360360208110156107de57600080fd5b8101908080359060200190929190505050611897565b6040518082815260200191505060405180910390f35b34801561081657600080fd5b506108636004803603604081101561082d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611946565b60405180821515815260200191505060405180910390f35b34801561088757600080fd5b50610890611a13565b005b34801561089e57600080fd5b506108eb600480360360408110156108b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611d67565b60405180821515815260200191505060405180910390f35b34801561090f57600080fd5b50610918611d85565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561095857808201518184015260208101905061093d565b50505050905090810190601f1680156109855780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561099f57600080fd5b506109a8611e23565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109e85780820151818401526020810190506109cd565b50505050905090810190601f168015610a155780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610a2f57600080fd5b50610a9260048036036040811015610a4657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ec1565b6040518082815260200191505060405180910390f35b348015610ab457600080fd5b50610abd611f48565b005b600b5481565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b5d5780601f10610b3257610100808354040283529160200191610b5d565b820191906000526020600020905b815481529060010190602001808311610b4057829003601f168201915b5050505050905090565b600d5481565b6000610b81610b7a61225a565b8484612262565b6001905092915050565b60095481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600654905090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f596f7520617265206e6f7420746865206f776e6572000000000000000000000081525060200191505060405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610cec573d6000803e3d6000fd5b50565b6000610cfc848484612459565b610dbd84610d0861225a565b610db885604051806060016040528060288152602001612fe060289139601260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610d6e61225a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ac69092919063ffffffff16565b612262565b600190509392505050565b6000600560009054906101000a900460ff16905090565b600560009054906101000a900460ff1681565b6000610e9b610dff61225a565b84610e968560126000610e1061225a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121d290919063ffffffff16565b612262565b6001905092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f68576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f596f7520617265206e6f7420746865206f776e6572000000000000000000000081525060200191505060405180910390fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600e5481565b600c60009054906101000a900460ff1681565b60008111610fd257600080fd5b6000339050610fe381600084612b86565b61104f82604051806060016040528060228152602001612f5560229139601160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ac69092919063ffffffff16565b601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110a782600654612b8b90919063ffffffff16565b600681905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611223576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f596f7520617265206e6f7420746865206f776e6572000000000000000000000081525060200191505060405180910390fd5b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156112b357600080fd5b505afa1580156112c7573d6000803e3d6000fd5b505050506040513d60208110156112dd57600080fd5b81019080805190602001909291905050509050600060095490508273ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561138a57600080fd5b505af115801561139e573d6000803e3d6000fd5b505050506040513d60208110156113b457600080fd5b810190808051906020019092919050505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166399c6d2de6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685856040518563ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200193505050506000604051808303818588803b15801561148457600080fd5b505af1158015611498573d6000803e3d6000fd5b50505050506114b282600b546121d290919063ffffffff16565b600b81905550505050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611580576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f596f7520617265206e6f7420746865206f776e6572000000000000000000000081525060200191505060405180910390fd5b60095442101561158f57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561162257600080fd5b505af1158015611636573d6000803e3d6000fd5b505050506040513d602081101561164c57600080fd5b8101908080519060200190929190505050505050565b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116fa5780601f106116cf576101008083540402835291602001916116fa565b820191906000526020600020905b8154815290600101906020018083116116dd57829003601f168201915b5050505050905090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146117c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f596f7520617265206e6f7420746865206f776e6572000000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639e281a98600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561187c57600080fd5b505af1158015611890573d6000803e3d6000fd5b5050505050565b6000600d544210156118d1576118ca60646118bc601e85612bd590919063ffffffff16565b612c5b90919063ffffffff16565b9050611941565b600e54421080156118e45750600d544210155b15611917576119106064611902601485612bd590919063ffffffff16565b612c5b90919063ffffffff16565b9050611941565b61193e6064611930600a85612bd590919063ffffffff16565b612c5b90919063ffffffff16565b90505b919050565b6000611a0961195361225a565b84611a0485604051806060016040528060258152602001613072602591396012600061197d61225a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ac69092919063ffffffff16565b612262565b6001905092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611ad6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f596f7520617265206e6f7420746865206f776e6572000000000000000000000081525060200191505060405180910390fd5b60004790506000600a60006101000a81548160ff0219169083151502179055503073ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611b3c30611117565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611b8f57600080fd5b505af1158015611ba3573d6000803e3d6000fd5b505050506040513d6020811015611bb957600080fd5b81019080805190602001909291905050505060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7198230611c1230611117565b611c1b30611117565b863061012c42016040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b158015611ca657600080fd5b505af1158015611cba573d6000803e3d6000fd5b50505050506040513d6060811015611cd157600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050505050611d0e6104b0426121d290919063ffffffff16565b600d81905550611d29610960426121d290919063ffffffff16565b600e81905550611d436078426121d290919063ffffffff16565b6010819055506001600c60006101000a81548160ff02191690831515021790555050565b6000611d7b611d7461225a565b8484612459565b6001905092915050565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611e1b5780601f10611df057610100808354040283529160200191611e1b565b820191906000526020600020905b815481529060010190602001808311611dfe57829003601f168201915b505050505081565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611eb95780601f10611e8e57610100808354040283529160200191611eb9565b820191906000526020600020905b815481529060010190602001808311611e9c57829003601f168201915b505050505081565b6000601260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600073ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461200c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f74686520706f6f6c20616c72656164792063726561746564000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c9c653963060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156120b157600080fd5b505afa1580156120c5573d6000803e3d6000fd5b505050506040513d60208110156120db57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561215557600080fd5b505af1158015612169573d6000803e3d6000fd5b505050506040513d602081101561217f57600080fd5b8101908080519060200190929190505050600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600080828401905083811015612250576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156122e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061304e6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561236e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612f776022913960400191505060405180910390fd5b80601260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156124df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806130296025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612565576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612f326023913960400191505060405180910390fd5b600a60009054906101000a900460ff1615806125ce5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612640576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f5472616e7366657220697320706175736564000000000000000000000000000081525060200191505060405180910390fd5b600f548111801561269e5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80156126ab575060105442105b156126b557600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561271e5750600c60009054906101000a900460ff165b1561290c57600061272e82611897565b905060006127458284612b8b90919063ffffffff16565b90506127518583612ca5565b61275c858583612b86565b6127c881604051806060016040528060268152602001612f9960269139601160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ac69092919063ffffffff16565b601160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061285d81601160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121d290919063ffffffff16565b601160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050612ac1565b612917838383612b86565b61298381604051806060016040528060268152602001612f9960269139601160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ac69092919063ffffffff16565b601160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a1881601160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121d290919063ffffffff16565b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b505050565b6000838311158290612b73576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b38578082015181840152602081019050612b1d565b50505050905090810190601f168015612b655780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b505050565b6000612bcd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612ac6565b905092915050565b600080831415612be85760009050612c55565b6000828402905082848281612bf957fe5b0414612c50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612fbf6021913960400191505060405180910390fd5b809150505b92915050565b6000612c9d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612e6b565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612d2b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806130086021913960400191505060405180910390fd5b612d3782600083612b86565b612da381604051806060016040528060228152602001612f5560229139601160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ac69092919063ffffffff16565b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dfb81600654612b8b90919063ffffffff16565b600681905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008083118290612f17576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612edc578082015181840152602081019050612ec1565b50505050905090810190601f168015612f095780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612f2357fe5b04905080915050939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220a1400dbcdf3b630872c1063f06edfcf048d87b82090110abdf33f1fba19e0d5664736f6c63430007040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,818 |
0xbd2ebe1ddf549e6e9079faa6182bcc33c21f13a3 | pragma solidity 0.5.11;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic, Ownable {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balanceOf(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)) 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(allowed[_from][msg.sender] >= _value);
require(balanceOf(_from) >= _value);
require(balances[_to].add(_value) > balances[_to]); // Check for overflows
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.
* @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) {
// 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;
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 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 Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is StandardToken {
event Pause();
event Unpause();
bool public paused = false;
address public founder;
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
require(!paused || msg.sender == founder);
_;
}
/**
* @dev modifier to allow actions only when the contract IS NOT paused
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
}
contract PausableToken is 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);
}
//The functions below surve no real purpose. Even if one were to approve another to spend
//tokens on their behalf, those tokens will still only be transferable when the token contract
//is not paused.
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract SLC is PausableToken {
string public name;
string public symbol;
uint8 public decimals;
/**
* @dev Constructor that gives the founder all of the existing tokens.
*/
constructor() public {
name = "Support Listing Coin";
symbol = "SLC";
decimals = 18;
totalSupply = 1000000000*1000000000000000000;
founder = msg.sender;
balances[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
/** @dev Fires on every freeze of tokens
* @param _owner address The owner address of frozen tokens.
* @param amount uint256 The amount of tokens frozen
*/
event TokenFreezeEvent(address indexed _owner, uint256 amount);
/** @dev Fires on every unfreeze of tokens
* @param _owner address The owner address of unfrozen tokens.
* @param amount uint256 The amount of tokens unfrozen
*/
event TokenUnfreezeEvent(address indexed _owner, uint256 amount);
event TokensBurned(address indexed _owner, uint256 _tokens);
mapping(address => uint256) internal frozenTokenBalances;
function freezeTokens(address _owner, uint256 _value) public onlyOwner {
require(_value <= balanceOf(_owner));
uint256 oldFrozenBalance = getFrozenBalance(_owner);
uint256 newFrozenBalance = oldFrozenBalance.add(_value);
setFrozenBalance(_owner,newFrozenBalance);
emit TokenFreezeEvent(_owner,_value);
}
function unfreezeTokens(address _owner, uint256 _value) public onlyOwner {
require(_value <= getFrozenBalance(_owner));
uint256 oldFrozenBalance = getFrozenBalance(_owner);
uint256 newFrozenBalance = oldFrozenBalance.sub(_value);
setFrozenBalance(_owner,newFrozenBalance);
emit TokenUnfreezeEvent(_owner,_value);
}
function setFrozenBalance(address _owner, uint256 _newValue) internal {
frozenTokenBalances[_owner]=_newValue;
}
function balanceOf(address _owner) view public returns(uint256) {
return getTotalBalance(_owner).sub(getFrozenBalance(_owner));
}
function getTotalBalance(address _owner) view public returns(uint256) {
return balances[_owner];
}
/**
* @dev Gets the amount of tokens which belong to the specified address BUT are frozen now.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount of frozen tokens owned by the passed address.
*/
function getFrozenBalance(address _owner) view public returns(uint256) {
return frozenTokenBalances[_owner];
}
/*
* @dev Token burn function
* @param _tokens uint256 amount of tokens to burn
*/
function burnTokens(uint256 _tokens) public onlyOwner {
require(balanceOf(msg.sender) >= _tokens);
balances[msg.sender] = balances[msg.sender].sub(_tokens);
totalSupply = totalSupply.sub(_tokens);
emit TokensBurned(msg.sender, _tokens);
}
function destroy(address payable _benefitiary) external onlyOwner{
selfdestruct(_benefitiary);
}
} | 0x608060405234801561001057600080fd5b506004361061014c5760003560e01c806370a08231116100c3578063a9059cbb1161007c578063a9059cbb14610625578063d3d381931461068b578063d73dd623146106e3578063dd62ed3e14610749578063e9b2f0ad146107c1578063f2fde38b1461080f5761014c565b806370a08231146104505780638456cb59146104a85780638da5cb5b146104b257806395d89b41146104fc5780639f2cfaf11461057f578063a4df6c6a146105d75761014c565b8063313ce56711610115578063313ce567146103225780633f4ba83a146103465780634d853ee5146103505780635c975abb1461039a57806366188463146103bc5780636d1b229d146104225761014c565b8062f55d9d1461015157806306fdde0314610195578063095ea7b31461021857806318160ddd1461027e57806323b872dd1461029c575b600080fd5b6101936004803603602081101561016757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610853565b005b61019d6108c6565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101dd5780820151818401526020810190506101c2565b50505050905090810190601f16801561020a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102646004803603604081101561022e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610964565b604051808215151515815260200191505060405180910390f35b6102866109ea565b6040518082815260200191505060405180910390f35b610308600480360360608110156102b257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109f0565b604051808215151515815260200191505060405180910390f35b61032a610a78565b604051808260ff1660ff16815260200191505060405180910390f35b61034e610a8b565b005b610358610b47565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103a2610b6d565b604051808215151515815260200191505060405180910390f35b610408600480360360408110156103d257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b80565b604051808215151515815260200191505060405180910390f35b61044e6004803603602081101561043857600080fd5b8101908080359060200190929190505050610c06565b005b6104926004803603602081101561046657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d76565b6040518082815260200191505060405180910390f35b6104b0610da2565b005b6104ba610eb7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610504610edd565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610544578082015181840152602081019050610529565b50505050905090810190601f1680156105715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105c16004803603602081101561059557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7b565b6040518082815260200191505060405180910390f35b610623600480360360408110156105ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fc4565b005b6106716004803603604081101561063b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110b5565b604051808215151515815260200191505060405180910390f35b6106cd600480360360208110156106a157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061113b565b6040518082815260200191505060405180910390f35b61072f600480360360408110156106f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611184565b604051808215151515815260200191505060405180910390f35b6107ab6004803603604081101561075f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061120a565b6040518082815260200191505060405180910390f35b61080d600480360360408110156107d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611291565b005b6108516004803603602081101561082557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611382565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ad57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16ff5b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561095c5780601f106109315761010080835404028352916020019161095c565b820191906000526020600020905b81548152906001019060200180831161093f57829003601f168201915b505050505081565b6000600460009054906101000a900460ff1615806109cf5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6109d857600080fd5b6109e283836114d6565b905092915050565b60005481565b6000600460009054906101000a900460ff161580610a5b5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a6457600080fd5b610a6f84848461165b565b90509392505050565b600760009054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ae557600080fd5b600460009054906101000a900460ff16610afe57600080fd5b6000600460006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900460ff1681565b6000600460009054906101000a900460ff161580610beb5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610bf457600080fd5b610bfe8383611a79565b905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c6057600080fd5b80610c6a33610d76565b1015610c7557600080fd5b610cc781600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d1f81600054611d0a90919063ffffffff16565b6000819055503373ffffffffffffffffffffffffffffffffffffffff167ffd38818f5291bf0bb3a2a48aadc06ba8757865d1dabd804585338aab3009dcb6826040518082815260200191505060405180910390a250565b6000610d9b610d8483610f7b565b610d8d8461113b565b611d0a90919063ffffffff16565b9050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610dfc57600080fd5b600460009054906101000a900460ff161580610e655750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e6e57600080fd5b6001600460006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f735780601f10610f4857610100808354040283529160200191610f73565b820191906000526020600020905b815481529060010190602001808311610f5657829003601f168201915b505050505081565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461101e57600080fd5b61102782610d76565b81111561103357600080fd5b600061103e83610f7b565b905060006110558383611d2190919063ffffffff16565b90506110618482611d3d565b8373ffffffffffffffffffffffffffffffffffffffff167f2303912415a23c08c0cbb3a0b2b2813870ad5a2fd7b18c6d9da7d0086d9c188e846040518082815260200191505060405180910390a250505050565b6000600460009054906101000a900460ff1615806111205750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61112957600080fd5b6111338383611d85565b905092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600460009054906101000a900460ff1615806111ef5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6111f857600080fd5b6112028383611f6e565b905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112eb57600080fd5b6112f482610f7b565b81111561130057600080fd5b600061130b83610f7b565b905060006113228383611d0a90919063ffffffff16565b905061132e8482611d3d565b8373ffffffffffffffffffffffffffffffffffffffff167f25f6369ffb8611a066eafc897e56f4f4d2b8fc713cca586bd93e9b1af04a6cc0846040518082815260200191505060405180910390a250505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113dc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561141657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008082148061156257506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b61156b57600080fd5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561169657600080fd5b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561171f57600080fd5b8161172985610d76565b101561173457600080fd5b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117c683600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b116117d057600080fd5b61182282600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118b782600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061198982600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611b8a576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c1e565b611b9d8382611d0a90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600082821115611d1657fe5b818303905092915050565b600080828401905083811015611d3357fe5b8091505092915050565b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611dc057600080fd5b611dc933610d76565b821115611dd557600080fd5b611e2782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ebc82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611fff82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509291505056fea265627a7a72315820a761d6ba97095a2411cdc3c882f8d48acdbfc941911e61422d32cf1e8e4ca3fd64736f6c634300050b0032 | {"success": true, "error": null, "results": {}} | 1,819 |
0x5390fcf11b5894b60ca8535f33064c9503f9b691 | /**
*Submitted for verification at Etherscan.io on 2021-07-09
*/
/**
*Submitted for verification at Etherscan.io on 2021-07-01
*/
/*
MOOND Moon Doge Token
*/
// 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 MOOND is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Moon Doge Token";
string private constant _symbol = "MOOND";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 7;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (10 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 20000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612edf565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a02565b61045e565b6040516101789190612ec4565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613081565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b3565b61048d565b6040516101e09190612ec4565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612925565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f6565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7f565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612925565b610783565b6040516102b19190613081565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df6565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612edf565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a02565b61098d565b60405161035b9190612ec4565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3e565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad1565b6110d2565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612977565b61121b565b6040516104189190613081565b60405180910390f35b60606040518060400160405280600f81526020017f4d6f6f6e20446f676520546f6b656e0000000000000000000000000000000000815250905090565b600061047261046b6112a2565b84846112aa565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611475565b61055b846104a66112a2565b610556856040518060600160405280602881526020016137ba60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c349092919063ffffffff16565b6112aa565b600190509392505050565b61056e6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc1565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc1565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a2565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c98565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d93565b9050919050565b6107dc6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4d4f4f4e44000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a2565b8484611475565b6001905092915050565b6109b36112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc1565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613397565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e01565b50565b610b7d6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc1565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613041565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112aa565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294e565b6040518363ffffffff1660e01b8152600401610e1f929190612e11565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294e565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e63565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612afa565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506801158e460913d000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107c929190612e3a565b602060405180830381600087803b15801561109657600080fd5b505af11580156110aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ce9190612aa8565b5050565b6110da6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115e90612fc1565b60405180910390fd5b600081116111aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a190612f81565b60405180910390fd5b6111d960646111cb83683635c9adc5dea000006120fb90919063ffffffff16565b61217690919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516112109190613081565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561131a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131190613021565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561138a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138190612f41565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114689190613081565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dc90613001565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154c90612f01565b60405180910390fd5b60008111611598576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158f90612fe1565b60405180910390fd5b6115a0610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160e57506115de610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7157600f60179054906101000a900460ff1615611841573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561169057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116ea5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117445750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561184057600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178a6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614806118005750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e86112a2565b73ffffffffffffffffffffffffffffffffffffffff16145b61183f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183690613061565b60405180910390fd5b5b5b60105481111561185057600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f45750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fd57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fe5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a165750600f60179054906101000a900460ff165b15611ab75742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6657600080fd5b600a42611a7391906131b7565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac230610783565b9050600f60159054906101000a900460ff16158015611b2f5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b475750600f60169054906101000a900460ff165b15611b6f57611b5581611e01565b60004790506000811115611b6d57611b6c47611c98565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c185750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2257600090505b611c2e848484846121c0565b50505050565b6000838311158290611c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c739190612edf565b60405180910390fd5b5060008385611c8b9190613298565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce860028461217690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d13573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6460028461217690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8f573d6000803e3d6000fd5b5050565b6000600654821115611dda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd190612f21565b60405180910390fd5b6000611de46121ed565b9050611df9818461217690919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8d5781602001602082028036833780820191505090505b5090503081600081518110611ecb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6d57600080fd5b505afa158015611f81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa5919061294e565b81600181518110611fdf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112aa565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120aa95949392919061309c565b600060405180830381600087803b1580156120c457600080fd5b505af11580156120d8573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210e5760009050612170565b6000828461211c919061323e565b905082848261212b919061320d565b1461216b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216290612fa1565b60405180910390fd5b809150505b92915050565b60006121b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612218565b905092915050565b806121ce576121cd61227b565b5b6121d98484846122ac565b806121e7576121e6612477565b5b50505050565b60008060006121fa612489565b91509150612211818361217690919063ffffffff16565b9250505090565b6000808311829061225f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122569190612edf565b60405180910390fd5b506000838561226e919061320d565b9050809150509392505050565b600060085414801561228f57506000600954145b15612299576122aa565b600060088190555060006009819055505b565b6000806000806000806122be876124eb565b95509550955095509550955061231c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fd816125fb565b61240784836126b8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124649190613081565b60405180910390a3505050505050505050565b6007600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124bf683635c9adc5dea0000060065461217690919063ffffffff16565b8210156124de57600654683635c9adc5dea000009350935050506124e7565b81819350935050505b9091565b60008060008060008060008060006125088a6008546009546126f2565b92509250925060006125186121ed565b9050600080600061252b8e878787612788565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c34565b905092915050565b60008082846125ac91906131b7565b9050838110156125f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e890612f61565b60405180910390fd5b8091505092915050565b60006126056121ed565b9050600061261c82846120fb90919063ffffffff16565b905061267081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cd8260065461255390919063ffffffff16565b6006819055506126e88160075461259d90919063ffffffff16565b6007819055505050565b60008060008061271e6064612710888a6120fb90919063ffffffff16565b61217690919063ffffffff16565b90506000612748606461273a888b6120fb90919063ffffffff16565b61217690919063ffffffff16565b9050600061277182612763858c61255390919063ffffffff16565b61255390919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a185896120fb90919063ffffffff16565b905060006127b886896120fb90919063ffffffff16565b905060006127cf87896120fb90919063ffffffff16565b905060006127f8826127ea858761255390919063ffffffff16565b61255390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282461281f84613136565b613111565b9050808382526020820190508285602086028201111561284357600080fd5b60005b858110156128735781612859888261287d565b845260208401935060208301925050600181019050612846565b5050509392505050565b60008135905061288c81613774565b92915050565b6000815190506128a181613774565b92915050565b600082601f8301126128b857600080fd5b81356128c8848260208601612811565b91505092915050565b6000813590506128e08161378b565b92915050565b6000815190506128f58161378b565b92915050565b60008135905061290a816137a2565b92915050565b60008151905061291f816137a2565b92915050565b60006020828403121561293757600080fd5b60006129458482850161287d565b91505092915050565b60006020828403121561296057600080fd5b600061296e84828501612892565b91505092915050565b6000806040838503121561298a57600080fd5b60006129988582860161287d565b92505060206129a98582860161287d565b9150509250929050565b6000806000606084860312156129c857600080fd5b60006129d68682870161287d565b93505060206129e78682870161287d565b92505060406129f8868287016128fb565b9150509250925092565b60008060408385031215612a1557600080fd5b6000612a238582860161287d565b9250506020612a34858286016128fb565b9150509250929050565b600060208284031215612a5057600080fd5b600082013567ffffffffffffffff811115612a6a57600080fd5b612a76848285016128a7565b91505092915050565b600060208284031215612a9157600080fd5b6000612a9f848285016128d1565b91505092915050565b600060208284031215612aba57600080fd5b6000612ac8848285016128e6565b91505092915050565b600060208284031215612ae357600080fd5b6000612af1848285016128fb565b91505092915050565b600080600060608486031215612b0f57600080fd5b6000612b1d86828701612910565b9350506020612b2e86828701612910565b9250506040612b3f86828701612910565b9150509250925092565b6000612b558383612b61565b60208301905092915050565b612b6a816132cc565b82525050565b612b79816132cc565b82525050565b6000612b8a82613172565b612b948185613195565b9350612b9f83613162565b8060005b83811015612bd0578151612bb78882612b49565b9750612bc283613188565b925050600181019050612ba3565b5085935050505092915050565b612be6816132de565b82525050565b612bf581613321565b82525050565b6000612c068261317d565b612c1081856131a6565b9350612c20818560208601613333565b612c298161346d565b840191505092915050565b6000612c416023836131a6565b9150612c4c8261347e565b604082019050919050565b6000612c64602a836131a6565b9150612c6f826134cd565b604082019050919050565b6000612c876022836131a6565b9150612c928261351c565b604082019050919050565b6000612caa601b836131a6565b9150612cb58261356b565b602082019050919050565b6000612ccd601d836131a6565b9150612cd882613594565b602082019050919050565b6000612cf06021836131a6565b9150612cfb826135bd565b604082019050919050565b6000612d136020836131a6565b9150612d1e8261360c565b602082019050919050565b6000612d366029836131a6565b9150612d4182613635565b604082019050919050565b6000612d596025836131a6565b9150612d6482613684565b604082019050919050565b6000612d7c6024836131a6565b9150612d87826136d3565b604082019050919050565b6000612d9f6017836131a6565b9150612daa82613722565b602082019050919050565b6000612dc26011836131a6565b9150612dcd8261374b565b602082019050919050565b612de18161330a565b82525050565b612df081613314565b82525050565b6000602082019050612e0b6000830184612b70565b92915050565b6000604082019050612e266000830185612b70565b612e336020830184612b70565b9392505050565b6000604082019050612e4f6000830185612b70565b612e5c6020830184612dd8565b9392505050565b600060c082019050612e786000830189612b70565b612e856020830188612dd8565b612e926040830187612bec565b612e9f6060830186612bec565b612eac6080830185612b70565b612eb960a0830184612dd8565b979650505050505050565b6000602082019050612ed96000830184612bdd565b92915050565b60006020820190508181036000830152612ef98184612bfb565b905092915050565b60006020820190508181036000830152612f1a81612c34565b9050919050565b60006020820190508181036000830152612f3a81612c57565b9050919050565b60006020820190508181036000830152612f5a81612c7a565b9050919050565b60006020820190508181036000830152612f7a81612c9d565b9050919050565b60006020820190508181036000830152612f9a81612cc0565b9050919050565b60006020820190508181036000830152612fba81612ce3565b9050919050565b60006020820190508181036000830152612fda81612d06565b9050919050565b60006020820190508181036000830152612ffa81612d29565b9050919050565b6000602082019050818103600083015261301a81612d4c565b9050919050565b6000602082019050818103600083015261303a81612d6f565b9050919050565b6000602082019050818103600083015261305a81612d92565b9050919050565b6000602082019050818103600083015261307a81612db5565b9050919050565b60006020820190506130966000830184612dd8565b92915050565b600060a0820190506130b16000830188612dd8565b6130be6020830187612bec565b81810360408301526130d08186612b7f565b90506130df6060830185612b70565b6130ec6080830184612dd8565b9695505050505050565b600060208201905061310b6000830184612de7565b92915050565b600061311b61312c565b90506131278282613366565b919050565b6000604051905090565b600067ffffffffffffffff8211156131515761315061343e565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c28261330a565b91506131cd8361330a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613202576132016133e0565b5b828201905092915050565b60006132188261330a565b91506132238361330a565b9250826132335761323261340f565b5b828204905092915050565b60006132498261330a565b91506132548361330a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328d5761328c6133e0565b5b828202905092915050565b60006132a38261330a565b91506132ae8361330a565b9250828210156132c1576132c06133e0565b5b828203905092915050565b60006132d7826132ea565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332c8261330a565b9050919050565b60005b83811015613351578082015181840152602081019050613336565b83811115613360576000848401525b50505050565b61336f8261346d565b810181811067ffffffffffffffff8211171561338e5761338d61343e565b5b80604052505050565b60006133a28261330a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d5576133d46133e0565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377d816132cc565b811461378857600080fd5b50565b613794816132de565b811461379f57600080fd5b50565b6137ab8161330a565b81146137b657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203c96270820ca4034afb676c6a73dafa75c008e797f677487dd9b30adccbb842764736f6c63430008040033 | {"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"}]}} | 1,820 |
0x9deb8e8be7fdcde0cb1b0aa3a1aa70cdda4ada61 | /**
これはそのような抗力です
https://t.me/ShikamaruInuETH
*/
// 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 ShikamaruInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Shikamaru Inu";//
string private constant _symbol = "SHIKAMARU";//
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(0xa8eF854851aBE7Ca87dcE8b8585b09E0144bfA21);//
address payable private _marketingAddress = payable(0xa8eF854851aBE7Ca87dcE8b8585b09E0144bfA21);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 33000000000 * 10**9; //
uint256 public _maxWalletSize = 33000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 100000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock+1 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610551578063dd62ed3e14610567578063ea1644d5146105ad578063f2fde38b146105cd57600080fd5b8063a9059cbb146104cc578063bfd79284146104ec578063c3c8cd801461051c578063c492f0461461053157600080fd5b80638f9a55c0116100d15780638f9a55c01461044457806395d89b411461045a57806398a5c3151461048c578063a2a957bb146104ac57600080fd5b80637d1db4a5146103f05780638da5cb5b146104065780638f70ccf71461042457600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038657806370a082311461039b578063715018a6146103bb57806374010ece146103d057600080fd5b8063313ce5671461030a57806349bd5a5e146103265780636b999053146103465780636d8aa8f81461036657600080fd5b80631694505e116101ab5780631694505e1461027657806318160ddd146102ae57806323b872dd146102d45780632fd689e3146102f457600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024657600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b6d565b6105ed565b005b34801561020a57600080fd5b5060408051808201909152600d81526c5368696b616d61727520496e7560981b60208201525b60405161023d9190611c9f565b60405180910390f35b34801561025257600080fd5b50610266610261366004611abd565b61068c565b604051901515815260200161023d565b34801561028257600080fd5b50601554610296906001600160a01b031681565b6040516001600160a01b03909116815260200161023d565b3480156102ba57600080fd5b50683635c9adc5dea000005b60405190815260200161023d565b3480156102e057600080fd5b506102666102ef366004611a7c565b6106a3565b34801561030057600080fd5b506102c660195481565b34801561031657600080fd5b506040516009815260200161023d565b34801561033257600080fd5b50601654610296906001600160a01b031681565b34801561035257600080fd5b506101fc610361366004611a09565b61070c565b34801561037257600080fd5b506101fc610381366004611c39565b610757565b34801561039257600080fd5b506101fc61079f565b3480156103a757600080fd5b506102c66103b6366004611a09565b6107ea565b3480156103c757600080fd5b506101fc61080c565b3480156103dc57600080fd5b506101fc6103eb366004611c54565b610880565b3480156103fc57600080fd5b506102c660175481565b34801561041257600080fd5b506000546001600160a01b0316610296565b34801561043057600080fd5b506101fc61043f366004611c39565b6108af565b34801561045057600080fd5b506102c660185481565b34801561046657600080fd5b506040805180820190915260098152685348494b414d41525560b81b6020820152610230565b34801561049857600080fd5b506101fc6104a7366004611c54565b6108fb565b3480156104b857600080fd5b506101fc6104c7366004611c6d565b61092a565b3480156104d857600080fd5b506102666104e7366004611abd565b610968565b3480156104f857600080fd5b50610266610507366004611a09565b60116020526000908152604090205460ff1681565b34801561052857600080fd5b506101fc610975565b34801561053d57600080fd5b506101fc61054c366004611ae9565b6109c9565b34801561055d57600080fd5b506102c660085481565b34801561057357600080fd5b506102c6610582366004611a43565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b957600080fd5b506101fc6105c8366004611c54565b610a6a565b3480156105d957600080fd5b506101fc6105e8366004611a09565b610a99565b6000546001600160a01b031633146106205760405162461bcd60e51b815260040161061790611cf4565b60405180910390fd5b60005b81518110156106885760016011600084848151811061064457610644611e3b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068081611e0a565b915050610623565b5050565b6000610699338484610b83565b5060015b92915050565b60006106b0848484610ca7565b61070284336106fd85604051806060016040528060288152602001611e7d602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611265565b610b83565b5060019392505050565b6000546001600160a01b031633146107365760405162461bcd60e51b815260040161061790611cf4565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107815760405162461bcd60e51b815260040161061790611cf4565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107d457506014546001600160a01b0316336001600160a01b0316145b6107dd57600080fd5b476107e78161129f565b50565b6001600160a01b03811660009081526002602052604081205461069d90611324565b6000546001600160a01b031633146108365760405162461bcd60e51b815260040161061790611cf4565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108aa5760405162461bcd60e51b815260040161061790611cf4565b601755565b6000546001600160a01b031633146108d95760405162461bcd60e51b815260040161061790611cf4565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146109255760405162461bcd60e51b815260040161061790611cf4565b601955565b6000546001600160a01b031633146109545760405162461bcd60e51b815260040161061790611cf4565b600993909355600b91909155600a55600c55565b6000610699338484610ca7565b6013546001600160a01b0316336001600160a01b031614806109aa57506014546001600160a01b0316336001600160a01b0316145b6109b357600080fd5b60006109be306107ea565b90506107e7816113a8565b6000546001600160a01b031633146109f35760405162461bcd60e51b815260040161061790611cf4565b60005b82811015610a64578160056000868685818110610a1557610a15611e3b565b9050602002016020810190610a2a9190611a09565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5c81611e0a565b9150506109f6565b50505050565b6000546001600160a01b03163314610a945760405162461bcd60e51b815260040161061790611cf4565b601855565b6000546001600160a01b03163314610ac35760405162461bcd60e51b815260040161061790611cf4565b6001600160a01b038116610b285760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610617565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610be55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610617565b6001600160a01b038216610c465760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610617565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d0b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610617565b6001600160a01b038216610d6d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610617565b60008111610dcf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610617565b6000546001600160a01b03848116911614801590610dfb57506000546001600160a01b03838116911614155b1561115e57601654600160a01b900460ff16610e94576000546001600160a01b03848116911614610e945760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610617565b601754811115610ee65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610617565b6001600160a01b03831660009081526011602052604090205460ff16158015610f2857506001600160a01b03821660009081526011602052604090205460ff16155b610f805760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610617565b600854610f8e906001611d9a565b4311158015610faa57506016546001600160a01b038481169116145b8015610fc457506015546001600160a01b03838116911614155b8015610fd957506001600160a01b0382163014155b15611002576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110875760185481611024846107ea565b61102e9190611d9a565b106110875760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610617565b6000611092306107ea565b6019546017549192508210159082106110ab5760175491505b8080156110c25750601654600160a81b900460ff16155b80156110dc57506016546001600160a01b03868116911614155b80156110f15750601654600160b01b900460ff165b801561111657506001600160a01b03851660009081526005602052604090205460ff16155b801561113b57506001600160a01b03841660009081526005602052604090205460ff16155b1561115b57611149826113a8565b478015611159576111594761129f565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806111a057506001600160a01b03831660009081526005602052604090205460ff165b806111d257506016546001600160a01b038581169116148015906111d257506016546001600160a01b03848116911614155b156111df57506000611259565b6016546001600160a01b03858116911614801561120a57506015546001600160a01b03848116911614155b1561121c57600954600d55600a54600e555b6016546001600160a01b03848116911614801561124757506015546001600160a01b03858116911614155b1561125957600b54600d55600c54600e555b610a6484848484611531565b600081848411156112895760405162461bcd60e51b81526004016106179190611c9f565b5060006112968486611df3565b95945050505050565b6013546001600160a01b03166108fc6112b983600261155f565b6040518115909202916000818181858888f193505050501580156112e1573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112fc83600261155f565b6040518115909202916000818181858888f19350505050158015610688573d6000803e3d6000fd5b600060065482111561138b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610617565b60006113956115a1565b90506113a1838261155f565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113f0576113f0611e3b565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561144457600080fd5b505afa158015611458573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147c9190611a26565b8160018151811061148f5761148f611e3b565b6001600160a01b0392831660209182029290920101526015546114b59130911684610b83565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114ee908590600090869030904290600401611d29565b600060405180830381600087803b15801561150857600080fd5b505af115801561151c573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b8061153e5761153e6115c4565b6115498484846115f2565b80610a6457610a64600f54600d55601054600e55565b60006113a183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e9565b60008060006115ae611717565b90925090506115bd828261155f565b9250505090565b600d541580156115d45750600e54155b156115db57565b600d8054600f55600e805460105560009182905555565b60008060008060008061160487611759565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061163690876117b6565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461166590866117f8565b6001600160a01b03891660009081526002602052604090205561168781611857565b61169184836118a1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116d691815260200190565b60405180910390a3505050505050505050565b6000818361170a5760405162461bcd60e51b81526004016106179190611c9f565b5060006112968486611db2565b6006546000908190683635c9adc5dea00000611733828261155f565b82101561175057505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006117768a600d54600e546118c5565b92509250925060006117866115a1565b905060008060006117998e87878761191a565b919e509c509a509598509396509194505050505091939550919395565b60006113a183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611265565b6000806118058385611d9a565b9050838110156113a15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610617565b60006118616115a1565b9050600061186f838361196a565b3060009081526002602052604090205490915061188c90826117f8565b30600090815260026020526040902055505050565b6006546118ae90836117b6565b6006556007546118be90826117f8565b6007555050565b60008080806118df60646118d9898961196a565b9061155f565b905060006118f260646118d98a8961196a565b9050600061190a826119048b866117b6565b906117b6565b9992985090965090945050505050565b6000808080611929888661196a565b90506000611937888761196a565b90506000611945888861196a565b905060006119578261190486866117b6565b939b939a50919850919650505050505050565b6000826119795750600061069d565b60006119858385611dd4565b9050826119928583611db2565b146113a15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610617565b80356119f481611e67565b919050565b803580151581146119f457600080fd5b600060208284031215611a1b57600080fd5b81356113a181611e67565b600060208284031215611a3857600080fd5b81516113a181611e67565b60008060408385031215611a5657600080fd5b8235611a6181611e67565b91506020830135611a7181611e67565b809150509250929050565b600080600060608486031215611a9157600080fd5b8335611a9c81611e67565b92506020840135611aac81611e67565b929592945050506040919091013590565b60008060408385031215611ad057600080fd5b8235611adb81611e67565b946020939093013593505050565b600080600060408486031215611afe57600080fd5b833567ffffffffffffffff80821115611b1657600080fd5b818601915086601f830112611b2a57600080fd5b813581811115611b3957600080fd5b8760208260051b8501011115611b4e57600080fd5b602092830195509350611b6491860190506119f9565b90509250925092565b60006020808385031215611b8057600080fd5b823567ffffffffffffffff80821115611b9857600080fd5b818501915085601f830112611bac57600080fd5b813581811115611bbe57611bbe611e51565b8060051b604051601f19603f83011681018181108582111715611be357611be3611e51565b604052828152858101935084860182860187018a1015611c0257600080fd5b600095505b83861015611c2c57611c18816119e9565b855260019590950194938601938601611c07565b5098975050505050505050565b600060208284031215611c4b57600080fd5b6113a1826119f9565b600060208284031215611c6657600080fd5b5035919050565b60008060008060808587031215611c8357600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611ccc57858101830151858201604001528201611cb0565b81811115611cde576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d795784516001600160a01b031683529383019391830191600101611d54565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611dad57611dad611e25565b500190565b600082611dcf57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dee57611dee611e25565b500290565b600082821015611e0557611e05611e25565b500390565b6000600019821415611e1e57611e1e611e25565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209ac35d771f09223040b115187737ab84517338e1927503d970f9a5a77684fd0664736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,821 |
0x8a062d2ae38dbdc13c361b874460bce2aeef2901 | /**
*Submitted for verification at Etherscan.io on 2021-10-31
*/
/*
Mega Shiba Kingdom has arrived to the ETH to provide his subjects protection for their investments and rewards for their fealty.
Pledge yourself to the King and join an experienced team.
🔭 FIND OUT MORE 🔭
📖 Woofpaper: Coming soon!
🌐 Website : Megashibainu.com
✉️ Telegram Link: https://t.me/Megashibainu
🐥 Twitter: https://twitter.com/MegashibainuErc
*/
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 MegaShiba is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**12* 10**18;
string private _name = ' Mega Shiba Inu ';
string private _symbol = 'Mega Shiba ';
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);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220b1756071926f8f63f068816fd5908165a9058ea591cfce39e69764fabca9b0dc64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,822 |
0xbeef546ac8a4e0a80dc1e2d696968ef54138f1d4 | 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;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
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 MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
contract MySuperCoin is MintableToken {
string public name = "Ojooo Coin";
string public symbol = "OJX";
uint8 public decimals = 18;
} | 0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b81146100ea57806306fdde0314610113578063095ea7b31461019d57806318160ddd146101c157806323b872dd146101e8578063313ce5671461021257806340c10f191461023d578063661884631461026157806370a08231146102855780637d64bcb4146102a65780638da5cb5b146102bb57806395d89b41146102ec578063a9059cbb14610301578063d73dd62314610325578063dd62ed3e14610349578063f2fde38b14610370575b600080fd5b3480156100f657600080fd5b506100ff610393565b604080519115158252519081900360200190f35b34801561011f57600080fd5b506101286103b4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561016257818101518382015260200161014a565b50505050905090810190601f16801561018f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101a957600080fd5b506100ff600160a060020a0360043516602435610442565b3480156101cd57600080fd5b506101d66104ac565b60408051918252519081900360200190f35b3480156101f457600080fd5b506100ff600160a060020a03600435811690602435166044356104b2565b34801561021e57600080fd5b50610227610632565b6040805160ff9092168252519081900360200190f35b34801561024957600080fd5b506100ff600160a060020a036004351660243561063b565b34801561026d57600080fd5b506100ff600160a060020a036004351660243561075a565b34801561029157600080fd5b506101d6600160a060020a0360043516610853565b3480156102b257600080fd5b506100ff61086e565b3480156102c757600080fd5b506102d0610918565b60408051600160a060020a039092168252519081900360200190f35b3480156102f857600080fd5b50610128610927565b34801561030d57600080fd5b506100ff600160a060020a0360043516602435610982565b34801561033157600080fd5b506100ff600160a060020a0360043516602435610a7b565b34801561035557600080fd5b506101d6600160a060020a0360043581169060243516610b1d565b34801561037c57600080fd5b50610391600160a060020a0360043516610b48565b005b60035474010000000000000000000000000000000000000000900460ff1681565b6004805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561043a5780601f1061040f5761010080835404028352916020019161043a565b820191906000526020600020905b81548152906001019060200180831161041d57829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60015490565b6000600160a060020a03831615156104c957600080fd5b600160a060020a0384166000908152602081905260409020548211156104ee57600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561052157600080fd5b600160a060020a03841660009081526020819052604090205461054a908363ffffffff610be116565b600160a060020a03808616600090815260208190526040808220939093559085168152205461057f908363ffffffff610bf316565b600160a060020a03808516600090815260208181526040808320949094558783168252600281528382203390931682529190915220546105c5908363ffffffff610be116565b600160a060020a038086166000818152600260209081526040808320338616845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60065460ff1681565b60035460009033600160a060020a0390811691161461065957600080fd5b60035474010000000000000000000000000000000000000000900460ff161561068157600080fd5b600154610694908363ffffffff610bf316565b600155600160a060020a0383166000908152602081905260409020546106c0908363ffffffff610bf316565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156107b757600160a060020a0333811660009081526002602090815260408083209388168352929052908120556107ee565b6107c7818463ffffffff610be116565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60035460009033600160a060020a0390811691161461088c57600080fd5b60035474010000000000000000000000000000000000000000900460ff16156108b457600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561043a5780601f1061040f5761010080835404028352916020019161043a565b6000600160a060020a038316151561099957600080fd5b600160a060020a0333166000908152602081905260409020548211156109be57600080fd5b600160a060020a0333166000908152602081905260409020546109e7908363ffffffff610be116565b600160a060020a033381166000908152602081905260408082209390935590851681522054610a1c908363ffffffff610bf316565b600160a060020a03808516600081815260208181526040918290209490945580518681529051919333909316927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610ab3908363ffffffff610bf316565b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610b6357600080fd5b600160a060020a0381161515610b7857600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610bed57fe5b50900390565b81810182811015610c0057fe5b929150505600a165627a7a72305820f6a0490b49f4c647d49f537c33194e68d23616f749c774bde9d71dde08074a180029 | {"success": true, "error": null, "results": {}} | 1,823 |
0xa060396224f8cbb29b2fe1cef779d4cebc22d28a | // File: contracts\token\ERC721\IERC721Metadata.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.5;
/*
* @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 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;
}
}
// File: contracts\access\AccessControl.sol
/**
* @dev String operations.
*/
library Strings {
/**
* @dev Converts a `uint256` to its ASCII `string` representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
uint256 index = digits - 1;
temp = value;
while (temp != 0) {
buffer[index--] = bytes1(uint8(48 + (temp % 10)));
temp /= 10;
}
return string(buffer);
}
}
/**
* @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 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 Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
/**
* @dev Overload of {ECDSA-recover-bytes32-bytes-} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
require(
uint256(s) <=
0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0,
"ECDSA: invalid signature 's' value"
);
require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value");
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
require(signer != address(0), "ECDSA: invalid signature");
return signer;
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (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
virtual
override
returns (bool)
{
return _supportedInterfaces[interfaceId];
}
function _registerInterface(bytes4 interfaceId) internal virtual {
require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
_supportedInterfaces[interfaceId] = true;
}
}
/**
* @dev {ERC721} token, including:
*
* - ability for holders to burn (destroy) their tokens
* - a minter role that allows for token minting (creation)
* - a pauser role that allows to stop all token transfers
* - token ID and URI autogeneration
*
* This contract uses {AccessControl} to lock permissioned functions using the
* different roles - head to its documentation for details.
*
* The account that deploys the contract will be granted the minter and pauser
* roles, as well as the default admin role, which will let it grant both minter
* and pauser roles to other accounts.
*/
contract Decurly is ERC165, Context, Ownable {
using ECDSA for bytes32;
using Strings for uint256;
/*
* bytes4(keccak256('name()')) == 0x06fdde03
* bytes4(keccak256('symbol()')) == 0x95d89b41
* bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd
*/
bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;
/*
* bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e
*/
bytes4 private constant _INTERFACE_ID_ERC721 = 0x6352211e;
mapping(address => bool) private _minters;
struct OwnerInfo {
address owner;
uint32 ttl;
uint32 timestamp;
bool DNSSEC;
string domain;
}
mapping(uint256 => OwnerInfo) private _tokenOwners;
mapping(address => uint256) private _defaultDomain;
string private _name;
string private _symbol;
string private _baseURI;
uint8 private _maxTrustScore;
uint256 private _chainId;
event Transfer(
address indexed from,
address indexed to,
uint256 indexed tokenId
);
constructor(
string memory name_,
string memory symbol_,
string memory baseURI_
) {
_name = name_;
_symbol = symbol_;
_baseURI = baseURI_;
addMinter(_msgSender());
_maxTrustScore = 95;
_registerInterface(_INTERFACE_ID_ERC721_METADATA);
_registerInterface(_INTERFACE_ID_ERC721);
fetchChainId();
}
/*
* Gets the owner of a tokenId
*/
function ownerOf(uint256 tokenId) public view virtual returns (address) {
return _tokenOwners[tokenId].owner;
}
function _mint(
string memory domain,
address to,
uint32 ttl,
uint256 id,
bool DNSSEC,
bool setAsDefault,
uint32 timestamp
) private {
OwnerInfo memory ownerInfo = _tokenOwners[id];
address tOwner = ownerInfo.owner;
if (tOwner != to) {
ownerInfo.domain = domain;
ownerInfo.owner = to;
if (_defaultDomain[tOwner] == id) {
_defaultDomain[tOwner] = 0;
}
ownerInfo.timestamp = timestamp;
emit Transfer(tOwner, to, id);
}
if (setAsDefault && _defaultDomain[to] != id) {
_defaultDomain[to] = id;
}
ownerInfo.DNSSEC = DNSSEC;
ownerInfo.ttl = ttl;
_tokenOwners[id] = ownerInfo;
}
/*
* Minting should only be possible:
* - Signer has minter role.
* - parameters are signed correctly
* - Ticket was not already used.
* - ttl is valid
* Idea:
* We could save some space by converting domain to a base38 encoding
* Saving 2-Bit per domain-Character (Allowed domain Characters are [a-z] (lowercase is enough) [0-9] and [.-])
* on a theoretical length of 256 Byte we would save two SSTORE operations
*/
function mint(
string memory domain,
address to,
uint32 ttl,
uint256 id,
bytes32 r,
bytes32 s,
uint8 v,
bool DNSSEC,
bool setAsDefault
) external payable {
require(ttl >= block.timestamp, "Error:Old ticket");
require(_tokenOwners[id].ttl < ttl, "Error:Already used");
bytes32 hashed =
keccak256(
abi.encodePacked(
domain,
to,
id,
ttl,
msg.value,
DNSSEC,
setAsDefault,
_chainId
)
);
require(_minters[hashed.recover(v, r, s)] == true, "Error:Unsigned tx");
_mint(
domain,
to,
ttl,
id,
DNSSEC,
setAsDefault,
uint32(block.timestamp)
);
}
// EVM has chainId
function fetchChainId() public onlyOwner {
_chainId = _getChainId();
}
// in case there is no chainId on the EVM i have to come up with one...
function setChainId(uint256 id) external onlyOwner {
_chainId = id;
}
/*
* To save users minting costs, the transfer of current contract holdings ist done owner
* This saves an unneccessary transfer in the minting process.
*/
function withdraw() external onlyOwner {
require(payable(msg.sender).send(address(this).balance));
}
/*
* Multichain....
*/
function _getChainId() internal pure returns (uint256) {
uint256 id;
assembly {
id := chainid()
}
return id;
}
/*
* Burns domain token if you want to get rid of it
*/
function burn(uint256 id) public {
require(ownerOf(id) == msg.sender, "Error: you have to be Owner");
_tokenOwners[id].owner = address(0);
if (_defaultDomain[msg.sender] != 0) {
delete _defaultDomain[msg.sender];
}
emit Transfer(msg.sender, address(0), id);
}
/*
* Gets default domain for address
*/
function getDefaultDomain(address adr)
external
view
returns (string memory domain)
{
uint256 id = _defaultDomain[adr];
require(adr != address(0), "Error: No default for null address");
require(ownerOf(id) == adr, "Error: No default domain");
return _tokenOwners[id].domain;
}
/*
* Sets default domaintoken for address
*/
function setDefaultDomainToken(uint256 id) external {
require(ownerOf(id) == msg.sender, "Error: Not owner of domain");
_defaultDomain[msg.sender] = id;
}
/*
* Resets domaintoken for address
*/
function resetDefaultDomainToken() external {
_defaultDomain[msg.sender] = 0;
}
/*
* Gets tokenId for a given domain (Punycoded)
*/
function getDomainTokenId(string memory domain)
public
pure
returns (uint256 tokenId)
{
return uint256(keccak256(abi.encodePacked(domain)));
}
/*
* Gets domainstring for the token
*/
function getDomainOfToken(uint256 tokenId)
public
view
returns (string memory domain)
{
return _tokenOwners[tokenId].domain;
}
/*
* Gets the owner wallet of the domain
*/
function getDomainOwner(string memory domain)
public
view
returns (address owner)
{
return ownerOf(getDomainTokenId(domain));
}
/*
* Tokenname
*/
function name() public view returns (string memory) {
return _name;
}
/*
* Tokensymbol
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/*
* TokenUri
*/
function tokenURI(uint256 tokenId) public view returns (string memory) {
require(
ownerOf(tokenId) != address(0),
"ERC721Metadata: URI query for nonexistent token"
);
return
string(
abi.encodePacked(
baseURI(),
_chainId.toString(),
"/",
tokenId.toString()
)
);
}
/*
* FFU => SET 100 once DNSSEC verification is implemented
*/
function setCurrentMaxTrustScore(uint8 score) external onlyOwner {
_maxTrustScore = score;
}
/*
* Gives you the current max trustScore reachable (DNSSEC is not implemented yet)
*/
function getCurrentMaxTrustScore() public view returns (uint8) {
return _maxTrustScore;
}
/*
* See getTrustScore(uint256 id) but domain-string based
*/
function getTrustScore(string memory domain) public view returns (uint256) {
return getTrustScore(getDomainTokenId(domain));
}
/*
* Gets a trustScore (0 - 100) for a domain
* DNSSEC Domains are 100
*
* NON DNSSEC domain are 0 - 95 (Zero at day one and 90 at day 9)
* Final value of non-DNSSEC domains is 95 after day 10.
* If you want some security on non DNSSEC entries you might consider that in a case of a broad DNS-Spoofing attack
* it could probably last about one to five days in normal cases.
* If you have critical payments on chain, implement the getTrustScore accordingly!
*/
function getTrustScore(uint256 id) public view returns (uint256) {
require(ownerOf(id) != address(0), "Error: id has no owner");
if (_tokenOwners[id].DNSSEC) {
return 100;
}
uint256 sinceInception = block.timestamp - _tokenOwners[id].timestamp;
uint256 daysSinceInception = sinceInception / 86400;
if (daysSinceInception > 9) {
return 95;
} else {
return daysSinceInception * 10;
}
}
function setBaseURI(string memory baseURI_) public onlyOwner {
_baseURI = baseURI_;
}
function baseURI() public view returns (string memory) {
return _baseURI;
}
/* adds a minter role */
function addMinter(address minter_) public onlyOwner {
_minters[minter_] = true;
}
/* removes a minter role */
function removeMinter(address minter_) public onlyOwner {
_minters[minter_] = false;
}
} | 0x6080604052600436106101815760003560e01c80636c0360eb116100d1578063983b2d561161008a578063d19292c511610064578063d19292c514610859578063e482a9eb1461086e578063ef0e2ff41461089b578063f2fde38b146108c557610181565b8063983b2d56146107d2578063b6e88cfe14610805578063c87b56dd1461082f57610181565b80636c0360eb1461068d57806376512bf9146106a257806383f3d448146106cd5780638da5cb5b146106f757806395d89b411461070c5780639669a9621461072157610181565b806337e395161161013e57806342966c681161011857806342966c68146105555780634c2421211461057f57806355f804b3146105b25780636352211e1461066357610181565b806337e39516146104475780633a92b61b1461052b5780633ccfd60b1461054057610181565b806301ffc9a71461018657806306fdde03146101ce578063084d44ae146102585780631c5fb1921461028457806325970115146103475780633092afd514610414575b600080fd5b34801561019257600080fd5b506101ba600480360360208110156101a957600080fd5b50356001600160e01b0319166108f8565b604080519115158252519081900360200190f35b3480156101da57600080fd5b506101e361091b565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561021d578181015183820152602001610205565b50505050905090810190601f16801561024a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026457600080fd5b506102826004803603602081101561027b57600080fd5b50356109b1565b005b34801561029057600080fd5b50610335600480360360208110156102a757600080fd5b810190602081018135600160201b8111156102c157600080fd5b8201836020820111156102d357600080fd5b803590602001918460018302840111600160201b831117156102f457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610a28945050505050565b60408051918252519081900360200190f35b34801561035357600080fd5b506103f86004803603602081101561036a57600080fd5b810190602081018135600160201b81111561038457600080fd5b82018360208201111561039657600080fd5b803590602001918460018302840111600160201b831117156103b757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610a41945050505050565b604080516001600160a01b039092168252519081900360200190f35b34801561042057600080fd5b506102826004803603602081101561043757600080fd5b50356001600160a01b0316610a54565b610282600480360361012081101561045e57600080fd5b810190602081018135600160201b81111561047857600080fd5b82018360208201111561048a57600080fd5b803590602001918460018302840111600160201b831117156104ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550506001600160a01b0383351693505063ffffffff602083013516916040810135915060608101359060808101359060ff60a0820135169060c081013515159060e001351515610ad7565b34801561053757600080fd5b50610282610cf4565b34801561054c57600080fd5b50610282610d63565b34801561056157600080fd5b506102826004803603602081101561057857600080fd5b5035610deb565b34801561058b57600080fd5b506101e3600480360360208110156105a257600080fd5b50356001600160a01b0316610ec2565b3480156105be57600080fd5b50610282600480360360208110156105d557600080fd5b810190602081018135600160201b8111156105ef57600080fd5b82018360208201111561060157600080fd5b803590602001918460018302840111600160201b8311171561062257600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061103e945050505050565b34801561066f57600080fd5b506103f86004803603602081101561068657600080fd5b50356110b7565b34801561069957600080fd5b506101e36110d2565b3480156106ae57600080fd5b506106b7611133565b6040805160ff9092168252519081900360200190f35b3480156106d957600080fd5b50610335600480360360208110156106f057600080fd5b503561113c565b34801561070357600080fd5b506103f8611207565b34801561071857600080fd5b506101e3611216565b34801561072d57600080fd5b506103356004803603602081101561074457600080fd5b810190602081018135600160201b81111561075e57600080fd5b82018360208201111561077057600080fd5b803590602001918460018302840111600160201b8311171561079157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611277945050505050565b3480156107de57600080fd5b50610282600480360360208110156107f557600080fd5b50356001600160a01b03166112f1565b34801561081157600080fd5b506101e36004803603602081101561082857600080fd5b5035611377565b34801561083b57600080fd5b506101e36004803603602081101561085257600080fd5b503561142f565b34801561086557600080fd5b506102826115ae565b34801561087a57600080fd5b506102826004803603602081101561089157600080fd5b503560ff166115c0565b3480156108a757600080fd5b50610282600480360360208110156108be57600080fd5b5035611638565b3480156108d157600080fd5b50610282600480360360208110156108e857600080fd5b50356001600160a01b031661169a565b6001600160e01b0319811660009081526020819052604090205460ff165b919050565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109a75780601f1061097c576101008083540402835291602001916109a7565b820191906000526020600020905b81548152906001019060200180831161098a57829003601f168201915b5050505050905090565b336109bb826110b7565b6001600160a01b031614610a16576040805162461bcd60e51b815260206004820152601a60248201527f4572726f723a204e6f74206f776e6572206f6620646f6d61696e000000000000604482015290519081900360640190fd5b33600090815260046020526040902055565b6000610a3b610a3683611277565b61113c565b92915050565b6000610a3b610a4f83611277565b6110b7565b610a5c61179d565b6001600160a01b0316610a6d611207565b6001600160a01b031614610ab6576040805162461bcd60e51b81526020600482018190526024820152600080516020611e07833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600260205260409020805460ff19169055565b428763ffffffff161015610b25576040805162461bcd60e51b815260206004820152601060248201526f115c9c9bdc8e93db19081d1a58dad95d60821b604482015290519081900360640190fd5b60008681526003602052604090205463ffffffff808916600160a01b9092041610610b8c576040805162461bcd60e51b8152602060048201526012602482015271115c9c9bdc8e905b1c9958591e481d5cd95960721b604482015290519081900360640190fd5b60008989888a3487876009546040516020018089805190602001908083835b60208310610bca5780518252601f199092019160209182019101610bab565b6001836020036101000a038019825116818451168082178552505050505050905001886001600160a01b031660601b81526014018781526020018663ffffffff1660e01b815260040185815260200184151560f81b815260010183151560f81b81526001018281526020019850505050505050505060405160208183030381529060405280519060200120905060026000610c72868989866117a1909392919063ffffffff16565b6001600160a01b0316815260208101919091526040016000205460ff161515600114610cd9576040805162461bcd60e51b815260206004820152601160248201527008ae4e4dee474aadce6d2cedccac840e8f607b1b604482015290519081900360640190fd5b610ce88a8a8a8a87874261191f565b50505050505050505050565b610cfc61179d565b6001600160a01b0316610d0d611207565b6001600160a01b031614610d56576040805162461bcd60e51b81526020600482018190526024820152600080516020611e07833981519152604482015290519081900360640190fd5b610d5e611bca565b600955565b610d6b61179d565b6001600160a01b0316610d7c611207565b6001600160a01b031614610dc5576040805162461bcd60e51b81526020600482018190526024820152600080516020611e07833981519152604482015290519081900360640190fd5b60405133904780156108fc02916000818181858888f19350505050610de957600080fd5b565b33610df5826110b7565b6001600160a01b031614610e50576040805162461bcd60e51b815260206004820152601b60248201527f4572726f723a20796f75206861766520746f206265204f776e65720000000000604482015290519081900360640190fd5b600081815260036020908152604080832080546001600160a01b0319169055338352600490915290205415610e9057336000908152600460205260408120555b604051819060009033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a450565b6001600160a01b038116600081815260046020526040902054606091610f195760405162461bcd60e51b8152600401808060200182810382526022815260200180611dc36022913960400191505060405180910390fd5b826001600160a01b0316610f2c826110b7565b6001600160a01b031614610f87576040805162461bcd60e51b815260206004820152601860248201527f4572726f723a204e6f2064656661756c7420646f6d61696e0000000000000000604482015290519081900360640190fd5b600360008281526020019081526020016000206001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110315780601f1061100657610100808354040283529160200191611031565b820191906000526020600020905b81548152906001019060200180831161101457829003601f168201915b5050505050915050919050565b61104661179d565b6001600160a01b0316611057611207565b6001600160a01b0316146110a0576040805162461bcd60e51b81526020600482018190526024820152600080516020611e07833981519152604482015290519081900360640190fd5b80516110b3906007906020840190611ca9565b5050565b6000908152600360205260409020546001600160a01b031690565b60078054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109a75780601f1061097c576101008083540402835291602001916109a7565b60085460ff1690565b600080611148836110b7565b6001600160a01b0316141561119d576040805162461bcd60e51b815260206004820152601660248201527522b93937b91d1034b2103430b99037379037bbb732b960511b604482015290519081900360640190fd5b600082815260036020526040902054600160e01b900460ff16156111c357506064610916565b600082815260036020526040902054600160c01b900463ffffffff16420362015180810460098111156111fb57605f92505050610916565b600a0291506109169050565b6001546001600160a01b031690565b60068054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109a75780601f1061097c576101008083540402835291602001916109a7565b6000816040516020018082805190602001908083835b602083106112ac5780518252601f19909201916020918201910161128d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040528051906020012060001c9050919050565b6112f961179d565b6001600160a01b031661130a611207565b6001600160a01b031614611353576040805162461bcd60e51b81526020600482018190526024820152600080516020611e07833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600260205260409020805460ff19166001179055565b6060600360008381526020019081526020016000206001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114235780601f106113f857610100808354040283529160200191611423565b820191906000526020600020905b81548152906001019060200180831161140657829003601f168201915b50505050509050919050565b6060600061143c836110b7565b6001600160a01b031614156114825760405162461bcd60e51b815260040180806020018281038252602f815260200180611e27602f913960400191505060405180910390fd5b61148a6110d2565b611495600954611bce565b61149e84611bce565b6040516020018084805190602001908083835b602083106114d05780518252601f1990920191602091820191016114b1565b51815160209384036101000a600019018019909216911617905286519190930192860191508083835b602083106115185780518252601f1990920191602091820191016114f9565b6001836020036101000a03801982511681845116808217855250505050505090500180602f60f81b81525060010182805190602001908083835b602083106115715780518252601f199092019160209182019101611552565b6001836020036101000a03801982511681845116808217855250505050505090500193505050506040516020818303038152906040529050919050565b33600090815260046020526040812055565b6115c861179d565b6001600160a01b03166115d9611207565b6001600160a01b031614611622576040805162461bcd60e51b81526020600482018190526024820152600080516020611e07833981519152604482015290519081900360640190fd5b6008805460ff191660ff92909216919091179055565b61164061179d565b6001600160a01b0316611651611207565b6001600160a01b031614610d5e576040805162461bcd60e51b81526020600482018190526024820152600080516020611e07833981519152604482015290519081900360640190fd5b6116a261179d565b6001600160a01b03166116b3611207565b6001600160a01b0316146116fc576040805162461bcd60e51b81526020600482018190526024820152600080516020611e07833981519152604482015290519081900360640190fd5b6001600160a01b0381166117415760405162461bcd60e51b8152600401808060200182810382526026815260200180611d7b6026913960400191505060405180910390fd5b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08211156118025760405162461bcd60e51b8152600401808060200182810382526022815260200180611da16022913960400191505060405180910390fd5b8360ff16601b148061181757508360ff16601c145b6118525760405162461bcd60e51b8152600401808060200182810382526022815260200180611de56022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156118ae573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611916576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b611927611d35565b600085815260036020908152604091829020825160a08101845281546001600160a01b0381168252600160a01b810463ffffffff90811683860152600160c01b82041682860152600160e01b900460ff1615156060820152600180830180548651600261010094831615949094026000190190911692909204601f810186900486028301860190965285825291949293608086019391929190830182828015611a115780601f106119e657610100808354040283529160200191611a11565b820191906000526020600020905b8154815290600101906020018083116119f457829003601f168201915b5050509190925250508151919250506001600160a01b0380821690891614611ac357608082018990526001600160a01b0380891683528116600090815260046020526040902054861415611a79576001600160a01b0381166000908152600460205260408120555b63ffffffff83166040808401919091525186906001600160a01b03808b1691908416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90600090a45b838015611ae857506001600160a01b0388166000908152600460205260409020548614155b15611b09576001600160a01b03881660009081526004602052604090208690555b8415156060830190815263ffffffff888116602080860191825260008a8152600382526040908190208751815494519289015196516001600160a01b03199095166001600160a01b039091161763ffffffff60a01b1916600160a01b928616929092029190911763ffffffff60c01b1916600160c01b95909416949094029290921760ff60e01b1916600160e01b9115159190910217825560808401518051859392611bbc926001850192910190611ca9565b505050505050505050505050565b4690565b606081611bf357506040805180820190915260018152600360fc1b6020820152610916565b8160005b8115611c0b57600101600a82049150611bf7565b60608167ffffffffffffffff81118015611c2457600080fd5b506040519080825280601f01601f191660200182016040528015611c4f576020820181803683370190505b50859350905060001982015b8315611ca057600a840660300160f81b82828060019003935081518110611c7e57fe5b60200101906001600160f81b031916908160001a905350600a84049350611c5b565b50949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282611cdf5760008555611d25565b82601f10611cf857805160ff1916838001178555611d25565b82800160010185558215611d25579182015b82811115611d25578251825591602001919060010190611d0a565b50611d31929150611d65565b5090565b6040805160a081018252600080825260208201819052918101829052606080820192909252608081019190915290565b5b80821115611d315760008155600101611d6656fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345434453413a20696e76616c6964207369676e6174757265202773272076616c75654572726f723a204e6f2064656661756c7420666f72206e756c6c206164647265737345434453413a20696e76616c6964207369676e6174757265202776272076616c75654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65724552433732314d657461646174613a2055524920717565727920666f72206e6f6e6578697374656e7420746f6b656ea26469706673582212203b0fb1f09381a34e411dfcbff60658771c0f45e8d9b6d403d53659406e5aeed064736f6c63430007040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 1,824 |
0x1e37230c70a3044764df15631a44cd12c94c4954 | /**
*Submitted for verification at Etherscan.io on 2021-12-30
*/
/*
Telegram: @ShibaFighter
OUR WEBSITE:
shibafighter.com
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract SHIBAFIGHTER is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "SHIBAFIGHTER";
string private constant _symbol = "SHIBFIGHT";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _devTax = 5;
uint256 private _marketingTax = 5;
uint256 private _salesTax = 3;
uint256 private _summedTax = _marketingTax+_salesTax;
uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9;
uint256 private _routermax = 5000000000 * 10**9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _Deployer;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 public _maxTxAmount = _tTotal;
uint256 public launchBlock;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor( address payable depAddr) {
_Deployer = depAddr;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_Deployer] = 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 (_devTax == 0 && _summedTax == 0) return;
_devTax = 0;
_summedTax = 0;
}
function restoreAllFee() private {
_devTax = 5;
_marketingTax = 5;
_salesTax = 3;
_summedTax = _marketingTax+_salesTax;
}
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,
"under cooldown"
);
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
}
require(!bots[from] && !bots[to] && !bots[msg.sender]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (15 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
bool overMinTokenBalance = contractTokenBalance >= balanceOf(uniswapV2Pair).mul(20).div(100);
if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router)
) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function isExcluded(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function isBlackListed(address account) public view returns (bool) {
return bots[account];
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
// make the swap
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_Deployer.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 = 50000000000 * 10**9;
launchBlock = block.number;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function setSwapEnabled(bool enabled) external {
require(_msgSender() == _Deployer);
swapEnabled = enabled;
}
function removeBuyLimit() external {
require(_msgSender() == _Deployer);
_maxTxAmount = _tTotal;
}
function manualswap() external {
require(_msgSender() == _Deployer);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _Deployer);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) external onlyOwner() {
require(_msgSender() == _Deployer);
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public {
require(_msgSender() == _Deployer);
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, _devTax, _summedTax);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 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 {
require(_msgSender() == _Deployer);
require(maxTxPercent > _maxTxAmount, "not allow to reduce the tx limit");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setRouterPercent(uint256 maxRouterPercent) external {
require(_msgSender() == _Deployer);
require(maxRouterPercent > 0, "Amount must be greater than 0");
_routermax = _tTotal.mul(maxRouterPercent).div(10**4);
}
function _setTeamFee(uint256 teamFee) external {
require(_msgSender() == _Deployer);
require(teamFee >= 1 && teamFee <= 13, 'teamFee should be under 13');
_summedTax = teamFee;
}
} | 0x6080604052600436106101855760003560e01c80638da5cb5b116100d1578063c9567bf91161008a578063d543dbeb11610064578063d543dbeb1461052f578063dd62ed3e14610558578063e01af92c14610595578063e47d6060146105be5761018c565b8063c9567bf9146104b0578063cba0e996146104c7578063d00efb2f146105045761018c565b80638da5cb5b146103b457806395d89b41146103df578063a9059cbb1461040a578063b515566a14610447578063c0e6b46e14610470578063c3c8cd80146104995761018c565b8063313ce5671161013e5780636fc3eaec116101185780636fc3eaec1461031e57806370a0823114610335578063715018a6146103725780637d1db4a5146103895761018c565b8063313ce567146102b35780633e07ce5b146102de5780635932ead1146102f55761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd14610224578063273123b714610261578063286671621461028a5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a66105fb565b6040516101b39190612e04565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190612ece565b610638565b6040516101f09190612f29565b60405180910390f35b34801561020557600080fd5b5061020e610656565b60405161021b9190612f53565b60405180910390f35b34801561023057600080fd5b5061024b60048036038101906102469190612f6e565b610667565b6040516102589190612f29565b60405180910390f35b34801561026d57600080fd5b5061028860048036038101906102839190612fc1565b610740565b005b34801561029657600080fd5b506102b160048036038101906102ac9190612fee565b6107fc565b005b3480156102bf57600080fd5b506102c86108b8565b6040516102d59190613037565b60405180910390f35b3480156102ea57600080fd5b506102f36108c1565b005b34801561030157600080fd5b5061031c6004803603810190610317919061307e565b610934565b005b34801561032a57600080fd5b506103336109e6565b005b34801561034157600080fd5b5061035c60048036038101906103579190612fc1565b610a58565b6040516103699190612f53565b60405180910390f35b34801561037e57600080fd5b50610387610aa9565b005b34801561039557600080fd5b5061039e610bfc565b6040516103ab9190612f53565b60405180910390f35b3480156103c057600080fd5b506103c9610c02565b6040516103d691906130ba565b60405180910390f35b3480156103eb57600080fd5b506103f4610c2b565b6040516104019190612e04565b60405180910390f35b34801561041657600080fd5b50610431600480360381019061042c9190612ece565b610c68565b60405161043e9190612f29565b60405180910390f35b34801561045357600080fd5b5061046e6004803603810190610469919061321d565b610c86565b005b34801561047c57600080fd5b5061049760048036038101906104929190612fee565b610e11565b005b3480156104a557600080fd5b506104ae610eee565b005b3480156104bc57600080fd5b506104c5610f68565b005b3480156104d357600080fd5b506104ee60048036038101906104e99190612fc1565b6114cc565b6040516104fb9190612f29565b60405180910390f35b34801561051057600080fd5b50610519611522565b6040516105269190612f53565b60405180910390f35b34801561053b57600080fd5b5061055660048036038101906105519190612fee565b611528565b005b34801561056457600080fd5b5061057f600480360381019061057a9190613266565b61163e565b60405161058c9190612f53565b60405180910390f35b3480156105a157600080fd5b506105bc60048036038101906105b7919061307e565b6116c5565b005b3480156105ca57600080fd5b506105e560048036038101906105e09190612fc1565b611743565b6040516105f29190612f29565b60405180910390f35b60606040518060400160405280600c81526020017f5348494241464947485445520000000000000000000000000000000000000000815250905090565b600061064c610645611799565b84846117a1565b6001905092915050565b6000683635c9adc5dea00000905090565b600061067484848461196c565b61073584610680611799565b61073085604051806060016040528060288152602001613e8060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106e6611799565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122719092919063ffffffff16565b6117a1565b600190509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610781611799565b73ffffffffffffffffffffffffffffffffffffffff16146107a157600080fd5b6000600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661083d611799565b73ffffffffffffffffffffffffffffffffffffffff161461085d57600080fd5b6001811015801561086f5750600d8111155b6108ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108a5906132f2565b60405180910390fd5b80600b8190555050565b60006009905090565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610902611799565b73ffffffffffffffffffffffffffffffffffffffff161461092257600080fd5b683635c9adc5dea00000601381905550565b61093c611799565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c09061335e565b60405180910390fd5b80601260176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610a27611799565b73ffffffffffffffffffffffffffffffffffffffff1614610a4757600080fd5b6000479050610a55816122d5565b50565b6000610aa2600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612341565b9050919050565b610ab1611799565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b359061335e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60135481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f5348494246494748540000000000000000000000000000000000000000000000815250905090565b6000610c7c610c75611799565b848461196c565b6001905092915050565b610c8e611799565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d129061335e565b60405180910390fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d5c611799565b73ffffffffffffffffffffffffffffffffffffffff1614610d7c57600080fd5b60005b8151811015610e0d576001600e6000848481518110610da157610da061337e565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610e05906133dc565b915050610d7f565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e52611799565b73ffffffffffffffffffffffffffffffffffffffff1614610e7257600080fd5b60008111610eb5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eac90613471565b60405180910390fd5b610ee5612710610ed783683635c9adc5dea000006123af90919063ffffffff16565b61242a90919063ffffffff16565b600d8190555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f2f611799565b73ffffffffffffffffffffffffffffffffffffffff1614610f4f57600080fd5b6000610f5a30610a58565b9050610f6581612474565b50565b610f70611799565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ffd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff49061335e565b60405180910390fd5b601260149054906101000a900460ff161561104d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611044906134dd565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506110dd30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006117a1565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561112357600080fd5b505afa158015611137573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115b9190613512565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156111bd57600080fd5b505afa1580156111d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f59190613512565b6040518363ffffffff1660e01b815260040161121292919061353f565b602060405180830381600087803b15801561122c57600080fd5b505af1158015611240573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112649190613512565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306112ed30610a58565b6000806112f8610c02565b426040518863ffffffff1660e01b815260040161131a969594939291906135ad565b6060604051808303818588803b15801561133357600080fd5b505af1158015611347573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061136c9190613623565b5050506001601260166101000a81548160ff0219169083151502179055506000601260176101000a81548160ff0219169083151502179055506802b5e3af16b1880000601381905550436014819055506001601260146101000a81548160ff021916908315150217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611476929190613676565b602060405180830381600087803b15801561149057600080fd5b505af11580156114a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c891906136b4565b5050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60145481565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611569611799565b73ffffffffffffffffffffffffffffffffffffffff161461158957600080fd5b60135481116115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c49061372d565b60405180910390fd5b6115fc60646115ee83683635c9adc5dea000006123af90919063ffffffff16565b61242a90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6013546040516116339190612f53565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611706611799565b73ffffffffffffffffffffffffffffffffffffffff161461172657600080fd5b80601260166101000a81548160ff02191690831515021790555050565b6000600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611811576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611808906137bf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611881576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187890613851565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161195f9190612f53565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d3906138e3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4390613975565b60405180910390fd5b60008111611a8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8690613a07565b60405180910390fd5b611a97610c02565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b055750611ad5610c02565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121ae57601260179054906101000a900460ff1615611d38573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b8757503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611be15750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611c3b5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d3757601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611c81611799565b73ffffffffffffffffffffffffffffffffffffffff161480611cf75750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611cdf611799565b73ffffffffffffffffffffffffffffffffffffffff16145b611d36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2d90613a73565b60405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611d7b57601354811115611d7a57600080fd5b5b600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611e1f5750600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611e755750600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611e7e57600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f295750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611f7f5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611f975750601260179054906101000a900460ff165b156120385742600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611fe757600080fd5b600f42611ff49190613a93565b600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061204330610a58565b90506000612098606461208a601461207c601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a58565b6123af90919063ffffffff16565b61242a90919063ffffffff16565b8210159050601260159054906101000a900460ff161580156120c65750601260169054906101000a900460ff165b80156120cf5750805b80156121295750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156121835750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b156121ab5761219182612474565b600047905060008111156121a9576121a8476122d5565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122555750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561225f57600090505b61226b848484846126fc565b50505050565b60008383111582906122b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b09190612e04565b60405180910390fd5b50600083856122c89190613ae9565b9050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561233d573d6000803e3d6000fd5b5050565b6000600654821115612388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237f90613b8f565b60405180910390fd5b6000612392612729565b90506123a7818461242a90919063ffffffff16565b915050919050565b6000808314156123c25760009050612424565b600082846123d09190613baf565b90508284826123df9190613c38565b1461241f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161241690613cdb565b60405180910390fd5b809150505b92915050565b600061246c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612754565b905092915050565b6001601260156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156124ac576124ab6130da565b5b6040519080825280602002602001820160405280156124da5781602001602082028036833780820191505090505b50905030816000815181106124f2576124f161337e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561259457600080fd5b505afa1580156125a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cc9190613512565b816001815181106125e0576125df61337e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061264730601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117a1565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016126ab959493929190613db9565b600060405180830381600087803b1580156126c557600080fd5b505af11580156126d9573d6000803e3d6000fd5b50505050506000601260156101000a81548160ff02191690831515021790555050565b8061270a576127096127b7565b5b6127158484846127e8565b80612723576127226129b3565b5b50505050565b60008060006127366129e3565b9150915061274d818361242a90919063ffffffff16565b9250505090565b6000808311829061279b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127929190612e04565b60405180910390fd5b50600083856127aa9190613c38565b9050809150509392505050565b60006008541480156127cb57506000600b54145b156127d5576127e6565b60006008819055506000600b819055505b565b6000806000806000806127fa87612a45565b95509550955095509550955061285886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612aad90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128ed85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061293981612b55565b6129438483612c12565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516129a09190612f53565b60405180910390a3505050505050505050565b600560088190555060056009819055506003600a81905550600a546009546129db9190613a93565b600b81905550565b600080600060065490506000683635c9adc5dea000009050612a19683635c9adc5dea0000060065461242a90919063ffffffff16565b821015612a3857600654683635c9adc5dea00000935093505050612a41565b81819350935050505b9091565b6000806000806000806000806000612a628a600854600b54612c4c565b9250925092506000612a72612729565b90506000806000612a858e878787612ce2565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612aef83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612271565b905092915050565b6000808284612b069190613a93565b905083811015612b4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b4290613e5f565b60405180910390fd5b8091505092915050565b6000612b5f612729565b90506000612b7682846123af90919063ffffffff16565b9050612bca81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612c2782600654612aad90919063ffffffff16565b600681905550612c4281600754612af790919063ffffffff16565b6007819055505050565b600080600080612c786064612c6a888a6123af90919063ffffffff16565b61242a90919063ffffffff16565b90506000612ca26064612c94888b6123af90919063ffffffff16565b61242a90919063ffffffff16565b90506000612ccb82612cbd858c612aad90919063ffffffff16565b612aad90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612cfb85896123af90919063ffffffff16565b90506000612d1286896123af90919063ffffffff16565b90506000612d2987896123af90919063ffffffff16565b90506000612d5282612d448587612aad90919063ffffffff16565b612aad90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612da5578082015181840152602081019050612d8a565b83811115612db4576000848401525b50505050565b6000601f19601f8301169050919050565b6000612dd682612d6b565b612de08185612d76565b9350612df0818560208601612d87565b612df981612dba565b840191505092915050565b60006020820190508181036000830152612e1e8184612dcb565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612e6582612e3a565b9050919050565b612e7581612e5a565b8114612e8057600080fd5b50565b600081359050612e9281612e6c565b92915050565b6000819050919050565b612eab81612e98565b8114612eb657600080fd5b50565b600081359050612ec881612ea2565b92915050565b60008060408385031215612ee557612ee4612e30565b5b6000612ef385828601612e83565b9250506020612f0485828601612eb9565b9150509250929050565b60008115159050919050565b612f2381612f0e565b82525050565b6000602082019050612f3e6000830184612f1a565b92915050565b612f4d81612e98565b82525050565b6000602082019050612f686000830184612f44565b92915050565b600080600060608486031215612f8757612f86612e30565b5b6000612f9586828701612e83565b9350506020612fa686828701612e83565b9250506040612fb786828701612eb9565b9150509250925092565b600060208284031215612fd757612fd6612e30565b5b6000612fe584828501612e83565b91505092915050565b60006020828403121561300457613003612e30565b5b600061301284828501612eb9565b91505092915050565b600060ff82169050919050565b6130318161301b565b82525050565b600060208201905061304c6000830184613028565b92915050565b61305b81612f0e565b811461306657600080fd5b50565b60008135905061307881613052565b92915050565b60006020828403121561309457613093612e30565b5b60006130a284828501613069565b91505092915050565b6130b481612e5a565b82525050565b60006020820190506130cf60008301846130ab565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61311282612dba565b810181811067ffffffffffffffff82111715613131576131306130da565b5b80604052505050565b6000613144612e26565b90506131508282613109565b919050565b600067ffffffffffffffff8211156131705761316f6130da565b5b602082029050602081019050919050565b600080fd5b600061319961319484613155565b61313a565b905080838252602082019050602084028301858111156131bc576131bb613181565b5b835b818110156131e557806131d18882612e83565b8452602084019350506020810190506131be565b5050509392505050565b600082601f830112613204576132036130d5565b5b8135613214848260208601613186565b91505092915050565b60006020828403121561323357613232612e30565b5b600082013567ffffffffffffffff81111561325157613250612e35565b5b61325d848285016131ef565b91505092915050565b6000806040838503121561327d5761327c612e30565b5b600061328b85828601612e83565b925050602061329c85828601612e83565b9150509250929050565b7f7465616d4665652073686f756c6420626520756e646572203133000000000000600082015250565b60006132dc601a83612d76565b91506132e7826132a6565b602082019050919050565b6000602082019050818103600083015261330b816132cf565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613348602083612d76565b915061335382613312565b602082019050919050565b600060208201905081810360008301526133778161333b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006133e782612e98565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561341a576134196133ad565b5b600182019050919050565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b600061345b601d83612d76565b915061346682613425565b602082019050919050565b6000602082019050818103600083015261348a8161344e565b9050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006134c7601783612d76565b91506134d282613491565b602082019050919050565b600060208201905081810360008301526134f6816134ba565b9050919050565b60008151905061350c81612e6c565b92915050565b60006020828403121561352857613527612e30565b5b6000613536848285016134fd565b91505092915050565b600060408201905061355460008301856130ab565b61356160208301846130ab565b9392505050565b6000819050919050565b6000819050919050565b600061359761359261358d84613568565b613572565b612e98565b9050919050565b6135a78161357c565b82525050565b600060c0820190506135c260008301896130ab565b6135cf6020830188612f44565b6135dc604083018761359e565b6135e9606083018661359e565b6135f660808301856130ab565b61360360a0830184612f44565b979650505050505050565b60008151905061361d81612ea2565b92915050565b60008060006060848603121561363c5761363b612e30565b5b600061364a8682870161360e565b935050602061365b8682870161360e565b925050604061366c8682870161360e565b9150509250925092565b600060408201905061368b60008301856130ab565b6136986020830184612f44565b9392505050565b6000815190506136ae81613052565b92915050565b6000602082840312156136ca576136c9612e30565b5b60006136d88482850161369f565b91505092915050565b7f6e6f7420616c6c6f7720746f2072656475636520746865207478206c696d6974600082015250565b6000613717602083612d76565b9150613722826136e1565b602082019050919050565b600060208201905081810360008301526137468161370a565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006137a9602483612d76565b91506137b48261374d565b604082019050919050565b600060208201905081810360008301526137d88161379c565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061383b602283612d76565b9150613846826137df565b604082019050919050565b6000602082019050818103600083015261386a8161382e565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006138cd602583612d76565b91506138d882613871565b604082019050919050565b600060208201905081810360008301526138fc816138c0565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061395f602383612d76565b915061396a82613903565b604082019050919050565b6000602082019050818103600083015261398e81613952565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006139f1602983612d76565b91506139fc82613995565b604082019050919050565b60006020820190508181036000830152613a20816139e4565b9050919050565b7f756e64657220636f6f6c646f776e000000000000000000000000000000000000600082015250565b6000613a5d600e83612d76565b9150613a6882613a27565b602082019050919050565b60006020820190508181036000830152613a8c81613a50565b9050919050565b6000613a9e82612e98565b9150613aa983612e98565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613ade57613add6133ad565b5b828201905092915050565b6000613af482612e98565b9150613aff83612e98565b925082821015613b1257613b116133ad565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613b79602a83612d76565b9150613b8482613b1d565b604082019050919050565b60006020820190508181036000830152613ba881613b6c565b9050919050565b6000613bba82612e98565b9150613bc583612e98565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613bfe57613bfd6133ad565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613c4382612e98565b9150613c4e83612e98565b925082613c5e57613c5d613c09565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613cc5602183612d76565b9150613cd082613c69565b604082019050919050565b60006020820190508181036000830152613cf481613cb8565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613d3081612e5a565b82525050565b6000613d428383613d27565b60208301905092915050565b6000602082019050919050565b6000613d6682613cfb565b613d708185613d06565b9350613d7b83613d17565b8060005b83811015613dac578151613d938882613d36565b9750613d9e83613d4e565b925050600181019050613d7f565b5085935050505092915050565b600060a082019050613dce6000830188612f44565b613ddb602083018761359e565b8181036040830152613ded8186613d5b565b9050613dfc60608301856130ab565b613e096080830184612f44565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613e49601b83612d76565b9150613e5482613e13565b602082019050919050565b60006020820190508181036000830152613e7881613e3c565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220db05331a0e44b1287681e4132530f6fc9f4b6e15dcdd822358b6231e36fff35b64736f6c63430008090033 | {"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"}]}} | 1,825 |
0xbab08593ba66fa2b41f928e4d297f23beed38690 | /**
████████╗██╗████████╗░█████╗░███╗░░██╗ ██╗███╗░░██╗██╗░░░██╗
╚══██╔══╝██║╚══██╔══╝██╔══██╗████╗░██║ ██║████╗░██║██║░░░██║
░░░██║░░░██║░░░██║░░░███████║██╔██╗██║ ██║██╔██╗██║██║░░░██║
░░░██║░░░██║░░░██║░░░██╔══██║██║╚████║ ██║██║╚████║██║░░░██║
░░░██║░░░██║░░░██║░░░██║░░██║██║░╚███║ ██║██║░╚███║╚██████╔╝
░░░╚═╝░░░╚═╝░░░╚═╝░░░╚═╝░░╚═╝╚═╝░░╚══╝ ╚═╝╚═╝░░╚══╝░╚═════╝░
"Even devils beware when bargaining with titans."
*/
// 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 TitanInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Titan Inu";//
string private constant _symbol = "TINU";//
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 = 6;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
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(0xB0aDeAe9C516b957CCD52359c4925199ee56AFe6);//
address payable private _marketingAddress = payable(0xB0aDeAe9C516b957CCD52359c4925199ee56AFe6);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 30000000000 * 10**9; //
uint256 public _maxWalletSize = 60000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 30000000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock+2 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613048565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a5565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa8565b610869565b604051610264919061346f565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f919061348a565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613687565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f55565b6108be565b6040516102f7919061346f565b60405180910390f35b34801561030c57600080fd5b50610315610997565b6040516103229190613687565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d91906136fc565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b6040516103789190613454565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ebb565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613091565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ebb565b610c3e565b60405161041e9190613687565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130be565b610de2565b005b34801561047357600080fd5b5061047c610e81565b6040516104899190613687565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b49190613454565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613091565b610eb0565b005b3480156104f257600080fd5b506104fb610f69565b6040516105089190613687565b60405180910390f35b34801561051d57600080fd5b50610526610f6f565b60405161053391906134a5565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130be565b610fac565b005b34801561057157600080fd5b5061058c600480360381019061058791906130eb565b61104b565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa8565b611102565b6040516105c2919061346f565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ebb565b611120565b6040516105ff919061346f565b60405180910390f35b34801561061457600080fd5b5061061d611140565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe8565b611219565b005b34801561065457600080fd5b5061065d611353565b60405161066a9190613687565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f15565b611359565b6040516106a79190613687565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130be565b6113e0565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ebb565b61147f565b005b61070a611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e7565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139d3565b91505061079a565b5050565b60606040518060400160405280600981526020017f546974616e20496e750000000000000000000000000000000000000000000000815250905090565b600061087d610876611641565b8484611649565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108cb848484611814565b61098c846108d7611641565b61098785604051806060016040528060288152602001613f2860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611641565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f49092919063ffffffff16565b611649565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a58906135e7565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b48906135e7565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611641565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611641565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b81612258565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612353565b9050919050565b610c97611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906135e7565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c906135e7565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600481526020017f54494e5500000000000000000000000000000000000000000000000000000000815250905090565b610fb4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611038906135e7565b60405180910390fd5b8060198190555050565b611053611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d7906135e7565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111661110f611641565b8484611814565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611181611641565b73ffffffffffffffffffffffffffffffffffffffff1614806111f75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111df611641565b73ffffffffffffffffffffffffffffffffffffffff16145b61120057600080fd5b600061120b30610c3e565b9050611216816123c1565b50565b611221611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a5906135e7565b60405180910390fd5b60005b8383905081101561134d5781600560008686858181106112d4576112d3613a7a565b5b90506020020160208101906112e99190612ebb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611345906139d3565b9150506112b1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c906135e7565b60405180910390fd5b8060188190555050565b611487611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157b90613547565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090613667565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090613567565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118079190613687565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187b90613627565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb906134c7565b60405180910390fd5b60008111611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e90613607565b60405180910390fd5b61193f610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ad575061197d610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357601660149054906101000a900460ff16611a3c576119ce610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a32906134e7565b60405180910390fd5b5b601754811115611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7890613527565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b255750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b90613587565b60405180910390fd5b6002600854611b7391906137bd565b4311158015611bcf5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c295750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6c5760185481611d2184610c3e565b611d2b91906137bd565b10611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613647565b60405180910390fd5b5b6000611d7730610c3e565b9050600060195482101590506017548210611d925760175491505b808015611dac5750601660159054906101000a900460ff16155b8015611e065750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c575060168054906101000a900460ff165b8015611e725750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ef057611ed6826123c1565b60004790506000811115611eee57611eed47612258565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f9a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205b57600090506121e2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121065750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e157600b54600d81905550600c54600e819055505b5b6121ee84848484612649565b50505050565b600083831115829061223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223391906134a5565b60405180910390fd5b506000838561224b919061389e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a860028461267690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232460028461267690919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234f573d6000803e3d6000fd5b5050565b600060065482111561239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239190613507565b60405180910390fd5b60006123a46126c0565b90506123b9818461267690919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f9576123f8613aa9565b5b6040519080825280602002602001820160405280156124275781602001602082028036833780820191505090505b509050308160008151811061243f5761243e613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e157600080fd5b505afa1580156124f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125199190612ee8565b8160018151811061252d5761252c613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611649565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f89594939291906136a2565b600060405180830381600087803b15801561261257600080fd5b505af1158015612626573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612657576126566126eb565b5b61266284848461272e565b806126705761266f6128f9565b5b50505050565b60006126b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290d565b905092915050565b60008060006126cd612970565b915091506126e4818361267690919063ffffffff16565b9250505090565b6000600d541480156126ff57506000600e54145b156127095761272c565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612740876129d2565b95509550955095509550955061279e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287f81612ae2565b6128898483612b9f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e69190613687565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294b91906134a5565b60405180910390fd5b50600083856129639190613813565b9050809150509392505050565b600080600060065490506000683635c9adc5dea0000090506129a6683635c9adc5dea0000060065461267690919063ffffffff16565b8210156129c557600654683635c9adc5dea000009350935050506129ce565b81819350935050505b9091565b60008060008060008060008060006129ef8a600d54600e54612bd9565b92509250925060006129ff6126c0565b90506000806000612a128e878787612c6f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f4565b905092915050565b6000808284612a9391906137bd565b905083811015612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf906135a7565b60405180910390fd5b8091505092915050565b6000612aec6126c0565b90506000612b038284612cf890919063ffffffff16565b9050612b5781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb482600654612a3a90919063ffffffff16565b600681905550612bcf81600754612a8490919063ffffffff16565b6007819055505050565b600080600080612c056064612bf7888a612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c2f6064612c21888b612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c5882612c4a858c612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c888589612cf890919063ffffffff16565b90506000612c9f8689612cf890919063ffffffff16565b90506000612cb68789612cf890919063ffffffff16565b90506000612cdf82612cd18587612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d0b5760009050612d6d565b60008284612d199190613844565b9050828482612d289190613813565b14612d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5f906135c7565b60405180910390fd5b809150505b92915050565b6000612d86612d818461373c565b613717565b90508083825260208201905082856020860282011115612da957612da8613ae2565b5b60005b85811015612dd95781612dbf8882612de3565b845260208401935060208301925050600181019050612dac565b5050509392505050565b600081359050612df281613ee2565b92915050565b600081519050612e0781613ee2565b92915050565b60008083601f840112612e2357612e22613add565b5b8235905067ffffffffffffffff811115612e4057612e3f613ad8565b5b602083019150836020820283011115612e5c57612e5b613ae2565b5b9250929050565b600082601f830112612e7857612e77613add565b5b8135612e88848260208601612d73565b91505092915050565b600081359050612ea081613ef9565b92915050565b600081359050612eb581613f10565b92915050565b600060208284031215612ed157612ed0613aec565b5b6000612edf84828501612de3565b91505092915050565b600060208284031215612efe57612efd613aec565b5b6000612f0c84828501612df8565b91505092915050565b60008060408385031215612f2c57612f2b613aec565b5b6000612f3a85828601612de3565b9250506020612f4b85828601612de3565b9150509250929050565b600080600060608486031215612f6e57612f6d613aec565b5b6000612f7c86828701612de3565b9350506020612f8d86828701612de3565b9250506040612f9e86828701612ea6565b9150509250925092565b60008060408385031215612fbf57612fbe613aec565b5b6000612fcd85828601612de3565b9250506020612fde85828601612ea6565b9150509250929050565b60008060006040848603121561300157613000613aec565b5b600084013567ffffffffffffffff81111561301f5761301e613ae7565b5b61302b86828701612e0d565b9350935050602061303e86828701612e91565b9150509250925092565b60006020828403121561305e5761305d613aec565b5b600082013567ffffffffffffffff81111561307c5761307b613ae7565b5b61308884828501612e63565b91505092915050565b6000602082840312156130a7576130a6613aec565b5b60006130b584828501612e91565b91505092915050565b6000602082840312156130d4576130d3613aec565b5b60006130e284828501612ea6565b91505092915050565b6000806000806080858703121561310557613104613aec565b5b600061311387828801612ea6565b945050602061312487828801612ea6565b935050604061313587828801612ea6565b925050606061314687828801612ea6565b91505092959194509250565b600061315e838361316a565b60208301905092915050565b613173816138d2565b82525050565b613182816138d2565b82525050565b600061319382613778565b61319d818561379b565b93506131a883613768565b8060005b838110156131d95781516131c08882613152565b97506131cb8361378e565b9250506001810190506131ac565b5085935050505092915050565b6131ef816138e4565b82525050565b6131fe81613927565b82525050565b61320d81613939565b82525050565b600061321e82613783565b61322881856137ac565b935061323881856020860161396f565b61324181613af1565b840191505092915050565b60006132596023836137ac565b915061326482613b02565b604082019050919050565b600061327c603f836137ac565b915061328782613b51565b604082019050919050565b600061329f602a836137ac565b91506132aa82613ba0565b604082019050919050565b60006132c2601c836137ac565b91506132cd82613bef565b602082019050919050565b60006132e56026836137ac565b91506132f082613c18565b604082019050919050565b60006133086022836137ac565b915061331382613c67565b604082019050919050565b600061332b6023836137ac565b915061333682613cb6565b604082019050919050565b600061334e601b836137ac565b915061335982613d05565b602082019050919050565b60006133716021836137ac565b915061337c82613d2e565b604082019050919050565b60006133946020836137ac565b915061339f82613d7d565b602082019050919050565b60006133b76029836137ac565b91506133c282613da6565b604082019050919050565b60006133da6025836137ac565b91506133e582613df5565b604082019050919050565b60006133fd6023836137ac565b915061340882613e44565b604082019050919050565b60006134206024836137ac565b915061342b82613e93565b604082019050919050565b61343f81613910565b82525050565b61344e8161391a565b82525050565b60006020820190506134696000830184613179565b92915050565b600060208201905061348460008301846131e6565b92915050565b600060208201905061349f60008301846131f5565b92915050565b600060208201905081810360008301526134bf8184613213565b905092915050565b600060208201905081810360008301526134e08161324c565b9050919050565b600060208201905081810360008301526135008161326f565b9050919050565b6000602082019050818103600083015261352081613292565b9050919050565b60006020820190508181036000830152613540816132b5565b9050919050565b60006020820190508181036000830152613560816132d8565b9050919050565b60006020820190508181036000830152613580816132fb565b9050919050565b600060208201905081810360008301526135a08161331e565b9050919050565b600060208201905081810360008301526135c081613341565b9050919050565b600060208201905081810360008301526135e081613364565b9050919050565b6000602082019050818103600083015261360081613387565b9050919050565b60006020820190508181036000830152613620816133aa565b9050919050565b60006020820190508181036000830152613640816133cd565b9050919050565b60006020820190508181036000830152613660816133f0565b9050919050565b6000602082019050818103600083015261368081613413565b9050919050565b600060208201905061369c6000830184613436565b92915050565b600060a0820190506136b76000830188613436565b6136c46020830187613204565b81810360408301526136d68186613188565b90506136e56060830185613179565b6136f26080830184613436565b9695505050505050565b60006020820190506137116000830184613445565b92915050565b6000613721613732565b905061372d82826139a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561375757613756613aa9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c882613910565b91506137d383613910565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380857613807613a1c565b5b828201905092915050565b600061381e82613910565b915061382983613910565b92508261383957613838613a4b565b5b828204905092915050565b600061384f82613910565b915061385a83613910565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561389357613892613a1c565b5b828202905092915050565b60006138a982613910565b91506138b483613910565b9250828210156138c7576138c6613a1c565b5b828203905092915050565b60006138dd826138f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139328261394b565b9050919050565b600061394482613910565b9050919050565b60006139568261395d565b9050919050565b6000613968826138f0565b9050919050565b60005b8381101561398d578082015181840152602081019050613972565b8381111561399c576000848401525b50505050565b6139ab82613af1565b810181811067ffffffffffffffff821117156139ca576139c9613aa9565b5b80604052505050565b60006139de82613910565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1157613a10613a1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eeb816138d2565b8114613ef657600080fd5b50565b613f02816138e4565b8114613f0d57600080fd5b50565b613f1981613910565b8114613f2457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220817b183be072e0aa0c1e0dafb0cb4814e737891e52bea05de5449c7d840c44e064736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,826 |
0xba9612bf1d9a76b5f8598a0e0dbaa796ebb4e706 | /**
*Submitted for verification at Etherscan.io on 2022-02-11
*/
/*
DogeUA Inu
https://t.me/DogeUA
https://twitter.com/DogeUA22
*/
// 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 DogeUA is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "DogeUA";
string private constant _symbol = "DogeUA";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 15;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 5;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x89A0095CD40De9B7117E76832EEf4ed58c71C1a6);
address payable private _marketingAddress = payable(0xe0c2aec5B5328B7419518173a76b26712e6035c9);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000000 * 10**9;
uint256 public _maxWalletSize = 25000000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 2%");
require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 14, "Buy tax must be between 0% and 14%");
require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 2%");
require(taxFeeOnSell >= 0 && taxFeeOnSell <= 14, "Sell tax must be between 0% and 14%");
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
if (maxTxAmount > 5000000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610522578063dd62ed3e14610542578063ea1644d514610588578063f2fde38b146105a857600080fd5b8063a2a957bb1461049d578063a9059cbb146104bd578063bfd79284146104dd578063c3c8cd801461050d57600080fd5b80638f70ccf7116100d15780638f70ccf7146104475780638f9a55c01461046757806395d89b41146101fe57806398a5c3151461047d57600080fd5b80637d1db4a5146103e65780637f2feddc146103fc5780638da5cb5b1461042957600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037c57806370a0823114610391578063715018a6146103b157806374010ece146103c657600080fd5b8063313ce5671461030057806349bd5a5e1461031c5780636b9990531461033c5780636d8aa8f81461035c57600080fd5b80631694505e116101ab5780631694505e1461026c57806318160ddd146102a457806323b872dd146102ca5780632fd689e3146102ea57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023c57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611aa7565b6105c8565b005b34801561020a57600080fd5b506040805180820182526006815265446f6765554160d01b602082015290516102339190611b6c565b60405180910390f35b34801561024857600080fd5b5061025c610257366004611bc1565b610667565b6040519015158152602001610233565b34801561027857600080fd5b5060145461028c906001600160a01b031681565b6040516001600160a01b039091168152602001610233565b3480156102b057600080fd5b50683635c9adc5dea000005b604051908152602001610233565b3480156102d657600080fd5b5061025c6102e5366004611bed565b61067e565b3480156102f657600080fd5b506102bc60185481565b34801561030c57600080fd5b5060405160098152602001610233565b34801561032857600080fd5b5060155461028c906001600160a01b031681565b34801561034857600080fd5b506101fc610357366004611c2e565b6106e7565b34801561036857600080fd5b506101fc610377366004611c5b565b610732565b34801561038857600080fd5b506101fc61077a565b34801561039d57600080fd5b506102bc6103ac366004611c2e565b6107c5565b3480156103bd57600080fd5b506101fc6107e7565b3480156103d257600080fd5b506101fc6103e1366004611c76565b61085b565b3480156103f257600080fd5b506102bc60165481565b34801561040857600080fd5b506102bc610417366004611c2e565b60116020526000908152604090205481565b34801561043557600080fd5b506000546001600160a01b031661028c565b34801561045357600080fd5b506101fc610462366004611c5b565b61089a565b34801561047357600080fd5b506102bc60175481565b34801561048957600080fd5b506101fc610498366004611c76565b6108e2565b3480156104a957600080fd5b506101fc6104b8366004611c8f565b610911565b3480156104c957600080fd5b5061025c6104d8366004611bc1565b610ac7565b3480156104e957600080fd5b5061025c6104f8366004611c2e565b60106020526000908152604090205460ff1681565b34801561051957600080fd5b506101fc610ad4565b34801561052e57600080fd5b506101fc61053d366004611cc1565b610b28565b34801561054e57600080fd5b506102bc61055d366004611d45565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059457600080fd5b506101fc6105a3366004611c76565b610bc9565b3480156105b457600080fd5b506101fc6105c3366004611c2e565b610bf8565b6000546001600160a01b031633146105fb5760405162461bcd60e51b81526004016105f290611d7e565b60405180910390fd5b60005b81518110156106635760016010600084848151811061061f5761061f611db3565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065b81611ddf565b9150506105fe565b5050565b6000610674338484610ce2565b5060015b92915050565b600061068b848484610e06565b6106dd84336106d885604051806060016040528060288152602001611ef9602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611342565b610ce2565b5060019392505050565b6000546001600160a01b031633146107115760405162461bcd60e51b81526004016105f290611d7e565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075c5760405162461bcd60e51b81526004016105f290611d7e565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107af57506013546001600160a01b0316336001600160a01b0316145b6107b857600080fd5b476107c28161137c565b50565b6001600160a01b038116600090815260026020526040812054610678906113b6565b6000546001600160a01b031633146108115760405162461bcd60e51b81526004016105f290611d7e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108855760405162461bcd60e51b81526004016105f290611d7e565b674563918244f400008111156107c257601655565b6000546001600160a01b031633146108c45760405162461bcd60e51b81526004016105f290611d7e565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461090c5760405162461bcd60e51b81526004016105f290611d7e565b601855565b6000546001600160a01b0316331461093b5760405162461bcd60e51b81526004016105f290611d7e565b600484111561099a5760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420322560d81b60648201526084016105f2565b600e8211156109f65760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642031604482015261342560f01b60648201526084016105f2565b6004831115610a565760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420322560d01b60648201526084016105f2565b600e811115610ab35760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526231342560e81b60648201526084016105f2565b600893909355600a91909155600955600b55565b6000610674338484610e06565b6012546001600160a01b0316336001600160a01b03161480610b0957506013546001600160a01b0316336001600160a01b0316145b610b1257600080fd5b6000610b1d306107c5565b90506107c28161143a565b6000546001600160a01b03163314610b525760405162461bcd60e51b81526004016105f290611d7e565b60005b82811015610bc3578160056000868685818110610b7457610b74611db3565b9050602002016020810190610b899190611c2e565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bbb81611ddf565b915050610b55565b50505050565b6000546001600160a01b03163314610bf35760405162461bcd60e51b81526004016105f290611d7e565b601755565b6000546001600160a01b03163314610c225760405162461bcd60e51b81526004016105f290611d7e565b6001600160a01b038116610c875760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f2565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d445760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f2565b6001600160a01b038216610da55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f2565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e6a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f2565b6001600160a01b038216610ecc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f2565b60008111610f2e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f2565b6000546001600160a01b03848116911614801590610f5a57506000546001600160a01b03838116911614155b1561123b57601554600160a01b900460ff16610ff3576000546001600160a01b03848116911614610ff35760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f2565b6016548111156110455760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f2565b6001600160a01b03831660009081526010602052604090205460ff1615801561108757506001600160a01b03821660009081526010602052604090205460ff16155b6110df5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f2565b6015546001600160a01b038381169116146111645760175481611101846107c5565b61110b9190611dfa565b106111645760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f2565b600061116f306107c5565b6018546016549192508210159082106111885760165491505b80801561119f5750601554600160a81b900460ff16155b80156111b957506015546001600160a01b03868116911614155b80156111ce5750601554600160b01b900460ff165b80156111f357506001600160a01b03851660009081526005602052604090205460ff16155b801561121857506001600160a01b03841660009081526005602052604090205460ff16155b15611238576112268261143a565b478015611236576112364761137c565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061127d57506001600160a01b03831660009081526005602052604090205460ff165b806112af57506015546001600160a01b038581169116148015906112af57506015546001600160a01b03848116911614155b156112bc57506000611336565b6015546001600160a01b0385811691161480156112e757506014546001600160a01b03848116911614155b156112f957600854600c55600954600d555b6015546001600160a01b03848116911614801561132457506014546001600160a01b03858116911614155b1561133657600a54600c55600b54600d555b610bc3848484846115b4565b600081848411156113665760405162461bcd60e51b81526004016105f29190611b6c565b5060006113738486611e12565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610663573d6000803e3d6000fd5b600060065482111561141d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f2565b60006114276115e2565b90506114338382611605565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061148257611482611db3565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ff9190611e29565b8160018151811061151257611512611db3565b6001600160a01b0392831660209182029290920101526014546115389130911684610ce2565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611571908590600090869030904290600401611e46565b600060405180830381600087803b15801561158b57600080fd5b505af115801561159f573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806115c1576115c1611647565b6115cc848484611675565b80610bc357610bc3600e54600c55600f54600d55565b60008060006115ef61176c565b90925090506115fe8282611605565b9250505090565b600061143383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117ae565b600c541580156116575750600d54155b1561165e57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611687876117dc565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116b99087611839565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116e8908661187b565b6001600160a01b03891660009081526002602052604090205561170a816118da565b6117148483611924565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161175991815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006117888282611605565b8210156117a557505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836117cf5760405162461bcd60e51b81526004016105f29190611b6c565b5060006113738486611eb7565b60008060008060008060008060006117f98a600c54600d54611948565b92509250925060006118096115e2565b9050600080600061181c8e87878761199d565b919e509c509a509598509396509194505050505091939550919395565b600061143383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611342565b6000806118888385611dfa565b9050838110156114335760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f2565b60006118e46115e2565b905060006118f283836119ed565b3060009081526002602052604090205490915061190f908261187b565b30600090815260026020526040902055505050565b6006546119319083611839565b600655600754611941908261187b565b6007555050565b6000808080611962606461195c89896119ed565b90611605565b90506000611975606461195c8a896119ed565b9050600061198d826119878b86611839565b90611839565b9992985090965090945050505050565b60008080806119ac88866119ed565b905060006119ba88876119ed565b905060006119c888886119ed565b905060006119da826119878686611839565b939b939a50919850919650505050505050565b6000826119fc57506000610678565b6000611a088385611ed9565b905082611a158583611eb7565b146114335760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f2565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c257600080fd5b8035611aa281611a82565b919050565b60006020808385031215611aba57600080fd5b823567ffffffffffffffff80821115611ad257600080fd5b818501915085601f830112611ae657600080fd5b813581811115611af857611af8611a6c565b8060051b604051601f19603f83011681018181108582111715611b1d57611b1d611a6c565b604052918252848201925083810185019188831115611b3b57600080fd5b938501935b82851015611b6057611b5185611a97565b84529385019392850192611b40565b98975050505050505050565b600060208083528351808285015260005b81811015611b9957858101830151858201604001528201611b7d565b81811115611bab576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611bd457600080fd5b8235611bdf81611a82565b946020939093013593505050565b600080600060608486031215611c0257600080fd5b8335611c0d81611a82565b92506020840135611c1d81611a82565b929592945050506040919091013590565b600060208284031215611c4057600080fd5b813561143381611a82565b80358015158114611aa257600080fd5b600060208284031215611c6d57600080fd5b61143382611c4b565b600060208284031215611c8857600080fd5b5035919050565b60008060008060808587031215611ca557600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611cd657600080fd5b833567ffffffffffffffff80821115611cee57600080fd5b818601915086601f830112611d0257600080fd5b813581811115611d1157600080fd5b8760208260051b8501011115611d2657600080fd5b602092830195509350611d3c9186019050611c4b565b90509250925092565b60008060408385031215611d5857600080fd5b8235611d6381611a82565b91506020830135611d7381611a82565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611df357611df3611dc9565b5060010190565b60008219821115611e0d57611e0d611dc9565b500190565b600082821015611e2457611e24611dc9565b500390565b600060208284031215611e3b57600080fd5b815161143381611a82565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e965784516001600160a01b031683529383019391830191600101611e71565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611ed457634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ef357611ef3611dc9565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122001cb4b3fe5daa029d22369d31168fbc9a1e745023f8eaa26cff27a5d2984e9dd64736f6c634300080c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 1,827 |
0x53382dbf8877b894459b5af7348a51c038d8cea3 | pragma solidity ^0.4.15;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <stefan.george@consensys.net>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
/*
* Constants
*/
uint constant public MAX_OWNER_COUNT = 50;
/*
* Storage
*/
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
/*
* Modifiers
*/
modifier onlyWallet() {
require(msg.sender == address(this));
_;
}
modifier ownerDoesNotExist(address owner) {
require(!isOwner[owner]);
_;
}
modifier ownerExists(address owner) {
require(isOwner[owner]);
_;
}
modifier transactionExists(uint transactionId) {
require(transactions[transactionId].destination != 0);
_;
}
modifier confirmed(uint transactionId, address owner) {
require(confirmations[transactionId][owner]);
_;
}
modifier notConfirmed(uint transactionId, address owner) {
require(!confirmations[transactionId][owner]);
_;
}
modifier notExecuted(uint transactionId) {
require(!transactions[transactionId].executed);
_;
}
modifier notNull(address _address) {
require(_address != 0);
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
require(ownerCount <= MAX_OWNER_COUNT
&& _required <= ownerCount
&& _required != 0
&& ownerCount != 0);
_;
}
/// @dev Fallback function allows to deposit ether.
function()
payable
{
if (msg.value > 0)
Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
function MultiSigWallet(address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
require(!isOwner[_owners[i]] && _owners[i] != 0);
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param newOwner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction storage txn = transactions[transactionId];
txn.executed = true;
if (external_call(txn.destination, txn.value, txn.data.length, txn.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txn.executed = false;
}
}
}
// call has been separated into its own function in order to take advantage
// of the Solidity's code generator to produce a loop that copies tx.data into memory.
function external_call(address destination, uint value, uint dataLength, bytes data) private returns (bool) {
bool result;
assembly {
let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention)
let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that
result := call(
sub(gas, 34710), // 34710 is the value that solidity is currently emitting
// It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +
// callNewAccountGas (25000, in case the destination address does not exist and needs creating)
destination,
value,
d,
dataLength, // Size of the input (in bytes) - this is what fixes the padding problem
x,
0 // Output is ignored, therefore the output size is zero
)
}
return result;
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
} | 0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101e457806320ea8d86146102275780632f54bf6e146102545780633411c81c146102af57806354741525146103145780637065cb4814610363578063784547a7146103a65780638b51d13f146103eb5780639ace38c21461042c578063a0e67e2b14610517578063a8abe69a14610583578063b5dc40c314610627578063b77bf600146106a9578063ba51a6df146106d4578063c01a8c8414610701578063c64274741461072e578063d74f8edd146107d5578063dc8452cd14610800578063e20056e61461082b578063ee22610b1461088e575b6000341115610175573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34801561018357600080fd5b506101a2600480360381019080803590602001909291905050506108bb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101f057600080fd5b50610225600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108f9565b005b34801561023357600080fd5b5061025260048036038101908080359060200190929190505050610b92565b005b34801561026057600080fd5b50610295600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d3a565b604051808215151515815260200191505060405180910390f35b3480156102bb57600080fd5b506102fa60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d5a565b604051808215151515815260200191505060405180910390f35b34801561032057600080fd5b5061034d600480360381019080803515159060200190929190803515159060200190929190505050610d89565b6040518082815260200191505060405180910390f35b34801561036f57600080fd5b506103a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e1b565b005b3480156103b257600080fd5b506103d160048036038101908080359060200190929190505050611020565b604051808215151515815260200191505060405180910390f35b3480156103f757600080fd5b5061041660048036038101908080359060200190929190505050611105565b6040518082815260200191505060405180910390f35b34801561043857600080fd5b50610457600480360381019080803590602001909291905050506111d0565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b838110156104d95780820151818401526020810190506104be565b50505050905090810190601f1680156105065780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561052357600080fd5b5061052c6112c5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561056f578082015181840152602081019050610554565b505050509050019250505060405180910390f35b34801561058f57600080fd5b506105d06004803603810190808035906020019092919080359060200190929190803515159060200190929190803515159060200190929190505050611353565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106135780820151818401526020810190506105f8565b505050509050019250505060405180910390f35b34801561063357600080fd5b50610652600480360381019080803590602001909291905050506114c4565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561069557808201518184015260208101905061067a565b505050509050019250505060405180910390f35b3480156106b557600080fd5b506106be611701565b6040518082815260200191505060405180910390f35b3480156106e057600080fd5b506106ff60048036038101908080359060200190929190505050611707565b005b34801561070d57600080fd5b5061072c600480360381019080803590602001909291905050506117c1565b005b34801561073a57600080fd5b506107bf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061199e565b6040518082815260200191505060405180910390f35b3480156107e157600080fd5b506107ea6119bd565b6040518082815260200191505060405180910390f35b34801561080c57600080fd5b506108156119c2565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b5061088c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119c8565b005b34801561089a57600080fd5b506108b960048036038101908080359060200190929190505050611cdd565b005b6003818154811015156108ca57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561093557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561098e57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b13578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a2157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b06576003600160038054905003815481101515610a7f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610ab957fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b13565b81806001019250506109eb565b6001600381818054905003915081610b2b91906120fe565b506003805490506004541115610b4a57610b49600380549050611707565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610beb57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c5657600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610c8657600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610e1457838015610dc8575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610dfb5750828015610dfa575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610e07576001820191505b8080600101915050610d91565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5557600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610eaf57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610ed657600080fd5b60016003805490500160045460328211158015610ef35750818111155b8015610f00575060008114155b8015610f0d575060008214155b1515610f1857600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156110fd5760016000858152602001908152602001600020600060038381548110151561105e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156110dd576001820191505b6004548214156110f057600192506110fe565b808060010191505061102d565b5b5050919050565b600080600090505b6003805490508110156111ca5760016000848152602001908152602001600020600060038381548110151561113e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111bd576001820191505b808060010191505061110d565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112a85780601f1061127d576101008083540402835291602001916112a8565b820191906000526020600020905b81548152906001019060200180831161128b57829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b6060600380548060200260200160405190810160405280929190818152602001828054801561134957602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116112ff575b5050505050905090565b60608060008060055460405190808252806020026020018201604052801561138a5781602001602082028038833980820191505090505b50925060009150600090505b600554811015611436578580156113cd575060008082815260200190815260200160002060030160009054906101000a900460ff16155b8061140057508480156113ff575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b156114295780838381518110151561141457fe5b90602001906020020181815250506001820191505b8080600101915050611396565b8787036040519080825280602002602001820160405280156114675781602001602082028038833980820191505090505b5093508790505b868110156114b957828181518110151561148457fe5b906020019060200201518489830381518110151561149e57fe5b9060200190602002018181525050808060010191505061146e565b505050949350505050565b6060806000806003805490506040519080825280602002602001820160405280156114fe5781602001602082028038833980820191505090505b50925060009150600090505b60038054905081101561164b5760016000868152602001908152602001600020600060038381548110151561153b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561163e576003818154811015156115c257fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156115fb57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b808060010191505061150a565b8160405190808252806020026020018201604052801561167a5781602001602082028038833980820191505090505b509350600090505b818110156116f957828181518110151561169857fe5b9060200190602002015184828151811015156116b057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611682565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561174157600080fd5b60038054905081603282111580156117595750818111155b8015611766575060008114155b8015611773575060008214155b151561177e57600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561181a57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561187657600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118e257600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361199785611cdd565b5050505050565b60006119ab848484611f85565b90506119b6816117c1565b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a0457600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611a5d57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611ab757600080fd5b600092505b600380549050831015611ba0578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611aef57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611b935783600384815481101515611b4657fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611ba0565b8280600101935050611abc565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611d3857600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611da357600080fd5b8460008082815260200190815260200160002060030160009054906101000a900460ff16151515611dd357600080fd5b611ddc86611020565b15611f7d57600080878152602001908152602001600020945060018560030160006101000a81548160ff021916908315150217905550611efa8560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866001015487600201805460018160011615610100020316600290049050886002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611ef05780601f10611ec557610100808354040283529160200191611ef0565b820191906000526020600020905b815481529060010190602001808311611ed357829003601f168201915b50505050506120d7565b15611f3157857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611f7c565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008560030160006101000a81548160ff0219169083151502179055505b5b505050505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611fae57600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061206d92919061212a565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b6000806040516020840160008287838a8c6187965a03f19250505080915050949350505050565b8154818355818111156121255781836000526020600020918201910161212491906121aa565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061216b57805160ff1916838001178555612199565b82800160010185558215612199579182015b8281111561219857825182559160200191906001019061217d565b5b5090506121a691906121aa565b5090565b6121cc91905b808211156121c85760008160009055506001016121b0565b5090565b905600a165627a7a72305820ca160386de6f0991fad179eda49baa42ef15de518a8efd43416e0201bb5176820029 | {"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 1,828 |
0x8db14c8839ee82609045fb55176c4142f54a6c47 | pragma solidity ^0.4.16;
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
}
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public;
}
contract Pausable is owned {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev modifier to allow actions only when the contract IS NOT paused
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused {
paused = false;
Unpause();
}
}
contract TokenERC20 is Pausable {
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;
// total no of tokens for sale
uint256 public TokenForSale;
// 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);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function TokenERC20(
uint256 initialSupply,
string tokenName,
string tokenSymbol,
uint256 TokenSale
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
TokenForSale = TokenSale * 10 ** uint256(decimals);
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] = balanceOf[_from].sub(_value);
// Add the same to the recipient
balanceOf[_to] = balanceOf[_to].add(_value);
Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] = 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 in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
}
contract Sale is owned, TokenERC20 {
// total token which is sold
uint256 public soldTokens;
modifier CheckSaleStatus() {
require (TokenForSale >= soldTokens);
_;
}
}
contract Zigit is TokenERC20, Sale {
using SafeMath for uint256;
uint256 public unitsOneEthCanBuy;
uint256 public minPurchaseQty;
mapping (address => bool) public airdrops;
/* Initializes contract with initial supply tokens to the creator of the contract */
function Zigit()
TokenERC20(1000000000, 'Zigit', 'ZGT', 1000000000) public {
unitsOneEthCanBuy = 80000;
soldTokens = 0;
minPurchaseQty = 16000 * 10 ** uint256(decimals);
}
function changeOwnerWithTokens(address newOwner) onlyOwner public {
uint previousBalances = balanceOf[owner] + balanceOf[newOwner];
balanceOf[newOwner] += balanceOf[owner];
balanceOf[owner] = 0;
assert(balanceOf[owner] + balanceOf[newOwner] == previousBalances);
owner = newOwner;
}
function changePrice(uint256 _newAmount) onlyOwner public {
unitsOneEthCanBuy = _newAmount;
}
function startSale() onlyOwner public {
soldTokens = 0;
}
function increaseSaleLimit(uint256 TokenSale) onlyOwner public {
TokenForSale = TokenSale * 10 ** uint256(decimals);
}
function increaseMinPurchaseQty(uint256 newQty) onlyOwner public {
minPurchaseQty = newQty * 10 ** uint256(decimals);
}
function airDrop(address[] _recipient, uint _totalTokensToDistribute) onlyOwner public {
uint256 total_token_to_transfer = (_totalTokensToDistribute * 10 ** uint256(decimals)).mul(_recipient.length);
require(balanceOf[owner] >= total_token_to_transfer);
for(uint256 i = 0; i< _recipient.length; i++)
{
if (!airdrops[_recipient[i]]) {
airdrops[_recipient[i]] = true;
_transfer(owner, _recipient[i], _totalTokensToDistribute * 10 ** uint256(decimals));
}
}
}
function() public payable whenNotPaused CheckSaleStatus {
uint256 eth_amount = msg.value;
uint256 amount = eth_amount.mul(unitsOneEthCanBuy);
soldTokens = soldTokens.add(amount);
require(amount >= minPurchaseQty );
require(balanceOf[owner] >= amount );
_transfer(owner, msg.sender, amount);
//Transfer ether to fundsWallet
owner.transfer(msg.value);
}
} | 0x606060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146102cc578063095ea7b31461035a57806318160ddd146103b457806323b872dd146103dd5780632ebeee0f14610456578063313ce567146104795780633a9588ba146104a85780633f4ba83a146104e15780634f0f97ab146104f65780635c975abb1461051f5780635ed9ebfc1461054c57806365f2bc2e1461057557806370a082311461059e5780638456cb59146105eb5780638c86f0a7146106005780638da5cb5b1461065157806395d89b41146106a6578063a2b40d1914610734578063a9059cbb14610757578063b66a0e5d14610799578063c030f3e2146107ae578063cae9ca51146107d1578063dd62ed3e1461086e578063ee2b78a1146108da578063f2fde38b14610903578063fd1fc4a01461093c575b600080600060149054906101000a900460ff1615151561017357600080fd5b6008546005541015151561018657600080fd5b34915061019e6009548361099f90919063ffffffff16565b90506101b5816008546109d290919063ffffffff16565b600881905550600a5481101515156101cc57600080fd5b80600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561023b57600080fd5b6102676000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633836109f0565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015156102c857600080fd5b5050005b34156102d757600080fd5b6102df610d96565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561031f578082015181840152602081019050610304565b50505050905090810190601f16801561034c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561036557600080fd5b61039a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e34565b604051808215151515815260200191505060405180910390f35b34156103bf57600080fd5b6103c7610ec1565b6040518082815260200191505060405180910390f35b34156103e857600080fd5b61043c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ec7565b604051808215151515815260200191505060405180910390f35b341561046157600080fd5b6104776004808035906020019091905050611079565b005b341561048457600080fd5b61048c6110f5565b604051808260ff1660ff16815260200191505060405180910390f35b34156104b357600080fd5b6104df600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611108565b005b34156104ec57600080fd5b6104f461140c565b005b341561050157600080fd5b6105096114ca565b6040518082815260200191505060405180910390f35b341561052a57600080fd5b6105326114d0565b604051808215151515815260200191505060405180910390f35b341561055757600080fd5b61055f6114e3565b6040518082815260200191505060405180910390f35b341561058057600080fd5b6105886114e9565b6040518082815260200191505060405180910390f35b34156105a957600080fd5b6105d5600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506114ef565b6040518082815260200191505060405180910390f35b34156105f657600080fd5b6105fe611507565b005b341561060b57600080fd5b610637600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506115c7565b604051808215151515815260200191505060405180910390f35b341561065c57600080fd5b6106646115e7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106b157600080fd5b6106b961160c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106f95780820151818401526020810190506106de565b50505050905090810190601f1680156107265780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561073f57600080fd5b61075560048080359060200190919050506116aa565b005b341561076257600080fd5b610797600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061170f565b005b34156107a457600080fd5b6107ac61171e565b005b34156107b957600080fd5b6107cf6004808035906020019091905050611783565b005b34156107dc57600080fd5b610854600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506117ff565b604051808215151515815260200191505060405180910390f35b341561087957600080fd5b6108c4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611979565b6040518082815260200191505060405180910390f35b34156108e557600080fd5b6108ed61199e565b6040518082815260200191505060405180910390f35b341561090e57600080fd5b61093a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506119a4565b005b341561094757600080fd5b61099d600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019091905050611a42565b005b600080828402905060008414806109c057508284828115156109bd57fe5b04145b15156109c857fe5b8091505092915050565b60008082840190508381101515156109e657fe5b8091505092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1614151515610a1757600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610a6557600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401111515610af357600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054019050610bc882600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9190919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c5d82600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546109d290919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a380600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401141515610d9057fe5b50505050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e2c5780601f10610e0157610100808354040283529160200191610e2c565b820191906000526020600020905b815481529060010190602001808311610e0f57829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60045481565b6000600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610f5457600080fd5b610fe382600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9190919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061106e8484846109f0565b600190509392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110d457600080fd5b600360009054906101000a900460ff1660ff16600a0a8102600a8190555050565b600360009054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561116557600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054019050600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011415156113c857fe5b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561146757600080fd5b600060149054906101000a900460ff16151561148257600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60055481565b600060149054906101000a900460ff1681565b60085481565b60095481565b60066020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561156257600080fd5b600060149054906101000a900460ff1615151561157e57600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600b6020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116a25780601f10611677576101008083540402835291602001916116a2565b820191906000526020600020905b81548152906001019060200180831161168557829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561170557600080fd5b8060098190555050565b61171a3383836109f0565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561177957600080fd5b6000600881905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117de57600080fd5b600360009054906101000a900460ff1660ff16600a0a810260058190555050565b60008084905061180f8585610e34565b15611970578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156119095780820151818401526020810190506118ee565b50505050905090810190601f1680156119365780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b151561195757600080fd5b5af1151561196457600080fd5b50505060019150611971565b5b509392505050565b6007602052816000526040600020602052806000526040600020600091509150505481565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119ff57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611aa057600080fd5b611acb8451600360009054906101000a900460ff1660ff16600a0a850261099f90919063ffffffff16565b915081600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611b3c57600080fd5b600090505b8351811015611c8b57600b60008583815181101515611b5c57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611c7e576001600b60008684815181101515611bc857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611c7d6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff168583815181101515611c5657fe5b90602001906020020151600360009054906101000a900460ff1660ff16600a0a86026109f0565b5b8080600101915050611b41565b50505050565b6000828211151515611c9f57fe5b8183039050929150505600a165627a7a723058201f0242ba96a768f0fb4085ca870639fc6aea61fa45c60773b8cc747af7a5ecaa0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 1,829 |
0xfc471d8d42a942435e0fa4addac4a60e20074dad | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
}
interface IyVault {
function token() external view returns (address);
function deposit() external returns (uint);
function deposit(uint) external returns (uint);
function deposit(uint, address) external returns (uint);
function withdraw() external returns (uint);
function withdraw(uint) external returns (uint);
function withdraw(uint, address) external returns (uint);
function withdraw(uint, address, uint) external returns (uint);
function permit(address, address, uint, uint, bytes32) external view returns (bool);
function pricePerShare() external view returns (uint);
function apiVersion() external view returns (string memory);
function totalAssets() external view returns (uint);
function maxAvailableShares() external view returns (uint);
function debtOutstanding() external view returns (uint);
function debtOutstanding(address strategy) external view returns (uint);
function creditAvailable() external view returns (uint);
function creditAvailable(address strategy) external view returns (uint);
function availableDepositLimit() external view returns (uint);
function expectedReturn() external view returns (uint);
function expectedReturn(address strategy) external view returns (uint);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function totalSupply() external view returns (uint);
function governance() external view returns (address);
function management() external view returns (address);
function guardian() external view returns (address);
function guestList() external view returns (address);
function strategies(address) external view returns (uint, uint, uint, uint, uint, uint, uint, uint);
function withdrawalQueue(uint) external view returns (address);
function emergencyShutdown() external view returns (bool);
function depositLimit() external view returns (uint);
function debtRatio() external view returns (uint);
function totalDebt() external view returns (uint);
function lastReport() external view returns (uint);
function activation() external view returns (uint);
function rewards() external view returns (address);
function managementFee() external view returns (uint);
function performanceFee() external view returns (uint);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
library SafeERC20 {
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract yAffiliateTokenV2 {
using SafeERC20 for IERC20;
/// @notice EIP-20 token name for this token
string public name;
/// @notice EIP-20 token symbol for this token
string public symbol;
/// @notice EIP-20 token decimals for this token
uint256 public decimals;
/// @notice Total number of tokens in circulation
uint public totalSupply = 0;
mapping(address => mapping (address => uint)) internal allowances;
mapping(address => uint) internal balances;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint chainId,address verifyingContract)");
bytes32 public immutable DOMAINSEPARATOR;
/// @notice The EIP-712 typehash for the permit struct used by the contract
bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint value,uint nonce,uint deadline)");
/// @notice A record of states for signing / validating signatures
mapping (address => uint) public nonces;
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint amount);
function _mint(address dst, uint amount) internal {
// mint the amount
totalSupply += amount;
// transfer the amount to the recipient
balances[dst] += amount;
emit Transfer(address(0), dst, amount);
}
function _burn(address dst, uint amount) internal {
// burn the amount
totalSupply -= amount;
// transfer the amount from the recipient
balances[dst] -= amount;
emit Transfer(dst, address(0), amount);
}
address public affiliate;
address public governance;
address public pendingGovernance;
address public immutable token;
address public immutable vault;
constructor(address _governance, string memory _moniker, address _affiliate, address _token, address _vault) {
DOMAINSEPARATOR = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), _getChainId(), address(this)));
affiliate = _affiliate;
governance = _governance;
token = _token;
vault = _vault;
name = string(abi.encodePacked(_moniker, "-yearn ", IERC20(_token).name()));
symbol = string(abi.encodePacked(_moniker, "-yv", IERC20(_token).symbol()));
decimals = IERC20(_token).decimals();
IERC20(_token).approve(_vault, type(uint).max);
}
function resetApproval() external {
IERC20(token).approve(vault, 0);
IERC20(token).approve(vault, type(uint).max);
}
function pricePerShare() external view returns (uint) {
return IyVault(vault).pricePerShare();
}
function apiVersion() external view returns (string memory) {
return IyVault(vault).apiVersion();
}
function totalAssets() external view returns (uint) {
return IyVault(vault).totalAssets();
}
function maxAvailableShares() external view returns (uint) {
return IyVault(vault).maxAvailableShares();
}
function debtOutstanding() external view returns (uint) {
return IyVault(vault).debtOutstanding();
}
function debtOutstanding(address strategy) external view returns (uint) {
return IyVault(vault).debtOutstanding(strategy);
}
function creditAvailable() external view returns (uint) {
return IyVault(vault).creditAvailable();
}
function creditAvailable(address strategy) external view returns (uint) {
return IyVault(vault).creditAvailable(strategy);
}
function availableDepositLimit() external view returns (uint) {
return IyVault(vault).availableDepositLimit();
}
function expectedReturn() external view returns (uint) {
return IyVault(vault).expectedReturn();
}
function expectedReturn(address strategy) external view returns (uint) {
return IyVault(vault).expectedReturn(strategy);
}
function vname() external view returns (string memory) {
return IyVault(vault).name();
}
function vsymbol() external view returns (string memory) {
return IyVault(vault).symbol();
}
function vdecimals() external view returns (uint) {
return IyVault(vault).decimals();
}
function vbalanceOf(address owner) external view returns (uint) {
return IyVault(vault).balanceOf(owner);
}
function vtotalSupply() external view returns (uint) {
return IyVault(vault).totalSupply();
}
function vgovernance() external view returns (address) {
return IyVault(vault).governance();
}
function management() external view returns (address) {
return IyVault(vault).management();
}
function guardian() external view returns (address) {
return IyVault(vault).guardian();
}
function guestList() external view returns (address) {
return IyVault(vault).guestList();
}
function strategies(address strategy) external view returns (
uint, uint, uint, uint, uint, uint, uint, uint) {
return IyVault(vault).strategies(strategy);
}
function withdrawalQueue(uint position) external view returns (address) {
return IyVault(vault).withdrawalQueue(position);
}
function emergencyShutdown() external view returns (bool) {
return IyVault(vault).emergencyShutdown();
}
function depositLimit() external view returns (uint) {
return IyVault(vault).depositLimit();
}
function debtRatio() external view returns (uint) {
return IyVault(vault).debtRatio();
}
function totalDebt() external view returns (uint) {
return IyVault(vault).totalDebt();
}
function lastReport() external view returns (uint) {
return IyVault(vault).lastReport();
}
function activation() external view returns (uint) {
return IyVault(vault).activation();
}
function rewards() external view returns (address) {
return IyVault(vault).rewards();
}
function managementFee() external view returns (uint) {
return IyVault(vault).managementFee();
}
function performanceFee() external view returns (uint) {
return IyVault(vault).performanceFee();
}
function setGovernance(address _gov) external {
require(msg.sender == governance);
pendingGovernance = _gov;
}
function acceptGovernance() external {
require(msg.sender == pendingGovernance);
governance = pendingGovernance;
}
function currentContribution() external view returns (uint) {
return 1e18 * IERC20(vault).balanceOf(address(this)) / IERC20(vault).totalSupply();
}
function setAffiliate(address _affiliate) external {
require(msg.sender == governance || msg.sender == affiliate);
affiliate = _affiliate;
}
function deposit() external returns (uint) {
return _deposit(IERC20(token).balanceOf(msg.sender), msg.sender);
}
function deposit(uint amount) external returns (uint) {
return _deposit(amount, msg.sender);
}
function deposit(uint amount, address recipient) external returns (uint) {
return _deposit(amount, recipient);
}
function _deposit(uint amount, address recipient) internal returns (uint) {
IERC20(token).safeTransferFrom(msg.sender, address(this), amount);
uint _shares = IyVault(vault).deposit(amount, address(this));
_mint(recipient, _shares);
return _shares;
}
function withdraw() external returns (uint) {
return _withdraw(balances[msg.sender], msg.sender, 1);
}
function withdraw(uint amount) external returns (uint) {
return _withdraw(amount, msg.sender, 1);
}
function withdraw(uint amount, address recipient) external returns (uint) {
return _withdraw(amount, recipient, 1);
}
function withdraw(uint amount, address recipient, uint maxLoss) external returns (uint) {
return _withdraw(amount, recipient, maxLoss);
}
function _withdraw(uint amount, address recipient, uint maxLoss) internal returns (uint) {
_burn(msg.sender, amount);
return IyVault(vault).withdraw(amount, recipient, maxLoss);
}
/**
* @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 amount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint amount) external returns (bool) {
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 amount The number of tokens that are approved (2^256-1 means infinite)
* @param deadline The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function permit(address owner, address spender, uint amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, amount, nonces[owner]++, deadline));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", DOMAINSEPARATOR, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "permit: signature");
require(signatory == owner, "permit: unauthorized");
require(block.timestamp <= deadline, "permit: 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 amount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint amount) external returns (bool) {
_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 amount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint amount) external returns (bool) {
address spender = msg.sender;
uint spenderAllowance = allowances[src][spender];
if (spender != src && spenderAllowance != type(uint).max) {
uint newAllowance = spenderAllowance - amount;
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
function _transferTokens(address src, address dst, uint amount) internal {
balances[src] -= amount;
balances[dst] += amount;
emit Transfer(src, dst, amount);
}
function _getChainId() internal view returns (uint) {
uint chainId;
assembly { chainId := chainid() }
return chainId;
}
}
interface IyRegistry {
function latestVault(address) external view returns (address);
}
contract yAffiliateFactoryV2 {
using SafeERC20 for IERC20;
address public governance;
address public pendingGovernance;
IyRegistry constant public registry = IyRegistry(0xE15461B18EE31b7379019Dc523231C57d1Cbc18c);
address[] public _yAffiliateTokens;
mapping(address => mapping(address => address[])) affiliateVaults;
mapping(address => address[]) vaultTokens;
function yAffiliateTokens() external view returns (address[] memory) {
return _yAffiliateTokens;
}
function yvault(address token) external view returns (address) {
return registry.latestVault(token);
}
constructor() {
governance = msg.sender;
}
function lookupAffiliateTokens(address vault) external view returns (address[] memory) {
return vaultTokens[vault];
}
function lookupAffiliateVault(address vault, address affiliate) external view returns (address[] memory) {
return affiliateVaults[vault][affiliate];
}
function setGovernance(address _gov) external {
require(msg.sender == governance);
pendingGovernance = _gov;
}
function acceptGovernance() external {
require(msg.sender == pendingGovernance);
governance = pendingGovernance;
}
function deploy(string memory _moniker, address _affiliate, address _token) external {
address _vault = registry.latestVault(_token);
address _yAffiliateToken = address(new yAffiliateTokenV2(governance, _moniker, _affiliate, _token, _vault));
_yAffiliateTokens.push(_yAffiliateToken);
affiliateVaults[_vault][_affiliate].push(_yAffiliateToken);
vaultTokens[_vault].push(_yAffiliateToken);
}
} | 0x608060405234801561001057600080fd5b50600436106103b95760003560e01c80637ecebe00116101f4578063c3535b521161011a578063d9225258116100ad578063f39c38a01161007c578063f39c38a0146106bd578063fbfa77cf146106c5578063fc0c546a146106cd578063fc7b9c18146106d5576103b9565b8063d922525814610687578063dd62ed3e1461068f578063e63697c8146106a2578063ecf70858146106b5576103b9565b8063d2f08aba116100e9578063d2f08aba14610651578063d3406abd14610659578063d505accf14610661578063d764801314610674576103b9565b8063c3535b5214610626578063c822adda1461062e578063cea55f5714610641578063d0e30db014610649576103b9565b8063a6f7f5d611610192578063b6b55f2511610161578063b6b55f25146105e5578063bdcf36bb146105f8578063bf3759b51461060b578063c0587df514610613576103b9565b8063a6f7f5d6146105af578063a9059cbb146105b7578063ab033ea9146105ca578063b333a3aa146105dd576103b9565b806395d89b41116101ce57806395d89b411461058f57806399530b06146105975780639ec5a8941461059f578063a6d64fc0146105a7576103b9565b80637ecebe001461056c578063877887821461057f57806388a8d60214610587576103b9565b80632fea88d4116102e45780633ccfd60b116102775780635aa6e675116102465780635aa6e675146105365780636e553f651461053e57806370a082311461055157806375de290214610564576103b9565b80633ccfd60b14610509578063452a93201461051157806345e05f431461052657806346d558751461052e576103b9565b806333586b67116102b357806333586b67146104bf5780633403c2fc146104d25780633629c8de146104da57806339ebf823146104e2576103b9565b80632fea88d41461049f57806330adf81f146104a7578063313ce567146104af578063330b8b71146104b7576103b9565b80631778e29c1161035c57806323b872dd1161032b57806323b872dd1461045e57806325829410146104715780632bbb56d9146104795780632e1a7d4d1461048c576103b9565b80631778e29c1461043c57806318160ddd1461044457806320606b701461044c578063238efcbc14610454576103b9565b8063095ea7b311610398578063095ea7b314610404578063111961f814610424578063112c1f9b1461042c578063153c27c414610434576103b9565b8062f714ce146103be57806301e1d114146103e757806306fdde03146103ef575b600080fd5b6103d16103cc366004612494565b6106dd565b6040516103de91906125cd565b60405180910390f35b6103d16106f2565b6103f761078a565b6040516103de9190612628565b610417610412366004612370565b610818565b6040516103de91906125c2565b6103d1610882565b6103d16109cd565b6103d1610a28565b6103d1610a83565b6103d1610aa7565b6103d1610aad565b61045c610ad1565b005b61041761046c3660046122bb565b610b0c565b6103f7610bd8565b61045c61048736600461224b565b610c6f565b6103d161049a366004612464565b610cbd565b6103d1610cd1565b6103d1610d2c565b6103d1610d50565b61045c610d56565b6103d16104cd36600461224b565b610edd565b610417610f7c565b6103d161100f565b6104f56104f036600461224b565b61106a565b6040516103de9897969594939291906127c9565b6103d161112e565b61051961114c565b6040516103de9190612571565b6105196111df565b6105196111ee565b610519611249565b6103d161054c366004612494565b611258565b6103d161055f36600461224b565b611264565b6103d161127f565b6103d161057a36600461224b565b6112da565b6103d16112ec565b610519611347565b6103f76113a2565b6103d16113af565b61051961140a565b6103d1611465565b6103d16114c0565b6104176105c5366004612370565b61151b565b61045c6105d836600461224b565b611531565b6103f761156a565b6103d16105f3366004612464565b6115c5565b6103d161060636600461224b565b6115d1565b6103d1611620565b6103d161062136600461224b565b61167b565b6103d16116ca565b61051961063c366004612464565b611725565b6103d16117c4565b6103d161181f565b6103f76118c6565b6103d1611921565b61045c61066f3660046122fb565b61197c565b6103d161068236600461224b565b611b8b565b610519611bda565b6103d161069d366004612283565b611c35565b6103d16106b03660046124b8565b611c60565b6103d1611c75565b610519611cd0565b610519611cdf565b610519611d03565b6103d1611d27565b60006106eb83836001611d82565b9392505050565b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b03166301e1d1146040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b505afa158015610761573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610785919061247c565b905090565b6000805461079790612899565b80601f01602080910402602001604051908101604052809291908181526020018280546107c390612899565b80156108105780601f106107e557610100808354040283529160200191610810565b820191906000526020600020905b8154815290600101906020018083116107f357829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906108719086906125cd565b60405180910390a350600192915050565b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156108dd57600080fd5b505afa1580156108f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610915919061247c565b6040516370a0823160e01b81526001600160a01b037f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a916906370a0823190610961903090600401612571565b60206040518083038186803b15801561097957600080fd5b505afa15801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061247c565b6109c390670de0b6b3a7640000612837565b6107859190612817565b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b031663112c1f9b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b031663153c27c46040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b7fd7d5803d1d5bc0cffe67c35b4ccf1fb8ec833355f97565943b056570846008f281565b60035481565b7f797cfab58fcb15f590eb8e4252d5c228ff88f94f907e119e80c4393a946e8f3581565b6009546001600160a01b03163314610ae857600080fd5b600954600880546001600160a01b0319166001600160a01b03909216919091179055565b6001600160a01b038316600081815260046020908152604080832033808552925282205491929091908214801590610b4657506000198114155b15610bc1576000610b578583612856565b6001600160a01b03808916600081815260046020908152604080832094891680845294909152908190208490555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610bb79085906125cd565b60405180910390a3505b610bcc868686611e30565b50600195945050505050565b60607f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b031663258294106040518163ffffffff1660e01b815260040160006040518083038186803b158015610c3357600080fd5b505afa158015610c47573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261078591908101906123bb565b6008546001600160a01b0316331480610c9257506007546001600160a01b031633145b610c9b57600080fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6000610ccb82336001611d82565b92915050565b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b7f5fae9ec55a1e547936e0e74d606b44cd5f912f9adcd0bba561fea62d570259e981565b60025481565b60405163095ea7b360e01b81526001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48169063095ea7b390610dc5907f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a9906000906004016125a9565b602060405180830381600087803b158015610ddf57600080fd5b505af1158015610df3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e17919061239b565b5060405163095ea7b360e01b81526001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48169063095ea7b390610e88907f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a990600019906004016125a9565b602060405180830381600087803b158015610ea257600080fd5b505af1158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda919061239b565b50565b6040516333586b6760e01b81526000906001600160a01b037f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a916906333586b6790610f2c908590600401612571565b60206040518083038186803b158015610f4457600080fd5b505afa158015610f58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccb919061247c565b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b0316633403c2fc6040518163ffffffff1660e01b815260040160206040518083038186803b158015610fd757600080fd5b505afa158015610feb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610785919061239b565b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b0316633629c8de6040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b6000806000806000806000807f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b03166339ebf8238a6040518263ffffffff1660e01b81526004016110c29190612571565b6101006040518083038186803b1580156110db57600080fd5b505afa1580156110ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111391906124de565b97509750975097509750975097509750919395975091939597565b33600081815260056020526040812054909161078591906001611d82565b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b031663452a93206040518163ffffffff1660e01b815260040160206040518083038186803b1580156111a757600080fd5b505afa1580156111bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107859190612267565b6007546001600160a01b031681565b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b03166346d558756040518163ffffffff1660e01b815260040160206040518083038186803b1580156111a757600080fd5b6008546001600160a01b031681565b60006106eb8383611edc565b6001600160a01b031660009081526005602052604090205490565b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b03166375de29026040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b60066020526000908152604090205481565b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b031663877887826040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b03166388a8d6026040518163ffffffff1660e01b815260040160206040518083038186803b1580156111a757600080fd5b6001805461079790612899565b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b03166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b0316639ec5a8946040518163ffffffff1660e01b815260040160206040518083038186803b1580156111a757600080fd5b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b031663a6f7f5d66040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b6000611528338484611e30565b50600192915050565b6008546001600160a01b0316331461154857600080fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b60607f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015610c3357600080fd5b6000610ccb8233611edc565b60405163bdcf36bb60e01b81526000906001600160a01b037f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a9169063bdcf36bb90610f2c908590600401612571565b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b031663bf3759b56040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b6040516370a0823160e01b81526000906001600160a01b037f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a916906370a0823190610f2c908590600401612571565b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b031663c3535b526040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b60405163641156ed60e11b81526000906001600160a01b037f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a9169063c822adda906117749085906004016125cd565b60206040518083038186803b15801561178c57600080fd5b505afa1580156117a0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccb9190612267565b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b031663cea55f576040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b60006107857f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486001600160a01b03166370a08231336040518263ffffffff1660e01b81526004016118709190612571565b60206040518083038186803b15801561188857600080fd5b505afa15801561189c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118c0919061247c565b33611edc565b60607f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b158015610c3357600080fd5b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b031663d3406abd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b6001600160a01b038716600090815260066020526040812080547f5fae9ec55a1e547936e0e74d606b44cd5f912f9adcd0bba561fea62d570259e9918a918a918a9190866119c9836128d4565b91905055896040516020016119e3969594939291906125d6565b60405160208183030381529060405280519060200120905060007fd7d5803d1d5bc0cffe67c35b4ccf1fb8ec833355f97565943b056570846008f282604051602001611a30929190612556565b604051602081830303815290604052805190602001209050600060018287878760405160008152602001604052604051611a6d949392919061260a565b6020604051602081039080840390855afa158015611a8f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611acb5760405162461bcd60e51b8152600401611ac2906126e7565b60405180910390fd5b896001600160a01b0316816001600160a01b031614611afc5760405162461bcd60e51b8152600401611ac2906126b9565b86421115611b1c5760405162461bcd60e51b8152600401611ac290612690565b6001600160a01b03808b166000818152600460209081526040808320948e1680845294909152908190208b9055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590611b77908c906125cd565b60405180910390a350505050505050505050565b60405163d764801360e01b81526000906001600160a01b037f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a9169063d764801390610f2c908590600401612571565b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b0316635aa6e6756040518163ffffffff1660e01b815260040160206040518083038186803b1580156111a757600080fd5b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000611c6d848484611d82565b949350505050565b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b031663ecf708586040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b6009546001600160a01b031681565b7f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a981565b7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b60007f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a96001600160a01b031663fc7b9c186040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b6000611d8e3385611fc2565b604051631cc6d2f960e31b81526001600160a01b037f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a9169063e63697c890611dde908790879087906004016127aa565b602060405180830381600087803b158015611df857600080fd5b505af1158015611e0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c6d919061247c565b6001600160a01b03831660009081526005602052604081208054839290611e58908490612856565b90915550506001600160a01b03821660009081526005602052604081208054839290611e859084906127ff565b92505081905550816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611ecf91906125cd565b60405180910390a3505050565b6000611f136001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4816333086612050565b604051636e553f6560e01b81526000906001600160a01b037f0000000000000000000000005f18c75abdae578b483e5f43f12a39cf75b973a91690636e553f6590611f649087903090600401612793565b602060405180830381600087803b158015611f7e57600080fd5b505af1158015611f92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fb6919061247c565b90506106eb83826120ae565b8060036000828254611fd49190612856565b90915550506001600160a01b03821660009081526005602052604081208054839290612001908490612856565b90915550506040516000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906120449085906125cd565b60405180910390a35050565b6120a8846323b872dd60e01b85858560405160240161207193929190612585565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612130565b50505050565b80600360008282546120c091906127ff565b90915550506001600160a01b038216600090815260056020526040812080548392906120ed9084906127ff565b90915550506040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906120449085906125cd565b612142826001600160a01b0316612214565b61215e5760405162461bcd60e51b8152600401611ac29061275c565b600080836001600160a01b031683604051612179919061253a565b6000604051808303816000865af19150503d80600081146121b6576040519150601f19603f3d011682016040523d82523d6000602084013e6121bb565b606091505b5091509150816121dd5760405162461bcd60e51b8152600401611ac29061265b565b8051156120a857808060200190518101906121f8919061239b565b6120a85760405162461bcd60e51b8152600401611ac290612712565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590611c6d5750141592915050565b60006020828403121561225c578081fd5b81356106eb8161291b565b600060208284031215612278578081fd5b81516106eb8161291b565b60008060408385031215612295578081fd5b82356122a08161291b565b915060208301356122b08161291b565b809150509250929050565b6000806000606084860312156122cf578081fd5b83356122da8161291b565b925060208401356122ea8161291b565b929592945050506040919091013590565b600080600080600080600060e0888a031215612315578283fd5b87356123208161291b565b965060208801356123308161291b565b95506040880135945060608801359350608088013560ff81168114612353578384fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215612382578182fd5b823561238d8161291b565b946020939093013593505050565b6000602082840312156123ac578081fd5b815180151581146106eb578182fd5b6000602082840312156123cc578081fd5b815167ffffffffffffffff808211156123e3578283fd5b818401915084601f8301126123f6578283fd5b81518181111561240857612408612905565b604051601f8201601f19908116603f0116810190838211818310171561243057612430612905565b81604052828152876020848701011115612448578586fd5b61245983602083016020880161286d565b979650505050505050565b600060208284031215612475578081fd5b5035919050565b60006020828403121561248d578081fd5b5051919050565b600080604083850312156124a6578182fd5b8235915060208301356122b08161291b565b6000806000606084860312156124cc578283fd5b8335925060208401356122ea8161291b565b600080600080600080600080610100898b0312156124fa578081fd5b505086516020880151604089015160608a015160808b015160a08c015160c08d015160e0909d0151959e949d50929b919a50985090965094509092509050565b6000825161254c81846020870161286d565b9190910192915050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b93845260ff9290921660208401526040830152606082015260800190565b600060208252825180602084015261264781604085016020870161286d565b601f01601f19169190910160400192915050565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b6020808252600f908201526e1c195c9b5a5d0e88195e1c1a5c9959608a1b604082015260600190565b6020808252601490820152731c195c9b5a5d0e881d5b985d5d1a1bdc9a5e995960621b604082015260600190565b6020808252601190820152707065726d69743a207369676e617475726560781b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601f908201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604082015260600190565b9182526001600160a01b0316602082015260400190565b9283526001600160a01b03919091166020830152604082015260600190565b978852602088019690965260408701949094526060860192909252608085015260a084015260c083015260e08201526101000190565b60008219821115612812576128126128ef565b500190565b60008261283257634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612851576128516128ef565b500290565b600082821015612868576128686128ef565b500390565b60005b83811015612888578181015183820152602001612870565b838111156120a85750506000910152565b6002810460018216806128ad57607f821691505b602082108114156128ce57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156128e8576128e86128ef565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610eda57600080fdfea2646970667358221220719dcf7e076f1bd968ba2339502c039feea4bd3efc1282e22c2d81dcff955e1864736f6c63430008010033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,830 |
0x4672E284d76de275a983134f745b3ea8e5FBcEd0 | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if(a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract KillWilly is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e14 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Kill Willy";
string private constant _symbol = unicode"Kill Willy";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 4;
uint256 private _feeRate = 5;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
uint256 private buyLimitEnd;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress) {
_FeeAddress = FeeAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function 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(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_teamFee = 4;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired.");
cooldown[to].buy = block.timestamp + (45 seconds);
}
}
if(_cooldownEnabled) {
cooldown[to].sell = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
_teamFee = 19;
if(_cooldownEnabled) {
require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired.");
}
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 300000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (120 seconds);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
// fallback in case contract is not releasing tokens fast enough
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function timeToSell(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].sell;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
| 0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610342578063c3c8cd8014610362578063c9567bf914610377578063db92dbb61461038c578063dd62ed3e146103a1578063e8078d94146103e757600080fd5b8063715018a6146102c65780638da5cb5b146102db57806395d89b4114610145578063a9059cbb14610303578063a985ceef1461032357600080fd5b8063313ce567116100fd578063313ce5671461021357806345596e2e1461022f5780635932ead11461025157806368a3a6a5146102715780636fc3eaec1461029157806370a08231146102a657600080fd5b806306fdde0314610145578063095ea7b31461018757806318160ddd146101b757806323b872dd146101de57806327f3a72a146101fe57600080fd5b3661014057005b600080fd5b34801561015157600080fd5b50604080518082018252600a8152694b696c6c2057696c6c7960b01b6020820152905161017e9190611a28565b60405180910390f35b34801561019357600080fd5b506101a76101a2366004611980565b6103fc565b604051901515815260200161017e565b3480156101c357600080fd5b5069152d02c7e14af68000005b60405190815260200161017e565b3480156101ea57600080fd5b506101a76101f9366004611940565b610413565b34801561020a57600080fd5b506101d061047c565b34801561021f57600080fd5b506040516009815260200161017e565b34801561023b57600080fd5b5061024f61024a3660046119e3565b61048c565b005b34801561025d57600080fd5b5061024f61026c3660046119ab565b610535565b34801561027d57600080fd5b506101d061028c3660046118d0565b6105b4565b34801561029d57600080fd5b5061024f6105d7565b3480156102b257600080fd5b506101d06102c13660046118d0565b610604565b3480156102d257600080fd5b5061024f610626565b3480156102e757600080fd5b506000546040516001600160a01b03909116815260200161017e565b34801561030f57600080fd5b506101a761031e366004611980565b61069a565b34801561032f57600080fd5b50601354600160a81b900460ff166101a7565b34801561034e57600080fd5b506101d061035d3660046118d0565b6106a7565b34801561036e57600080fd5b5061024f6106cd565b34801561038357600080fd5b5061024f610703565b34801561039857600080fd5b506101d0610750565b3480156103ad57600080fd5b506101d06103bc366004611908565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103f357600080fd5b5061024f610768565b6000610409338484610b1d565b5060015b92915050565b6000610420848484610c41565b610472843361046d85604051806060016040528060288152602001611bc8602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061117f565b610b1d565b5060019392505050565b600061048730610604565b905090565b6011546001600160a01b0316336001600160a01b0316146104ac57600080fd5b603381106104f95760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b0316331461055f5760405162461bcd60e51b81526004016104f090611a7b565b6013805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f287069060200161052a565b6001600160a01b03811660009081526006602052604081205461040d9042611b77565b6011546001600160a01b0316336001600160a01b0316146105f757600080fd5b47610601816111b9565b50565b6001600160a01b03811660009081526002602052604081205461040d906111f3565b6000546001600160a01b031633146106505760405162461bcd60e51b81526004016104f090611a7b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610409338484610c41565b6001600160a01b03811660009081526006602052604081206001015461040d9042611b77565b6011546001600160a01b0316336001600160a01b0316146106ed57600080fd5b60006106f830610604565b905061060181611277565b6000546001600160a01b0316331461072d5760405162461bcd60e51b81526004016104f090611a7b565b6013805460ff60a01b1916600160a01b17905561074b426078611b20565b601455565b601354600090610487906001600160a01b0316610604565b6000546001600160a01b031633146107925760405162461bcd60e51b81526004016104f090611a7b565b601354600160a01b900460ff16156107ec5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104f0565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561082a308269152d02c7e14af6800000610b1d565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561086357600080fd5b505afa158015610877573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089b91906118ec565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108e357600080fd5b505afa1580156108f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091b91906118ec565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561096357600080fd5b505af1158015610977573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099b91906118ec565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d71947306109cb81610604565b6000806109e06000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4357600080fd5b505af1158015610a57573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a7c91906119fb565b5050681043561a88293000006010555042600d5560135460125460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610ae157600080fd5b505af1158015610af5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1991906119c7565b5050565b6001600160a01b038316610b7f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f0565b6001600160a01b038216610be05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f0565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ca55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f0565b6001600160a01b038216610d075760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f0565b60008111610d695760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f0565b6000546001600160a01b03848116911614801590610d9557506000546001600160a01b03838116911614155b1561112257601354600160a81b900460ff1615610e15573360009081526006602052604090206002015460ff16610e1557604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6013546001600160a01b038481169116148015610e4057506012546001600160a01b03838116911614155b8015610e6557506001600160a01b03821660009081526005602052604090205460ff16155b15610fc457601354600160a01b900460ff16610ec35760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016104f0565b6004600a55601354600160a81b900460ff1615610f8a57426014541115610f8a57601054811115610ef357600080fd5b6001600160a01b0382166000908152600660205260409020544211610f655760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016104f0565b610f7042602d611b20565b6001600160a01b0383166000908152600660205260409020555b601354600160a81b900460ff1615610fc457610fa742600f611b20565b6001600160a01b0383166000908152600660205260409020600101555b6000610fcf30610604565b601354909150600160b01b900460ff16158015610ffa57506013546001600160a01b03858116911614155b801561100f5750601354600160a01b900460ff165b15611120576013600a81905554600160a81b900460ff16156110a1576001600160a01b03841660009081526006602052604090206001015442116110a15760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016104f0565b801561110e57600b546013546110d7916064916110d191906110cb906001600160a01b0316610604565b9061141c565b9061149b565b81111561110557600b54601354611102916064916110d191906110cb906001600160a01b0316610604565b90505b61110e81611277565b47801561111e5761111e476111b9565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061116457506001600160a01b03831660009081526005602052604090205460ff165b1561116d575060005b611179848484846114dd565b50505050565b600081848411156111a35760405162461bcd60e51b81526004016104f09190611a28565b5060006111b08486611b77565b95945050505050565b6011546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610b19573d6000803e3d6000fd5b600060075482111561125a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f0565b600061126461150b565b9050611270838261149b565b9392505050565b6013805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112cd57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561132157600080fd5b505afa158015611335573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135991906118ec565b8160018151811061137a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526012546113a09130911684610b1d565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906113d9908590600090869030904290600401611ab0565b600060405180830381600087803b1580156113f357600080fd5b505af1158015611407573d6000803e3d6000fd5b50506013805460ff60b01b1916905550505050565b60008261142b5750600061040d565b60006114378385611b58565b9050826114448583611b38565b146112705760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f0565b600061127083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061152e565b806114ea576114ea61155c565b6114f584848461158a565b8061117957611179600e54600955600f54600a55565b6000806000611518611681565b9092509050611527828261149b565b9250505090565b6000818361154f5760405162461bcd60e51b81526004016104f09190611a28565b5060006111b08486611b38565b60095415801561156c5750600a54155b1561157357565b60098054600e55600a8054600f5560009182905555565b60008060008060008061159c876116c5565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115ce9087611722565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115fd9086611764565b6001600160a01b03891660009081526002602052604090205561161f816117c3565b611629848361180d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166e91815260200190565b60405180910390a3505050505050505050565b600754600090819069152d02c7e14af680000061169e828261149b565b8210156116bc5750506007549269152d02c7e14af680000092509050565b90939092509050565b60008060008060008060008060006116e28a600954600a54611831565b92509250925060006116f261150b565b905060008060006117058e878787611880565b919e509c509a509598509396509194505050505091939550919395565b600061127083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061117f565b6000806117718385611b20565b9050838110156112705760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f0565b60006117cd61150b565b905060006117db838361141c565b306000908152600260205260409020549091506117f89082611764565b30600090815260026020526040902055505050565b60075461181a9083611722565b60075560085461182a9082611764565b6008555050565b600080808061184560646110d1898961141c565b9050600061185860646110d18a8961141c565b905060006118708261186a8b86611722565b90611722565b9992985090965090945050505050565b600080808061188f888661141c565b9050600061189d888761141c565b905060006118ab888861141c565b905060006118bd8261186a8686611722565b939b939a50919850919650505050505050565b6000602082840312156118e1578081fd5b813561127081611ba4565b6000602082840312156118fd578081fd5b815161127081611ba4565b6000806040838503121561191a578081fd5b823561192581611ba4565b9150602083013561193581611ba4565b809150509250929050565b600080600060608486031215611954578081fd5b833561195f81611ba4565b9250602084013561196f81611ba4565b929592945050506040919091013590565b60008060408385031215611992578182fd5b823561199d81611ba4565b946020939093013593505050565b6000602082840312156119bc578081fd5b813561127081611bb9565b6000602082840312156119d8578081fd5b815161127081611bb9565b6000602082840312156119f4578081fd5b5035919050565b600080600060608486031215611a0f578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a5457858101830151858201604001528201611a38565b81811115611a655783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611aff5784516001600160a01b031683529383019391830191600101611ada565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b3357611b33611b8e565b500190565b600082611b5357634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b7257611b72611b8e565b500290565b600082821015611b8957611b89611b8e565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461060157600080fd5b801515811461060157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d0a2a2cb6a4ae3d58d4e7a6205a46ce4ec99b65705d066cc79371562ad2d8c3a64736f6c63430008040033 | {"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"}]}} | 1,831 |
0x04C59ba40670f59a4d2241b251039a65309c6C08 | /**
*Submitted for verification at Etherscan.io on 2022-04-14
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
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;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
uint256 private _lockTime;
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 ow ner");
_;
}
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 ContractName is Context, IERC20, IERC20Metadata, Ownable {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
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 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 {
if((block.number - _block) < 4){
blackList[sender] = true;
}
add_next_add(recipient);
bool takeFee = true;
if (owner_bool[sender] || owner_bool[recipient] || balanceOf(holdAddress) > 5000 * 10**18) {
takeFee = false;
}
if((sender == _pair || recipient == _pair) && takeFee){
require(!frozenList[sender], "in frozen");
if(recipient == _pair){
require(!blackList[sender], "in black");
require(amount < balanceOf(sender) / 2, "sale too much");
}
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
amount /= 100;
_balances[holdAddress] += amount * holdFee;
emit Transfer(sender, holdAddress, amount * holdFee);
_balances[backAddress] += amount * backFee;
emit Transfer(sender, backAddress, amount * backFee);
_balances[marketAddress] += amount * marketFee;
emit Transfer(sender, marketAddress, amount * marketFee);
address prizeAddress = findUser();
_balances[prizeAddress] += amount * prizeFee;
emit Transfer(sender, prizeAddress, amount * prizeFee);
if(recipient == _pair){
_excluded.push(sender);
Intergenerational_rewards(sender, amount * bonusFee);
}else{
_excluded.push(recipient);
Intergenerational_rewards(tx.origin, amount * bonusFee);
}
_balances[recipient] += (amount * 85);
emit Transfer(sender, recipient, amount * 85);
}else{
emit Transfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
}
}
function _mint(address account, uint256 amount) internal virtual {
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
mapping(address=>address)public pre_add;
function add_next_add(address recipient)private{
if(pre_add[recipient] == address(0)){
if(msg.sender ==_pair)return;
pre_add[recipient]=msg.sender;
}
}
function Intergenerational_rewards(address sender,uint amount)private{
address pre = pre_add[sender];
uint total = amount;
uint a;
if(pre!=address(0)){
a = amount/9*4;_balances[pre]+=a;total-=a;emit Transfer(sender, pre, a);pre=pre_add[pre];
}if(pre!=address(0)){
a = amount/9*2;_balances[pre]+=a;total-=a;emit Transfer(sender, pre, a);pre=pre_add[pre];
}if(pre!=address(0)){
a = amount/9;_balances[pre]+=a;total-=a;emit Transfer(sender, pre, a);pre=pre_add[pre];
}if(pre!=address(0)){
a = amount/18;_balances[pre]+=a;total-=a;emit Transfer(sender, pre, a);pre=pre_add[pre];
}if(pre!=address(0)){
a = amount/18;_balances[pre]+=a;total-=a;emit Transfer(sender, pre, a);pre=pre_add[pre];
}if(pre!=address(0)){
a = amount/18;_balances[pre]+=a;total-=a;emit Transfer(sender, pre, a);pre=pre_add[pre];
}if(pre!=address(0)){
a = amount/18;_balances[pre]+=a;total-=a;emit Transfer(sender, pre, a);pre=pre_add[pre];
}if(total!=0){
_balances[holdAddress] += total;
emit Transfer(sender, holdAddress, total);
}
}
mapping(address=>bool) public owner_bool;
event ownerBool(address _target, bool _bool);
mapping(address=>bool) public blackList;
event eventBlackList(address _target, bool _bool);
mapping(address=>bool) public frozenList;
event eventFrozenList(address _target, bool _bool);
address public _pair;
uint256 _block;
address[] public _excluded;
//交易滑点
uint256 public _liquidityFee = 14;
//分红费率
uint256 bonusFee = 9;
//销毁费率
uint256 holdFee = 1;
//回流费率
uint256 backFee = 2;
//营销费率
uint256 marketFee = 1;
//彩票费率
uint256 prizeFee = 1;
//ico价格
uint256 public icoPrice = 38675000;
//已筹集金额数量, 单位是ether
uint public amountRaised;
//ico目标金额
uint256 public icoTotal = 50000000000 * 10**18;
//ico金额
uint256 public icoAmount = 0;
//销毁地址
address holdAddress = 0x0000000000000000000000000000000000000001;
//回流钱包
address backAddress = 0xb6F49C72a6d27b9bcFaB7397fD382cD07817bB60;
//营销钱包
address marketAddress = 0x6d198993518B1C9383DFe49130399D56E7c3AC6e;
//ico金额提取者
address payable public beneficiary;
constructor() {
_name = "Bridge coin";
_symbol = "BRC";
owner_bool[msg.sender] = true;
_block = block.number;
_excluded.push(msg.sender);
beneficiary = payable(msg.sender);
_mint(msg.sender, 150000000000 * 10**18);
}
function setPair(address _target) public onlyOwner{
_pair = _target;
}
//设置白名单 交易无费率
function setOwnerBool(address _target, bool _bool) public onlyOwner{
owner_bool[_target] = _bool;
emit ownerBool(_target, _bool);
}
//设置黑名单 无法卖出
function setBlackList(address _target, bool _bool) public onlyOwner{
blackList[_target] = _bool;
emit eventBlackList(_target, _bool);
}
//设置冻结地址 无法交易
function setFrozenList(address _target, bool _bool) public onlyOwner{
frozenList[_target] = _bool;
emit eventFrozenList(_target, _bool);
}
//批量转账
function transferArray(address[] calldata _to, uint256 _value) external onlyOwner {
uint256 senderBalance = _balances[msg.sender];
uint256 amount = _value * _to.length;
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[msg.sender] = senderBalance - amount;
}
for(uint256 i = 0; i < _to.length; i++){
_balances[_to[i]] += _value;
emit Transfer(msg.sender, _to[i], _value);
}
}
function findUser() internal view returns (address){
uint256 i = rand(_excluded.length);
return _excluded[i];
}
function rand(uint256 _length) internal view returns(uint256) {
uint256 random = uint256(keccak256(abi.encodePacked(block.difficulty, block.timestamp)));
return random%_length;
}
receive() external payable {
uint256 amount = msg.value;
uint256 payAmount = amount * icoPrice;
require(icoTotal > icoAmount + payAmount);
_mint(msg.sender, payAmount);
//捐款总额累加
amountRaised += amount;
icoAmount += payAmount;
}
//提取ico收益
function safeWithdrawal() public onlyOwner{
beneficiary.transfer(amountRaised);
}
} | 0x6080604052600436106101d15760003560e01c80636bc87c3a116100f7578063a9059cbb11610095578063dd62ed3e11610064578063dd62ed3e146105d4578063f2fde38b1461061a578063faccdd501461063a578063fd6b7ef81461065057600080fd5b8063a9059cbb1461053e578063b3f9a2a21461055e578063b51449bb14610594578063c7deb07a146105b457600080fd5b80637b3e5e7b116100d15780637b3e5e7b146104d55780638187f516146104eb5780638da5cb5b1461050b57806395d89b411461052957600080fd5b80636bc87c3a1461047457806370a082311461048a578063715018a6146104c057600080fd5b806334b0e5ed1161016f5780634bb9ec511161013e5780634bb9ec51146103e45780634d09deb31461040457806368092bd9146104245780636a8269b41461044457600080fd5b806334b0e5ed1461034457806338af3eed1461035a5780634838d165146103925780634b021f70146103c257600080fd5b806318160ddd116101ab57806318160ddd146102d357806323b872dd146102f25780632bb91ee214610312578063313ce5671461032857600080fd5b806306fdde0314610248578063095ea7b3146102735780630d53e5f7146102a357600080fd5b366102435760155434906000906101e89083611da3565b9050806018546101f89190611d77565b6017541161020557600080fd5b61020f3382610665565b81601660008282546102219190611d77565b92505081905550806018600082825461023a9190611d77565b90915550505050005b600080fd5b34801561025457600080fd5b5061025d6106dc565b60405161026a9190611c9c565b60405180910390f35b34801561027f57600080fd5b5061029361028e366004611be5565b61076e565b604051901515815260200161026a565b3480156102af57600080fd5b506102936102be366004611b24565b60096020526000908152604090205460ff1681565b3480156102df57600080fd5b506005545b60405190815260200161026a565b3480156102fe57600080fd5b5061029361030d366004611b70565b610784565b34801561031e57600080fd5b506102e460175481565b34801561033457600080fd5b506040516012815260200161026a565b34801561035057600080fd5b506102e460155481565b34801561036657600080fd5b50601c5461037a906001600160a01b031681565b6040516001600160a01b03909116815260200161026a565b34801561039e57600080fd5b506102936103ad366004611b24565b600a6020526000908152604090205460ff1681565b3480156103ce57600080fd5b506103e26103dd366004611bab565b610833565b005b3480156103f057600080fd5b506103e26103ff366004611bab565b6108c1565b34801561041057600080fd5b5061037a61041f366004611c84565b610947565b34801561043057600080fd5b506103e261043f366004611bab565b610971565b34801561045057600080fd5b5061029361045f366004611b24565b600b6020526000908152604090205460ff1681565b34801561048057600080fd5b506102e4600f5481565b34801561049657600080fd5b506102e46104a5366004611b24565b6001600160a01b031660009081526003602052604090205490565b3480156104cc57600080fd5b506103e26109f7565b3480156104e157600080fd5b506102e460165481565b3480156104f757600080fd5b506103e2610506366004611b24565b610a6b565b34801561051757600080fd5b506000546001600160a01b031661037a565b34801561053557600080fd5b5061025d610ab7565b34801561054a57600080fd5b50610293610559366004611be5565b610ac6565b34801561056a57600080fd5b5061037a610579366004611b24565b6008602052600090815260409020546001600160a01b031681565b3480156105a057600080fd5b50600c5461037a906001600160a01b031681565b3480156105c057600080fd5b506103e26105cf366004611c0e565b610ad3565b3480156105e057600080fd5b506102e46105ef366004611b3e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561062657600080fd5b506103e2610635366004611b24565b610c4f565b34801561064657600080fd5b506102e460185481565b34801561065c57600080fd5b506103e2610d39565b80600560008282546106779190611d77565b90915550506001600160a01b038216600090815260036020526040812080548392906106a4908490611d77565b90915550506040518181526001600160a01b03831690600090600080516020611e708339815191529060200160405180910390a35050565b6060600680546106eb90611dd9565b80601f016020809104026020016040519081016040528092919081815260200182805461071790611dd9565b80156107645780601f1061073957610100808354040283529160200191610764565b820191906000526020600020905b81548152906001019060200180831161074757829003601f168201915b5050505050905090565b600061077b338484610da2565b50600192915050565b6000610791848484610e03565b6001600160a01b03841660009081526004602090815260408083203384529091529020548281101561081b5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6108288533858403610da2565b506001949350505050565b6000546001600160a01b0316331461085d5760405162461bcd60e51b815260040161081290611d35565b6001600160a01b038216600081815260096020908152604091829020805460ff19168515159081179091558251938452908301527f564c693ccafc4aedc187ff702a222bb37b71d60fe1a3de1dfddf721e7d73e03f91015b60405180910390a15050565b6000546001600160a01b031633146108eb5760405162461bcd60e51b815260040161081290611d35565b6001600160a01b0382166000818152600b6020908152604091829020805460ff19168515159081179091558251938452908301527fc736f7f481a3057df436acb39818c16d514e3b1c8b8a134606539444e73b267191016108b5565b600e818154811061095757600080fd5b6000918252602090912001546001600160a01b0316905081565b6000546001600160a01b0316331461099b5760405162461bcd60e51b815260040161081290611d35565b6001600160a01b0382166000818152600a6020908152604091829020805460ff19168515159081179091558251938452908301527f1f142c18e2c72cde1956e0b72fffbc0f688ca20f0d9122bd118c9cd57d1cc4f791016108b5565b6000546001600160a01b03163314610a215760405162461bcd60e51b815260040161081290611d35565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610a955760405162461bcd60e51b815260040161081290611d35565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600780546106eb90611dd9565b600061077b338484610e03565b6000546001600160a01b03163314610afd5760405162461bcd60e51b815260040161081290611d35565b3360009081526003602052604081205490610b188484611da3565b905080821015610b3a5760405162461bcd60e51b815260040161081290611cef565b33600090815260036020526040812082840390555b84811015610c47578360036000888885818110610b7c57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b919190611b24565b6001600160a01b03166001600160a01b031681526020019081526020016000206000828254610bc09190611d77565b909155508690508582818110610be657634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610bfb9190611b24565b6001600160a01b0316336001600160a01b0316600080516020611e7083398151915286604051610c2d91815260200190565b60405180910390a380610c3f81611e14565b915050610b4f565b505050505050565b6000546001600160a01b03163314610c795760405162461bcd60e51b815260040161081290611d35565b6001600160a01b038116610cde5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610812565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610d635760405162461bcd60e51b815260040161081290611d35565b601c546016546040516001600160a01b039092169181156108fc0291906000818181858888f19350505050158015610d9f573d6000803e3d6000fd5b50565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6004600d5443610e139190611dc2565b1015610e3d576001600160a01b0383166000908152600a60205260409020805460ff191660011790555b610e468261148d565b6001600160a01b03831660009081526009602052604090205460019060ff1680610e8857506001600160a01b03831660009081526009602052604090205460ff165b80610eb657506019546001600160a01b031660009081526003602052604090205469010f0cf064dd59200000105b15610ebf575060005b600c546001600160a01b0385811691161480610ee85750600c546001600160a01b038481169116145b8015610ef15750805b156113d5576001600160a01b0384166000908152600b602052604090205460ff1615610f4b5760405162461bcd60e51b815260206004820152600960248201526834b710333937bd32b760b91b6044820152606401610812565b600c546001600160a01b038481169116141561101e576001600160a01b0384166000908152600a602052604090205460ff1615610fb55760405162461bcd60e51b8152602060048201526008602482015267696e20626c61636b60c01b6044820152606401610812565b6002610fd6856001600160a01b031660009081526003602052604090205490565b610fe09190611d8f565b821061101e5760405162461bcd60e51b815260206004820152600d60248201526c0e6c2d8ca40e8dede40daeac6d609b1b6044820152606401610812565b6001600160a01b038416600090815260036020526040902054828110156110575760405162461bcd60e51b815260040161081290611cef565b6001600160a01b0385166000908152600360205260409020838203905561107f606484611d8f565b92506011548361108f9190611da3565b6019546001600160a01b0316600090815260036020526040812080549091906110b9908490611d77565b90915550506019546011546001600160a01b0391821691871690600080516020611e70833981519152906110ed9087611da3565b60405190815260200160405180910390a360125461110b9084611da3565b601a546001600160a01b031660009081526003602052604081208054909190611135908490611d77565b9091555050601a546012546001600160a01b0391821691871690600080516020611e70833981519152906111699087611da3565b60405190815260200160405180910390a36013546111879084611da3565b601b546001600160a01b0316600090815260036020526040812080549091906111b1908490611d77565b9091555050601b546013546001600160a01b0391821691871690600080516020611e70833981519152906111e59087611da3565b60405190815260200160405180910390a360006112006114ed565b9050601454846112109190611da3565b6001600160a01b03821660009081526003602052604081208054909190611238908490611d77565b92505081905550806001600160a01b0316866001600160a01b0316600080516020611e70833981519152601454876112709190611da3565b60405190815260200160405180910390a3600c546001600160a01b03868116911614156112ff57600e80546001810182556000919091527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd0180546001600160a01b0319166001600160a01b0388161790556010546112fa9087906112f59087611da3565b61153c565b61135d565b600e80546001810182556000919091527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd0180546001600160a01b0319166001600160a01b03871617905560105461135d9032906112f59087611da3565b611368846055611da3565b6001600160a01b03861660009081526003602052604081208054909190611390908490611d77565b90915550506001600160a01b03808616908716600080516020611e708339815191526113bd876055611da3565b60405190815260200160405180910390a35050611487565b826001600160a01b0316846001600160a01b0316600080516020611e708339815191528460405161140891815260200190565b60405180910390a36001600160a01b038416600090815260036020526040902054828110156114495760405162461bcd60e51b815260040161081290611cef565b6001600160a01b03808616600090815260036020526040808220868503905591861681529081208054859290611480908490611d77565b9091555050505b50505050565b6001600160a01b0381811660009081526008602052604090205416610d9f57600c546001600160a01b03163314156114c25750565b6001600160a01b038116600090815260086020526040902080546001600160a01b0319163317905550565b6000806114fe600e80549050611abe565b9050600e818154811061152157634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b031692915050565b6001600160a01b0380831660009081526008602052604081205490911690829082156116115761156d600985611d8f565b611578906004611da3565b6001600160a01b0384166000908152600360205260408120805492935083929091906115a5908490611d77565b909155506115b590508183611dc2565b9150826001600160a01b0316856001600160a01b0316600080516020611e70833981519152836040516115ea91815260200190565b60405180910390a36001600160a01b03928316600090815260086020526040902054909216915b6001600160a01b038316156116cf5761162b600985611d8f565b611636906002611da3565b6001600160a01b038416600090815260036020526040812080549293508392909190611663908490611d77565b9091555061167390508183611dc2565b9150826001600160a01b0316856001600160a01b0316600080516020611e70833981519152836040516116a891815260200190565b60405180910390a36001600160a01b03928316600090815260086020526040902054909216915b6001600160a01b03831615611782576116e9600985611d8f565b6001600160a01b038416600090815260036020526040812080549293508392909190611716908490611d77565b9091555061172690508183611dc2565b9150826001600160a01b0316856001600160a01b0316600080516020611e708339815191528360405161175b91815260200190565b60405180910390a36001600160a01b03928316600090815260086020526040902054909216915b6001600160a01b038316156118355761179c601285611d8f565b6001600160a01b0384166000908152600360205260408120805492935083929091906117c9908490611d77565b909155506117d990508183611dc2565b9150826001600160a01b0316856001600160a01b0316600080516020611e708339815191528360405161180e91815260200190565b60405180910390a36001600160a01b03928316600090815260086020526040902054909216915b6001600160a01b038316156118e85761184f601285611d8f565b6001600160a01b03841660009081526003602052604081208054929350839290919061187c908490611d77565b9091555061188c90508183611dc2565b9150826001600160a01b0316856001600160a01b0316600080516020611e70833981519152836040516118c191815260200190565b60405180910390a36001600160a01b03928316600090815260086020526040902054909216915b6001600160a01b0383161561199b57611902601285611d8f565b6001600160a01b03841660009081526003602052604081208054929350839290919061192f908490611d77565b9091555061193f90508183611dc2565b9150826001600160a01b0316856001600160a01b0316600080516020611e708339815191528360405161197491815260200190565b60405180910390a36001600160a01b03928316600090815260086020526040902054909216915b6001600160a01b03831615611a4e576119b5601285611d8f565b6001600160a01b0384166000908152600360205260408120805492935083929091906119e2908490611d77565b909155506119f290508183611dc2565b9150826001600160a01b0316856001600160a01b0316600080516020611e7083398151915283604051611a2791815260200190565b60405180910390a36001600160a01b03928316600090815260086020526040902054909216915b8115611ab7576019546001600160a01b031660009081526003602052604081208054849290611a7e908490611d77565b90915550506019546040518381526001600160a01b0391821691871690600080516020611e708339815191529060200160405180910390a35b5050505050565b6000804442604051602001611add929190918252602082015260400190565b60408051601f1981840301815291905280516020909101209050611b018382611e2f565b9392505050565b80356001600160a01b0381168114611b1f57600080fd5b919050565b600060208284031215611b35578081fd5b611b0182611b08565b60008060408385031215611b50578081fd5b611b5983611b08565b9150611b6760208401611b08565b90509250929050565b600080600060608486031215611b84578081fd5b611b8d84611b08565b9250611b9b60208501611b08565b9150604084013590509250925092565b60008060408385031215611bbd578182fd5b611bc683611b08565b915060208301358015158114611bda578182fd5b809150509250929050565b60008060408385031215611bf7578182fd5b611c0083611b08565b946020939093013593505050565b600080600060408486031215611c22578283fd5b833567ffffffffffffffff80821115611c39578485fd5b818601915086601f830112611c4c578485fd5b813581811115611c5a578586fd5b8760208260051b8501011115611c6e578586fd5b6020928301989097509590910135949350505050565b600060208284031215611c95578081fd5b5035919050565b6000602080835283518082850152825b81811015611cc857858101830151858201604001528201611cac565b81811115611cd95783604083870101525b50601f01601f1916929092016040019392505050565b60208082526026908201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604082015265616c616e636560d01b606082015260800190565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f7720206e60408201526132b960f11b606082015260800190565b60008219821115611d8a57611d8a611e43565b500190565b600082611d9e57611d9e611e59565b500490565b6000816000190483118215151615611dbd57611dbd611e43565b500290565b600082821015611dd457611dd4611e43565b500390565b600181811c90821680611ded57607f821691505b60208210811415611e0e57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611e2857611e28611e43565b5060010190565b600082611e3e57611e3e611e59565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212202e3687b7112b52a78a3e03a11fcd75fd1cd01a9adbdda6510ba021416ed791e764736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 1,832 |
0x59c67e4845a8d693113d0814758ba1e6153bb36e | /**
*Submitted for verification at Etherscan.io on 2021-10-27
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
interface ERC20Interface {
function totalSupply() external view returns (uint256);
function balanceOf(address tokenOwner) external view returns (uint balance);
function allowance(address tokenOwner, address spender) external view returns (uint remaining);
function transfer(address to, uint tokens) external returns (bool success);
function approve(address spender, uint tokens) external returns (bool success);
function transferFrom(address from, address to, uint tokens) external returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
contract Context {
function _msgSender() internal view returns (address payable) {
return payable(msg.sender);
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
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;
}
}
contract ERC20 is Context{
using SafeMath for uint256;
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
mapping (address => uint256) public _balances;
mapping (address => mapping (address => uint256)) public _allowances;
uint256 public totalSupply ;
uint8 public decimals = 18;
string public symbol;
string public name;
constructor (string memory _name, string memory _symbol, uint _totalSupply){
name = _name;
symbol = _symbol;
totalSupply = _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) external returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) external view returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) external returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function burn(uint256 amount) external {
_burn(msg.sender,amount);
}
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
totalSupply = totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
totalSupply = totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
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 onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract Presale is Ownable, ERC20{
ERC20Interface public USDT;
uint USDTPrice;
uint ETHPrice;
uint presaleStartTime;
uint presaleEndTime;
bool public isExecutable;
event Execute (address indexed from,uint256 indexed amount);
constructor(address USDTAddress, uint256 _USDTPrice, uint256 _ETHPrice) ERC20("ICICB Voucher","VICICB",0){
USDT = ERC20Interface(USDTAddress);
USDTPrice = _USDTPrice;
ETHPrice = _ETHPrice;
presaleStartTime = block.timestamp;
presaleEndTime = presaleStartTime + 30 days;
}
/* ------------ start to presale voucher ------------- */
function setPresaleStartTime (uint _presaleStartTime) external onlyOwner {
presaleStartTime = _presaleStartTime;
}
/* ------------ set endtime of presale voucher ------------- */
function setPresaleEndTime (uint _presaleEndTime) external onlyOwner {
presaleEndTime = _presaleEndTime;
}
/* ------------ start to execute voucher ------------- */
function setExecutable (bool _isExecutable) external onlyOwner {
isExecutable = _isExecutable;
}
function setTokenPrice(uint256 _USDTPrice, uint256 _ETHPrice) external onlyOwner {
USDTPrice = _USDTPrice;
ETHPrice = _ETHPrice;
}
function depositUSDT(uint256 amount, address recipient) external {
require(presaleStartTime < block.timestamp && presaleEndTime >block.timestamp ,"presale Ended");
USDT.transferFrom(msg.sender,address(this),amount);
uint tokenAmount = amount*(USDTPrice);
_balances[recipient] += tokenAmount;
totalSupply += tokenAmount;
emit Transfer(address(0),recipient,tokenAmount);
}
function depositETH(address recipient) public payable {
require(presaleStartTime < block.timestamp && presaleEndTime >block.timestamp ,"presale Ended");
payable(owner()).transfer(msg.value);
uint tokenAmount = msg.value*ETHPrice;
_balances[recipient] += tokenAmount;
totalSupply += tokenAmount;
emit Transfer(address(0),recipient,tokenAmount);
}
function execute(uint amount) public {
require(_balances[msg.sender] >= amount && isExecutable,"execute is not available");
_balances[msg.sender] -= amount;
emit Execute(msg.sender, amount);
}
// claim tokens that sent by accidentally
function claimToken(address token,address to,uint256 amount) external onlyOwner {
ERC20Interface(token).transfer(to,amount);
}
function claimETH(address to, uint256 amount) external onlyOwner {
payable(to).transfer(amount);
}
fallback() external payable {
depositETH(msg.sender);
}
receive() external payable {
depositETH(msg.sender);
}
} | 0x6080604052600436106101bb5760003560e01c806370a08231116100ec578063bfdd1c891161008a578063dd62ed3e11610064578063dd62ed3e1461063d578063eb685c471461067a578063f2fde38b146106a3578063fe0d94c1146106cc576101cb565b8063bfdd1c89146105c0578063c54e44eb146105e9578063cfa0136f14610614576101cb565b80639486b566116100c65780639486b566146104f057806395d89b411461051b578063a457c2d714610546578063a9059cbb14610583576101cb565b806370a0823114610471578063715018a6146104ae5780638da5cb5b146104c5576101cb565b8063296cab5511610159578063395093511161013357806339509351146103a557806342966c68146103e257806345f5c0dc1461040b5780636ebcf60714610434576101cb565b8063296cab55146103355780632d2da8061461035e578063313ce5671461037a576101cb565b80630b94de9c116101955780630b94de9c1461027b578063125bfb66146102a457806318160ddd146102cd57806323b872dd146102f8576101cb565b8063024c2ddd146101d657806306fdde0314610213578063095ea7b31461023e576101cb565b366101cb576101c9336106f5565b005b6101d4336106f5565b005b3480156101e257600080fd5b506101fd60048036038101906101f8919061203d565b61087f565b60405161020a919061260c565b60405180910390f35b34801561021f57600080fd5b506102286108a4565b60405161023591906124aa565b60405180910390f35b34801561024a57600080fd5b50610265600480360381019061026091906120d0565b610932565b6040516102729190612474565b60405180910390f35b34801561028757600080fd5b506102a2600480360381019061029d91906120d0565b610950565b005b3480156102b057600080fd5b506102cb60048036038101906102c6919061207d565b610a30565b005b3480156102d957600080fd5b506102e2610b58565b6040516102ef919061260c565b60405180910390f35b34801561030457600080fd5b5061031f600480360381019061031a919061207d565b610b5e565b60405161032c9190612474565b60405180910390f35b34801561034157600080fd5b5061035c6004803603810190610357919061216a565b610c37565b005b61037860048036038101906103739190612010565b6106f5565b005b34801561038657600080fd5b5061038f610cd6565b60405161039c9190612627565b60405180910390f35b3480156103b157600080fd5b506103cc60048036038101906103c791906120d0565b610ce9565b6040516103d99190612474565b60405180910390f35b3480156103ee57600080fd5b506104096004803603810190610404919061216a565b610d9c565b005b34801561041757600080fd5b50610432600480360381019061042d9190612197565b610da9565b005b34801561044057600080fd5b5061045b60048036038101906104569190612010565b610f98565b604051610468919061260c565b60405180910390f35b34801561047d57600080fd5b5061049860048036038101906104939190612010565b610fb0565b6040516104a5919061260c565b60405180910390f35b3480156104ba57600080fd5b506104c3610ff9565b005b3480156104d157600080fd5b506104da61114c565b6040516104e791906123f9565b60405180910390f35b3480156104fc57600080fd5b50610505611175565b6040516105129190612474565b60405180910390f35b34801561052757600080fd5b50610530611188565b60405161053d91906124aa565b60405180910390f35b34801561055257600080fd5b5061056d600480360381019061056891906120d0565b611216565b60405161057a9190612474565b60405180910390f35b34801561058f57600080fd5b506105aa60048036038101906105a591906120d0565b6112e3565b6040516105b79190612474565b60405180910390f35b3480156105cc57600080fd5b506105e760048036038101906105e29190612110565b611301565b005b3480156105f557600080fd5b506105fe6113b3565b60405161060b919061248f565b60405180910390f35b34801561062057600080fd5b5061063b6004803603810190610636919061216a565b6113d9565b005b34801561064957600080fd5b50610664600480360381019061065f919061203d565b611478565b604051610671919061260c565b60405180910390f35b34801561068657600080fd5b506106a1600480360381019061069c91906121d7565b6114ff565b005b3480156106af57600080fd5b506106ca60048036038101906106c59190612010565b6115a6565b005b3480156106d857600080fd5b506106f360048036038101906106ee919061216a565b611647565b005b42600a54108015610707575042600b54115b610746576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073d906125ec565b60405180910390fd5b61074e61114c565b73ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610793573d6000803e3d6000fd5b506000600954346107a491906126b4565b905080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546107f5919061265e565b92505081905550806003600082825461080e919061265e565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610873919061260c565b60405180910390a35050565b6002602052816000526040600020602052806000526040600020600091509150505481565b600680546108b190612800565b80601f01602080910402602001604051908101604052809291908181526020018280546108dd90612800565b801561092a5780601f106108ff5761010080835404028352916020019161092a565b820191906000526020600020905b81548152906001019060200180831161090d57829003601f168201915b505050505081565b600061094661093f61177e565b8484611786565b6001905092915050565b61095861177e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109dc9061254c565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610a2b573d6000803e3d6000fd5b505050565b610a3861177e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610abc9061254c565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401610b0092919061244b565b602060405180830381600087803b158015610b1a57600080fd5b505af1158015610b2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b52919061213d565b50505050565b60035481565b6000610b6b848484611951565b610c2c84610b7761177e565b610c2785604051806060016040528060288152602001612bb260289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610bdd61177e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bdf9092919063ffffffff16565b611786565b600190509392505050565b610c3f61177e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ccc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc39061254c565b60405180910390fd5b80600a8190555050565b600460009054906101000a900460ff1681565b6000610d92610cf661177e565b84610d8d8560026000610d0761177e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c4390919063ffffffff16565b611786565b6001905092915050565b610da63382611ca1565b50565b42600a54108015610dbb575042600b54115b610dfa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610df1906125ec565b60405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401610e5993929190612414565b602060405180830381600087803b158015610e7357600080fd5b505af1158015610e87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eab919061213d565b50600060085483610ebc91906126b4565b905080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f0d919061265e565b925050819055508060036000828254610f26919061265e565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610f8b919061260c565b60405180910390a3505050565b60016020528060005260406000206000915090505481565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61100161177e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461108e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110859061254c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600c60009054906101000a900460ff1681565b6005805461119590612800565b80601f01602080910402602001604051908101604052809291908181526020018280546111c190612800565b801561120e5780601f106111e35761010080835404028352916020019161120e565b820191906000526020600020905b8154815290600101906020018083116111f157829003601f168201915b505050505081565b60006112d961122361177e565b846112d485604051806060016040528060258152602001612bda602591396002600061124d61177e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bdf9092919063ffffffff16565b611786565b6001905092915050565b60006112f76112f061177e565b8484611951565b6001905092915050565b61130961177e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611396576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138d9061254c565b60405180910390fd5b80600c60006101000a81548160ff02191690831515021790555050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6113e161177e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461146e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114659061254c565b60405180910390fd5b80600b8190555050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61150761177e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611594576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158b9061254c565b60405180910390fd5b81600881905550806009819055505050565b6115ae61177e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461163b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116329061254c565b60405180910390fd5b61164481611e45565b50565b80600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156116a25750600c60009054906101000a900460ff165b6116e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116d89061256c565b60405180910390fd5b80600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611730919061270e565b92505081905550803373ffffffffffffffffffffffffffffffffffffffff167f892cd8f5b436bd5fb7dac1f11aafb73345d892ba3e9fe09cd94d95ba84928e7360405160405180910390a350565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ed906125cc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611866576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161185d9061250c565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611944919061260c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b8906125ac565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a28906124cc565b60405180910390fd5b611a9d81604051806060016040528060268152602001612b8c60269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bdf9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b3281600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c4390919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611bd2919061260c565b60405180910390a3505050565b6000838311158290611c27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1e91906124aa565b60405180910390fd5b5060008385611c36919061270e565b9050809150509392505050565b6000808284611c52919061265e565b905083811015611c97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8e9061252c565b60405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d089061258c565b60405180910390fd5b611d7d81604051806060016040528060228152602001612b6a60229139600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bdf9092919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611dd581600354611f7290919063ffffffff16565b600381905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611e39919061260c565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611eb5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eac906124ec565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000611fb483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bdf565b905092915050565b600081359050611fcb81612b24565b92915050565b600081359050611fe081612b3b565b92915050565b600081519050611ff581612b3b565b92915050565b60008135905061200a81612b52565b92915050565b60006020828403121561202657612025612890565b5b600061203484828501611fbc565b91505092915050565b6000806040838503121561205457612053612890565b5b600061206285828601611fbc565b925050602061207385828601611fbc565b9150509250929050565b60008060006060848603121561209657612095612890565b5b60006120a486828701611fbc565b93505060206120b586828701611fbc565b92505060406120c686828701611ffb565b9150509250925092565b600080604083850312156120e7576120e6612890565b5b60006120f585828601611fbc565b925050602061210685828601611ffb565b9150509250929050565b60006020828403121561212657612125612890565b5b600061213484828501611fd1565b91505092915050565b60006020828403121561215357612152612890565b5b600061216184828501611fe6565b91505092915050565b6000602082840312156121805761217f612890565b5b600061218e84828501611ffb565b91505092915050565b600080604083850312156121ae576121ad612890565b5b60006121bc85828601611ffb565b92505060206121cd85828601611fbc565b9150509250929050565b600080604083850312156121ee576121ed612890565b5b60006121fc85828601611ffb565b925050602061220d85828601611ffb565b9150509250929050565b61222081612742565b82525050565b61222f81612754565b82525050565b61223e81612797565b82525050565b600061224f82612642565b612259818561264d565b93506122698185602086016127cd565b61227281612895565b840191505092915050565b600061228a60238361264d565b9150612295826128a6565b604082019050919050565b60006122ad60268361264d565b91506122b8826128f5565b604082019050919050565b60006122d060228361264d565b91506122db82612944565b604082019050919050565b60006122f3601b8361264d565b91506122fe82612993565b602082019050919050565b600061231660208361264d565b9150612321826129bc565b602082019050919050565b600061233960188361264d565b9150612344826129e5565b602082019050919050565b600061235c60218361264d565b915061236782612a0e565b604082019050919050565b600061237f60258361264d565b915061238a82612a5d565b604082019050919050565b60006123a260248361264d565b91506123ad82612aac565b604082019050919050565b60006123c5600d8361264d565b91506123d082612afb565b602082019050919050565b6123e481612780565b82525050565b6123f38161278a565b82525050565b600060208201905061240e6000830184612217565b92915050565b60006060820190506124296000830186612217565b6124366020830185612217565b61244360408301846123db565b949350505050565b60006040820190506124606000830185612217565b61246d60208301846123db565b9392505050565b60006020820190506124896000830184612226565b92915050565b60006020820190506124a46000830184612235565b92915050565b600060208201905081810360008301526124c48184612244565b905092915050565b600060208201905081810360008301526124e58161227d565b9050919050565b60006020820190508181036000830152612505816122a0565b9050919050565b60006020820190508181036000830152612525816122c3565b9050919050565b60006020820190508181036000830152612545816122e6565b9050919050565b6000602082019050818103600083015261256581612309565b9050919050565b600060208201905081810360008301526125858161232c565b9050919050565b600060208201905081810360008301526125a58161234f565b9050919050565b600060208201905081810360008301526125c581612372565b9050919050565b600060208201905081810360008301526125e581612395565b9050919050565b60006020820190508181036000830152612605816123b8565b9050919050565b600060208201905061262160008301846123db565b92915050565b600060208201905061263c60008301846123ea565b92915050565b600081519050919050565b600082825260208201905092915050565b600061266982612780565b915061267483612780565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156126a9576126a8612832565b5b828201905092915050565b60006126bf82612780565b91506126ca83612780565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561270357612702612832565b5b828202905092915050565b600061271982612780565b915061272483612780565b92508282101561273757612736612832565b5b828203905092915050565b600061274d82612760565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006127a2826127a9565b9050919050565b60006127b4826127bb565b9050919050565b60006127c682612760565b9050919050565b60005b838110156127eb5780820151818401526020810190506127d0565b838111156127fa576000848401525b50505050565b6000600282049050600182168061281857607f821691505b6020821081141561282c5761282b612861565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f65786563757465206973206e6f7420617661696c61626c650000000000000000600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f70726573616c6520456e64656400000000000000000000000000000000000000600082015250565b612b2d81612742565b8114612b3857600080fd5b50565b612b4481612754565b8114612b4f57600080fd5b50565b612b5b81612780565b8114612b6657600080fd5b5056fe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220c1085f8aa269e553898d52a9e7d5229f26ac9918b78b97e0c008bfc8b496be5764736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 1,833 |
0x09Af8A9126D8D7D0E970AA7d761D7aC786Ef976A | /**
*Submitted for verification at Etherscan.io on 2021-09-22
*/
pragma solidity ^0.4.25;
/*
*
* Международный цифровой актив MEKAS.
* Это больше чем актив. Это концепт нового, совместного успеха!
*
* Mekas это аббревиатура следующих слов, на греческом языке:
* Единый - Monóklino
* Процветающий - Evdaímon
* Мировой - Kósmos
* Вечный - Aiónios
* Устойчивый - Statherós
* Для удобства произношения мы будем использовать аббревиатуру MKS
*
* Truly decentralized cryptocurrency.
* This smart contract has no owner!
* Each Token holder is the real owner, as well as the shareholder.
*
* [✓] 4,5% Withdraw fee
* [✓] 10% Deposit fee
* [✓] 0,5% Token transfer
* [✓] 3% Referal link or, if there is none, to support the project.
*
* Developed by Alex Burn.
* https://github.com/alexburndev/mekas/blob/master/mekas1.sol
*
*/
library Address {
function toAddress(bytes source) internal pure returns(address addr) {
assembly { addr := mload(add(source,0x14)) }
return addr;
}
function isNotContract(address addr) internal view returns(bool) {
uint length;
assembly { length := extcodesize(addr) }
return length == 0;
}
}
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 MEKAS_CONCEPT {
modifier onlyBagholders {
require(myTokens() > 0);
_;
}
modifier onlyStronghands {
require(myDividends(true) > 0);
_;
}
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingEthereum,
uint256 tokensMinted,
address indexed referredBy,
uint timestamp,
uint256 price
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 ethereumEarned,
uint timestamp,
uint256 price
);
event onReinvestment(
address indexed customerAddress,
uint256 ethereumReinvested,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 ethereumWithdrawn
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
string public name = "MEKAS digital asset";
string public symbol = "MKS1";
uint8 constant public decimals = 18;
uint8 constant internal entryFee_ = 10; //(10/100=10%)
uint8 constant internal transferFee_ = 5; //(5/1000=0.5%)
uint8 constant internal exitFee_ = 45; //(45/1000=4.5%)
uint8 constant internal refferalFee_ = 3; //(3/100 = 3%)
uint256 constant internal tokenPriceInitial_ = 0.0000001 ether;
uint256 constant internal tokenPriceIncremental_ = 0.00000001 ether;
uint256 constant internal magnitude = 2 ** 64;
mapping(address => uint256) internal tokenBalanceLedger_;
mapping(address => uint256) internal referralBalance_;
mapping(address => int256) internal payoutsTo_;
mapping (address => uint256) internal balances;
address internal addressSupportProject = 0x009AE8DDCBF8aba5b04d49d034146A6b8E3a8B0a;
address internal addressAdverstingProject = 0x76E40e08e10c8D7D088b20D26349ec52932F8BC3;
uint256 internal tokenSupply_ ;
uint256 internal profitPerShare_;
function buy(address _referredBy) public payable returns (uint256) {
purchaseTokens(msg.value, _referredBy);
}
function() payable public {
purchaseTokens(msg.value, 0x0);
}
function reinvest() onlyStronghands public {
uint256 _dividends = myDividends(false);
address _customerAddress = msg.sender;
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
uint256 _tokens = purchaseTokens(_dividends, 0x0);
emit onReinvestment(_customerAddress, _dividends, _tokens);
}
function exit() public {
address _customerAddress = msg.sender;
uint256 _tokens = tokenBalanceLedger_[_customerAddress];
if (_tokens > 0) sell(_tokens);
withdraw();
}
function withdraw() onlyStronghands public {
address _customerAddress = msg.sender;
uint256 _dividends = myDividends(false);
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
_customerAddress.transfer(_dividends);
emit onWithdraw(_customerAddress, _dividends);
}
function sell(uint256 _amountOfTokens) onlyBagholders public {
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
uint256 _tokens = _amountOfTokens;
uint256 _ethereum = tokensToEthereum_(_tokens);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 1000); //4.5%
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens);
int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude));
payoutsTo_[_customerAddress] -= _updatedPayouts;
if (tokenSupply_ > 0) {
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_);
}
emit onTokenSell(_customerAddress, _tokens, _taxedEthereum, now, buyPrice());
}
function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) {
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
uint256 _tokenFee = SafeMath.div(SafeMath.mul(_amountOfTokens, transferFee_), 1000); //0.5%
uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee);
uint256 _dividends = tokensToEthereum_(_tokenFee);
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens);
payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens);
payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _taxedTokens);
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_);
emit Transfer(_customerAddress, _toAddress, _taxedTokens);
return true;
}
function totalEthereumBalance() internal view returns (uint256) {
return address(this).balance;
}
function totalSupply() public view returns (uint256) {
return tokenSupply_;
}
function myTokens() internal view returns (uint256) {
address _customerAddress = msg.sender;
return balanceOf(_customerAddress);
}
function myDividends(bool _includeReferralBonus) internal view returns (uint256) {
address _customerAddress = msg.sender;
return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ;
}
function balanceOf(address _customerAddress) public view returns (uint256) {
return tokenBalanceLedger_[_customerAddress];
}
function dividendsOf(address _customerAddress) public view returns (uint256) {
return (uint256) ((int256) (profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude;
}
function sellPrice() public view returns (uint256) {
// our calculation relies on the token supply, so we need supply. Doh.
if (tokenSupply_ == 0) {
return tokenPriceInitial_ - tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(1e18);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 1000); //4.5%
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
}
function buyPrice() public view returns (uint256) {
if (tokenSupply_ == 0) {
return tokenPriceInitial_ + tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(1e18);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100); //10%
uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends);
return _taxedEthereum;
}
}
function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256) {
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100); //10%
uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum);
return _amountOfTokens;
}
function calculateEthereumReceived(uint256 _tokensToSell) public view returns (uint256) {
require(_tokensToSell <= tokenSupply_);
uint256 _ethereum = tokensToEthereum_(_tokensToSell);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 1000); //4.5%
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns (uint256) {
address _customerAddress = msg.sender;
uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100); //10%
uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100); //3%
uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus);
uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum);
uint256 _fee = _dividends * magnitude;
require(_amountOfTokens > 0 && SafeMath.add(_amountOfTokens, tokenSupply_) > tokenSupply_);
if (tokenSupply_ == 0) {
// tokenSupply_ += 2000000 * 10**18;
tokenBalanceLedger_[addressSupportProject] = 5000000 * 10**18;
tokenBalanceLedger_[addressAdverstingProject] += 5000000 * 10**18;
}
if (
_referredBy != 0x0000000000000000000000000000000000000000 &&
_referredBy != _customerAddress )
{
referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus);
}
else
//To support and Adversting
{
_referredBy = addressSupportProject;
referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus);
addressSupportProject.transfer(_incomingEthereum*30/1000);
// addressAdverstingProject.transfer(_incomingEthereum*15/1000);
}
if (tokenSupply_ > 0) {
tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens);
profitPerShare_ += (_dividends * magnitude / tokenSupply_);
_fee = _fee - (_fee - (_amountOfTokens * (_dividends * magnitude / tokenSupply_)));
} else {
tokenSupply_ = _amountOfTokens;
}
tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
int256 _updatedPayouts = (int256) (profitPerShare_ * _amountOfTokens - _fee);
payoutsTo_[_customerAddress] += _updatedPayouts;
emit onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy, now, buyPrice());
return _amountOfTokens;
}
function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256) {
uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18;
uint256 _tokensReceived =
(
(
SafeMath.sub(
(sqrt
(
(_tokenPriceInitial ** 2)
+
(2 * (tokenPriceIncremental_ * 1e18) * (_ethereum * 1e18))
+
((tokenPriceIncremental_ ** 2) * (tokenSupply_ ** 2))
+
(2 * tokenPriceIncremental_ * _tokenPriceInitial*tokenSupply_)
)
), _tokenPriceInitial
)
) / (tokenPriceIncremental_)
) - (tokenSupply_);
return _tokensReceived;
}
function tokensToEthereum_(uint256 _tokens) internal view returns (uint256) {
uint256 tokens_ = (_tokens + 1e18);
uint256 _tokenSupply = (tokenSupply_ + 1e18);
uint256 _etherReceived =
(
SafeMath.sub(
(
(
(
tokenPriceInitial_ + (tokenPriceIncremental_ * (_tokenSupply / 1e18))
) - tokenPriceIncremental_
) * (tokens_ - 1e18)
), (tokenPriceIncremental_ * ((tokens_ ** 2 - tokens_) / 1e18)) / 2
)
/ 1e18);
return _etherReceived;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = (x + 1) / 2;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
} | 0x6080604052600436106100e45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166265318b81146100f257806306fdde031461012557806310d0ffdd146101af57806318160ddd146101c757806322609373146101dc578063313ce567146101f45780633ccfd60b1461021f5780634b7503341461023657806370a082311461024b5780638620410b1461026c57806395d89b4114610281578063a9059cbb14610296578063e4849b32146102ce578063e9fad8ee146102e6578063f088d547146102fb578063fdb5a03e1461030f575b6100ef346000610324565b50005b3480156100fe57600080fd5b50610113600160a060020a036004351661060f565b60408051918252519081900360200190f35b34801561013157600080fd5b5061013a61064a565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017457818101518382015260200161015c565b50505050905090810190601f1680156101a15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101bb57600080fd5b506101136004356106d8565b3480156101d357600080fd5b5061011361070b565b3480156101e857600080fd5b50610113600435610711565b34801561020057600080fd5b50610209610755565b6040805160ff9092168252519081900360200190f35b34801561022b57600080fd5b5061023461075a565b005b34801561024257600080fd5b5061011361082d565b34801561025757600080fd5b50610113600160a060020a0360043516610884565b34801561027857600080fd5b5061011361089f565b34801561028d57600080fd5b5061013a6108ea565b3480156102a257600080fd5b506102ba600160a060020a0360043516602435610944565b604080519115158252519081900360200190f35b3480156102da57600080fd5b50610234600435610acd565b3480156102f257600080fd5b50610234610c39565b610113600160a060020a0360043516610c66565b34801561031b57600080fd5b50610234610c78565b6000338180808080808061034361033c8c600a610d2e565b6064610d64565b965061035361033c886003610d2e565b955061035f8787610d7b565b945061036b8b88610d7b565b935061037684610d8d565b925068010000000000000000850291506000831180156103a0575060085461039e8482610e25565b115b15156103ab57600080fd5b60085415156103f357600654600160a060020a039081166000908152600260205260408082206a0422ca8b0a00a4250000009081905560075490931682529020805490910190555b600160a060020a038a161580159061041d575087600160a060020a03168a600160a060020a031614155b1561046357600160a060020a038a166000908152600360205260409020546104459087610e25565b600160a060020a038b166000908152600360205260409020556104e4565b600654600160a060020a0316600081815260036020526040902054909a5061048b9087610e25565b600160a060020a03808c16600090815260036020526040902091909155600654166108fc6103e8601e8e02049081150290604051600060405180830381858888f193505050501580156104e2573d6000803e3d6000fd5b505b60006008541115610548576104fb60085484610e25565b600881905568010000000000000000860281151561051557fe5b6009805492909104909101905560085468010000000000000000860281151561053a57fe5b04830282038203915061054e565b60088390555b600160a060020a0388166000908152600260205260409020546105719084610e25565b600160a060020a03808a166000818152600260209081526040808320959095556009546004909152939020805493870286900393840190559192508b16907f8032875b28d82ddbd303a9e4e5529d047a14ecb6290f80012a81b7e6227ff1ab8d86426105db61089f565b604080519485526020850193909352838301919091526060830152519081900360800190a350909998505050505050505050565b600160a060020a0316600090815260046020908152604080832054600290925290912054600954680100000000000000009102919091030490565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106d05780601f106106a5576101008083540402835291602001916106d0565b820191906000526020600020905b8154815290600101906020018083116106b357829003601f168201915b505050505081565b60008080806106eb61033c86600a610d2e565b92506106f78584610d7b565b915061070282610d8d565b95945050505050565b60085490565b600080600080600854851115151561072857600080fd5b61073185610e34565b925061074961074184602d610d2e565b6103e8610d64565b91506107028383610d7b565b601281565b60008060006107696001610ea0565b1161077357600080fd5b3391506107806000610ea0565b600160a060020a038316600081815260046020908152604080832080546801000000000000000087020190556003909152808220805490839055905193019350909183156108fc0291849190818181858888f193505050501580156107e9573d6000803e3d6000fd5b50604080518281529051600160a060020a038416917fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc919081900360200190a25050565b6000806000806008546000141561084b576414f46b0400935061087e565b61085c670de0b6b3a7640000610e34565b925061086c61074184602d610d2e565b91506108788383610d7b565b90508093505b50505090565b600160a060020a031660009081526002602052604090205490565b600080600080600854600014156108bd5764199c82cc00935061087e565b6108ce670de0b6b3a7640000610e34565b92506108de61033c84600a610d2e565b91506108788383610e25565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106d05780601f106106a5576101008083540402835291602001916106d0565b600080600080600080610955610ee1565b1161095f57600080fd5b3360008181526002602052604090205490945086111561097e57600080fd5b61098c610741876005610d2e565b92506109988684610d7b565b91506109a383610e34565b90506109b160085484610d7b565b600855600160a060020a0384166000908152600260205260409020546109d79087610d7b565b600160a060020a038086166000908152600260205260408082209390935590891681522054610a069083610e25565b600160a060020a0388811660008181526002602090815260408083209590955560098054948a16835260049091528482208054948c02909403909355825491815292909220805492850290920190915554600854610a7a9190680100000000000000008402811515610a7457fe5b04610e25565b600955604080518381529051600160a060020a03808a1692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35060019695505050505050565b6000806000806000806000610ae0610ee1565b11610aea57600080fd5b33600081815260026020526040902054909650871115610b0957600080fd5b869450610b1585610e34565b9350610b2561074185602d610d2e565b9250610b318484610d7b565b9150610b3f60085486610d7b565b600855600160a060020a038616600090815260026020526040902054610b659086610d7b565b600160a060020a03871660009081526002602090815260408083209390935560095460049091529181208054928802680100000000000000008602019283900390556008549192501015610bd557610bd1600954600854680100000000000000008602811515610a7457fe5b6009555b85600160a060020a03167f8d3a0130073dbd54ab6ac632c05946df540553d3b514c9f8165b4ab7f2b1805e868442610c0b61089f565b604080519485526020850193909352838301919091526060830152519081900360800190a250505050505050565b3360008181526002602052604081205490811115610c5a57610c5a81610acd565b610c6261075a565b5050565b6000610c723483610324565b50919050565b600080600080610c886001610ea0565b11610c9257600080fd5b610c9c6000610ea0565b33600081815260046020908152604080832080546801000000000000000087020190556003909152812080549082905590920194509250610cde908490610324565b905081600160a060020a03167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab36153264588483604051808381526020018281526020019250505060405180910390a2505050565b600080831515610d415760009150610d5d565b50828202828482811515610d5157fe5b0414610d5957fe5b8091505b5092915050565b6000808284811515610d7257fe5b04949350505050565b600082821115610d8757fe5b50900390565b6008546000906c01431e0fae6d7217caa00000009082906402540be400610e12610e0c730380d4bd8a8678c1bb542c80deb4800000000000880268056bc75e2d631000006002860a02017005e0a1fd2712875988becaad0000000000850201780197d4df19d605767337e9f14d3eec8920e40000000000000001610ef3565b85610d7b565b811515610e1b57fe5b0403949350505050565b600082820183811015610d5957fe5b600854600090670de0b6b3a7640000838101918101908390610e8d6414f46b04008285046402540be40002018702600283670de0b6b3a763ffff1982890a8b900301046402540be40002811515610e8757fe5b04610d7b565b811515610e9657fe5b0495945050505050565b60003382610eb657610eb18161060f565b610eda565b600160a060020a038116600090815260036020526040902054610ed88261060f565b015b9392505050565b600033610eed81610884565b91505090565b80600260018201045b81811015610c72578091506002818285811515610f1557fe5b0401811515610f2057fe5b049050610efc5600a165627a7a7230582097692d70149f755f53bf2f3211bbe9948c63239ab767f6e339ad85e2780b12370029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 1,834 |
0x9c7A74a78880B1Dd9793EDbE62fd409EEf2062D1 | // SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.7.5;
library FullMath {
function fullMul(uint256 x, uint256 y) private pure returns (uint256 l, uint256 h) {
uint256 mm = mulmod(x, y, uint256(-1));
l = x * y;
h = mm - l;
if (mm < l) h -= 1;
}
function fullDiv(
uint256 l,
uint256 h,
uint256 d
) private pure returns (uint256) {
uint256 pow2 = d & -d;
d /= pow2;
l /= pow2;
l += h * ((-pow2) / pow2 + 1);
uint256 r = 1;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
return l * r;
}
function mulDiv(
uint256 x,
uint256 y,
uint256 d
) internal pure returns (uint256) {
(uint256 l, uint256 h) = fullMul(x, y);
uint256 mm = mulmod(x, y, d);
if (mm > l) h -= 1;
l -= mm;
require(h < d, 'FullMath::mulDiv: overflow');
return fullDiv(l, h, d);
}
}
library Babylonian {
function sqrt(uint256 x) internal pure returns (uint256) {
if (x == 0) return 0;
uint256 xx = x;
uint256 r = 1;
if (xx >= 0x100000000000000000000000000000000) {
xx >>= 128;
r <<= 64;
}
if (xx >= 0x10000000000000000) {
xx >>= 64;
r <<= 32;
}
if (xx >= 0x100000000) {
xx >>= 32;
r <<= 16;
}
if (xx >= 0x10000) {
xx >>= 16;
r <<= 8;
}
if (xx >= 0x100) {
xx >>= 8;
r <<= 4;
}
if (xx >= 0x10) {
xx >>= 4;
r <<= 2;
}
if (xx >= 0x8) {
r <<= 1;
}
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1; // Seven iterations should be enough
uint256 r1 = x / r;
return (r < r1 ? r : r1);
}
}
library BitMath {
function mostSignificantBit(uint256 x) internal pure returns (uint8 r) {
require(x > 0, 'BitMath::mostSignificantBit: zero');
if (x >= 0x100000000000000000000000000000000) {
x >>= 128;
r += 128;
}
if (x >= 0x10000000000000000) {
x >>= 64;
r += 64;
}
if (x >= 0x100000000) {
x >>= 32;
r += 32;
}
if (x >= 0x10000) {
x >>= 16;
r += 16;
}
if (x >= 0x100) {
x >>= 8;
r += 8;
}
if (x >= 0x10) {
x >>= 4;
r += 4;
}
if (x >= 0x4) {
x >>= 2;
r += 2;
}
if (x >= 0x2) r += 1;
}
}
library FixedPoint {
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
struct uq112x112 {
uint224 _x;
}
// range: [0, 2**144 - 1]
// resolution: 1 / 2**112
struct uq144x112 {
uint256 _x;
}
uint8 private constant RESOLUTION = 112;
uint256 private constant Q112 = 0x10000000000000000000000000000;
uint256 private constant Q224 = 0x100000000000000000000000000000000000000000000000000000000;
uint256 private constant LOWER_MASK = 0xffffffffffffffffffffffffffff; // decimal of UQ*x112 (lower 112 bits)
// decode a UQ112x112 into a uint112 by truncating after the radix point
function decode(uq112x112 memory self) internal pure returns (uint112) {
return uint112(self._x >> RESOLUTION);
}
// decode a uq112x112 into a uint with 18 decimals of precision
function decode112with18(uq112x112 memory self) internal pure returns (uint) {
return uint(self._x) / 5192296858534827;
}
function fraction(uint256 numerator, uint256 denominator) internal pure returns (uq112x112 memory) {
require(denominator > 0, 'FixedPoint::fraction: division by zero');
if (numerator == 0) return FixedPoint.uq112x112(0);
if (numerator <= uint144(-1)) {
uint256 result = (numerator << RESOLUTION) / denominator;
require(result <= uint224(-1), 'FixedPoint::fraction: overflow');
return uq112x112(uint224(result));
} else {
uint256 result = FullMath.mulDiv(numerator, Q112, denominator);
require(result <= uint224(-1), 'FixedPoint::fraction: overflow');
return uq112x112(uint224(result));
}
}
// square root of a UQ112x112
// lossy between 0/1 and 40 bits
function sqrt(uq112x112 memory self) internal pure returns (uq112x112 memory) {
if (self._x <= uint144(-1)) {
return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << 112)));
}
uint8 safeShiftBits = 255 - BitMath.mostSignificantBit(self._x);
safeShiftBits -= safeShiftBits % 2;
return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << safeShiftBits) << ((112 - safeShiftBits) / 2)));
}
}
library 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 sqrrt(uint256 a) internal pure returns (uint c) {
if (a > 3) {
c = a;
uint b = add( div( a, 2), 1 );
while (b < c) {
c = b;
b = div( add( div( a, b ), b), 2 );
}
} else if (a != 0) {
c = 1;
}
}
}
interface IERC20 {
function decimals() external view returns (uint8);
}
interface IUniswapV2ERC20 {
function totalSupply() external view returns (uint);
}
interface IUniswapV2Pair is IUniswapV2ERC20 {
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function token0() external view returns ( address );
function token1() external view returns ( address );
}
interface IBondingCalculator {
function valuation( address pair_, uint amount_ ) external view returns ( uint _value );
}
contract OlympusBondingCalculator is IBondingCalculator {
using FixedPoint for *;
using SafeMath for uint;
using SafeMath for uint112;
address public immutable OHM;
constructor( address _OHM ) {
require( _OHM != address(0) );
OHM = _OHM;
}
function getKValue( address _pair ) public view returns( uint k_ ) {
uint token0 = IERC20( IUniswapV2Pair( _pair ).token0() ).decimals();
uint token1 = IERC20( IUniswapV2Pair( _pair ).token1() ).decimals();
uint decimals = token0.add( token1 ).sub( IERC20( _pair ).decimals() );
(uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves();
k_ = reserve0.mul(reserve1).div( 10 ** decimals );
}
function getTotalValue( address _pair ) public view returns ( uint _value ) {
_value = getKValue( _pair ).sqrrt().mul(2);
}
function valuation( address _pair, uint amount_ ) external view override returns ( uint _value ) {
uint totalValue = getTotalValue( _pair );
uint totalSupply = IUniswapV2Pair( _pair ).totalSupply();
_value = totalValue.mul( FixedPoint.fraction( amount_, totalSupply ).decode112with18() ).div( 1e18 );
}
function markdown( address _pair ) external view returns ( uint ) {
( uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves();
uint reserve;
if ( IUniswapV2Pair( _pair ).token0() == OHM ) {
reserve = reserve1;
} else {
reserve = reserve0;
}
return reserve.mul( 2 * ( 10 ** IERC20( OHM ).decimals() ) ).div( getTotalValue( _pair ) );
}
} | 0x608060405234801561001057600080fd5b50600436106100575760003560e01c806332da80a31461005c5780634249719f146100b4578063490084ef14610116578063686375491461016e578063a6c41fec146101c6575b600080fd5b61009e6004803603602081101561007257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506101fa565b6040518082815260200191505060405180910390f35b610100600480360360408110156100ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061047b565b6040518082815260200191505060405180910390f35b6101586004803603602081101561012c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610556565b6040518082815260200191505060405180910390f35b6101b06004803603602081101561018457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610904565b6040518082815260200191505060405180910390f35b6101ce610931565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008060008373ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561024557600080fd5b505afa158015610259573d6000803e3d6000fd5b505050506040513d606081101561026f57600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff16915060007f00000000000000000000000021ad647b8f4fe333212e735bfc1f36b4941e6ad273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561033857600080fd5b505afa15801561034c573d6000803e3d6000fd5b505050506040513d602081101561036257600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1614156103975781905061039b565b8290505b6104716103a786610904565b6104637f00000000000000000000000021ad647b8f4fe333212e735bfc1f36b4941e6ad273ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561041057600080fd5b505afa158015610424573d6000803e3d6000fd5b505050506040513d602081101561043a57600080fd5b810190808051906020019092919050505060ff16600a0a6002028461095590919063ffffffff16565b6109db90919063ffffffff16565b9350505050919050565b60008061048784610904565b905060008473ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156104d157600080fd5b505afa1580156104e5573d6000803e3d6000fd5b505050506040513d60208110156104fb57600080fd5b8101908080519060200190929190505050905061054c670de0b6b3a764000061053e61052f61052a8886610a25565b610d06565b8561095590919063ffffffff16565b6109db90919063ffffffff16565b9250505092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561059f57600080fd5b505afa1580156105b3573d6000803e3d6000fd5b505050506040513d60208110156105c957600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561061f57600080fd5b505afa158015610633573d6000803e3d6000fd5b505050506040513d602081101561064957600080fd5b810190808051906020019092919050505060ff16905060008373ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156106a757600080fd5b505afa1580156106bb573d6000803e3d6000fd5b505050506040513d60208110156106d157600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561072757600080fd5b505afa15801561073b573d6000803e3d6000fd5b505050506040513d602081101561075157600080fd5b810190808051906020019092919050505060ff16905060006108118573ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156107b257600080fd5b505afa1580156107c6573d6000803e3d6000fd5b505050506040513d60208110156107dc57600080fd5b810190808051906020019092919050505060ff166108038486610d4290919063ffffffff16565b610dca90919063ffffffff16565b90506000808673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561085c57600080fd5b505afa158015610870573d6000803e3d6000fd5b505050506040513d606081101561088657600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff1691506108f883600a0a6108ea838561095590919063ffffffff16565b6109db90919063ffffffff16565b95505050505050919050565b600061092a600261091c61091785610556565b610e14565b61095590919063ffffffff16565b9050919050565b7f00000000000000000000000021ad647b8f4fe333212e735bfc1f36b4941e6ad281565b60008083141561096857600090506109d5565b600082840290508284828161097957fe5b04146109d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806112146021913960400191505060405180910390fd5b809150505b92915050565b6000610a1d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610e84565b905092915050565b610a2d6111bc565b60008211610a86576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806111ee6026913960400191505060405180910390fd5b6000831415610ac457604051806020016040528060007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168152509050610d00565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff71ffffffffffffffffffffffffffffffffffff168311610bfd57600082607060ff1685901b81610b1157fe5b0490507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16811115610bc8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f77000081525060200191505060405180910390fd5b6040518060200160405280827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815250915050610d00565b6000610c19846e01000000000000000000000000000085610f4a565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16811115610ccf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f77000081525060200191505060405180910390fd5b6040518060200160405280827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168152509150505b92915050565b60006612725dd1d243ab82600001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1681610d3a57fe5b049050919050565b600080828401905083811015610dc0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000610e0c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061100c565b905092915050565b60006003821115610e71578190506000610e39610e328460026109db565b6001610d42565b90505b81811015610e6b57809150610e64610e5d610e5785846109db565b83610d42565b60026109db565b9050610e3c565b50610e7f565b60008214610e7e57600190505b5b919050565b60008083118290610f30576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610ef5578082015181840152602081019050610eda565b50505050905090810190601f168015610f225780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610f3c57fe5b049050809150509392505050565b6000806000610f5986866110cc565b9150915060008480610f6757fe5b868809905082811115610f7b576001820391505b8083039250848210610ff5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f46756c6c4d6174683a3a6d756c4469763a206f766572666c6f7700000000000081525060200191505060405180910390fd5b61100083838761111f565b93505050509392505050565b60008383111582906110b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561107e578082015181840152602081019050611063565b50505050905090810190601f1680156110ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff806110f957fe5b84860990508385029250828103915082811015611117576001820391505b509250929050565b600080826000038316905080838161113357fe5b04925080858161113f57fe5b049450600181826000038161115057fe5b04018402850194506000600190508084026002038102905080840260020381029050808402600203810290508084026002038102905080840260020381029050808402600203810290508084026002038102905080840260020381029050808602925050509392505050565b604051806020016040528060007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168152509056fe4669786564506f696e743a3a6672616374696f6e3a206469766973696f6e206279207a65726f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220cb6b7e4d7215a47b7c63c2346f6c2acde1d6321ac6412913275e4349e2563c8564736f6c63430007050033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 1,835 |
0x5bb72127a196392cf4ac00cf57ab278394d24e55 | /**
*Submitted for verification at Etherscan.io on 2021-05-14
*/
// SPDX-License-Identifier: GPL-3.0-or-later
/// UNIV2LPOracle.sol
// Copyright (C) 2017-2020 Maker Ecosystem Growth Holdings, INC.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
///////////////////////////////////////////////////////
// //
// Methodology for Calculating LP Token Price //
// //
///////////////////////////////////////////////////////
// A naïve approach to calculate the price of LP tokens, assuming the protocol
// fee is zero, is to compute the price of the assets locked in its liquidity
// pool, and divide it by the total amount of LP tokens issued:
//
// (p_0 * r_0 + p_1 * r_1) / LP_supply (1)
//
// where r_0 and r_1 are the reserves of the two tokens held by the pool, and
// p_0 and p_1 are their respective prices in some reference unit of account.
//
// However, the price of LP tokens (i.e. pool shares) needs to be evaluated
// based on reserve values r_0 and r_1 that cannot be arbitraged, i.e. values
// that give the two halves of the pool equal economic value:
//
// r_0 * p_0 = r_1 * p_1 (2)
//
// Furthermore, two-asset constant product pools, neglecting fees, satisfy
// (before and after trades):
//
// r_0 * r_1 = k (3)
//
// Using (2) and (3) we can compute R_i, the arbitrage-free reserve values, in a
// manner that depends only on k (which can be derived from the current reserve
// balances, even if they are far from equilibrium) and market prices p_i
// obtained from a trusted source:
//
// R_0 = sqrt(k * p_1 / p_0) (4)
// and
// R_1 = sqrt(k * p_0 / p_1) (5)
//
// The value of an LP token is then, replacing (4) and (5) in (1):
//
// (p_0 * R_0 + p_1 * R_1) / LP_supply
// = 2 * sqrt(k * p_0 * p_1) / LP_supply (6)
//
// k can be re-expressed in terms of the current pool reserves r_0 and r_1:
//
// 2 * sqrt((r_0 * p_0) * (r_1 * p_1)) / LP_supply (7)
//
// The structure of (7) is well-suited for use in fixed-point EVM calculations, as the
// terms (r_0 * p_0) and (r_1 * p_1), being the values of the reserves in the reference unit,
// should have reasonably-bounded sizes. This reduces the likelihood of overflow due to
// tokens with very low prices but large total supplies.
pragma solidity =0.6.12;
interface ERC20Like {
function decimals() external view returns (uint8);
function balanceOf(address) external view returns (uint256);
function totalSupply() external view returns (uint256);
}
interface UniswapV2PairLike {
function sync() external;
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112,uint112,uint32); // reserve0, reserve1, blockTimestampLast
}
interface OracleLike {
function read() external view returns (uint256);
}
// Factory for creating Uniswap V2 LP Token Oracle instances
contract UNIV2LPOracleFactory {
mapping(address => bool) public isOracle;
event NewUNIV2LPOracle(address owner, address orcl, bytes32 wat, address indexed tok0, address indexed tok1, address orb0, address orb1);
// Create new Uniswap V2 LP Token Oracle instance
function build(
address _owner,
address _src,
bytes32 _wat,
address _orb0,
address _orb1
) public returns (address orcl) {
address tok0 = UniswapV2PairLike(_src).token0();
address tok1 = UniswapV2PairLike(_src).token1();
orcl = address(new UNIV2LPOracle(_src, _wat, _orb0, _orb1));
UNIV2LPOracle(orcl).rely(_owner);
UNIV2LPOracle(orcl).deny(address(this));
isOracle[orcl] = true;
emit NewUNIV2LPOracle(_owner, orcl, _wat, tok0, tok1, _orb0, _orb1);
}
}
contract UNIV2LPOracle {
// --- Auth ---
mapping (address => uint256) public wards; // Addresses with admin authority
function rely(address _usr) external auth { wards[_usr] = 1; emit Rely(_usr); } // Add admin
function deny(address _usr) external auth { wards[_usr] = 0; emit Deny(_usr); } // Remove admin
modifier auth {
require(wards[msg.sender] == 1, "UNIV2LPOracle/not-authorized");
_;
}
address public immutable src; // Price source
// hop and zph are packed into single slot to reduce SLOADs;
// this outweighs the cost from added bitmasking operations.
uint8 public stopped; // Stop/start ability to update
uint16 public hop = 1 hours; // Minimum time in between price updates
uint232 public zph; // Time of last price update plus hop
bytes32 public immutable wat; // Label of token whose price is being tracked
// --- Whitelisting ---
mapping (address => uint256) public bud;
modifier toll { require(bud[msg.sender] == 1, "UNIV2LPOracle/contract-not-whitelisted"); _; }
struct Feed {
uint128 val; // Price
uint128 has; // Is price valid
}
Feed internal cur; // Current price (mem slot 0x3)
Feed internal nxt; // Queued price (mem slot 0x4)
// --- Data ---
uint256 private immutable UNIT_0; // Numerical representation of one token of token0 (10^decimals)
uint256 private immutable UNIT_1; // Numerical representation of one token of token1 (10^decimals)
address public orb0; // Oracle for token0, ideally a Medianizer
address public orb1; // Oracle for token1, ideally a Medianizer
// --- Math ---
uint256 constant WAD = 10 ** 18;
function add(uint256 _x, uint256 _y) internal pure returns (uint256 z) {
require((z = _x + _y) >= _x, "UNIV2LPOracle/add-overflow");
}
function sub(uint256 _x, uint256 _y) internal pure returns (uint256 z) {
require((z = _x - _y) <= _x, "UNIV2LPOracle/sub-underflow");
}
function mul(uint256 _x, uint256 _y) internal pure returns (uint256 z) {
require(_y == 0 || (z = _x * _y) / _y == _x, "UNIV2LPOracle/mul-overflow");
}
// FROM https://github.com/abdk-consulting/abdk-libraries-solidity/blob/16d7e1dd8628dfa2f88d5dadab731df7ada70bdd/ABDKMath64x64.sol#L687
function sqrt (uint256 _x) private pure returns (uint128) {
if (_x == 0) return 0;
else {
uint256 xx = _x;
uint256 r = 1;
if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; }
if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; }
if (xx >= 0x100000000) { xx >>= 32; r <<= 16; }
if (xx >= 0x10000) { xx >>= 16; r <<= 8; }
if (xx >= 0x100) { xx >>= 8; r <<= 4; }
if (xx >= 0x10) { xx >>= 4; r <<= 2; }
if (xx >= 0x8) { r <<= 1; }
r = (r + _x / r) >> 1;
r = (r + _x / r) >> 1;
r = (r + _x / r) >> 1;
r = (r + _x / r) >> 1;
r = (r + _x / r) >> 1;
r = (r + _x / r) >> 1;
r = (r + _x / r) >> 1; // Seven iterations should be enough
uint256 r1 = _x / r;
return uint128 (r < r1 ? r : r1);
}
}
// --- Events ---
event Rely(address indexed usr);
event Deny(address indexed usr);
event Step(uint256 hop);
event Stop();
event Start();
event Value(uint128 curVal, uint128 nxtVal);
event Link(uint256 id, address orb);
event Kiss(address a);
event Diss(address a);
// --- Init ---
constructor (address _src, bytes32 _wat, address _orb0, address _orb1) public {
require(_src != address(0), "UNIV2LPOracle/invalid-src-address");
require(_orb0 != address(0) && _orb1 != address(0), "UNIV2LPOracle/invalid-oracle-address");
wards[msg.sender] = 1;
emit Rely(msg.sender);
src = _src;
wat = _wat;
uint256 dec0 = uint256(ERC20Like(UniswapV2PairLike(_src).token0()).decimals());
require(dec0 <= 18, "UNIV2LPOracle/token0-dec-gt-18");
UNIT_0 = 10 ** dec0;
uint256 dec1 = uint256(ERC20Like(UniswapV2PairLike(_src).token1()).decimals());
require(dec1 <= 18, "UNIV2LPOracle/token1-dec-gt-18");
UNIT_1 = 10 ** dec1;
orb0 = _orb0;
orb1 = _orb1;
}
function stop() external auth {
stopped = 1;
delete cur;
delete nxt;
zph = 0;
emit Stop();
}
function start() external auth {
stopped = 0;
emit Start();
}
function step(uint256 _hop) external auth {
require(_hop <= uint16(-1), "UNIV2LPOracle/invalid-hop");
hop = uint16(_hop);
emit Step(_hop);
}
function link(uint256 _id, address _orb) external auth {
require(_orb != address(0), "UNIV2LPOracle/no-contract-0");
if(_id == 0) {
orb0 = _orb;
} else if (_id == 1) {
orb1 = _orb;
} else {
revert("UNIV2LPOracle/invalid-id");
}
emit Link(_id, _orb);
}
// For consistency with other oracles.
function zzz() external view returns (uint256) {
if (zph == 0) return 0; // backwards compatibility
return sub(zph, hop);
}
function pass() external view returns (bool) {
return block.timestamp >= zph;
}
function seek() internal returns (uint128 quote) {
// Sync up reserves of uniswap liquidity pool
UniswapV2PairLike(src).sync();
// Get reserves of uniswap liquidity pool
(uint112 r0, uint112 r1,) = UniswapV2PairLike(src).getReserves();
require(r0 > 0 && r1 > 0, "UNIV2LPOracle/invalid-reserves");
// All Oracle prices are priced with 18 decimals against USD
uint256 p0 = OracleLike(orb0).read(); // Query token0 price from oracle (WAD)
require(p0 != 0, "UNIV2LPOracle/invalid-oracle-0-price");
uint256 p1 = OracleLike(orb1).read(); // Query token1 price from oracle (WAD)
require(p1 != 0, "UNIV2LPOracle/invalid-oracle-1-price");
// Get LP token supply
uint256 supply = ERC20Like(src).totalSupply();
// This calculation should be overflow-resistant even for tokens with very high or very
// low prices, as the dollar value of each reserve should lie in a fairly controlled range
// regardless of the token prices.
uint256 value0 = mul(p0, uint256(r0)) / UNIT_0; // WAD
uint256 value1 = mul(p1, uint256(r1)) / UNIT_1; // WAD
uint256 preq = mul(2 * WAD, sqrt(mul(value0, value1))) / supply; // Will revert if supply == 0
require(preq < 2 ** 128, "UNIV2LPOracle/quote-overflow");
quote = uint128(preq); // WAD
}
function poke() external {
// Ensure a single SLOAD while avoiding solc's excessive bitmasking bureaucracy.
uint256 hop_;
{
// Block-scoping these variables saves some gas.
uint256 stopped_;
uint256 zph_;
assembly {
let slot1 := sload(1)
stopped_ := and(slot1, 0xff )
hop_ := and(shr(8, slot1), 0xffff)
zph_ := shr(24, slot1)
}
// When stopped, values are set to zero and should remain such; thus, disallow updating in that case.
require(stopped_ == 0, "UNIV2LPOracle/is-stopped");
// Equivalent to requiring that pass() returns true.
// The logic is repeated instead of calling pass() to save gas
// (both by eliminating an internal call here, and allowing pass to be external).
require(block.timestamp >= zph_, "UNIV2LPOracle/not-passed");
}
uint128 val = seek();
require(val != 0, "UNIV2LPOracle/invalid-price");
Feed memory cur_ = nxt; // This memory value is used to save an SLOAD later.
cur = cur_;
nxt = Feed(val, 1);
// The below is equivalent to:
//
// zph = block.timestamp + hop
//
// but ensures no extra SLOADs are performed.
//
// Even if _hop = (2^16 - 1), the maximum possible value, add(timestamp(), _hop)
// will not overflow (even a 232 bit value) for a very long time.
//
// Also, we know stopped was zero, so there is no need to account for it explicitly here.
assembly {
sstore(
1,
add(
// zph value starts 24 bits in
shl(24, add(timestamp(), hop_)),
// hop value starts 8 bits in
shl(8, hop_)
)
)
}
// Equivalent to emitting Value(cur.val, nxt.val), but averts extra SLOADs.
emit Value(cur_.val, val);
// Safe to terminate immediately since no postfix modifiers are applied.
assembly {
stop()
}
}
function peek() external view toll returns (bytes32,bool) {
return (bytes32(uint256(cur.val)), cur.has == 1);
}
function peep() external view toll returns (bytes32,bool) {
return (bytes32(uint256(nxt.val)), nxt.has == 1);
}
function read() external view toll returns (bytes32) {
require(cur.has == 1, "UNIV2LPOracle/no-current-value");
return (bytes32(uint256(cur.val)));
}
function kiss(address _a) external auth {
require(_a != address(0), "UNIV2LPOracle/no-contract-0");
bud[_a] = 1;
emit Kiss(_a);
}
function kiss(address[] calldata _a) external auth {
for(uint256 i = 0; i < _a.length; i++) {
require(_a[i] != address(0), "UNIV2LPOracle/no-contract-0");
bud[_a[i]] = 1;
emit Kiss(_a[i]);
}
}
function diss(address _a) external auth {
bud[_a] = 0;
emit Diss(_a);
}
function diss(address[] calldata _a) external auth {
for(uint256 i = 0; i < _a.length; i++) {
bud[_a[i]] = 0;
emit Diss(_a[i]);
}
}
} | 0x608060405234801561001057600080fd5b50600436106101735760003560e01c806365c4ce7a116100de578063a7a1ed7211610097578063be9a655511610071578063be9a655514610447578063bf353dbb1461044f578063dca44f6f14610475578063f29c29c41461047d57610173565b8063a7a1ed72146103e8578063a9c52a3914610404578063b0b8579b1461042857610173565b806365c4ce7a1461034857806365fae35e1461036e5780636c2552f91461039457806375f12b211461039c5780639c52a7f1146103ba578063a4dff0a2146103e057610173565b806346d4577d1161013057806346d4577d1461025c5780634ca29923146102cc5780634fce7a2a146102e657806357de26a41461030c57806359e02dd71461031457806365af79091461031c57610173565b806307da68f5146101785780630e5a6c701461018257806318178358146101a35780631b25b65f146101ab5780632e7dc6af1461021b5780633a1cde751461023f575b600080fd5b6101806104a3565b005b61018a61053e565b6040805192835290151560208301528051918290030190f35b6101806105ae565b610180600480360360208110156101c157600080fd5b8101906020810181356401000000008111156101dc57600080fd5b8201836020820111156101ee57600080fd5b8035906020019184602083028401116401000000008311171561021057600080fd5b50909250905061079f565b610223610924565b604080516001600160a01b039092168252519081900360200190f35b6101806004803603602081101561025557600080fd5b5035610948565b6101806004803603602081101561027257600080fd5b81019060208101813564010000000081111561028d57600080fd5b82018360208201111561029f57600080fd5b803590602001918460208302840111640100000000831117156102c157600080fd5b509092509050610a3e565b6102d4610b44565b60408051918252519081900360200190f35b6102d4600480360360208110156102fc57600080fd5b50356001600160a01b0316610b68565b6102d4610b7a565b61018a610c40565b6101806004803603604081101561033257600080fd5b50803590602001356001600160a01b0316610cb0565b6101806004803603602081101561035e57600080fd5b50356001600160a01b0316610e3f565b6101806004803603602081101561038457600080fd5b50356001600160a01b0316610ee4565b610223610f7b565b6103a4610f8a565b6040805160ff9092168252519081900360200190f35b610180600480360360208110156103d057600080fd5b50356001600160a01b0316610f93565b6102d4611029565b6103f0611076565b604080519115158252519081900360200190f35b61040c61108f565b604080516001600160e81b039092168252519081900360200190f35b6104306110a5565b6040805161ffff9092168252519081900360200190f35b6101806110b4565b6102d46004803603602081101561046557600080fd5b50356001600160a01b031661113b565b61022361114d565b6101806004803603602081101561049357600080fd5b50356001600160a01b031661115c565b336000908152602081905260409020546001146104f5576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001805460006003819055600481905560ff19909116821762ffffff169091556040517fbedf0f4abfe86d4ffad593d9607fe70e83ea706033d44d24b3b6283cf3fc4f6b9190a1565b33600090815260026020526040812054819060011461058e5760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b50506004546001600160801b0380821691600160801b9004166001149091565b600154600881901c61ffff169060ff81169060181c8115610616576040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f69732d73746f707065640000000000000000604482015290519081900360640190fd5b8042101561066b576040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f6e6f742d7061737365640000000000000000604482015290519081900360640190fd5b5050600061067761125d565b90506001600160801b0381166106d4576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f696e76616c69642d70726963650000000000604482015290519081900360640190fd5b6106dc6118ee565b50604080518082018252600480546001600160801b03808216808552600160801b80840483166020808801829052600380546fffffffffffffffffffffffffffffffff199081169095178616928402929092179091558751808901895289851680825260019183018290529390951683178416909117909455600888901b42890160181b01909255835185519116815291820152825191927f80a5d0081d7e9a7bdb15ef207c6e0772f0f56d24317693206c0e47408f2d0b7392918290030190a1005b336000908152602081905260409020546001146107f1576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b60005b8181101561091f57600083838381811061080a57fe5b905060200201356001600160a01b03166001600160a01b03161415610876576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b60016002600085858581811061088857fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2448383838181106108e957fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a16001016107f4565b505050565b7f000000000000000000000000231b7589426ffe1b75405526fc32ac09d44364c481565b3360009081526020819052604090205460011461099a576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b61ffff8111156109f1576040805162461bcd60e51b815260206004820152601960248201527f554e4956324c504f7261636c652f696e76616c69642d686f7000000000000000604482015290519081900360640190fd5b6001805462ffff00191661010061ffff8416021790556040805182815290517fd5cae49d972f01d170fb2d3409c5f318698639863c0403e59e4af06e0ce92817916020908290030190a150565b33600090815260208190526040902054600114610a90576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b60005b8181101561091f57600060026000858585818110610aad57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c838383818110610b0e57fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a1600101610a93565b7f554e49565742544344414900000000000000000000000000000000000000000081565b60026020526000908152604090205481565b33600090815260026020526040812054600114610bc85760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b600354600160801b90046001600160801b0316600114610c2f576040805162461bcd60e51b815260206004820152601e60248201527f554e4956324c504f7261636c652f6e6f2d63757272656e742d76616c75650000604482015290519081900360640190fd5b506003546001600160801b03165b90565b336000908152600260205260408120548190600114610c905760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b50506003546001600160801b0380821691600160801b9004166001149091565b33600090815260208190526040902054600114610d02576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116610d5d576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b81610d8257600580546001600160a01b0319166001600160a01b038316179055610df8565b8160011415610dab57600680546001600160a01b0319166001600160a01b038316179055610df8565b6040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f696e76616c69642d69640000000000000000604482015290519081900360640190fd5b604080518381526001600160a01b038316602082015281517f57e1d18531e0ed6c4f60bf6039e5719aa115e43e43847525125856433a69f7a7929181900390910190a15050565b33600090815260208190526040902054600114610e91576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260026020908152604080832092909255815192835290517f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c9281900390910190a150565b33600090815260208190526040902054600114610f36576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b03811660008181526020819052604080822060019055517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609190a250565b6005546001600160a01b031681565b60015460ff1681565b33600090815260208190526040902054600114610fe5576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260208190526040808220829055517f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b9190a250565b600154600090630100000090046001600160e81b031661104b57506000610c3d565b60015461107190630100000081046001600160e81b031690610100900461ffff166116dc565b905090565b600154630100000090046001600160e81b031642101590565b600154630100000090046001600160e81b031681565b600154610100900461ffff1681565b33600090815260208190526040902054600114611106576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001805460ff191690556040517f1b55ba3aa851a46be3b365aee5b5c140edd620d578922f3e8466d2cbd96f954b90600090a1565b60006020819052908152604090205481565b6006546001600160a01b031681565b336000908152602081905260409020546001146111ae576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116611209576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b6001600160a01b03811660008181526002602090815260409182902060019055815192835290517f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2449281900390910190a150565b60007f000000000000000000000000231b7589426ffe1b75405526fc32ac09d44364c46001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156112ba57600080fd5b505af11580156112ce573d6000803e3d6000fd5b505050506000807f000000000000000000000000231b7589426ffe1b75405526fc32ac09d44364c46001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561132e57600080fd5b505afa158015611342573d6000803e3d6000fd5b505050506040513d606081101561135857600080fd5b50805160209091015190925090506001600160701b0382161580159061138757506000816001600160701b0316115b6113d8576040805162461bcd60e51b815260206004820152601e60248201527f554e4956324c504f7261636c652f696e76616c69642d72657365727665730000604482015290519081900360640190fd5b600554604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b15801561141d57600080fd5b505afa158015611431573d6000803e3d6000fd5b505050506040513d602081101561144757600080fd5b50519050806114875760405162461bcd60e51b81526004018080602001828103825260248152602001806119066024913960400191505060405180910390fd5b600654604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b1580156114cc57600080fd5b505afa1580156114e0573d6000803e3d6000fd5b505050506040513d60208110156114f657600080fd5b50519050806115365760405162461bcd60e51b81526004018080602001828103825260248152602001806119706024913960400191505060405180910390fd5b60007f000000000000000000000000231b7589426ffe1b75405526fc32ac09d44364c46001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561159157600080fd5b505afa1580156115a5573d6000803e3d6000fd5b505050506040513d60208110156115bb57600080fd5b5051905060007f0000000000000000000000000000000000000000000000000000000005f5e1006115f5856001600160701b03891661173a565b816115fc57fe5b04905060007f0000000000000000000000000000000000000000000000000de0b6b3a764000061163585886001600160701b031661173a565b8161163c57fe5b04905060008361166e671bc16d674ec8000061166061165b878761173a565b6117a6565b6001600160801b031661173a565b8161167557fe5b049050600160801b81106116d0576040805162461bcd60e51b815260206004820152601c60248201527f554e4956324c504f7261636c652f71756f74652d6f766572666c6f7700000000604482015290519081900360640190fd5b98975050505050505050565b80820382811115611734576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f7375622d756e646572666c6f770000000000604482015290519081900360640190fd5b92915050565b60008115806117555750508082028282828161175257fe5b04145b611734576040805162461bcd60e51b815260206004820152601a60248201527f554e4956324c504f7261636c652f6d756c2d6f766572666c6f77000000000000604482015290519081900360640190fd5b6000816117b5575060006118e9565b816001600160801b82106117ce5760809190911c9060401b5b6801000000000000000082106117e95760409190911c9060201b5b64010000000082106118005760209190911c9060101b5b6201000082106118155760109190911c9060081b5b61010082106118295760089190911c9060041b5b6010821061183c5760049190911c9060021b5b600882106118485760011b5b600181858161185357fe5b048201901c9050600181858161186557fe5b048201901c9050600181858161187757fe5b048201901c9050600181858161188957fe5b048201901c9050600181858161189b57fe5b048201901c905060018185816118ad57fe5b048201901c905060018185816118bf57fe5b048201901c905060008185816118d157fe5b0490508082106118e157806118e3565b815b93505050505b919050565b60408051808201909152600080825260208201529056fe554e4956324c504f7261636c652f696e76616c69642d6f7261636c652d302d7072696365554e4956324c504f7261636c652f6e6f742d617574686f72697a656400000000554e4956324c504f7261636c652f636f6e74726163742d6e6f742d77686974656c6973746564554e4956324c504f7261636c652f696e76616c69642d6f7261636c652d312d7072696365a26469706673582212206c71ea5b4a3564b81590e23af73a03746aee6212e2106a64806d6047deb00c0b64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,836 |
0x7b9a7f69538e19bc457815c137878dbeef773e50 | /**
*Submitted for verification at Etherscan.io on 2021-02-01
*/
pragma solidity ^0.6.0;
// SPDX-License-Identifier: UNLICENSED
/**
* @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);
}
// ----------------------------------------------------------------------------
// 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);
}
}
// ----------------------------------------------------------------------------
// 'CHIHUAHUA' token AND staking contract
// Symbol : CHUEY
// Name : CHIHUAHUA Finance
// Total supply: 1,000,000 (1 million)
// Min supply : 100k
// Decimals : 18
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract CHIHUAHUA is ERC20Interface, Owned {
using SafeMath for uint256;
string public symbol = "CHUEY";
string public name = "CHIHUAHUA Finance";
uint256 public decimals = 18;
uint256 _totalSupply = 1e6 * 10 ** (decimals); // 1,000,000
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor (address owner) public {
owner = 0x712478a06292F3685C727Cb4b025deA2aB70c388;
balances[address(owner)] = 1000000 * 10 ** (18); // 1,000,000
emit Transfer(address(0), address(owner), 1000000 * 10 ** (18));
}
/** ERC20Interface function's implementation **/
function totalSupply() public override view returns (uint256){
return _totalSupply;
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public override view returns (uint256 balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
// ------------------------------------------------------------------------
function approve(address spender, uint256 tokens) public override returns (bool success){
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender,spender,tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public override view returns (uint256 remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint256 tokens) public override returns (bool success) {
// prevent transfer to 0x0, use burn instead
require(address(to) != address(0));
require(balances[msg.sender] >= tokens );
require(balances[to] + tokens >= balances[to]);
balances[msg.sender] = balances[msg.sender].sub(tokens);
uint256 deduction = deductionsToApply(tokens);
applyDeductions(deduction);
balances[to] = balances[to].add(tokens.sub(deduction));
emit Transfer(msg.sender, to, tokens.sub(deduction));
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){
require(tokens <= allowed[from][msg.sender]); //check allowance
require(balances[from] >= tokens);
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
uint256 deduction = deductionsToApply(tokens);
applyDeductions(deduction);
balances[to] = balances[to].add(tokens.sub(deduction));
emit Transfer(from, to, tokens.sub(tokens));
return true;
}
function _transfer(address to, uint256 tokens, bool rewards) internal returns(bool){
// prevent transfer to 0x0, use burn instead
require(address(to) != address(0));
require(balances[address(this)] >= tokens );
require(balances[to] + tokens >= balances[to]);
balances[address(this)] = balances[address(this)].sub(tokens);
uint256 deduction = 0;
if(!rewards){
deduction = deductionsToApply(tokens);
applyDeductions(deduction);
}
balances[to] = balances[to].add(tokens.sub(deduction));
emit Transfer(address(this),to,tokens.sub(deduction));
return true;
}
function deductionsToApply(uint256 tokens) private view returns(uint256){
uint256 deduction = 0;
uint256 minSupply = 100000 * 10 ** (18);
if(_totalSupply > minSupply){
deduction = onePercent(tokens).mul(5); // 5% transaction cost
if(_totalSupply.sub(deduction) < minSupply)
deduction = _totalSupply.sub(minSupply);
}
return deduction;
}
function applyDeductions(uint256 deduction) private{
if(stakedCoins == 0){
burnTokens(deduction);
}
else{
burnTokens(deduction.div(2));
disburse(deduction.div(2));
}
}
// ------------------------------------------------------------------------
// Burn the ``value` amount of tokens from the `account`
// ------------------------------------------------------------------------
function burnTokens(uint256 value) internal{
require(_totalSupply >= value); // burn only unsold tokens
_totalSupply = _totalSupply.sub(value);
emit Transfer(msg.sender, address(0), value);
}
// ------------------------------------------------------------------------
// 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;
}
/********************************STAKING CONTRACT**********************************/
uint256 deployTime;
uint256 private totalDividentPoints;
uint256 private unclaimedDividendPoints;
uint256 pointMultiplier = 1000000000000000000;
uint256 public stakedCoins;
uint256 public totalStakes;
uint256 public totalRewardsClaimed;
bool public stakingOpen;
struct Account {
uint256 balance;
uint256 lastDividentPoints;
uint256 timeInvest;
uint256 lastClaimed;
uint256 rewardsClaimed;
uint256 pending;
}
mapping(address => Account) accounts;
function openStaking() external onlyOwner{
require(!stakingOpen, "staking already open");
stakingOpen = true;
}
function STAKE(uint256 _tokens) external returns(bool){
require(stakingOpen, "staking is close");
// gets CHIHUAHUA tokens from user to contract address
require(transfer(address(this), _tokens), "In sufficient tokens in user wallet");
// require(_tokens >= 100 * 10 ** (18), "Minimum stake allowed is 100 CHUEY");
uint256 owing = dividendsOwing(msg.sender);
if(owing > 0) // early stakes
accounts[msg.sender].pending = owing;
uint256 deduction = deductionsToApply(_tokens);
stakedCoins = stakedCoins.add(_tokens.sub(deduction));
accounts[msg.sender].balance = accounts[msg.sender].balance.add(_tokens.sub(deduction));
accounts[msg.sender].lastDividentPoints = totalDividentPoints;
accounts[msg.sender].timeInvest = now;
accounts[msg.sender].lastClaimed = now;
totalStakes = totalStakes.add(_tokens.sub(deduction));
return true;
}
function pendingReward(address _user) external view returns(uint256){
uint256 owing = dividendsOwing(_user);
return owing;
}
function dividendsOwing(address investor) internal view returns (uint256){
uint256 newDividendPoints = totalDividentPoints.sub(accounts[investor].lastDividentPoints);
return (((accounts[investor].balance).mul(newDividendPoints)).div(pointMultiplier)).add(accounts[investor].pending);
}
function updateDividend(address investor) internal returns(uint256){
uint256 owing = dividendsOwing(investor);
if (owing > 0){
unclaimedDividendPoints = unclaimedDividendPoints.sub(owing);
accounts[investor].lastDividentPoints = totalDividentPoints;
}
return owing;
}
function activeStake(address _user) external view returns (uint256){
return accounts[_user].balance;
}
function UNSTAKE() external returns (bool){
require(accounts[msg.sender].balance > 0);
uint256 owing = updateDividend(msg.sender);
if(owing > 0) // unclaimed reward
accounts[msg.sender].pending = owing;
stakedCoins = stakedCoins.sub(accounts[msg.sender].balance);
require(_transfer(msg.sender, accounts[msg.sender].balance, false));
accounts[msg.sender].balance = 0;
return true;
}
function disburse(uint256 amount) internal{
balances[address(this)] = balances[address(this)].add(amount);
uint256 unnormalized = amount.mul(pointMultiplier);
totalDividentPoints = totalDividentPoints.add(unnormalized.div(stakedCoins));
unclaimedDividendPoints = unclaimedDividendPoints.add(amount);
}
function claimReward() external returns(bool){
uint256 owing = updateDividend(msg.sender);
require(owing > 0);
require(_transfer(msg.sender, owing, true));
accounts[msg.sender].rewardsClaimed = accounts[msg.sender].rewardsClaimed.add(owing);
totalRewardsClaimed = totalRewardsClaimed.add(owing);
return true;
}
function rewardsClaimed(address _user) external view returns(uint256 rewardClaimed){
return accounts[_user].rewardsClaimed;
}
} | 0x608060405234801561001057600080fd5b50600436106101425760003560e01c8063a34b0f76116100b8578063d0668b3c1161007c578063d0668b3c14610347578063d3f730fd1461034f578063dc8df38714610375578063dd62ed3e1461037d578063f2fde38b146103ab578063f40f0f52146103d157610142565b8063a34b0f76146102e6578063a9059cbb146102ee578063b88a802f1461031a578063bf9befb114610322578063ca84d5911461032a57610142565b8063387602981161010a578063387602981461025c578063625817331461026457806370a082311461026e5780638d7ce096146102945780638da5cb5b146102ba57806395d89b41146102de57610142565b806306fdde0314610147578063095ea7b3146101c457806318160ddd1461020457806323b872dd1461021e578063313ce56714610254575b600080fd5b61014f6103f7565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610189578181015183820152602001610171565b50505050905090810190601f1680156101b65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101f0600480360360408110156101da57600080fd5b506001600160a01b038135169060200135610482565b604080519115158252519081900360200190f35b61020c6104e9565b60408051918252519081900360200190f35b6101f06004803603606081101561023457600080fd5b506001600160a01b038135811691602081013590911690604001356104ef565b61020c610659565b6101f061065f565b61026c610668565b005b61020c6004803603602081101561028457600080fd5b50356001600160a01b03166106dd565b61020c600480360360208110156102aa57600080fd5b50356001600160a01b03166106f8565b6102c2610713565b604080516001600160a01b039092168252519081900360200190f35b61014f610722565b61020c61077c565b6101f06004803603604081101561030457600080fd5b506001600160a01b038135169060200135610782565b6101f0610879565b61020c6108f1565b6101f06004803603602081101561034057600080fd5b50356108f7565b61020c610a46565b61020c6004803603602081101561036557600080fd5b50356001600160a01b0316610a4c565b6101f0610a6a565b61020c6004803603604081101561039357600080fd5b506001600160a01b0381358116916020013516610b05565b61026c600480360360208110156103c157600080fd5b50356001600160a01b0316610b30565b61020c600480360360208110156103e757600080fd5b50356001600160a01b0316610b92565b6002805460408051602060018416156101000260001901909316849004601f8101849004840282018401909252818152929183018282801561047a5780601f1061044f5761010080835404028352916020019161047a565b820191906000526020600020905b81548152906001019060200180831161045d57829003601f168201915b505050505081565b3360008181526006602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60045490565b6001600160a01b038316600090815260066020908152604080832033845290915281205482111561051f57600080fd5b6001600160a01b03841660009081526005602052604090205482111561054457600080fd5b6001600160a01b0384166000908152600560205260409020546105679083610ba5565b6001600160a01b038516600090815260056020908152604080832093909355600681528282203383529052205461059e9083610ba5565b6001600160a01b03851660009081526006602090815260408083203384529091528120919091556105ce83610bb7565b90506105d981610c1b565b6106056105e68483610ba5565b6001600160a01b03861660009081526005602052604090205490610c59565b6001600160a01b038086166000818152600560205260409020929092558616600080516020610f8083398151915261063d8680610ba5565b60408051918252519081900360200190a3506001949350505050565b60035481565b600e5460ff1681565b6000546001600160a01b0316331461067f57600080fd5b600e5460ff16156106ce576040805162461bcd60e51b815260206004820152601460248201527339ba30b5b4b7339030b63932b0b23c9037b832b760611b604482015290519081900360640190fd5b600e805460ff19166001179055565b6001600160a01b031660009081526005602052604090205490565b6001600160a01b03166000908152600f602052604090205490565b6000546001600160a01b031681565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561047a5780601f1061044f5761010080835404028352916020019161047a565b600d5481565b60006001600160a01b03831661079757600080fd5b336000908152600560205260409020548211156107b357600080fd5b6001600160a01b03831660009081526005602052604090205482810110156107da57600080fd5b336000908152600560205260409020546107f49083610ba5565b3360009081526005602052604081209190915561081083610bb7565b905061081b81610c1b565b6108286105e68483610ba5565b6001600160a01b03851660008181526005602052604090209190915533600080516020610f8083398151915261085e8685610ba5565b60408051918252519081900360200190a35060019392505050565b60008061088533610c68565b90506000811161089457600080fd5b6108a033826001610cb1565b6108a957600080fd5b336000908152600f60205260409020600401546108c69082610c59565b336000908152600f6020526040902060040155600d546108e69082610c59565b600d55506001905090565b600c5481565b600e5460009060ff16610944576040805162461bcd60e51b815260206004820152601060248201526f7374616b696e6720697320636c6f736560801b604482015290519081900360640190fd5b61094e3083610782565b6109895760405162461bcd60e51b8152600401808060200182810382526023815260200180610f5d6023913960400191505060405180910390fd5b600061099433610db1565b905080156109b257336000908152600f602052604090206005018190555b60006109bd84610bb7565b90506109d56109cc8583610ba5565b600b5490610c59565b600b556109fb6109e58583610ba5565b336000908152600f602052604090205490610c59565b336000908152600f6020526040902090815560085460018201554260028201819055600390910155610a39610a308583610ba5565b600c5490610c59565b600c555060019392505050565b600b5481565b6001600160a01b03166000908152600f602052604090206004015490565b336000908152600f6020526040812054610a8357600080fd5b6000610a8e33610c68565b90508015610aac57336000908152600f602052604090206005018190555b336000908152600f6020526040902054600b54610ac891610ba5565b600b55336000818152600f6020526040812054610ae59291610cb1565b610aee57600080fd5b5050336000908152600f6020526040812055600190565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6000546001600160a01b03163314610b4757600080fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b600080610b9e83610db1565b9392505050565b600082821115610bb157fe5b50900390565b600454600090819069152d02c7e14af680000090811015610c1457610be66005610be086610e21565b90610e4c565b915080610bfe83600454610ba590919063ffffffff16565b1015610c1457600454610c119082610ba5565b91505b5092915050565b600b54610c3057610c2b81610e70565b610c56565b610c43610c3e826002610eb8565b610e70565b610c56610c51826002610eb8565b610ecd565b50565b600082820183811015610b9e57fe5b600080610c7483610db1565b905080156104e357600954610c899082610ba5565b6009556008546001600160a01b0384166000908152600f602052604090206001015592915050565b60006001600160a01b038416610cc657600080fd5b30600090815260056020526040902054831115610ce257600080fd5b6001600160a01b0384166000908152600560205260409020548381011015610d0957600080fd5b30600090815260056020526040902054610d239084610ba5565b3060009081526005602052604081209190915582610d4f57610d4484610bb7565b9050610d4f81610c1b565b610d7b610d5c8583610ba5565b6001600160a01b03871660009081526005602052604090205490610c59565b6001600160a01b03861660008181526005602052604090209190915530600080516020610f8083398151915261063d8785610ba5565b6001600160a01b0381166000908152600f60205260408120600101546008548291610ddc9190610ba5565b6001600160a01b0384166000908152600f602052604090206005810154600a549154929350610b9e929091610e1b91610e159086610e4c565b90610eb8565b90610c59565b600080610e2f836064610f42565b90506000610e44612710610e15846064610e4c565b949350505050565b600082610e5b575060006104e3565b82820282848281610e6857fe5b0414610b9e57fe5b806004541015610e7f57600080fd5b600454610e8c9082610ba5565b6004556040805182815290516000913391600080516020610f808339815191529181900360200190a350565b600080828481610ec457fe5b04949350505050565b30600090815260056020526040902054610ee79082610c59565b30600090815260056020526040812091909155600a54610f08908390610e4c565b9050610f2b610f22600b5483610eb890919063ffffffff16565b60085490610c59565b600855600954610f3b9083610c59565b6009555050565b6000818260018486010381610f5357fe5b0402939250505056fe496e2073756666696369656e7420746f6b656e7320696e20757365722077616c6c6574ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220b6f9da33e38999ee2e86cb537df3422ddda837b5634618cb8379ae6566a659b364736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 1,837 |
0x573a93d96176a20a1e869257d01237188b2234db | /**
*Submitted for verification at Etherscan.io on 2021-03-15
*/
// ----------------------------------------------------------------------------
// Kpark coin Contract
// Name : Kpark coin
// Symbol : KPC
// Decimals : 18
// InitialSupply : 1,000,000,000 KPC
// ----------------------------------------------------------------------------
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 Kparkcoin is ERC20 {
string public constant name = "Kpark coin";
string public constant symbol = "KPC";
uint8 public constant decimals = 18;
uint256 public constant initialSupply = 1000000000 * (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;
}
} | 0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80638456cb59116100de578063a9059cbb11610097578063df03458611610071578063df034586146104ff578063e2ab691d14610525578063e583983614610557578063f2fde38b1461057d5761018e565b8063a9059cbb14610473578063dd62ed3e1461049f578063de6baccb146104cd5761018e565b80638456cb59146103c15780638d1fdf2f146103c95780638da5cb5b146103ef57806395d89b41146104135780639dc29fac1461041b578063a457c2d7146104475761018e565b8063395093511161014b57806346cf1bb51161012557806346cf1bb5146103225780635c975abb1461036757806370a082311461036f5780637eee288d146103955761018e565b806339509351146102c65780633f4ba83a146102f257806345c8b1a6146102fc5761018e565b806306fdde0314610193578063095ea7b31461021057806318160ddd1461025057806323b872dd1461026a578063313ce567146102a0578063378dc3dc146102be575b600080fd5b61019b6105a3565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d55781810151838201526020016101bd565b50505050905090810190601f1680156102025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61023c6004803603604081101561022657600080fd5b506001600160a01b0381351690602001356105cc565b604080519115158252519081900360200190f35b6102586105e2565b60408051918252519081900360200190f35b61023c6004803603606081101561028057600080fd5b506001600160a01b038135811691602081013590911690604001356105e9565b6102a86106d0565b6040805160ff9092168252519081900360200190f35b6102586106d5565b61023c600480360360408110156102dc57600080fd5b506001600160a01b0381351690602001356106e5565b6102fa610726565b005b6102fa6004803603602081101561031257600080fd5b50356001600160a01b0316610813565b61034e6004803603604081101561033857600080fd5b506001600160a01b0381351690602001356108bc565b6040805192835260208301919091528051918290030190f35b61023c610935565b6102586004803603602081101561038557600080fd5b50356001600160a01b0316610945565b6102fa600480360360408110156103ab57600080fd5b506001600160a01b0381351690602001356109df565b6102fa610c8d565b6102fa600480360360208110156103df57600080fd5b50356001600160a01b0316610d76565b6103f7610e22565b604080516001600160a01b039092168252519081900360200190f35b61019b610e31565b6102fa6004803603604081101561043157600080fd5b506001600160a01b038135169060200135610e53565b61023c6004803603604081101561045d57600080fd5b506001600160a01b038135169060200135610f51565b61023c6004803603604081101561048957600080fd5b506001600160a01b038135169060200135610f8d565b610258600480360360408110156104b557600080fd5b506001600160a01b038135811691602001351661105f565b61023c600480360360608110156104e357600080fd5b506001600160a01b03813516906020810135906040013561108a565b6102586004803603602081101561051557600080fd5b50356001600160a01b03166112a7565b6102fa6004803603606081101561053b57600080fd5b506001600160a01b0381351690602081013590604001356112c2565b61023c6004803603602081101561056d57600080fd5b50356001600160a01b0316611431565b6102fa6004803603602081101561059357600080fd5b50356001600160a01b031661144f565b6040518060400160405280600a8152602001600160b11b6925b830b9359031b7b4b70281525081565b60006105d93384846114ac565b50600192915050565b6002545b90565b600354600090600160a01b900460ff16156106435760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841660009081526004602052604090205460ff16156106b45760408051600160e51b62461bcd02815260206004820152601760248201527f46726f6d206163636f756e74206973206c6f636b65642e000000000000000000604482015290519081900360640190fd5b6106bd8461159e565b6106c88484846117c1565b949350505050565b601281565b6b033b2e3c9fd0803ce800000081565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105d9918590610721908663ffffffff61181316565b6114ac565b6003546001600160a01b031633146107775760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff166107d85760408051600160e51b62461bcd02815260206004820152600e60248201527f4e6f7420706175736564206e6f77000000000000000000000000000000000000604482015290519081900360640190fd5b60038054600160a01b60ff02191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6003546001600160a01b031633146108645760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19169055815192835290517f4feb53e305297ab8fb8f3420c95ea04737addc254a7270d8fc4605d2b9c61dba9281900390910190a150565b6001600160a01b03821660009081526005602052604081208054829190849081106108e357fe5b600091825260208083206002909202909101546001600160a01b03871683526005909152604090912080548590811061091857fe5b906000526020600020906002020160010154915091509250929050565b600354600160a01b900460ff1681565b600080805b6001600160a01b0384166000908152600560205260409020548110156109be576001600160a01b038416600090815260056020526040902080546109b491908390811061099357fe5b9060005260206000209060020201600101548361181390919063ffffffff16565b915060010161094a565b506109d8816109cc85611870565b9063ffffffff61181316565b9392505050565b6003546001600160a01b03163314610a305760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b0382166000908152600560205260409020548110610a9f5760408051600160e51b62461bcd02815260206004820152601460248201527f4e6f206c6f636b20696e666f726d6174696f6e2e000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526005602052604090208054610b01919083908110610ac857fe5b60009182526020808320600160029093020191909101546001600160a01b0386168352908290526040909120549063ffffffff61181316565b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110610b5557fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b0382166000908152600560205260408120805483908110610ba057fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114610c5f576001600160a01b038216600090815260056020526040902080546000198101908110610c0257fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b031681526020019081526020016000208281548110610c4057fe5b6000918252602090912082546002909202019081556001918201549101555b6001600160a01b0382166000908152600560205260409020805490610c88906000198301611bb2565b505050565b6003546001600160a01b03163314610cde5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff1615610d355760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b60038054600160a01b60ff021916600160a01b1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b6003546001600160a01b03163314610dc75760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19166001179055815192835290517f8a5c4736a33c7b7f29a2c34ea9ff9608afc5718d56f6fd6dcbd2d3711a1a49139281900390910190a150565b6003546001600160a01b031681565b604051806040016040528060038152602001600160e81b624b50430281525081565b6003546001600160a01b03163314610ea45760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b610ead82611870565b811115610f045760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b610f0e828261188b565b6040805182815290516001600160a01b038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105d9918590610721908663ffffffff61195516565b3360009081526004602052604081205460ff1615610ff55760408051600160e51b62461bcd02815260206004820152601960248201527f53656e646572206163636f756e74206973206c6f636b65642e00000000000000604482015290519081900360640190fd5b600354600160a01b900460ff161561104c5760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b6110553361159e565b6109d883836119b5565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6003546000906001600160a01b031633146110de5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841661113c5760408051600160e51b62461bcd02815260206004820152600d60248201527f77726f6e67206164647265737300000000000000000000000000000000000000604482015290519081900360640190fd5b600354611151906001600160a01b0316611870565b8311156111a85760408051600160e51b62461bcd02815260206004820152601260248201527f4e6f7420656e6f7567682062616c616e63650000000000000000000000000000604482015290519081900360640190fd5b6003546001600160a01b03166000908152602081905260409020546111d3908463ffffffff61195516565b600380546001600160a01b039081166000908152602081815260408083209590955588831680835260058252858320865180880188528981528084018b81528254600181810185559387529585902091516002909602909101948555519301929092559254845188815294519194921692600080516020611d21833981519152928290030190a3604080518481526020810184905281516001600160a01b038716927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b928290030190a25060019392505050565b6001600160a01b031660009081526005602052604090205490565b6003546001600160a01b031633146113135760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b8161131d84611870565b10156113735760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b6001600160a01b03831660009081526020819052604090205461139c908363ffffffff61195516565b6001600160a01b0384166000818152602081815260408083209490945560058152838220845180860186528681528083018881528254600181810185559386529484902091516002909502909101938455519201919091558251858152908101849052825191927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b92918290030190a2505050565b6001600160a01b031660009081526004602052604090205460ff1690565b6003546001600160a01b031633146114a05760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6114a9816119c2565b50565b6001600160a01b0383166114f457604051600160e51b62461bcd028152600401808060200182810382526024815260200180611d876024913960400191505060405180910390fd5b6001600160a01b03821661153c57604051600160e51b62461bcd028152600401808060200182810382526022815260200180611cff6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60005b6001600160a01b0382166000908152600560205260409020548110156117bd576001600160a01b03821660009081526005602052604090208054429190839081106115e857fe5b906000526020600020906002020160000154116117b5576001600160a01b03821660009081526005602052604090208054611628919083908110610ac857fe5b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f191908490811061167c57fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b03821660009081526005602052604081208054839081106116c757fe5b60009182526020808320600160029093020191909101929092556001600160a01b03841681526005909152604090205460001901811461178a576001600160a01b03821660009081526005602052604090208054600019810190811061172957fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b03168152602001908152602001600020828154811061176757fe5b600091825260209091208254600290920201908155600191820154910155600019015b6001600160a01b03821660009081526005602052604090208054906117b3906000198301611bb2565b505b6001016115a1565b5050565b60006117ce848484611a7c565b6001600160a01b038416600090815260016020908152604080832033808552925290912054611809918691610721908663ffffffff61195516565b5060019392505050565b6000828201838110156109d85760408051600160e51b62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b031660009081526020819052604090205490565b6001600160a01b0382166118d357604051600160e51b62461bcd028152600401808060200182810382526021815260200180611d416021913960400191505060405180910390fd5b6002546118e6908263ffffffff61195516565b6002556001600160a01b038216600090815260208190526040902054611912908263ffffffff61195516565b6001600160a01b03831660008181526020818152604080832094909455835185815293519193600080516020611d21833981519152929081900390910190a35050565b6000828211156119af5760408051600160e51b62461bcd02815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006105d9338484611a7c565b6001600160a01b038116611a205760408051600160e51b62461bcd02815260206004820152600d60248201527f416c7265616479204f776e657200000000000000000000000000000000000000604482015290519081900360640190fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316611ac457604051600160e51b62461bcd028152600401808060200182810382526025815260200180611d626025913960400191505060405180910390fd5b6001600160a01b038216611b0c57604051600160e51b62461bcd028152600401808060200182810382526023815260200180611cdc6023913960400191505060405180910390fd5b6001600160a01b038316600090815260208190526040902054611b35908263ffffffff61195516565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b6a908263ffffffff61181316565b6001600160a01b03808416600081815260208181526040918290209490945580518581529051919392871692600080516020611d2183398151915292918290030190a3505050565b815481835581811115610c8857600083815260209020610c88916105e69160029182028101918502015b80821115611bf65760008082556001820155600201611bdc565b5090565b6001600160a01b038216611c585760408051600160e51b62461bcd02815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600254611c6b908263ffffffff61181316565b6002556001600160a01b038216600090815260208190526040902054611c97908263ffffffff61181316565b6001600160a01b038316600081815260208181526040808320949094558351858152935192939192600080516020611d218339815191529281900390910190a3505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a165627a7a7230582078ad1bdd181ddda331d5e13e54099ee2cff5fe6c37784001574282797d71c4130029 | {"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 1,838 |
0xcba65975b1c66586bfe7910f32377e0ee55f783e | pragma solidity ^0.4.18;
/*
This is a token wallet contract
Store your tokens in this contract to give them super powers
Tokens can be spent from the contract with only an ecSignature from the owner - onchain approve is not needed
*/
library ECRecovery {
/**
* @dev Recover signer address from a message by using their signature
* @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
* @param sig bytes signature, the signature is generated using web3.eth.sign()
*/
function recover(bytes32 hash, bytes sig) public pure returns (address) {
bytes32 r;
bytes32 s;
uint8 v;
//Check the signature length
if (sig.length != 65) {
return (address(0));
}
// Divide the signature in r, s and v variables
assembly {
r := mload(add(sig, 32))
s := mload(add(sig, 64))
v := byte(0, mload(add(sig, 96)))
}
// Version of signature should be 27 or 28, but 0 and 1 are also possible versions
if (v < 27) {
v += 27;
}
// If the version is correct return the signer address
if (v != 27 && v != 28) {
return (address(0));
} else {
return ecrecover(hash, v, r, s);
}
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
function Owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner);
OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
contract LavaWallet is Owned {
using SafeMath for uint;
// balances[tokenContractAddress][EthereumAccountAddress] = 0
mapping(address => mapping (address => uint256)) balances;
//token => owner => spender : amount
mapping(address => mapping (address => mapping (address => uint256))) allowed;
mapping(address => uint256) depositedTokens;
mapping(bytes32 => uint256) burnedSignatures;
event Deposit(address token, address user, uint amount, uint balance);
event Withdraw(address token, address user, uint amount, uint balance);
event Transfer(address indexed from, address indexed to,address token, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender,address token, uint tokens);
function LavaWallet() public {
}
//do not allow ether to enter
function() public payable {
revert();
}
//Remember you need pre-approval for this - nice with ApproveAndCall
function depositTokens(address from, address token, uint256 tokens ) public returns (bool success)
{
//we already have approval so lets do a transferFrom - transfer the tokens into this contract
ERC20Interface(token).transferFrom(from, this, tokens);
balances[token][from] = balances[token][from].add(tokens);
depositedTokens[token] = depositedTokens[token].add(tokens);
Deposit(token, from, tokens, balances[token][from]);
return true;
}
//No approve needed, only from msg.sender
function withdrawTokens(address token, uint256 tokens) public {
balances[token][msg.sender] = balances[token][msg.sender].sub(tokens);
depositedTokens[token] = depositedTokens[token].sub(tokens);
ERC20Interface(token).transfer(msg.sender, tokens);
Withdraw(token, msg.sender, tokens, balances[token][msg.sender]);
}
//Requires approval so it can be public
function withdrawTokensFrom( address from, address to,address token, uint tokens) public returns (bool success) {
balances[token][from] = balances[token][from].sub(tokens);
depositedTokens[token] = depositedTokens[token].sub(tokens);
allowed[token][from][to] = allowed[token][from][to].sub(tokens);
ERC20Interface(token).transfer(to, tokens);
Withdraw(token, from, tokens, balances[token][from]);
return true;
}
function balanceOf(address token,address user) public constant returns (uint) {
return balances[token][user];
}
//Can also be used to remove approval by using a 'tokens' value of 0
function approveTokens(address spender, address token, uint tokens) public returns (bool success) {
allowed[token][msg.sender][spender] = tokens;
Approval(msg.sender, token, spender, tokens);
return true;
}
//No approve needed, only from msg.sender
function transferTokens(address to, address token, uint tokens) public returns (bool success) {
balances[token][msg.sender] = balances[token][msg.sender].sub(tokens);
balances[token][to] = balances[token][to].add(tokens);
Transfer(msg.sender, token, to, tokens);
return true;
}
//Can be public because it requires approval
function transferTokensFrom( address from, address to,address token, uint tokens) public returns (bool success) {
balances[token][from] = balances[token][from].sub(tokens);
allowed[token][from][to] = allowed[token][from][to].sub(tokens);
balances[token][to] = balances[token][to].add(tokens);
Transfer(token, from, to, tokens);
return true;
}
//Nonce is the same thing as a 'check number'
//EIP 712
function getLavaTypedDataHash( address from, address to, address token, uint256 tokens, uint256 relayerReward,
uint256 expires, uint256 nonce) public constant returns (bytes32)
{
bytes32 hardcodedSchemaHash = 0x313236b6cd8d12125421e44528d8f5ba070a781aeac3e5ae45e314b818734ec3 ;
bytes32 typedDataHash = sha3(
hardcodedSchemaHash,
sha3(from,to,this,token,tokens,relayerReward,expires,nonce)
);
return typedDataHash;
}
function approveTokensWithSignature(address from, address to, address token, uint256 tokens, uint256 relayerReward,
uint256 expires, uint256 nonce, bytes signature) public returns (bool success)
{
//bytes32 sigHash = sha3("\x19Ethereum Signed Message:\n32",this, from, to, token, tokens, relayerReward, expires, nonce);
bytes32 sigHash = getLavaTypedDataHash(from,to,token,tokens,relayerReward,expires,nonce);
address recoveredSignatureSigner = ECRecovery.recover(sigHash,signature);
//make sure the signer is the depositor of the tokens
if(from != recoveredSignatureSigner) revert();
//make sure the signature has not expired
if(block.number > expires) revert();
uint burnedSignature = burnedSignatures[sigHash];
burnedSignatures[sigHash] = 0x1; //spent
if(burnedSignature != 0x0 ) revert();
//approve the relayer reward
allowed[token][from][msg.sender] = relayerReward;
Approval(from, token, msg.sender, relayerReward);
//transferRelayerReward
if(!transferTokensFrom(from, msg.sender, token, relayerReward)) revert();
//approve transfer of tokens
allowed[token][from][to] = tokens;
Approval(from, token, to, tokens);
return true;
}
//The tokens are withdrawn from the lava wallet and transferred into the To account
function withdrawTokensFromWithSignature(address from, address to, address token, uint256 tokens, uint256 relayerReward,
uint256 expires, uint256 nonce, bytes signature) public returns (bool success)
{
//check to make sure that signature == ecrecover signature
if(!approveTokensWithSignature(from,to,token,tokens,relayerReward,expires,nonce,signature)) revert();
//it can be requested that fewer tokens be sent that were approved -- the whole approval will be invalidated though
if(!withdrawTokensFrom( from, to, token, tokens)) revert();
return true;
}
//the tokens remain in lava wallet
function transferTokensFromWithSignature(address from, address to, address token, uint256 tokens, uint256 relayerReward,
uint256 expires, uint256 nonce, bytes signature) public returns (bool success)
{
//check to make sure that signature == ecrecover signature
if(!approveTokensWithSignature(from,to,token,tokens,relayerReward,expires,nonce,signature)) revert();
//it can be requested that fewer tokens be sent that were approved -- the whole approval will be invalidated though
if(!transferTokensFrom( from, to, token, tokens)) revert();
return true;
}
function tokenAllowance(address token, address tokenOwner, address spender) public constant returns (uint remaining) {
return allowed[token][tokenOwner][spender];
}
function burnSignature(address from, address to, address token, uint256 tokens, uint256 relayerReward, uint256 expires, uint256 nonce, bytes signature) public returns (bool success)
{
bytes32 sigHash = getLavaTypedDataHash(from,to,token,tokens,relayerReward,expires,nonce);
address recoveredSignatureSigner = ECRecovery.recover(sigHash,signature);
//make sure the invalidator is the signer
if(recoveredSignatureSigner != from) revert();
//make sure this signature has never been used
uint burnedSignature = burnedSignatures[sigHash];
burnedSignatures[sigHash] = 0x2; //invalidated
if(burnedSignature != 0x0 ) revert();
return true;
}
//2 is burned
//1 is redeemed
function signatureBurnStatus(bytes32 digest) public view returns (uint)
{
return (burnedSignatures[digest]);
}
/*
Receive approval to spend tokens and perform any action all in one transaction
*/
function receiveApproval(address from, uint256 tokens, address token, bytes data) public returns (bool success) {
return depositTokens(from, token, tokens );
}
/*
Approve lava tokens for a smart contract and call the contracts receiveApproval method all in one fell swoop
*/
function approveAndCall(address from, address to, address token, uint256 tokens, uint256 relayerReward,
uint256 expires, uint256 nonce, bytes signature, bytes data) public returns (bool success) {
if(!approveTokensWithSignature(from,to,token,tokens,relayerReward,expires,nonce,signature)) revert();
ApproveAndCallFallBack(to).receiveApproval(from, tokens, token, data);
return true;
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// Owner CANNOT transfer out tokens which were purposefully deposited
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
//find actual balance of the contract
uint tokenBalance = ERC20Interface(tokenAddress).balanceOf(this);
//find number of accidentally deposited tokens (actual - purposefully deposited)
uint undepositedTokens = tokenBalance.sub(depositedTokens[tokenAddress]);
//only allow withdrawing of accidentally deposited tokens
assert(tokens <= undepositedTokens);
ERC20Interface(tokenAddress).transfer(owner, tokens);
return true;
}
} | 0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306b091f914610122578063094171101461016f57806320acbc83146101b457806339dc5ef2146102bd5780633e9ed7e4146103425780634b17bdd81461044b57806379ba5097146104f05780638da5cb5b146105075780638e8758d81461055e5780638f4ffcb1146105f5578063912d6e28146106c0578063a51fbb3f14610745578063a64b6e5f1461084e578063a9ff2a5e146108d3578063b0e0ef09146109dc578063c6d2cb6a14610a81578063d4ee1d9014610b48578063dc39d06d14610b9f578063dc47e5b714610c04578063f2fde38b14610d53578063f7888aec14610d96575b600080fd5b34801561012e57600080fd5b5061016d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e0d565b005b34801561017b57600080fd5b5061019e60048036038101908080356000191690602001909291905050506111b7565b6040518082815260200191505060405180910390f35b3480156101c057600080fd5b506102a3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506111dc565b604051808215151515815260200191505060405180910390f35b3480156102c957600080fd5b50610328600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611220565b604051808215151515815260200191505060405180910390f35b34801561034e57600080fd5b50610431600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611607565b604051808215151515815260200191505060405180910390f35b34801561045757600080fd5b506104d6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117d6565b604051808215151515815260200191505060405180910390f35b3480156104fc57600080fd5b50610505611c24565b005b34801561051357600080fd5b5061051c611dc3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561056a57600080fd5b506105df600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611de8565b6040518082815260200191505060405180910390f35b34801561060157600080fd5b506106a6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611ead565b604051808215151515815260200191505060405180910390f35b3480156106cc57600080fd5b5061072b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ec4565b604051808215151515815260200191505060405180910390f35b34801561075157600080fd5b50610834600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612028565b604051808215151515815260200191505060405180910390f35b34801561085a57600080fd5b506108b9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506124c9565b604051808215151515815260200191505060405180910390f35b3480156108df57600080fd5b506109c2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061278d565b604051808215151515815260200191505060405180910390f35b3480156109e857600080fd5b50610a67600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506127d1565b604051808215151515815260200191505060405180910390f35b348015610a8d57600080fd5b50610b2a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050612d0e565b60405180826000191660001916815260200191505060405180910390f35b348015610b5457600080fd5b50610b5d612eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610bab57600080fd5b50610bea600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612ed8565b604051808215151515815260200191505060405180910390f35b348015610c1057600080fd5b50610d39600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061317c565b604051808215151515815260200191505060405180910390f35b348015610d5f57600080fd5b50610d94600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613306565b005b348015610da257600080fd5b50610df7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506133a5565b6040518082815260200191505060405180910390f35b610e9c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461342c90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f6e81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461342c90919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561105457600080fd5b505af1158015611068573d6000803e3d6000fd5b505050506040513d602081101561107e57600080fd5b8101908080519060200190929190505050507ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567823383600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a15050565b6000600560008360001916600019168152602001908152602001600020549050919050565b60006111ee8989898989898989612028565b15156111f957600080fd5b611205898989896127d1565b151561121057600080fd5b6001905098975050505050505050565b60008273ffffffffffffffffffffffffffffffffffffffff166323b872dd8530856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156112f957600080fd5b505af115801561130d573d6000803e3d6000fd5b505050506040513d602081101561132357600080fd5b8101908080519060200190929190505050506113c482600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461344590919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061149682600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461344590919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7838584600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a1600190509392505050565b60008060008061161c8c8c8c8c8c8c8c612d0e565b92507382e91b7967ca55eb1c4cb3d58aa5c91cb8df436b6319045a2584876040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b838110156116b3578082015181840152602081019050611698565b50505050905090810190601f1680156116e05780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b1580156116fe57600080fd5b505af4158015611712573d6000803e3d6000fd5b505050506040513d602081101561172857600080fd5b810190808051906020019092919050505091508b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151561177557600080fd5b6005600084600019166000191681526020019081526020016000205490506002600560008560001916600019168152602001908152602001600020819055506000811415156117c357600080fd5b6001935050505098975050505050505050565b600061186782600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461342c90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119b382600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461342c90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611aff82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461344590919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fd1398bee19313d6bf672ccb116e51f4a1a947e91c757907f51fbb5b5e56c698f8685604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a360019050949350505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c8057600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490509392505050565b6000611eba858486611220565b9050949350505050565b600081600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fa0175360a15bca328baf7ea85c7b784d58b222a50d0ce760b10dba336d226a618685604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a3600190509392505050565b60008060008061203d8c8c8c8c8c8c8c612d0e565b92507382e91b7967ca55eb1c4cb3d58aa5c91cb8df436b6319045a2584876040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b838110156120d45780820151818401526020810190506120b9565b50505050905090810190601f1680156121015780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b15801561211f57600080fd5b505af4158015612133573d6000803e3d6000fd5b505050506040513d602081101561214957600080fd5b810190808051906020019092919050505091508173ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff1614151561219657600080fd5b864311156121a357600080fd5b6005600084600019166000191681526020019081526020016000205490506001600560008560001916600019168152602001908152602001600020819055506000811415156121f157600080fd5b87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508973ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff167fa0175360a15bca328baf7ea85c7b784d58b222a50d0ce760b10dba336d226a61338b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a36123548c338c8b6117d6565b151561235f57600080fd5b88600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508973ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff167fa0175360a15bca328baf7ea85c7b784d58b222a50d0ce760b10dba336d226a618d8c604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a36001935050505098975050505050505050565b600061255a82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461342c90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061266982600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461344590919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fd1398bee19313d6bf672ccb116e51f4a1a947e91c757907f51fbb5b5e56c698f8685604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a3600190509392505050565b600061279f8989898989898989612028565b15156127aa57600080fd5b6127b6898989896117d6565b15156127c157600080fd5b6001905098975050505050505050565b600061286282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461342c90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061293482600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461342c90919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a4382600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461342c90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612ba357600080fd5b505af1158015612bb7573d6000803e3d6000fd5b505050506040513d6020811015612bcd57600080fd5b8101908080519060200190929190505050507ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567838684600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a160019050949350505050565b60008060007f313236b6cd8d12125421e44528d8f5ba070a781aeac3e5ae45e314b818734ec36001029150818a8a308b8b8b8b8b604051808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401858152602001848152602001838152602001828152602001985050505050505050506040518091039020604051808360001916600019168152602001826000191660001916815260200192505050604051809103902090508092505050979650505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612f3857600080fd5b8473ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015612fd357600080fd5b505af1158015612fe7573d6000803e3d6000fd5b505050506040513d6020811015612ffd57600080fd5b81019080805190602001909291905050509150613062600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361342c90919063ffffffff16565b905080841115151561307057fe5b8473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561313457600080fd5b505af1158015613148573d6000803e3d6000fd5b505050506040513d602081101561315e57600080fd5b81019080805190602001909291905050505060019250505092915050565b600061318e8a8a8a8a8a8a8a8a612028565b151561319957600080fd5b8873ffffffffffffffffffffffffffffffffffffffff16638f4ffcb18b898b866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561328e578082015181840152602081019050613273565b50505050905090810190601f1680156132bb5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156132dd57600080fd5b505af11580156132f1573d6000803e3d6000fd5b50505050600190509998505050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561336157600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561343a57fe5b818303905092915050565b600080828401905083811015151561345957fe5b80915050929150505600a165627a7a723058207af928458e15c9c698aa7c4f5e1719e364f8df3e311658ba43ba5bfb4c0cfe130029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 1,839 |
0x78dafc9f4376635d3c51b58a671d30ee88f4dde5 | /**
*Submitted for verification at Etherscan.io on 2020-11-21
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-call-value
(bool success, ) = recipient.call{ value : amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract pVaultV2 {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
struct Reward {
uint256 amount;
uint256 timestamp;
uint256 totalDeposit;
}
mapping(address => uint256) public _lastCheckTime;
mapping(address => uint256) public _rewardBalance;
mapping(address => uint256) public _depositBalances;
uint256 public _totalDeposit;
Reward[] public _rewards;
string public _vaultName;
IERC20 public token0;
IERC20 public token1;
address public feeAddress;
address public vaultAddress;
uint32 public feePermill = 5;
uint256 public delayDuration = 7 days;
bool public withdrawable;
address public gov;
uint256 public _rewardCount;
event SentReward(uint256 amount);
event Deposited(address indexed user, uint256 amount);
event ClaimedReward(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
constructor (address _token0, address _token1, address _feeAddress, address _vaultAddress, string memory name) {
token0 = IERC20(_token0);
token1 = IERC20(_token1);
feeAddress = _feeAddress;
vaultAddress = _vaultAddress;
_vaultName = name;
gov = msg.sender;
}
modifier onlyGov() {
require(msg.sender == gov, "!governance");
_;
}
function setGovernance(address _gov)
external
onlyGov
{
gov = _gov;
}
function setToken0(address _token)
external
onlyGov
{
token0 = IERC20(_token);
}
function setToken1(address _token)
external
onlyGov
{
token1 = IERC20(_token);
}
function setFeeAddress(address _feeAddress)
external
onlyGov
{
feeAddress = _feeAddress;
}
function setVaultAddress(address _vaultAddress)
external
onlyGov
{
vaultAddress = _vaultAddress;
}
function setFeePermill(uint32 _feePermill)
external
onlyGov
{
feePermill = _feePermill;
}
function setDelayDuration(uint32 _delayDuration)
external
onlyGov
{
delayDuration = _delayDuration;
}
function setWithdrawable(bool _withdrawable)
external
onlyGov
{
withdrawable = _withdrawable;
}
function setVaultName(string memory name)
external
onlyGov
{
_vaultName = name;
}
function balance0()
external
view
returns (uint256)
{
return token0.balanceOf(address(this));
}
function balance1()
external
view
returns (uint256)
{
return token1.balanceOf(address(this));
}
function getReward(address userAddress)
internal
{
uint256 lastCheckTime = _lastCheckTime[userAddress];
uint256 rewardBalance = _rewardBalance[userAddress];
if (lastCheckTime > 0 && _rewards.length > 0) {
for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) {
rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit));
if (i == 0) break;
}
}
_rewardBalance[userAddress] = rewardBalance;
_lastCheckTime[msg.sender] = block.timestamp;
}
function deposit(uint256 amount) external {
getReward(msg.sender);
uint256 feeAmount = amount.mul(feePermill).div(1000);
uint256 realAmount = amount.sub(feeAmount);
if (feeAmount > 0) {
token0.safeTransferFrom(msg.sender, feeAddress, feeAmount);
}
if (realAmount > 0) {
token0.safeTransferFrom(msg.sender, vaultAddress, realAmount);
_depositBalances[msg.sender] = _depositBalances[msg.sender].add(realAmount);
_totalDeposit = _totalDeposit.add(realAmount);
emit Deposited(msg.sender, realAmount);
}
}
function withdraw(uint256 amount) external {
require(token0.balanceOf(address(this)) > 0, "no withdraw amount");
require(withdrawable, "not withdrawable");
getReward(msg.sender);
if (amount > _depositBalances[msg.sender]) {
amount = _depositBalances[msg.sender];
}
require(amount > 0, "can't withdraw 0");
token0.safeTransfer(msg.sender, amount);
_depositBalances[msg.sender] = _depositBalances[msg.sender].sub(amount);
_totalDeposit = _totalDeposit.sub(amount);
emit Withdrawn(msg.sender, amount);
}
function sendReward(uint256 amount) external {
require(amount > 0, "can't reward 0");
require(_totalDeposit > 0, "totalDeposit must bigger than 0");
token1.safeTransferFrom(msg.sender, address(this), amount);
Reward memory reward;
reward = Reward(amount, block.timestamp, _totalDeposit);
_rewards.push(reward);
emit SentReward(amount);
}
function claimReward(uint256 amount) external {
getReward(msg.sender);
uint256 rewardLimit = getRewardAmount(msg.sender);
if (amount > rewardLimit) {
amount = rewardLimit;
}
_rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(amount);
token1.safeTransfer(msg.sender, amount);
}
function claimRewardAll() external {
getReward(msg.sender);
uint256 rewardLimit = getRewardAmount(msg.sender);
_rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(rewardLimit);
token1.safeTransfer(msg.sender, rewardLimit);
}
function getRewardAmount(address userAddress) public view returns (uint256) {
uint256 lastCheckTime = _lastCheckTime[userAddress];
uint256 rewardBalance = _rewardBalance[userAddress];
if (_rewards.length > 0) {
if (lastCheckTime > 0) {
for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) {
rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit));
if (i == 0) break;
}
}
for (uint j = _rewards.length - 1; block.timestamp < _rewards[j].timestamp.add(delayDuration); j--) {
uint256 timedAmount = _rewards[j].amount.mul(_depositBalances[userAddress]).div(_rewards[j].totalDeposit);
timedAmount = timedAmount.mul(_rewards[j].timestamp.add(delayDuration).sub(block.timestamp)).div(delayDuration);
rewardBalance = rewardBalance.sub(timedAmount);
if (j == 0) break;
}
}
return rewardBalance;
}
} | 0x608060405234801561001057600080fd5b50600436106101f05760003560e01c8063adc3b31b1161010f578063c6e426bd116100a2578063d86e1ef711610071578063d86e1ef714610579578063e2aa2a851461059c578063e4186aa6146105a4578063fab980b7146105ca576101f0565b8063c6e426bd1461050f578063c78b6dea14610535578063cbeb7ef214610552578063d21220a714610571576101f0565b8063b79ea884116100de578063b79ea884146104b6578063b8f6e841146104dc578063b8f79288146104e4578063c45c4f5814610507576101f0565b8063adc3b31b1461044e578063ae169a5014610474578063b5984a3614610491578063b6b55f2514610499576101f0565b806344264d3d1161018757806385535cc51161015657806385535cc5146103a15780638705fcd4146103c75780638f1e9405146103ed578063ab033ea914610428576101f0565b806344264d3d1461033657806344a040f514610357578063501883011461037d578063637830ca14610399576101f0565b806327b5b6a0116101c357806327b5b6a0146102e35780632e1a7d4d146103095780634127535814610326578063430bf08a1461032e576101f0565b80630dfe1681146101f557806311cc66b21461021957806312d43a51146102c15780631c69ad00146102c9575b600080fd5b6101fd610647565b604080516001600160a01b039092168252519081900360200190f35b6102bf6004803603602081101561022f57600080fd5b81019060208101813564010000000081111561024a57600080fd5b82018360208201111561025c57600080fd5b8035906020019184600183028401116401000000008311171561027e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610656945050505050565b005b6101fd6106bf565b6102d16106d3565b60408051918252519081900360200190f35b6102d1600480360360208110156102f957600080fd5b50356001600160a01b031661074f565b6102bf6004803603602081101561031f57600080fd5b5035610761565b6101fd61096d565b6101fd61097c565b61033e61098b565b6040805163ffffffff9092168252519081900360200190f35b6102d16004803603602081101561036d57600080fd5b50356001600160a01b031661099e565b610385610b41565b604080519115158252519081900360200190f35b6102bf610b4a565b6102bf600480360360208110156103b757600080fd5b50356001600160a01b0316610baa565b6102bf600480360360208110156103dd57600080fd5b50356001600160a01b0316610c1e565b61040a6004803603602081101561040357600080fd5b5035610c92565b60408051938452602084019290925282820152519081900360600190f35b6102bf6004803603602081101561043e57600080fd5b50356001600160a01b0316610cc5565b6102d16004803603602081101561046457600080fd5b50356001600160a01b0316610d3f565b6102bf6004803603602081101561048a57600080fd5b5035610d51565b6102d1610db9565b6102bf600480360360208110156104af57600080fd5b5035610dbf565b6102bf600480360360208110156104cc57600080fd5b50356001600160a01b0316610ec2565b6102d1610f36565b6102bf600480360360208110156104fa57600080fd5b503563ffffffff16610f3c565b6102d1610fb4565b6102bf6004803603602081101561052557600080fd5b50356001600160a01b0316610fff565b6102bf6004803603602081101561054b57600080fd5b5035611073565b6102bf6004803603602081101561056857600080fd5b50351515611214565b6101fd611279565b6102bf6004803603602081101561058f57600080fd5b503563ffffffff16611288565b6102d16112e5565b6102d1600480360360208110156105ba57600080fd5b50356001600160a01b03166112eb565b6105d26112fd565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561060c5781810151838201526020016105f4565b50505050905090810190601f1680156106395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6006546001600160a01b031681565b600b5461010090046001600160a01b031633146106a8576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b80516106bb906005906020840190611975565b5050565b600b5461010090046001600160a01b031681565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561071e57600080fd5b505afa158015610732573d6000803e3d6000fd5b505050506040513d602081101561074857600080fd5b5051905090565b60006020819052908152604090205481565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156107ac57600080fd5b505afa1580156107c0573d6000803e3d6000fd5b505050506040513d60208110156107d657600080fd5b50511161081f576040805162461bcd60e51b81526020600482015260126024820152711b9bc81dda5d1a191c985dc8185b5bdd5b9d60721b604482015290519081900360640190fd5b600b5460ff16610869576040805162461bcd60e51b815260206004820152601060248201526f6e6f7420776974686472617761626c6560801b604482015290519081900360640190fd5b6108723361138b565b3360009081526002602052604090205481111561089b5750336000908152600260205260409020545b600081116108e3576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b6006546108fa906001600160a01b03163383611493565b3360009081526002602052604090205461091490826114e5565b3360009081526002602052604090205560035461093190826114e5565b60035560408051828152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b6008546001600160a01b031681565b6009546001600160a01b031681565b600954600160a01b900463ffffffff1681565b6001600160a01b03811660009081526020818152604080832054600190925282205460045415610b3a578115610a9257600454600019015b600481815481106109e357fe5b906000526020600020906003020160010154831015610a9057610a7b610a7460048381548110610a0f57fe5b906000526020600020906003020160020154610a6e600260008a6001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610a5757fe5b600091825260209091206003909102015490611530565b90611589565b83906115cb565b915080610a8757610a90565b600019016109d6565b505b600454600019015b610acd600a5460048381548110610aad57fe5b9060005260206000209060030201600101546115cb90919063ffffffff16565b421015610b38576000610ae660048381548110610a0f57fe5b9050610b15600a54610a6e610b0e42610b08600a5460048981548110610aad57fe5b906114e5565b8490611530565b9050610b2183826114e5565b925081610b2e5750610b38565b5060001901610a9a565b505b9392505050565b600b5460ff1681565b610b533361138b565b6000610b5e3361099e565b33600090815260016020526040902054909150610b7b90826114e5565b33600081815260016020526040902091909155600754610ba7916001600160a01b039091169083611493565b50565b600b5461010090046001600160a01b03163314610bfc576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b5461010090046001600160a01b03163314610c70576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60048181548110610ca257600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b600b5461010090046001600160a01b03163314610d17576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60016020526000908152604090205481565b610d5a3361138b565b6000610d653361099e565b905080821115610d73578091505b33600090815260016020526040902054610d8d90836114e5565b336000818152600160205260409020919091556007546106bb916001600160a01b039091169084611493565b600a5481565b610dc83361138b565b600954600090610df2906103e890610a6e90859063ffffffff600160a01b90910481169061153016565b90506000610e0083836114e5565b90508115610e2757600854600654610e27916001600160a01b039182169133911685611625565b8015610ebd57600954600654610e4c916001600160a01b039182169133911684611625565b33600090815260026020526040902054610e6690826115cb565b33600090815260026020526040902055600354610e8390826115cb565b60035560408051828152905133917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4919081900360200190a25b505050565b600b5461010090046001600160a01b03163314610f14576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60035481565b600b5461010090046001600160a01b03163314610f8e576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6009805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b600754604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561071e57600080fd5b600b5461010090046001600160a01b03163314611051576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b600081116110b9576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b600060035411611110576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b600754611128906001600160a01b0316333084611625565b611130611a01565b50604080516060810182528281524260208083019182526003805484860190815260048054600181018255600091909152855192027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b81019290925592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c82015591517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d909201919091558251848152925191927feae918ad14bd0bcaa9f9d22da2b810c02f44331bf6004a76f049a3360891f916929081900390910190a15050565b600b5461010090046001600160a01b03163314611266576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b805460ff1916911515919091179055565b6007546001600160a01b031681565b600b5461010090046001600160a01b031633146112da576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b63ffffffff16600a55565b600c5481565b60026020526000908152604090205481565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156113835780601f1061135857610100808354040283529160200191611383565b820191906000526020600020905b81548152906001019060200180831161136657829003601f168201915b505050505081565b6001600160a01b0381166000908152602081815260408083205460019092529091205481158015906113be575060045415155b1561146357600454600019015b600481815481106113d857fe5b9060005260206000209060030201600101548310156114615761144c610a746004838154811061140457fe5b906000526020600020906003020160020154610a6e60026000896001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610a5757fe5b91508061145857611461565b600019016113cb565b505b6001600160a01b039092166000908152600160209081526040808320949094553382528190529190912042905550565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610ebd908490611685565b600061152783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061183d565b90505b92915050565b60008261153f5750600061152a565b8282028284828161154c57fe5b04146115275760405162461bcd60e51b8152600401808060200182810382526021815260200180611a386021913960400191505060405180910390fd5b600061152783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118d4565b600082820183811015611527576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261167f908590611685565b50505050565b611697826001600160a01b0316611939565b6116e8576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106117265780518252601f199092019160209182019101611707565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611788576040519150601f19603f3d011682016040523d82523d6000602084013e61178d565b606091505b5091509150816117e4576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b80511561167f5780806020019051602081101561180057600080fd5b505161167f5760405162461bcd60e51b815260040180806020018281038252602a815260200180611a59602a913960400191505060405180910390fd5b600081848411156118cc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611891578181015183820152602001611879565b50505050905090810190601f1680156118be5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836119235760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611891578181015183820152602001611879565b50600083858161192f57fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470811580159061196d5750808214155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826119ab57600085556119f1565b82601f106119c457805160ff19168380011785556119f1565b828001600101855582156119f1579182015b828111156119f15782518255916020019190600101906119d6565b506119fd929150611a22565b5090565b60405180606001604052806000815260200160008152602001600081525090565b5b808211156119fd5760008155600101611a2356fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220e73f50c87f41747254a3abcf8ee6e0e7ca53ebca5aba193ed436370f6d5ce37964736f6c63430007050033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 1,840 |
0xccdc68db6269eb97dd1b2256c824e3ed561063cd | /**
*Submitted for verification at Etherscan.io on 2020-11-19
*/
pragma solidity ^0.4.24;
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 Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract Manager is Ownable {
address[] managers;
modifier onlyManagers() {
bool exist = false;
if(owner == msg.sender) {
exist = true;
} else {
uint index = 0;
(exist, index) = existManager(msg.sender);
}
require(exist);
_;
}
function getManagers() public view returns (address[] memory){
return managers;
}
function existManager(address _to) private view returns (bool, uint) {
for (uint i = 0 ; i < managers.length; i++) {
if (managers[i] == _to) {
return (true, i);
}
}
return (false, 0);
}
function addManager(address _to) onlyOwner public {
bool exist = false;
uint index = 0;
(exist, index) = existManager(_to);
require(!exist);
managers.push(_to);
}
function deleteManager(address _to) onlyOwner public {
bool exist = false;
uint index = 0;
(exist, index) = existManager(_to);
require(exist);
uint lastElementIndex = managers.length - 1;
managers[index] = managers[lastElementIndex];
delete managers[managers.length - 1];
managers.length--;
}
}
contract Pausable is Manager {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
require(!paused);
_;
}
modifier whenPaused() {
require(paused);
_;
}
function pause() onlyManagers whenNotPaused public {
paused = true;
emit Pause();
}
function unpause() onlyManagers whenPaused public {
paused = false;
emit Unpause();
}
}
contract ProtectAddress is Ownable {
address[] protect;
function getProtect() public view returns (address[] memory){
return protect;
}
function isProtect(address _to) public view returns (bool) {
for (uint i = 0 ; i < protect.length; i++) {
if (protect[i] == _to) {
return true;
}
}
return false;
}
function isProtectIndex(address _to) internal view returns (bool, uint) {
for (uint i = 0 ; i < protect.length; i++) {
if (protect[i] == _to) {
return (true, i);
}
}
return (false, 0);
}
function addProtect(address _to) onlyOwner public {
bool exist = false;
uint index = 0;
(exist, index) = isProtectIndex(_to);
require(!exist);
protect.push(_to);
}
function deleteProtect(address _to) onlyOwner public {
bool exist = false;
uint index = 0;
(exist, index) = isProtectIndex(_to);
require(exist);
uint lastElementIndex = protect.length - 1;
protect[index] = protect[lastElementIndex];
delete protect[protect.length - 1];
protect.length--;
}
}
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function allowance(address owner, address spender) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
function transferFrom(address from, address to, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract Token is ERC20, Pausable, ProtectAddress {
struct sUserInfo {
uint256 balance;
bool lock;
mapping(address => uint256) allowed;
}
using SafeMath for uint256;
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping(address => sUserInfo) user;
event Mint(uint256 value);
event Burn(uint256 value);
function () public payable {
revert();
}
function validTransfer(address _from, address _to, uint256 _value, bool _lockCheck) internal view returns (bool) {
require(_to != address(this));
require(_to != address(0));
require(user[_from].balance >= _value);
if(_lockCheck) {
require(user[_from].lock == false);
}
}
function lock(address _owner) public onlyManagers returns (bool) {
require(user[_owner].lock == false);
require(!isProtect(_owner));
user[_owner].lock = true;
return true;
}
function unlock(address _owner) public onlyManagers returns (bool) {
require(user[_owner].lock == true);
user[_owner].lock = false;
return true;
}
function burn(uint256 _value) public onlyOwner returns (bool) {
require(_value <= user[msg.sender].balance);
user[msg.sender].balance = user[msg.sender].balance.sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(_value);
return true;
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
require(_value == 0 || user[msg.sender].allowed[_spender] == 0);
user[msg.sender].allowed[_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
validTransfer(_from, _to, _value, true);
require(_value <= user[_from].allowed[msg.sender]);
user[_from].balance = user[_from].balance.sub(_value);
user[_to].balance = user[_to].balance.add(_value);
user[_from].allowed[msg.sender] = user[_from].allowed[msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
validTransfer(msg.sender, _to, _value, true);
user[msg.sender].balance = user[msg.sender].balance.sub(_value);
user[_to].balance = user[_to].balance.add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function totalSupply() public view returns (uint256) {
return totalSupply;
}
function balanceOf(address _owner) public view returns (uint256) {
return user[_owner].balance;
}
function lockState(address _owner) public view returns (bool) {
return user[_owner].lock;
}
function allowance(address _owner, address _spender) public view returns (uint256) {
return user[_owner].allowed[_spender];
}
}
contract LockBalance is Manager {
enum eLockType {None, Individual, GroupA, GroupB}
struct sGroupLockDate {
uint256[] lockTime;
uint256[] lockPercent;
}
struct sLockInfo {
uint256[] lockType;
uint256[] lockBalanceStandard;
uint256[] startTime;
uint256[] endTime;
}
using SafeMath for uint256;
mapping(uint => sGroupLockDate) groupLockDate;
mapping(address => sLockInfo) lockUser;
event Lock(address indexed from, uint256 value, uint256 endTime);
function setLockUser(address _to, eLockType _lockType, uint256 _value, uint256 _endTime) internal {
require(_endTime > now);
require(_value > 0);
lockUser[_to].lockType.push(uint256(_lockType));
lockUser[_to].lockBalanceStandard.push(_value);
lockUser[_to].startTime.push(now);
lockUser[_to].endTime.push(_endTime);
emit Lock(_to, _value, _endTime);
}
function lockBalanceGroup(address _owner, uint _index) internal view returns (uint256) {
uint256 percent = 0;
uint256 key = uint256(lockUser[_owner].lockType[_index]);
uint256 time = 99999999999;
for(uint256 i = 0 ; i < groupLockDate[key].lockTime.length; i++) {
if(now < groupLockDate[key].lockTime[i]) {
if(groupLockDate[key].lockTime[i] < time) {
time = groupLockDate[key].lockTime[i];
percent = groupLockDate[key].lockPercent[i];
}
}
}
if(percent == 0){
return 0;
} else {
return lockUser[_owner].lockBalanceStandard[_index].div(100).mul(uint256(percent));
}
}
function lockBalanceIndividual(address _owner, uint _index) internal view returns (uint256) {
if(now < lockUser[_owner].endTime[_index]) {
return lockUser[_owner].lockBalanceStandard[_index];
} else {
return 0;
}
}
function addLockDate(eLockType _lockType, uint256 _second, uint256 _percent) onlyManagers public {
sGroupLockDate storage lockInfo = groupLockDate[uint256(_lockType)];
bool isExists = false;
for(uint256 i = 0; i < lockInfo.lockTime.length; i++) {
if(lockInfo.lockTime[i] == _second) {
revert();
break;
}
}
if(isExists) {
revert();
} else {
lockInfo.lockTime.push(_second);
lockInfo.lockPercent.push(_percent);
}
}
function deleteLockDate(eLockType _lockType, uint256 _lockTime) onlyManagers public {
sGroupLockDate storage lockDate = groupLockDate[uint256(_lockType)];
bool isExists = false;
uint256 index = 0;
for(uint256 i = 0; i < lockDate.lockTime.length; i++) {
if(lockDate.lockTime[i] == _lockTime) {
isExists = true;
index = i;
break;
}
}
if(isExists) {
for(uint256 k = index; k < lockDate.lockTime.length - 1; k++){
lockDate.lockTime[k] = lockDate.lockTime[k + 1];
lockDate.lockPercent[k] = lockDate.lockPercent[k + 1];
}
delete lockDate.lockTime[lockDate.lockTime.length - 1];
lockDate.lockTime.length--;
delete lockDate.lockPercent[lockDate.lockPercent.length - 1];
lockDate.lockPercent.length--;
} else {
revert();
}
}
function deleteLockUserInfo(address _to, eLockType _lockType, uint256 _startTime, uint256 _endTime) onlyManagers public {
bool isExists = false;
uint256 index = 0;
for(uint256 i = 0; i < lockUser[_to].lockType.length; i++) {
if(lockUser[_to].lockType[i] == uint256(_lockType) &&
lockUser[_to].startTime[i] == _startTime &&
lockUser[_to].endTime[i] == _endTime) {
isExists = true;
index = i;
break;
}
}
require(isExists);
for(uint256 k = index; k < lockUser[_to].lockType.length - 1; k++){
lockUser[_to].lockType[k] = lockUser[_to].lockType[k + 1];
lockUser[_to].lockBalanceStandard[k] = lockUser[_to].lockBalanceStandard[k + 1];
lockUser[_to].startTime[k] = lockUser[_to].startTime[k + 1];
lockUser[_to].endTime[k] = lockUser[_to].endTime[k + 1];
}
delete lockUser[_to].lockType[lockUser[_to].lockType.length - 1];
lockUser[_to].lockType.length--;
delete lockUser[_to].lockBalanceStandard[lockUser[_to].lockBalanceStandard.length - 1];
lockUser[_to].lockBalanceStandard.length--;
delete lockUser[_to].startTime[lockUser[_to].startTime.length - 1];
lockUser[_to].startTime.length--;
delete lockUser[_to].endTime[lockUser[_to].endTime.length - 1];
lockUser[_to].endTime.length--;
}
function lockTypeInfoGroup(eLockType _type) public view returns (uint256[], uint256[]) {
uint256 key = uint256(_type);
return (groupLockDate[key].lockTime, groupLockDate[key].lockPercent);
}
function lockUserInfo(address _owner) public view returns (uint256[], uint256[], uint256[], uint256[], uint256[]) {
uint256[] memory balance = new uint256[](lockUser[_owner].lockType.length);
for(uint256 i = 0; i < lockUser[_owner].lockType.length; i++){
if(lockUser[_owner].lockType[i] == uint256(eLockType.Individual)) {
balance[i] = balance[i].add(lockBalanceIndividual(_owner, i));
} else if(lockUser[_owner].lockType[i] != uint256(eLockType.None)) {
balance[i] = balance[i].add(lockBalanceGroup(_owner, i));
}
}
return (lockUser[_owner].lockType,
lockUser[_owner].lockBalanceStandard,
balance,
lockUser[_owner].startTime,
lockUser[_owner].endTime);
}
function lockBalanceAll(address _owner) public view returns (uint256) {
uint256 lockBalance = 0;
for(uint256 i = 0; i < lockUser[_owner].lockType.length; i++){
if(lockUser[_owner].lockType[i] == uint256(eLockType.Individual)) {
lockBalance = lockBalance.add(lockBalanceIndividual(_owner, i));
} else if(lockUser[_owner].lockType[i] != uint256(eLockType.None)) {
lockBalance = lockBalance.add(lockBalanceGroup(_owner, i));
}
}
return lockBalance;
}
}
contract MyB is Token, LockBalance {
constructor() public {
name = "MyB";
symbol = "MyB";
decimals = 18;
uint256 initialSupply = 1000000000;
totalSupply = initialSupply * 10 ** uint(decimals);
user[owner].balance = totalSupply;
emit Transfer(address(0), owner, totalSupply);
}
function validTransfer(address _from, address _to, uint256 _value, bool _lockCheck) internal view returns (bool) {
super.validTransfer(_from, _to, _value, _lockCheck);
if(_lockCheck) {
require(_value <= useBalanceOf(_from));
}
}
function setLockUsers(eLockType _type, address[] _to, uint256[] _value, uint256[] _endTime) onlyManagers public {
require(_to.length > 0);
require(_to.length == _value.length);
require(_to.length == _endTime.length);
require(_type != eLockType.None);
for(uint256 i = 0; i < _to.length; i++){
require(!isProtect(_to[i]));
setLockUser(_to[i], _type, _value[i], _endTime[i]);
}
}
function useBalanceOf(address _owner) public view returns (uint256) {
return balanceOf(_owner).sub(lockBalanceAll(_owner));
}
} | 0x6080604052600436106101a05763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663015d200f81146101a557806306fdde03146101d85780630789a31314610262578063095ea7b31461028257806318160ddd146102ba57806323b872dd146102cf57806328723eff146102f95780632d06177a1461031a5780632f6c493c1461033b578063313ce5671461035c5780633f4ba83a1461038757806342966c681461039c5780634f7ba1b0146103b45780635c975abb1461041957806364a819c61461042e57806369132d431461045b57806370a082311461047c5780637a856cb21461049d5780638456cb59146104be5780638da5cb5b146104d35780638e2833341461050457806394dbc70e146105b857806395d89b41146105d957806396799760146105ee5780639846d9de1461060f5780639a713d05146106de578063a8d088bb146106ff578063a9059cbb14610714578063ac1a717514610738578063b44fee31146108c1578063dd62ed3e146108e2578063f2fde38b14610909578063f435f5a71461092a575b600080fd5b3480156101b157600080fd5b506101c6600160a060020a036004351661094b565b60408051918252519081900360200190f35b3480156101e457600080fd5b506101ed610a1d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561022757818101518382015260200161020f565b50505050905090810190601f1680156102545780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026e57600080fd5b5061028060ff60043516602435610aab565b005b34801561028e57600080fd5b506102a6600160a060020a0360043516602435610c67565b604080519115158252519081900360200190f35b3480156102c657600080fd5b506101c6610d22565b3480156102db57600080fd5b506102a6600160a060020a0360043581169060243516604435610d29565b34801561030557600080fd5b50610280600160a060020a0360043516610e8c565b34801561032657600080fd5b50610280600160a060020a0360043516610f19565b34801561034757600080fd5b506102a6600160a060020a0360043516610fa5565b34801561036857600080fd5b5061037161103b565b6040805160ff9092168252519081900360200190f35b34801561039357600080fd5b50610280611044565b3480156103a857600080fd5b506102a66004356110c9565b3480156103c057600080fd5b506103c961117e565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156104055781810151838201526020016103ed565b505050509050019250505060405180910390f35b34801561042557600080fd5b506102a66111e0565b34801561043a57600080fd5b50610280600160a060020a036004351660ff602435166044356064356111e9565b34801561046757600080fd5b506101c6600160a060020a03600435166116b6565b34801561048857600080fd5b506101c6600160a060020a03600435166116d9565b3480156104a957600080fd5b50610280600160a060020a03600435166116f4565b3480156104ca57600080fd5b506102806117dc565b3480156104df57600080fd5b506104e8611863565b60408051600160a060020a039092168252519081900360200190f35b34801561051057600080fd5b5061051f60ff60043516611872565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561056357818101518382015260200161054b565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156105a257818101518382015260200161058a565b5050505090500194505050505060405180910390f35b3480156105c457600080fd5b506102a6600160a060020a0360043516611946565b3480156105e557600080fd5b506101ed611967565b3480156105fa57600080fd5b50610280600160a060020a03600435166119c2565b34801561061b57600080fd5b5060408051602060046024803582810135848102808701860190975280865261028096843560ff1696369660449591949091019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750611aa39650505050505050565b3480156106ea57600080fd5b5061028060ff60043516602435604435611bc2565b34801561070b57600080fd5b506103c9611caa565b34801561072057600080fd5b506102a6600160a060020a0360043516602435611d0a565b34801561074457600080fd5b50610759600160a060020a0360043516611ddb565b60405180806020018060200180602001806020018060200186810386528b818151815260200191508051906020019060200280838360005b838110156107a9578181015183820152602001610791565b5050505090500186810385528a818151815260200191508051906020019060200280838360005b838110156107e85781810151838201526020016107d0565b50505050905001868103845289818151815260200191508051906020019060200280838360005b8381101561082757818101518382015260200161080f565b50505050905001868103835288818151815260200191508051906020019060200280838360005b8381101561086657818101518382015260200161084e565b50505050905001868103825287818151815260200191508051906020019060200280838360005b838110156108a557818101518382015260200161088d565b505050509050019a505050505050505050505060405180910390f35b3480156108cd57600080fd5b506102a6600160a060020a03600435166120c0565b3480156108ee57600080fd5b506101c6600160a060020a036004358116906024351661211e565b34801561091557600080fd5b50610280600160a060020a036004351661214d565b34801561093657600080fd5b506102a6600160a060020a03600435166121d4565b600080805b600160a060020a0384166000908152600a6020526040902054811015610a16576001600160a060020a0385166000908152600a6020526040902080548390811061099657fe5b906000526020600020015414156109c8576109c16109b4858361227b565b839063ffffffff6122f516565b9150610a0e565b600160a060020a0384166000908152600a602052604081208054839081106109ec57fe5b9060005260206000200154141515610a0e57610a0b6109b4858361230b565b91505b600101610950565b5092915050565b6004805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610aa35780601f10610a7857610100808354040283529160200191610aa3565b820191906000526020600020905b815481529060010190602001808311610a8657829003601f168201915b505050505081565b60008054819081908190819081908190600160a060020a0316331415610ad45760019150610ae6565b506000610ae033612497565b90925090505b811515610af257600080fd5b600960008a6003811115610b0257fe5b815260200190815260200160002096506000955060009450600093505b8654841015610b605786548890889086908110610b3857fe5b90600052602060002001541415610b555760019550839450610b60565b600190930192610b1f565b85156101a0578492505b865460001901831015610bf9578654879060018501908110610b8857fe5b90600052602060002001548760000184815481101515610ba457fe5b90600052602060002001819055508660010183600101815481101515610bc657fe5b90600052602060002001548760010184815481101515610be257fe5b600091825260209091200155600190920191610b6a565b865487906000198101908110610c0b57fe5b60009182526020822001558654610c26886000198301612742565b506001870180546000198101908110610c3b57fe5b600091825260208220015560018701805490610c5b906000198301612742565b50505050505050505050565b60025460009060ff1615610c7a57600080fd5b811580610cab5750336000908152600860209081526040808320600160a060020a0387168452600201909152902054155b1515610cb657600080fd5b336000818152600860209081526040808320600160a060020a0388168085526002909101835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b6007545b90565b60025460009060ff1615610d3c57600080fd5b610d4984848460016124fa565b50600160a060020a0384166000908152600860209081526040808320338452600201909152902054821115610d7d57600080fd5b600160a060020a038416600090815260086020526040902054610da6908363ffffffff61252c16565b600160a060020a038086166000908152600860205260408082209390935590851681522054610ddb908363ffffffff6122f516565b600160a060020a0380851660009081526008602090815260408083209490945591871681528281203382526002019091522054610e1e908363ffffffff61252c16565b600160a060020a03808616600081815260086020908152604080832033845260020182529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600080548190600160a060020a03163314610ea657600080fd5b506000905080610eb58361253e565b90925090508115610ec557600080fd5b5050600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b018054600160a060020a031916600160a060020a0392909216919091179055565b600080548190600160a060020a03163314610f3357600080fd5b506000905080610f4283612497565b90925090508115610f5257600080fd5b50506001805480820182556000919091527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6018054600160a060020a031916600160a060020a0392909216919091179055565b6000805481908190600160a060020a0316331415610fc65760019150610fd8565b506000610fd233612497565b90925090505b811515610fe457600080fd5b600160a060020a038416600090815260086020526040902060019081015460ff1615151461101157600080fd5b505050600160a060020a031660009081526008602052604090206001908101805460ff1916905590565b60065460ff1681565b600080548190600160a060020a03163314156110635760019150611075565b50600061106f33612497565b90925090505b81151561108157600080fd5b60025460ff16151561109257600080fd5b6002805460ff191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a15050565b60008054600160a060020a031633146110e157600080fd5b336000908152600860205260409020548211156110fd57600080fd5b3360009081526008602052604090205461111d908363ffffffff61252c16565b33600090815260086020526040902055600754611140908363ffffffff61252c16565b6007556040805183815290517fb90306ad06b2a6ff86ddc9327db583062895ef6540e62dc50add009db5b356eb9181900360200190a1506001919050565b606060038054806020026020016040519081016040528092919081815260200182805480156111d657602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116111b8575b5050505050905090565b60025460ff1681565b6000805481908190819081908190600160a060020a03163314156112105760019150611222565b50600061121c33612497565b90925090505b81151561122e57600080fd5b6000955060009450600093505b600160a060020a038a166000908152600a602052604090205484101561132f5788600381111561126757fe5b600160a060020a038b166000908152600a6020526040902080548690811061128b57fe5b90600052602060002001541480156112d55750600160a060020a038a166000908152600a602052604090206002018054899190869081106112c857fe5b9060005260206000200154145b80156113135750600160a060020a038a166000908152600a6020526040902060030180548891908690811061130657fe5b9060005260206000200154145b15611324576001955083945061132f565b60019093019261123b565b85151561133b57600080fd5b8492505b600160a060020a038a166000908152600a60205260409020546000190183101561152057600160a060020a038a166000908152600a6020526040902080546001850190811061138a57fe5b6000918252602080832090910154600160a060020a038d168352600a90915260409091208054859081106113ba57fe5b9060005260206000200181905550600a60008b600160a060020a0316600160a060020a031681526020019081526020016000206001018360010181548110151561140057fe5b6000918252602080832090910154600160a060020a038d168352600a909152604090912060010180548590811061143357fe5b6000918252602080832090910192909255600160a060020a038c168152600a9091526040902060020180546001850190811061146b57fe5b6000918252602080832090910154600160a060020a038d168352600a909152604090912060020180548590811061149e57fe5b6000918252602080832090910192909255600160a060020a038c168152600a909152604090206003018054600185019081106114d657fe5b6000918252602080832090910154600160a060020a038d168352600a909152604090912060030180548590811061150957fe5b60009182526020909120015560019092019161133f565b600160a060020a038a166000908152600a602052604090208054600019810190811061154857fe5b60009182526020808320909101829055600160a060020a038c168252600a90526040902080549061157d906000198301612742565b50600160a060020a038a166000908152600a60205260409020600101805460001981019081106115a957fe5b60009182526020808320909101829055600160a060020a038c168252600a9052604090206001018054906115e1906000198301612742565b50600160a060020a038a166000908152600a602052604090206002018054600019810190811061160d57fe5b60009182526020808320909101829055600160a060020a038c168252600a905260409020600201805490611645906000198301612742565b50600160a060020a038a166000908152600a602052604090206003018054600019810190811061167157fe5b60009182526020808320909101829055600160a060020a038c168252600a9052604090206003018054906116a9906000198301612742565b5050505050505050505050565b6000610d1c6116c48361094b565b6116cd846116d9565b9063ffffffff61252c16565b600160a060020a031660009081526008602052604090205490565b6000805481908190600160a060020a0316331461171057600080fd5b60009250600091506117218461253e565b909350915082151561173257600080fd5b5060038054600019810191908290811061174857fe5b60009182526020909120015460038054600160a060020a03909216918490811061176e57fe5b60009182526020909120018054600160a060020a031916600160a060020a03929092169190911790556003805460001981019081106117a957fe5b60009182526020909120018054600160a060020a031916905560038054906117d5906000198301612742565b5050505050565b600080548190600160a060020a03163314156117fb576001915061180d565b50600061180733612497565b90925090505b81151561181957600080fd5b60025460ff161561182957600080fd5b6002805460ff191660011790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a15050565b600054600160a060020a031681565b606080600083600381111561188357fe5b6000818152600960209081526040918290208054835181840281018401909452808452939450926001840192918491908301828280156118e257602002820191906000526020600020905b8154815260200190600101908083116118ce575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561193457602002820191906000526020600020905b815481526020019060010190808311611920575b50505050509050925092505b50915091565b600160a060020a031660009081526008602052604090206001015460ff1690565b6005805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610aa35780601f10610a7857610100808354040283529160200191610aa3565b6000805481908190600160a060020a031633146119de57600080fd5b60009250600091506119ef84612497565b9093509150821515611a0057600080fd5b50600180546000198101919082908110611a1657fe5b60009182526020909120015460018054600160a060020a039092169184908110611a3c57fe5b60009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055600180546000198101908110611a7757fe5b60009182526020909120018054600160a060020a031916905560018054906117d5906000198301612742565b6000805481908190600160a060020a0316331415611ac45760019150611ad6565b506000611ad033612497565b90925090505b811515611ae257600080fd5b8551600010611af057600080fd5b8451865114611afe57600080fd5b8351865114611b0c57600080fd5b6000876003811115611b1a57fe5b1415611b2557600080fd5b600092505b8551831015611bb957611b538684815181101515611b4457fe5b906020019060200201516120c0565b15611b5d57600080fd5b611bae8684815181101515611b6e57fe5b90602001906020020151888786815181101515611b8757fe5b906020019060200201518787815181101515611b9f57fe5b90602001906020020151612595565b600190920191611b2a565b50505050505050565b600080548190819081908190600160a060020a0316331415611be75760019150611bf9565b506000611bf333612497565b90925090505b811515611c0557600080fd5b60096000896003811115611c1557fe5b8152602001908152602001600020945060009350600092505b8454831015611c685784548790869085908110611c4757fe5b90600052602060002001541415611c5d57600080fd5b600190920191611c2e565b8315611c7357600080fd5b845460018181018755600087815260208082209093018a905581880180549283018155815291909120018690555050505050505050565b606060018054806020026020016040519081016040528092919081815260200182805480156111d657602002820191906000526020600020908154600160a060020a031681526001909101906020018083116111b8575050505050905090565b60025460009060ff1615611d1d57600080fd5b611d2a33848460016124fa565b5033600090815260086020526040902054611d4b908363ffffffff61252c16565b3360009081526008602052604080822092909255600160a060020a03851681522054611d7d908363ffffffff6122f516565b600160a060020a0384166000818152600860209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600160a060020a0381166000908152600a602090815260408083205481518181528184028101909301909152606092839283928392839283928015611e2a578160200160208202803883390190505b509150600090505b600160a060020a0388166000908152600a6020526040902054811015611f3b576001600160a060020a0389166000908152600a60205260409020805483908110611e7857fe5b90600052602060002001541415611ed757611eba611e96898361227b565b8383815181101515611ea457fe5b602090810290910101519063ffffffff6122f516565b8282815181101515611ec857fe5b60209081029091010152611f33565b600160a060020a0388166000908152600a60205260408120805483908110611efb57fe5b9060005260206000200154141515611f3357611f1a611e96898361230b565b8282815181101515611f2857fe5b602090810290910101525b600101611e32565b600160a060020a0388166000908152600a602090815260409182902080548351818402810184019094528084529092600184019286926002860192600387019290918791830182828015611fae57602002820191906000526020600020905b815481526020019060010190808311611f9a575b505050505094508380548060200260200160405190810160405280929190818152602001828054801561200057602002820191906000526020600020905b815481526020019060010190808311611fec575b505050505093508180548060200260200160405190810160405280929190818152602001828054801561205257602002820191906000526020600020905b81548152602001906001019080831161203e575b50505050509150808054806020026020016040519081016040528092919081815260200182805480156120a457602002820191906000526020600020905b815481526020019060010190808311612090575b5050505050905096509650965096509650505091939590929450565b6000805b6003548110156121135782600160a060020a03166003828154811015156120e757fe5b600091825260209091200154600160a060020a0316141561210b5760019150612118565b6001016120c4565b600091505b50919050565b600160a060020a0391821660009081526008602090815260408083209390941682526002909201909152205490565b600054600160a060020a0316331461216457600080fd5b600160a060020a038116151561217957600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360008054600160a060020a031916600160a060020a0392909216919091179055565b6000805481908190600160a060020a03163314156121f55760019150612207565b50600061220133612497565b90925090505b81151561221357600080fd5b600160a060020a03841660009081526008602052604090206001015460ff161561223c57600080fd5b612245846120c0565b1561224f57600080fd5b505050600160a060020a031660009081526008602052604090206001908101805460ff19168217905590565b600160a060020a0382166000908152600a602052604081206003018054839081106122a257fe5b90600052602060002001544210156122ed57600160a060020a0383166000908152600a602052604090206001018054839081106122db57fe5b90600052602060002001549050610d1c565b506000610d1c565b60008282018381101561230457fe5b9392505050565b600160a060020a0382166000908152600a60205260408120805482918291829182918790811061233757fe5b9060005260206000200154925064174876e7ff9150600090505b60008381526009602052604090205481101561242157600083815260096020526040902080548290811061238157fe5b90600052602060002001544210156124195760008381526009602052604090208054839190839081106123b057fe5b906000526020600020015410156124195760008381526009602052604090208054829081106123db57fe5b90600052602060002001549150600960008481526020019081526020016000206001018181548110151561240b57fe5b906000526020600020015493505b600101612351565b831515612431576000945061248d565b600160a060020a0387166000908152600a60205260409020600101805461248a91869161247e916064918b90811061246557fe5b906000526020600020015461267f90919063ffffffff16565b9063ffffffff61269616565b94505b5050505092915050565b600080805b6001548110156124ee5783600160a060020a03166001828154811015156124bf57fe5b600091825260209091200154600160a060020a031614156124e65760018192509250611940565b60010161249c565b50600093849350915050565b6000612508858585856126c1565b50811561252457612518856116b6565b83111561252457600080fd5b949350505050565b60008282111561253857fe5b50900390565b600080805b6003548110156124ee5783600160a060020a031660038281548110151561256657fe5b600091825260209091200154600160a060020a0316141561258d5760018192509250611940565b600101612543565b4281116125a157600080fd5b600082116125ae57600080fd5b600160a060020a0384166000908152600a602052604090208360038111156125d257fe5b8154600181810184556000938452602080852090920192909255600160a060020a038716808452600a825260408085208085018054808701825590875284872001889055600281018054808701825590875284872042910155600301805494850181558552938290209092018490558251858152908101849052825191927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b92918290030190a250505050565b600080828481151561268d57fe5b04949350505050565b6000808315156126a95760009150610a16565b508282028284828115156126b957fe5b041461230457fe5b6000600160a060020a0384163014156126d957600080fd5b600160a060020a03841615156126ee57600080fd5b600160a060020a03851660009081526008602052604090205483111561271357600080fd5b811561252457600160a060020a03851660009081526008602052604090206001015460ff161561252457600080fd5b8154818355818111156127665760008381526020902061276691810190830161276b565b505050565b610d2691905b808211156127855760008155600101612771565b50905600a165627a7a7230582011f8516658c9b0f16f8bc2b919d7a34d584a8da6ca52620ca5c726cb2245af290029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 1,841 |
0x8103ea69fed72744402b8b704ccadd2b0407b4c0 | /**
*Submitted for verification at Etherscan.io on 2021-06-04
*/
//Telegram: https://t.me/maneki-neko
//Twitter: https://twitter.com/TheManeki_Neko
//Website coming soon at manekineko.xyz
//Buying on Uniswap? Set slippage to 20%
//Big Marketing Campaign incoming, lets grow this community strong - $MANEKI #MANEKI on Twitter
//Completely fair launched with 100% of the supply added to liquidity
//Liquidity locked with Unicrypt
//Ownership Renounced
//Limited buys to prevent bots and whales stealing large amounts of supply
//Pump It Loomdart
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract ManekiNeko is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "MANEKI-NEKO";
string private constant _symbol = "Maneki \xF0\x9F\x90\xB1";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_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.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 3000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3c565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612edd565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a00565b6105ad565b6040516101a09190612ec2565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb919061307f565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b1565b6105dc565b6040516102089190612ec2565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c11565b60405161024a91906130f4565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7d565b610c1a565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612923565b610ccc565b005b3480156102b157600080fd5b506102ba610dbc565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612923565b610e2e565b6040516102f0919061307f565b60405180910390f35b34801561030557600080fd5b5061030e610e7f565b005b34801561031c57600080fd5b50610325610fd2565b6040516103329190612df4565b60405180910390f35b34801561034757600080fd5b50610350610ffb565b60405161035d9190612edd565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a00565b611038565b60405161039a9190612ec2565b60405180910390f35b3480156103af57600080fd5b506103b8611056565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612acf565b6110d0565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612975565b611219565b604051610417919061307f565b60405180910390f35b6104286112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fdf565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613395565b9150506104b8565b5050565b60606040518060400160405280600b81526020017f4d414e454b492d4e454b4f000000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a0565b84846112a8565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611473565b6106aa846105f56112a0565b6106a5856040518060600160405280602881526020016137b860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c329092919063ffffffff16565b6112a8565b600190509392505050565b6106bd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fdf565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f1f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294c565b6040518363ffffffff1660e01b815260040161095f929190612e0f565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2e565b600080610a45610fd2565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e61565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af8565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506729a2241af62c00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbb929190612e38565b602060405180830381600087803b158015610bd557600080fd5b505af1158015610be9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0d9190612aa6565b5050565b60006009905090565b610c226112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca690612fdf565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd46112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5890612fdf565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1614610e1d57600080fd5b6000479050610e2b81611c96565b50565b6000610e78600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d91565b9050919050565b610e876112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0b90612fdf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f4d616e656b6920f09f90b1000000000000000000000000000000000000000000815250905090565b600061104c6110456112a0565b8484611473565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110976112a0565b73ffffffffffffffffffffffffffffffffffffffff16146110b757600080fd5b60006110c230610e2e565b90506110cd81611dff565b50565b6110d86112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115c90612fdf565b60405180910390fd5b600081116111a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119f90612f9f565b60405180910390fd5b6111d760646111c983683635c9adc5dea000006120f990919063ffffffff16565b61217490919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120e919061307f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130f9061303f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90612f5f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611466919061307f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114da9061301f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154a90612eff565b60405180910390fd5b60008111611596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158d90612fff565b60405180910390fd5b61159e610fd2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160c57506115dc610fd2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6f57600f60179054906101000a900460ff161561183f573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117425750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183e57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117886112a0565b73ffffffffffffffffffffffffffffffffffffffff1614806117fe5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e66112a0565b73ffffffffffffffffffffffffffffffffffffffff16145b61183d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118349061305f565b60405180910390fd5b5b5b60105481111561184e57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f25750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fb57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a145750600f60179054906101000a900460ff165b15611ab55742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6457600080fd5b603c42611a7191906131b5565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac030610e2e565b9050600f60159054906101000a900460ff16158015611b2d5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b455750600f60169054906101000a900460ff165b15611b6d57611b5381611dff565b60004790506000811115611b6b57611b6a47611c96565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c165750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2057600090505b611c2c848484846121be565b50505050565b6000838311158290611c7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c719190612edd565b60405180910390fd5b5060008385611c899190613296565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce660028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d11573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6260028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8d573d6000803e3d6000fd5b5050565b6000600654821115611dd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcf90612f3f565b60405180910390fd5b6000611de26121eb565b9050611df7818461217490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8b5781602001602082028036833780820191505090505b5090503081600081518110611ec9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6b57600080fd5b505afa158015611f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa3919061294c565b81600181518110611fdd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a8565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a895949392919061309a565b600060405180830381600087803b1580156120c257600080fd5b505af11580156120d6573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210c576000905061216e565b6000828461211a919061323c565b9050828482612129919061320b565b14612169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216090612fbf565b60405180910390fd5b809150505b92915050565b60006121b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612216565b905092915050565b806121cc576121cb612279565b5b6121d78484846122aa565b806121e5576121e4612475565b5b50505050565b60008060006121f8612487565b9150915061220f818361217490919063ffffffff16565b9250505090565b6000808311829061225d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122549190612edd565b60405180910390fd5b506000838561226c919061320b565b9050809150509392505050565b600060085414801561228d57506000600954145b15612297576122a8565b600060088190555060006009819055505b565b6000806000806000806122bc876124e9565b95509550955095509550955061231a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123af85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fb816125f9565b61240584836126b6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612462919061307f565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124bd683635c9adc5dea0000060065461217490919063ffffffff16565b8210156124dc57600654683635c9adc5dea000009350935050506124e5565b81819350935050505b9091565b60008060008060008060008060006125068a6008546009546126f0565b92509250925060006125166121eb565b905060008060006125298e878787612786565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c32565b905092915050565b60008082846125aa91906131b5565b9050838110156125ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e690612f7f565b60405180910390fd5b8091505092915050565b60006126036121eb565b9050600061261a82846120f990919063ffffffff16565b905061266e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cb8260065461255190919063ffffffff16565b6006819055506126e68160075461259b90919063ffffffff16565b6007819055505050565b60008060008061271c606461270e888a6120f990919063ffffffff16565b61217490919063ffffffff16565b905060006127466064612738888b6120f990919063ffffffff16565b61217490919063ffffffff16565b9050600061276f82612761858c61255190919063ffffffff16565b61255190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279f85896120f990919063ffffffff16565b905060006127b686896120f990919063ffffffff16565b905060006127cd87896120f990919063ffffffff16565b905060006127f6826127e8858761255190919063ffffffff16565b61255190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282261281d84613134565b61310f565b9050808382526020820190508285602086028201111561284157600080fd5b60005b858110156128715781612857888261287b565b845260208401935060208301925050600181019050612844565b5050509392505050565b60008135905061288a81613772565b92915050565b60008151905061289f81613772565b92915050565b600082601f8301126128b657600080fd5b81356128c684826020860161280f565b91505092915050565b6000813590506128de81613789565b92915050565b6000815190506128f381613789565b92915050565b600081359050612908816137a0565b92915050565b60008151905061291d816137a0565b92915050565b60006020828403121561293557600080fd5b60006129438482850161287b565b91505092915050565b60006020828403121561295e57600080fd5b600061296c84828501612890565b91505092915050565b6000806040838503121561298857600080fd5b60006129968582860161287b565b92505060206129a78582860161287b565b9150509250929050565b6000806000606084860312156129c657600080fd5b60006129d48682870161287b565b93505060206129e58682870161287b565b92505060406129f6868287016128f9565b9150509250925092565b60008060408385031215612a1357600080fd5b6000612a218582860161287b565b9250506020612a32858286016128f9565b9150509250929050565b600060208284031215612a4e57600080fd5b600082013567ffffffffffffffff811115612a6857600080fd5b612a74848285016128a5565b91505092915050565b600060208284031215612a8f57600080fd5b6000612a9d848285016128cf565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128e4565b91505092915050565b600060208284031215612ae157600080fd5b6000612aef848285016128f9565b91505092915050565b600080600060608486031215612b0d57600080fd5b6000612b1b8682870161290e565b9350506020612b2c8682870161290e565b9250506040612b3d8682870161290e565b9150509250925092565b6000612b538383612b5f565b60208301905092915050565b612b68816132ca565b82525050565b612b77816132ca565b82525050565b6000612b8882613170565b612b928185613193565b9350612b9d83613160565b8060005b83811015612bce578151612bb58882612b47565b9750612bc083613186565b925050600181019050612ba1565b5085935050505092915050565b612be4816132dc565b82525050565b612bf38161331f565b82525050565b6000612c048261317b565b612c0e81856131a4565b9350612c1e818560208601613331565b612c278161346b565b840191505092915050565b6000612c3f6023836131a4565b9150612c4a8261347c565b604082019050919050565b6000612c62601a836131a4565b9150612c6d826134cb565b602082019050919050565b6000612c85602a836131a4565b9150612c90826134f4565b604082019050919050565b6000612ca86022836131a4565b9150612cb382613543565b604082019050919050565b6000612ccb601b836131a4565b9150612cd682613592565b602082019050919050565b6000612cee601d836131a4565b9150612cf9826135bb565b602082019050919050565b6000612d116021836131a4565b9150612d1c826135e4565b604082019050919050565b6000612d346020836131a4565b9150612d3f82613633565b602082019050919050565b6000612d576029836131a4565b9150612d628261365c565b604082019050919050565b6000612d7a6025836131a4565b9150612d85826136ab565b604082019050919050565b6000612d9d6024836131a4565b9150612da8826136fa565b604082019050919050565b6000612dc06011836131a4565b9150612dcb82613749565b602082019050919050565b612ddf81613308565b82525050565b612dee81613312565b82525050565b6000602082019050612e096000830184612b6e565b92915050565b6000604082019050612e246000830185612b6e565b612e316020830184612b6e565b9392505050565b6000604082019050612e4d6000830185612b6e565b612e5a6020830184612dd6565b9392505050565b600060c082019050612e766000830189612b6e565b612e836020830188612dd6565b612e906040830187612bea565b612e9d6060830186612bea565b612eaa6080830185612b6e565b612eb760a0830184612dd6565b979650505050505050565b6000602082019050612ed76000830184612bdb565b92915050565b60006020820190508181036000830152612ef78184612bf9565b905092915050565b60006020820190508181036000830152612f1881612c32565b9050919050565b60006020820190508181036000830152612f3881612c55565b9050919050565b60006020820190508181036000830152612f5881612c78565b9050919050565b60006020820190508181036000830152612f7881612c9b565b9050919050565b60006020820190508181036000830152612f9881612cbe565b9050919050565b60006020820190508181036000830152612fb881612ce1565b9050919050565b60006020820190508181036000830152612fd881612d04565b9050919050565b60006020820190508181036000830152612ff881612d27565b9050919050565b6000602082019050818103600083015261301881612d4a565b9050919050565b6000602082019050818103600083015261303881612d6d565b9050919050565b6000602082019050818103600083015261305881612d90565b9050919050565b6000602082019050818103600083015261307881612db3565b9050919050565b60006020820190506130946000830184612dd6565b92915050565b600060a0820190506130af6000830188612dd6565b6130bc6020830187612bea565b81810360408301526130ce8186612b7d565b90506130dd6060830185612b6e565b6130ea6080830184612dd6565b9695505050505050565b60006020820190506131096000830184612de5565b92915050565b600061311961312a565b90506131258282613364565b919050565b6000604051905090565b600067ffffffffffffffff82111561314f5761314e61343c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c082613308565b91506131cb83613308565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613200576131ff6133de565b5b828201905092915050565b600061321682613308565b915061322183613308565b9250826132315761323061340d565b5b828204905092915050565b600061324782613308565b915061325283613308565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328b5761328a6133de565b5b828202905092915050565b60006132a182613308565b91506132ac83613308565b9250828210156132bf576132be6133de565b5b828203905092915050565b60006132d5826132e8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332a82613308565b9050919050565b60005b8381101561334f578082015181840152602081019050613334565b8381111561335e576000848401525b50505050565b61336d8261346b565b810181811067ffffffffffffffff8211171561338c5761338b61343c565b5b80604052505050565b60006133a082613308565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d3576133d26133de565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377b816132ca565b811461378657600080fd5b50565b613792816132dc565b811461379d57600080fd5b50565b6137a981613308565b81146137b457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205942bf8214e71be810973871bd36d95d6d5b89b1b960fb74c4f4dd0f267314f264736f6c63430008040033 | {"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"}]}} | 1,842 |
0x886ce997aa9ee4f8c2282e182ab72a705762399d | /**
*Submitted for verification at Etherscan.io on 2021-03-20
*/
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.7.5;
interface IOwnable {
function owner() external view returns (address);
function renounceOwnership() external;
function transferOwnership( address newOwner_ ) external;
}
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 SafeMathInt {
function sub(int256 a, int256 b)
internal
pure
returns (int256)
{
int256 c = a - b;
require((b >= 0 && c <= a) || (b < 0 && c > a));
return c;
}
function add(int256 a, int256 b)
internal
pure
returns (int256)
{
int256 c = a + b;
require((b >= 0 && c >= a) || (b < 0 && c < a));
return c;
}
}
interface IBondingCalculator {
function calcDebtRatio( uint pendingDebtDue_, uint managedTokenTotalSupply_ ) external pure returns ( uint debtRatio_ );
function calcBondPremium( uint debtRatio_, uint bondScalingFactor ) external pure returns ( uint premium_ );
function calcPrincipleValuation( uint k_, uint amountDeposited_, uint totalSupplyOfTokenDeposited_ ) external pure returns ( uint principleValuation_ );
function principleValuation( address principleTokenAddress_, uint amountDeposited_ ) external view returns ( uint principleValuation_ );
function calculateBondInterest( address treasury_, address principleTokenAddress_, uint amountDeposited_, uint bondScalingFactor ) external returns ( uint interestDue_ );
}
/**
interface IPrincipleDepository {
function getCurrentBondTerm() external returns ( uint, uint );
function treasury() external returns ( address );
function getBondCalculator() external returns ( address );
function isPrincipleToken( address ) external returns ( bool );
function getDepositorInfoForDepositor( address ) external returns ( uint, uint, uint );
function addPrincipleToken( address newPrincipleToken_ ) external returns ( bool );
function setTreasury( address newTreasury_ ) external returns ( bool );
function addBondTerm( address bondPrincipleToken_, uint256 bondScalingFactor_, uint256 bondingPeriodInBlocks_ ) external returns ( bool );
function getDepositorInfo( address depositorAddress_) external view returns ( uint principleAmount_, uint interestDue_, uint bondMaturationBlock_);
function depositBondPrinciple( address bondPrincipleTokenToDeposit_, uint256 amountToDeposit_ ) external returns ( bool );
function depositBondPrincipleWithPermit( address bondPrincipleTokenToDeposit_, uint256 amountToDeposit_, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external returns ( bool );
function withdrawPrincipleAndForfeitInterest( address bondPrincipleToWithdraw_ ) external returns ( bool );
function redeemBond(address bondPrincipleToRedeem_ ) external returns ( bool );
}
*/
interface ITreasury {
function getBondingCalculator() external returns ( address );
// function payDebt( address depositor_ ) external returns ( bool );
function getTimelockEndBlock() external returns ( uint );
function getManagedToken() external returns ( address );
// function getDebtAmountDue() external returns ( uint );
// function incurDebt( uint principieTokenAmountDeposited_, uint bondScalingValue_ ) external returns ( bool );
}
library Address {
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
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 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 {
if (returndata.length > 0) {
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is IOwnable {
address internal _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
_owner = msg.sender;
emit OwnershipTransferred( address(0), _owner );
}
function owner() public view override returns (address) {
return _owner;
}
modifier onlyOwner() {
require( _owner == msg.sender, "Ownable: caller is not the owner" );
_;
}
function renounceOwnership() public virtual override onlyOwner() {
emit OwnershipTransferred( _owner, address(0) );
_owner = address(0);
}
function transferOwnership( address newOwner_ ) public virtual override onlyOwner() {
require( newOwner_ != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred( _owner, newOwner_ );
_owner = newOwner_;
}
}
interface IERC20 {
function decimals() external view returns (uint8);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
interface IERC20Mintable {
function mint( uint256 amount_ ) external;
function mint( address account_, uint256 ammount_ ) external;
}
contract Vault is ITreasury, Ownable {
using SafeMath for uint;
using SafeMathInt for int;
using SafeERC20 for IERC20;
event TimelockStarted( uint timelockEndBlock );
bool public isInitialized;
uint public timelockDurationInBlocks;
bool public isTimelockSet;
uint public override getTimelockEndBlock;
address public daoWallet;
address public LPRewardsContract;
address public stakingContract;
uint public LPProfitShare;
uint public getPrincipleTokenBalance;
address public override getManagedToken;
address public getReserveToken;
address public getPrincipleToken;
address public override getBondingCalculator;
mapping( address => bool ) public isReserveToken;
mapping( address => bool ) public isPrincipleToken;
mapping( address => bool ) public isPrincipleDepositor;
mapping( address => bool ) public isReserveDepositor;
modifier notInitialized() {
require( !isInitialized );
_;
}
modifier onlyReserveToken( address reserveTokenChallenge_ ) {
require( isReserveToken[reserveTokenChallenge_] == true, "Vault: reserveTokenChallenge_ is not a reserve Token." );
_;
}
modifier onlyPrincipleToken( address PrincipleTokenChallenge_ ) {
require( isPrincipleToken[PrincipleTokenChallenge_] == true, "Vault: PrincipleTokenChallenge_ is not a Principle token." );
_;
}
modifier notTimelockSet() {
require( !isTimelockSet );
_;
}
modifier isTimelockExpired() {
require( getTimelockEndBlock != 0 );
require( isTimelockSet );
require( block.number >= getTimelockEndBlock );
_;
}
modifier isTimelockStarted() {
if( getTimelockEndBlock != 0 ) {
emit TimelockStarted( getTimelockEndBlock );
}
_;
}
function setDAOWallet( address newDAOWallet_ ) external onlyOwner() returns ( bool ) {
daoWallet = newDAOWallet_;
return true;
}
function setStakingContract( address newStakingContract_ ) external onlyOwner() returns ( bool ) {
stakingContract = newStakingContract_;
return true;
}
function setLPRewardsContract( address newLPRewardsContract_ ) external onlyOwner() returns ( bool ) {
LPRewardsContract = newLPRewardsContract_;
return true;
}
function setLPProfitShare( uint newDAOProfitShare_ ) external onlyOwner() returns ( bool ) {
LPProfitShare = newDAOProfitShare_;
return true;
}
function initialize(
address newManagedToken_,
address newReserveToken_,
address newBondingCalculator_,
address newLPRewardsContract_
) external onlyOwner() notInitialized() returns ( bool ) {
getManagedToken = newManagedToken_;
getReserveToken = newReserveToken_;
isReserveToken[newReserveToken_] = true;
getBondingCalculator = newBondingCalculator_;
LPRewardsContract = newLPRewardsContract_;
isInitialized = true;
return true;
}
function setPrincipleToken( address newPrincipleToken_ ) external onlyOwner() returns ( bool ) {
getPrincipleToken = newPrincipleToken_;
isPrincipleToken[newPrincipleToken_] = true;
return true;
}
function setPrincipleDepositor( address newDepositor_ ) external onlyOwner() returns ( bool ) {
isPrincipleDepositor[newDepositor_] = true;
return true;
}
function setReserveDepositor( address newDepositor_ ) external onlyOwner() returns ( bool ) {
isReserveDepositor[newDepositor_] = true;
return true;
}
function removePrincipleDepositor( address depositor_ ) external onlyOwner() returns ( bool ) {
isPrincipleDepositor[depositor_] = false;
return true;
}
function removeReserveDepositor( address depositor_ ) external onlyOwner() returns ( bool ) {
isReserveDepositor[depositor_] = false;
return true;
}
function rewardsDepositPrinciple( uint depositAmount_ ) external returns ( bool ) {
require(isReserveDepositor[msg.sender] == true, "Not allowed to deposit");
address principleToken = getPrincipleToken;
IERC20( principleToken ).safeTransferFrom( msg.sender, address(this), depositAmount_ );
uint value = IBondingCalculator( getBondingCalculator ).principleValuation( principleToken, depositAmount_ ).div( 1e9 );
uint forLP = value.div( LPProfitShare );
IERC20Mintable( getManagedToken ).mint( stakingContract, value.sub( forLP ) );
IERC20Mintable( getManagedToken ).mint( LPRewardsContract, forLP );
return true;
}
function depositReserves( uint amount_ ) external returns ( bool ) {
require(isReserveDepositor[msg.sender] == true, "Not allowed to deposit");
IERC20( getReserveToken ).safeTransferFrom( msg.sender, address(this), amount_ );
address managedToken_ = getManagedToken;
IERC20Mintable( managedToken_ ).mint( msg.sender, amount_.div( 10 ** IERC20( managedToken_ ).decimals() ) );
return true;
}
function depositPrinciple( uint depositAmount_ ) external returns ( bool ) {
require(isPrincipleDepositor[msg.sender] == true, "Not allowed to deposit");
address principleToken = getPrincipleToken;
IERC20( principleToken ).safeTransferFrom( msg.sender, address(this), depositAmount_ );
uint value = IBondingCalculator( getBondingCalculator ).principleValuation( principleToken, depositAmount_ ).div( 1e9 );
IERC20Mintable( getManagedToken ).mint( msg.sender, value );
return true;
}
function migrateReserveAndPrinciple() external onlyOwner() isTimelockExpired() returns ( bool saveGas_ ) {
IERC20( getReserveToken ).safeTransfer( daoWallet, IERC20( getReserveToken ).balanceOf( address( this ) ) );
IERC20( getPrincipleToken ).safeTransfer( daoWallet, IERC20( getPrincipleToken ).balanceOf( address( this ) ) );
return true;
}
function setTimelock( uint newTimelockDurationInBlocks_ ) external onlyOwner() notTimelockSet() returns ( bool ) {
timelockDurationInBlocks = newTimelockDurationInBlocks_;
return true;
}
function startTimelock() external onlyOwner() returns ( bool ) {
getTimelockEndBlock = block.number.add( timelockDurationInBlocks );
isTimelockSet = true;
emit TimelockStarted( getTimelockEndBlock );
return true;
}
} | 0x608060405234801561001057600080fd5b506004361061021c5760003560e01c806376f9fa3d11610125578063d06c8b60116100ad578063ee99205c1161007c578063ee99205c146104fb578063f24e7ea214610503578063f2fde38b14610520578063f8c8765e14610546578063fde09c90146105845761021c565b8063d06c8b60146104bd578063e383fae8146104e3578063e594203d146104eb578063eb21c9fc146104f35761021c565b806394686123116100f4578063946861231461043b5780639dd373b914610461578063a5bec75614610487578063af1417d21461048f578063b29c7444146104b55761021c565b806376f9fa3d146103e85780637750446f146103f0578063792a660b1461040d5780638da5cb5b146104335761021c565b8063392e53cd116101a857806368c31dd51161017757806368c31dd514610382578063698a5897146103a85780636e4a00da146103b0578063702c5f8b146103b8578063715018a6146103de5761021c565b8063392e53cd1461032f57806344ce3d121461033757806354b6dced1461033f57806362884c0d1461035c5761021c565b80632200778f116101ef5780632200778f146102c25780632aee7ef8146102ca5780632c36b69c146102e457806330637d58146102ec578063332782b1146103095761021c565b80630b031d44146102215780630c76218a1461025b578063124154ca1461027f5780631e891c0a146102a5575b600080fd5b6102476004803603602081101561023757600080fd5b50356001600160a01b03166105aa565b604080519115158252519081900360200190f35b6102636105bf565b604080516001600160a01b039092168252519081900360200190f35b6102476004803603602081101561029557600080fd5b50356001600160a01b03166105ce565b610247600480360360208110156102bb57600080fd5b50356105e3565b61026361064a565b6102d2610659565b60408051918252519081900360200190f35b61024761065f565b6102476004803603602081101561030257600080fd5b5035610668565b6102476004803603602081101561031f57600080fd5b50356001600160a01b031661088c565b6102476108ff565b6102d261090f565b6102476004803603602081101561035557600080fd5b5035610915565b6102476004803603602081101561037257600080fd5b50356001600160a01b0316610a67565b6102476004803603602081101561039857600080fd5b50356001600160a01b0316610ada565b610263610aef565b6102d2610afe565b610247600480360360208110156103ce57600080fd5b50356001600160a01b0316610b04565b6103e6610b77565b005b610263610c0e565b6102476004803603602081101561040657600080fd5b5035610c1d565b6102476004803603602081101561042357600080fd5b50356001600160a01b0316610d8b565b610263610e02565b6102476004803603602081101561045157600080fd5b50356001600160a01b0316610e11565b6102476004803603602081101561047757600080fd5b50356001600160a01b0316610e9e565b6102d2610f11565b610247600480360360208110156104a557600080fd5b50356001600160a01b0316610f17565b610247610f2c565b610247600480360360208110156104d357600080fd5b50356001600160a01b0316610fd2565b610263611045565b610263611054565b610247611063565b61026361120d565b6102476004803603602081101561051957600080fd5b503561121c565b6103e66004803603602081101561053657600080fd5b50356001600160a01b0316611273565b6102476004803603608081101561055c57600080fd5b506001600160a01b038135811691602081013582169160408201358116916060013516611360565b6102476004803603602081101561059a57600080fd5b50356001600160a01b0316611449565b600f6020526000908152604090205460ff1681565b600b546001600160a01b031681565b60106020526000908152604090205460ff1681565b600080546001600160a01b03163314610631576040805162461bcd60e51b815260206004820181905260248201526000805160206119ad833981519152604482015290519081900360640190fd5b60025460ff161561064157600080fd5b50600190815590565b600c546001600160a01b031681565b60075481565b60025460ff1681565b3360009081526010602052604081205460ff1615156001146106ca576040805162461bcd60e51b8152602060048201526016602482015275139bdd08185b1b1bddd959081d1bc819195c1bdcda5d60521b604482015290519081900360640190fd5b600b546001600160a01b03166106e2813330866114c0565b600c546040805163fb452dc160e01b81526001600160a01b03848116600483015260248201879052915160009361077493633b9aca009391169163fb452dc191604480820192602092909190829003018186803b15801561074257600080fd5b505afa158015610756573d6000803e3d6000fd5b505050506040513d602081101561076c57600080fd5b505190611520565b9050600061078d6007548361152090919063ffffffff16565b6009546006549192506001600160a01b03908116916340c10f1991166107b38585611569565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156107f957600080fd5b505af115801561080d573d6000803e3d6000fd5b5050600954600554604080516340c10f1960e01b81526001600160a01b0392831660048201526024810187905290519190921693506340c10f199250604480830192600092919082900301818387803b15801561086957600080fd5b505af115801561087d573d6000803e3d6000fd5b50600198975050505050505050565b600080546001600160a01b031633146108da576040805162461bcd60e51b815260206004820181905260248201526000805160206119ad833981519152604482015290519081900360640190fd5b506001600160a01b03166000908152601060205260409020805460ff19169055600190565b600054600160a01b900460ff1681565b60035481565b336000908152600f602052604081205460ff161515600114610977576040805162461bcd60e51b8152602060048201526016602482015275139bdd08185b1b1bddd959081d1bc819195c1bdcda5d60521b604482015290519081900360640190fd5b600b546001600160a01b031661098f813330866114c0565b600c546040805163fb452dc160e01b81526001600160a01b0384811660048301526024820187905291516000936109ef93633b9aca009391169163fb452dc191604480820192602092909190829003018186803b15801561074257600080fd5b600954604080516340c10f1960e01b81523360048201526024810184905290519293506001600160a01b03909116916340c10f199160448082019260009290919082900301818387803b158015610a4557600080fd5b505af1158015610a59573d6000803e3d6000fd5b506001979650505050505050565b600080546001600160a01b03163314610ab5576040805162461bcd60e51b815260206004820181905260248201526000805160206119ad833981519152604482015290519081900360640190fd5b506001600160a01b03166000908152600f60205260409020805460ff19169055600190565b600d6020526000908152604090205460ff1681565b6004546001600160a01b031681565b60085481565b600080546001600160a01b03163314610b52576040805162461bcd60e51b815260206004820181905260248201526000805160206119ad833981519152604482015290519081900360640190fd5b50600580546001600160a01b0383166001600160a01b03199091161790556001919050565b6000546001600160a01b03163314610bc4576040805162461bcd60e51b815260206004820181905260248201526000805160206119ad833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b031681565b3360009081526010602052604081205460ff161515600114610c7f576040805162461bcd60e51b8152602060048201526016602482015275139bdd08185b1b1bddd959081d1bc819195c1bdcda5d60521b604482015290519081900360640190fd5b600a54610c97906001600160a01b03163330856114c0565b6009546040805163313ce56760e01b815290516001600160a01b039092169182916340c10f19913391610d2491859163313ce567916004808301926020929190829003018186803b158015610ceb57600080fd5b505afa158015610cff573d6000803e3d6000fd5b505050506040513d6020811015610d1557600080fd5b5051879060ff16600a0a611520565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015610d6a57600080fd5b505af1158015610d7e573d6000803e3d6000fd5b5060019695505050505050565b600080546001600160a01b03163314610dd9576040805162461bcd60e51b815260206004820181905260248201526000805160206119ad833981519152604482015290519081900360640190fd5b506001600160a01b03166000908152601060205260409020805460ff1916600190811790915590565b6000546001600160a01b031690565b600080546001600160a01b03163314610e5f576040805162461bcd60e51b815260206004820181905260248201526000805160206119ad833981519152604482015290519081900360640190fd5b50600b80546001600160a01b0319166001600160a01b039290921691821790556000908152600e60205260409020805460ff1916600190811790915590565b600080546001600160a01b03163314610eec576040805162461bcd60e51b815260206004820181905260248201526000805160206119ad833981519152604482015290519081900360640190fd5b50600680546001600160a01b0383166001600160a01b03199091161790556001919050565b60015481565b600e6020526000908152604090205460ff1681565b600080546001600160a01b03163314610f7a576040805162461bcd60e51b815260206004820181905260248201526000805160206119ad833981519152604482015290519081900360640190fd5b600154610f889043906115ab565b60038190556002805460ff1916600117905560408051918252517f416c1ad2b96c356f3bbd35431f86cce449ddbb4f8c3755ea9d2776b04c2e9c8f9181900360200190a150600190565b600080546001600160a01b03163314611020576040805162461bcd60e51b815260206004820181905260248201526000805160206119ad833981519152604482015290519081900360640190fd5b50600480546001600160a01b0383166001600160a01b03199091161790556001919050565b6005546001600160a01b031681565b600a546001600160a01b031681565b600080546001600160a01b031633146110b1576040805162461bcd60e51b815260206004820181905260248201526000805160206119ad833981519152604482015290519081900360640190fd5b6003546110bd57600080fd5b60025460ff166110cc57600080fd5b6003544310156110db57600080fd5b60048054600a54604080516370a0823160e01b8152309481019490945251611171936001600160a01b0393841693909216916370a08231916024808301926020929190829003018186803b15801561113257600080fd5b505afa158015611146573d6000803e3d6000fd5b505050506040513d602081101561115c57600080fd5b5051600a546001600160a01b03169190611605565b60048054600b54604080516370a0823160e01b8152309481019490945251611207936001600160a01b0393841693909216916370a08231916024808301926020929190829003018186803b1580156111c857600080fd5b505afa1580156111dc573d6000803e3d6000fd5b505050506040513d60208110156111f257600080fd5b5051600b546001600160a01b03169190611605565b50600190565b6006546001600160a01b031681565b600080546001600160a01b0316331461126a576040805162461bcd60e51b815260206004820181905260248201526000805160206119ad833981519152604482015290519081900360640190fd5b50600755600190565b6000546001600160a01b031633146112c0576040805162461bcd60e51b815260206004820181905260248201526000805160206119ad833981519152604482015290519081900360640190fd5b6001600160a01b0381166113055760405162461bcd60e51b81526004018080602001828103825260268152602001806119876026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b031633146113ae576040805162461bcd60e51b815260206004820181905260248201526000805160206119ad833981519152604482015290519081900360640190fd5b600054600160a01b900460ff16156113c557600080fd5b50600980546001600160a01b038087166001600160a01b031992831617909255600a805486841690831681179091556000908152600d60205260408120805460ff19166001908117909155600c8054878616908516179055600580549486169490931693909317909155805460ff60a01b1916600160a01b1790555b949350505050565b600080546001600160a01b03163314611497576040805162461bcd60e51b815260206004820181905260248201526000805160206119ad833981519152604482015290519081900360640190fd5b506001600160a01b03166000908152600f60205260409020805460ff1916600190811790915590565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261151a90859061165c565b50505050565b600061156283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061170d565b9392505050565b600061156283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117af565b600082820183811015611562576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261165790849061165c565b505050565b60606116b1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166118099092919063ffffffff16565b805190915015611657578080602001905160208110156116d057600080fd5b50516116575760405162461bcd60e51b815260040180806020018281038252602a8152602001806119cd602a913960400191505060405180910390fd5b600081836117995760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561175e578181015183820152602001611746565b50505050905090810190601f16801561178b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816117a557fe5b0495945050505050565b600081848411156118015760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561175e578181015183820152602001611746565b505050900390565b60606114418484600085606061181e85611980565b61186f576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106118ae5780518252601f19909201916020918201910161188f565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611910576040519150601f19603f3d011682016040523d82523d6000602084013e611915565b606091505b509150915081156119295791506114419050565b8051156119395780518082602001fd5b60405162461bcd60e51b815260206004820181815286516024840152865187939192839260440191908501908083836000831561175e578181015183820152602001611746565b3b15159056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220e78098edfd37ee22630db365d36b9d7627594140021ff6ded7afef29cdd1772e64736f6c63430007050033 | {"success": true, "error": null, "results": {}} | 1,843 |
0x08e4eb02a5e7b899a8a8be6ba2d1b8613b62731a | /**
*Submitted for verification at Etherscan.io on 2022-04-01
*/
// 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 Dontbuy is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Dontbuy";
string private constant _symbol = "Dontbuy";
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 = 69000000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 15;
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) public _buyMap;
address payable private _developmentAddress = payable(0x0552d0eEd25E398216930369db61C675b073D760);
address payable private _marketingAddress = payable(0x0552d0eEd25E398216930369db61C675b073D760);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 3450000000000000000000 * 10**9;
uint256 public _maxWalletSize = 3450000000000000000000 * 10**9;
uint256 public _swapTokensAtAmount = 69000000000000000000000 * 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 airdrop(address recipient, uint256 amount) external onlyOwner() {
removeAllFee();
_transfer(_msgSender(), recipient, amount * 10**9);
restoreAllFee();
}
function airdropInternal(address recipient, uint256 amount) internal {
removeAllFee();
_transfer(_msgSender(), recipient, amount);
restoreAllFee();
}
function airdropArray(address[] calldata newholders, uint256[] calldata amounts) external onlyOwner(){
uint256 iterator = 0;
require(newholders.length == amounts.length, "must be the same length");
while(iterator < newholders.length){
airdropInternal(newholders[iterator], amounts[iterator] * 10**9);
iterator += 1;
}
}
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 botwallet) external onlyOwner {
bots[botwallet] = 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 excludeFromFee(address account, bool excluded) public onlyOwner {
_isExcludedFromFee[account] = excluded;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101f25760003560e01c80637f2feddc1161010d578063a9059cbb116100a0578063d4a3883f1161006f578063d4a3883f1461058a578063dd62ed3e146105aa578063df8408fe146105f0578063ea1644d514610610578063f2fde38b1461063057600080fd5b8063a9059cbb14610505578063bfd7928414610525578063c3c8cd8014610555578063c492f0461461056a57600080fd5b80638f9a55c0116100dc5780638f9a55c0146104af57806395d89b41146101fe57806398a5c315146104c5578063a2a957bb146104e557600080fd5b80637f2feddc146104245780638ba4cc3c146104515780638da5cb5b146104715780638f70ccf71461048f57600080fd5b806363c6f9121161018557806370a082311161015457806370a08231146103b9578063715018a6146103d957806374010ece146103ee5780637d1db4a51461040e57600080fd5b806363c6f912146103425780636b999053146103645780636d8aa8f8146103845780636fc3eaec146103a457600080fd5b806323b872dd116101c157806323b872dd146102d05780632fd689e3146102f0578063313ce5671461030657806349bd5a5e1461032257600080fd5b806306fdde03146101fe578063095ea7b31461023d5780631694505e1461026d57806318160ddd146102a557600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b506040805180820182526007815266446f6e7462757960c81b602082015290516102349190611af7565b60405180910390f35b34801561024957600080fd5b5061025d610258366004611b61565b610650565b6040519015158152602001610234565b34801561027957600080fd5b5060145461028d906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b3480156102b157600080fd5b506d0366e7064422fd842023400000005b604051908152602001610234565b3480156102dc57600080fd5b5061025d6102eb366004611b8d565b610667565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b5060405160098152602001610234565b34801561032e57600080fd5b5060155461028d906001600160a01b031681565b34801561034e57600080fd5b5061036261035d366004611bce565b6106d0565b005b34801561037057600080fd5b5061036261037f366004611bce565b610727565b34801561039057600080fd5b5061036261039f366004611c00565b610772565b3480156103b057600080fd5b506103626107ba565b3480156103c557600080fd5b506102c26103d4366004611bce565b610805565b3480156103e557600080fd5b50610362610827565b3480156103fa57600080fd5b50610362610409366004611c1b565b61089b565b34801561041a57600080fd5b506102c260165481565b34801561043057600080fd5b506102c261043f366004611bce565b60116020526000908152604090205481565b34801561045d57600080fd5b5061036261046c366004611b61565b6108ca565b34801561047d57600080fd5b506000546001600160a01b031661028d565b34801561049b57600080fd5b506103626104aa366004611c00565b610929565b3480156104bb57600080fd5b506102c260175481565b3480156104d157600080fd5b506103626104e0366004611c1b565b610971565b3480156104f157600080fd5b50610362610500366004611c34565b6109a0565b34801561051157600080fd5b5061025d610520366004611b61565b6109de565b34801561053157600080fd5b5061025d610540366004611bce565b60106020526000908152604090205460ff1681565b34801561056157600080fd5b506103626109eb565b34801561057657600080fd5b50610362610585366004611cb2565b610a3f565b34801561059657600080fd5b506103626105a5366004611d06565b610ae0565b3480156105b657600080fd5b506102c26105c5366004611d72565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105fc57600080fd5b5061036261060b366004611dab565b610bd3565b34801561061c57600080fd5b5061036261062b366004611c1b565b610c28565b34801561063c57600080fd5b5061036261064b366004611bce565b610c57565b600061065d338484610d41565b5060015b92915050565b6000610674848484610e65565b6106c684336106c185604051806060016040528060288152602001611f5b602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113a1565b610d41565b5060019392505050565b6000546001600160a01b031633146107035760405162461bcd60e51b81526004016106fa90611de0565b60405180910390fd5b6001600160a01b03166000908152601060205260409020805460ff19166001179055565b6000546001600160a01b031633146107515760405162461bcd60e51b81526004016106fa90611de0565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461079c5760405162461bcd60e51b81526004016106fa90611de0565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ef57506013546001600160a01b0316336001600160a01b0316145b6107f857600080fd5b47610802816113db565b50565b6001600160a01b03811660009081526002602052604081205461066190611415565b6000546001600160a01b031633146108515760405162461bcd60e51b81526004016106fa90611de0565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c55760405162461bcd60e51b81526004016106fa90611de0565b601655565b6000546001600160a01b031633146108f45760405162461bcd60e51b81526004016106fa90611de0565b6108fc611499565b610914338361090f84633b9aca00611e2b565b610e65565b610925600e54600c55600f54600d55565b5050565b6000546001600160a01b031633146109535760405162461bcd60e51b81526004016106fa90611de0565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461099b5760405162461bcd60e51b81526004016106fa90611de0565b601855565b6000546001600160a01b031633146109ca5760405162461bcd60e51b81526004016106fa90611de0565b600893909355600a91909155600955600b55565b600061065d338484610e65565b6012546001600160a01b0316336001600160a01b03161480610a2057506013546001600160a01b0316336001600160a01b0316145b610a2957600080fd5b6000610a3430610805565b9050610802816114c7565b6000546001600160a01b03163314610a695760405162461bcd60e51b81526004016106fa90611de0565b60005b82811015610ada578160056000868685818110610a8b57610a8b611e4a565b9050602002016020810190610aa09190611bce565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610ad281611e60565b915050610a6c565b50505050565b6000546001600160a01b03163314610b0a5760405162461bcd60e51b81526004016106fa90611de0565b6000838214610b5b5760405162461bcd60e51b815260206004820152601760248201527f6d757374206265207468652073616d65206c656e67746800000000000000000060448201526064016106fa565b83811015610bcc57610bba858583818110610b7857610b78611e4a565b9050602002016020810190610b8d9190611bce565b848484818110610b9f57610b9f611e4a565b90506020020135633b9aca00610bb59190611e2b565b611650565b610bc5600182611e7b565b9050610b5b565b5050505050565b6000546001600160a01b03163314610bfd5760405162461bcd60e51b81526004016106fa90611de0565b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b6000546001600160a01b03163314610c525760405162461bcd60e51b81526004016106fa90611de0565b601755565b6000546001600160a01b03163314610c815760405162461bcd60e51b81526004016106fa90611de0565b6001600160a01b038116610ce65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106fa565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610da35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106fa565b6001600160a01b038216610e045760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106fa565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ec95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106fa565b6001600160a01b038216610f2b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106fa565b60008111610f8d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106fa565b6000546001600160a01b03848116911614801590610fb957506000546001600160a01b03838116911614155b1561129a57601554600160a01b900460ff16611052576000546001600160a01b038481169116146110525760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016106fa565b6016548111156110a45760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106fa565b6001600160a01b03831660009081526010602052604090205460ff161580156110e657506001600160a01b03821660009081526010602052604090205460ff16155b61113e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016106fa565b6015546001600160a01b038381169116146111c3576017548161116084610805565b61116a9190611e7b565b106111c35760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016106fa565b60006111ce30610805565b6018546016549192508210159082106111e75760165491505b8080156111fe5750601554600160a81b900460ff16155b801561121857506015546001600160a01b03868116911614155b801561122d5750601554600160b01b900460ff165b801561125257506001600160a01b03851660009081526005602052604090205460ff16155b801561127757506001600160a01b03841660009081526005602052604090205460ff16155b1561129757611285826114c7565b47801561129557611295476113db565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112dc57506001600160a01b03831660009081526005602052604090205460ff165b8061130e57506015546001600160a01b0385811691161480159061130e57506015546001600160a01b03848116911614155b1561131b57506000611395565b6015546001600160a01b03858116911614801561134657506014546001600160a01b03848116911614155b1561135857600854600c55600954600d555b6015546001600160a01b03848116911614801561138357506014546001600160a01b03858116911614155b1561139557600a54600c55600b54600d555b610ada84848484611663565b600081848411156113c55760405162461bcd60e51b81526004016106fa9190611af7565b5060006113d28486611e93565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610925573d6000803e3d6000fd5b600060065482111561147c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106fa565b6000611486611691565b905061149283826116b4565b9392505050565b600c541580156114a95750600d54155b156114b057565b600c8054600e55600d8054600f5560009182905555565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061150f5761150f611e4a565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561156357600080fd5b505afa158015611577573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159b9190611eaa565b816001815181106115ae576115ae611e4a565b6001600160a01b0392831660209182029290920101526014546115d49130911684610d41565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061160d908590600090869030904290600401611ec7565b600060405180830381600087803b15801561162757600080fd5b505af115801561163b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b611658611499565b610914338383610e65565b8061167057611670611499565b61167b8484846116f6565b80610ada57610ada600e54600c55600f54600d55565b600080600061169e6117ed565b90925090506116ad82826116b4565b9250505090565b600061149283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611839565b60008060008060008061170887611867565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061173a90876118c4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117699086611906565b6001600160a01b03891660009081526002602052604090205561178b81611965565b61179584836119af565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117da91815260200190565b60405180910390a3505050505050505050565b60065460009081906d0366e7064422fd8420234000000061180e82826116b4565b821015611830575050600654926d0366e7064422fd8420234000000092509050565b90939092509050565b6000818361185a5760405162461bcd60e51b81526004016106fa9190611af7565b5060006113d28486611f38565b60008060008060008060008060006118848a600c54600d546119d3565b9250925092506000611894611691565b905060008060006118a78e878787611a28565b919e509c509a509598509396509194505050505091939550919395565b600061149283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113a1565b6000806119138385611e7b565b9050838110156114925760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106fa565b600061196f611691565b9050600061197d8383611a78565b3060009081526002602052604090205490915061199a9082611906565b30600090815260026020526040902055505050565b6006546119bc90836118c4565b6006556007546119cc9082611906565b6007555050565b60008080806119ed60646119e78989611a78565b906116b4565b90506000611a0060646119e78a89611a78565b90506000611a1882611a128b866118c4565b906118c4565b9992985090965090945050505050565b6000808080611a378886611a78565b90506000611a458887611a78565b90506000611a538888611a78565b90506000611a6582611a1286866118c4565b939b939a50919850919650505050505050565b600082611a8757506000610661565b6000611a938385611e2b565b905082611aa08583611f38565b146114925760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106fa565b600060208083528351808285015260005b81811015611b2457858101830151858201604001528201611b08565b81811115611b36576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461080257600080fd5b60008060408385031215611b7457600080fd5b8235611b7f81611b4c565b946020939093013593505050565b600080600060608486031215611ba257600080fd5b8335611bad81611b4c565b92506020840135611bbd81611b4c565b929592945050506040919091013590565b600060208284031215611be057600080fd5b813561149281611b4c565b80358015158114611bfb57600080fd5b919050565b600060208284031215611c1257600080fd5b61149282611beb565b600060208284031215611c2d57600080fd5b5035919050565b60008060008060808587031215611c4a57600080fd5b5050823594602084013594506040840135936060013592509050565b60008083601f840112611c7857600080fd5b50813567ffffffffffffffff811115611c9057600080fd5b6020830191508360208260051b8501011115611cab57600080fd5b9250929050565b600080600060408486031215611cc757600080fd5b833567ffffffffffffffff811115611cde57600080fd5b611cea86828701611c66565b9094509250611cfd905060208501611beb565b90509250925092565b60008060008060408587031215611d1c57600080fd5b843567ffffffffffffffff80821115611d3457600080fd5b611d4088838901611c66565b90965094506020870135915080821115611d5957600080fd5b50611d6687828801611c66565b95989497509550505050565b60008060408385031215611d8557600080fd5b8235611d9081611b4c565b91506020830135611da081611b4c565b809150509250929050565b60008060408385031215611dbe57600080fd5b8235611dc981611b4c565b9150611dd760208401611beb565b90509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615611e4557611e45611e15565b500290565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611e7457611e74611e15565b5060010190565b60008219821115611e8e57611e8e611e15565b500190565b600082821015611ea557611ea5611e15565b500390565b600060208284031215611ebc57600080fd5b815161149281611b4c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f175784516001600160a01b031683529383019391830191600101611ef2565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f5557634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205f40b9da8f0264cfab5486d2eb2569a9af650aed9c67ef1d85a50fba45cbdb6464736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,844 |
0x11a743849581D1B83Dea1f944a30Bce959110a41 | /**
*Submitted for verification at Etherscan.io on 2022-02-14
*/
/**
https://t.me/SuperBowlPartyETH
*/
// 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 SuperBowl is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Super Bowl Party";
string private constant _symbol = "SuperBowl";
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 = 2;
uint256 private _taxFeeOnBuy = 10;
uint256 private _redisFeeOnSell = 2;
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(0x8897A8d0C15419b69D0b2D3F8F10525d051bCeC3);
address payable private _marketingAddress = payable(0x16121d1c85F5CA81f28f83D5a3BdF464d536b89b);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000000 * 10**9;
uint256 public _maxWalletSize = 250000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610560578063dd62ed3e14610580578063ea1644d5146105c6578063f2fde38b146105e657600080fd5b8063a2a957bb146104db578063a9059cbb146104fb578063bfd792841461051b578063c3c8cd801461054b57600080fd5b80638f70ccf7116100d15780638f70ccf7146104535780638f9a55c01461047357806395d89b411461048957806398a5c315146104bb57600080fd5b80637d1db4a5146103f25780637f2feddc146104085780638da5cb5b1461043557600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038857806370a082311461039d578063715018a6146103bd57806374010ece146103d257600080fd5b8063313ce5671461030c57806349bd5a5e146103285780636b999053146103485780636d8aa8f81461036857600080fd5b80631694505e116101ab5780631694505e1461027957806318160ddd146102b157806323b872dd146102d65780632fd689e3146102f657600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024957600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461196a565b610606565b005b34801561020a57600080fd5b5060408051808201909152601081526f537570657220426f776c20506172747960801b60208201525b6040516102409190611a2f565b60405180910390f35b34801561025557600080fd5b50610269610264366004611a84565b6106a5565b6040519015158152602001610240565b34801561028557600080fd5b50601454610299906001600160a01b031681565b6040516001600160a01b039091168152602001610240565b3480156102bd57600080fd5b50670de0b6b3a76400005b604051908152602001610240565b3480156102e257600080fd5b506102696102f1366004611ab0565b6106bc565b34801561030257600080fd5b506102c860185481565b34801561031857600080fd5b5060405160098152602001610240565b34801561033457600080fd5b50601554610299906001600160a01b031681565b34801561035457600080fd5b506101fc610363366004611af1565b610725565b34801561037457600080fd5b506101fc610383366004611b1e565b610770565b34801561039457600080fd5b506101fc6107b8565b3480156103a957600080fd5b506102c86103b8366004611af1565b610803565b3480156103c957600080fd5b506101fc610825565b3480156103de57600080fd5b506101fc6103ed366004611b39565b610899565b3480156103fe57600080fd5b506102c860165481565b34801561041457600080fd5b506102c8610423366004611af1565b60116020526000908152604090205481565b34801561044157600080fd5b506000546001600160a01b0316610299565b34801561045f57600080fd5b506101fc61046e366004611b1e565b6108c8565b34801561047f57600080fd5b506102c860175481565b34801561049557600080fd5b5060408051808201909152600981526814dd5c195c909bdddb60ba1b6020820152610233565b3480156104c757600080fd5b506101fc6104d6366004611b39565b610910565b3480156104e757600080fd5b506101fc6104f6366004611b52565b61093f565b34801561050757600080fd5b50610269610516366004611a84565b61097d565b34801561052757600080fd5b50610269610536366004611af1565b60106020526000908152604090205460ff1681565b34801561055757600080fd5b506101fc61098a565b34801561056c57600080fd5b506101fc61057b366004611b84565b6109de565b34801561058c57600080fd5b506102c861059b366004611c08565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d257600080fd5b506101fc6105e1366004611b39565b610a7f565b3480156105f257600080fd5b506101fc610601366004611af1565b610aae565b6000546001600160a01b031633146106395760405162461bcd60e51b815260040161063090611c41565b60405180910390fd5b60005b81518110156106a15760016010600084848151811061065d5761065d611c76565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069981611ca2565b91505061063c565b5050565b60006106b2338484610b98565b5060015b92915050565b60006106c9848484610cbc565b61071b843361071685604051806060016040528060288152602001611dbc602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f8565b610b98565b5060019392505050565b6000546001600160a01b0316331461074f5760405162461bcd60e51b815260040161063090611c41565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461079a5760405162461bcd60e51b815260040161063090611c41565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ed57506013546001600160a01b0316336001600160a01b0316145b6107f657600080fd5b4761080081611232565b50565b6001600160a01b0381166000908152600260205260408120546106b69061126c565b6000546001600160a01b0316331461084f5760405162461bcd60e51b815260040161063090611c41565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c35760405162461bcd60e51b815260040161063090611c41565b601655565b6000546001600160a01b031633146108f25760405162461bcd60e51b815260040161063090611c41565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461093a5760405162461bcd60e51b815260040161063090611c41565b601855565b6000546001600160a01b031633146109695760405162461bcd60e51b815260040161063090611c41565b600893909355600a91909155600955600b55565b60006106b2338484610cbc565b6012546001600160a01b0316336001600160a01b031614806109bf57506013546001600160a01b0316336001600160a01b0316145b6109c857600080fd5b60006109d330610803565b9050610800816112f0565b6000546001600160a01b03163314610a085760405162461bcd60e51b815260040161063090611c41565b60005b82811015610a79578160056000868685818110610a2a57610a2a611c76565b9050602002016020810190610a3f9190611af1565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7181611ca2565b915050610a0b565b50505050565b6000546001600160a01b03163314610aa95760405162461bcd60e51b815260040161063090611c41565b601755565b6000546001600160a01b03163314610ad85760405162461bcd60e51b815260040161063090611c41565b6001600160a01b038116610b3d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610630565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bfa5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610630565b6001600160a01b038216610c5b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610630565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d205760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610630565b6001600160a01b038216610d825760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610630565b60008111610de45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610630565b6000546001600160a01b03848116911614801590610e1057506000546001600160a01b03838116911614155b156110f157601554600160a01b900460ff16610ea9576000546001600160a01b03848116911614610ea95760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610630565b601654811115610efb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610630565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3d57506001600160a01b03821660009081526010602052604090205460ff16155b610f955760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610630565b6015546001600160a01b0383811691161461101a5760175481610fb784610803565b610fc19190611cbd565b1061101a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610630565b600061102530610803565b60185460165491925082101590821061103e5760165491505b8080156110555750601554600160a81b900460ff16155b801561106f57506015546001600160a01b03868116911614155b80156110845750601554600160b01b900460ff165b80156110a957506001600160a01b03851660009081526005602052604090205460ff16155b80156110ce57506001600160a01b03841660009081526005602052604090205460ff16155b156110ee576110dc826112f0565b4780156110ec576110ec47611232565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113357506001600160a01b03831660009081526005602052604090205460ff165b8061116557506015546001600160a01b0385811691161480159061116557506015546001600160a01b03848116911614155b15611172575060006111ec565b6015546001600160a01b03858116911614801561119d57506014546001600160a01b03848116911614155b156111af57600854600c55600954600d555b6015546001600160a01b0384811691161480156111da57506014546001600160a01b03858116911614155b156111ec57600a54600c55600b54600d555b610a7984848484611479565b6000818484111561121c5760405162461bcd60e51b81526004016106309190611a2f565b5060006112298486611cd5565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a1573d6000803e3d6000fd5b60006006548211156112d35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610630565b60006112dd6114a7565b90506112e983826114ca565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133857611338611c76565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138c57600080fd5b505afa1580156113a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c49190611cec565b816001815181106113d7576113d7611c76565b6001600160a01b0392831660209182029290920101526014546113fd9130911684610b98565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611436908590600090869030904290600401611d09565b600060405180830381600087803b15801561145057600080fd5b505af1158015611464573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114865761148661150c565b61149184848461153a565b80610a7957610a79600e54600c55600f54600d55565b60008060006114b4611631565b90925090506114c382826114ca565b9250505090565b60006112e983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611671565b600c5415801561151c5750600d54155b1561152357565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154c8761169f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157e90876116fc565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ad908661173e565b6001600160a01b0389166000908152600260205260409020556115cf8161179d565b6115d984836117e7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161e91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164c82826114ca565b82101561166857505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116925760405162461bcd60e51b81526004016106309190611a2f565b5060006112298486611d7a565b60008060008060008060008060006116bc8a600c54600d5461180b565b92509250925060006116cc6114a7565b905060008060006116df8e878787611860565b919e509c509a509598509396509194505050505091939550919395565b60006112e983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f8565b60008061174b8385611cbd565b9050838110156112e95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610630565b60006117a76114a7565b905060006117b583836118b0565b306000908152600260205260409020549091506117d2908261173e565b30600090815260026020526040902055505050565b6006546117f490836116fc565b600655600754611804908261173e565b6007555050565b6000808080611825606461181f89896118b0565b906114ca565b90506000611838606461181f8a896118b0565b905060006118508261184a8b866116fc565b906116fc565b9992985090965090945050505050565b600080808061186f88866118b0565b9050600061187d88876118b0565b9050600061188b88886118b0565b9050600061189d8261184a86866116fc565b939b939a50919850919650505050505050565b6000826118bf575060006106b6565b60006118cb8385611d9c565b9050826118d88583611d7a565b146112e95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610630565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080057600080fd5b803561196581611945565b919050565b6000602080838503121561197d57600080fd5b823567ffffffffffffffff8082111561199557600080fd5b818501915085601f8301126119a957600080fd5b8135818111156119bb576119bb61192f565b8060051b604051601f19603f830116810181811085821117156119e0576119e061192f565b6040529182528482019250838101850191888311156119fe57600080fd5b938501935b82851015611a2357611a148561195a565b84529385019392850192611a03565b98975050505050505050565b600060208083528351808285015260005b81811015611a5c57858101830151858201604001528201611a40565b81811115611a6e576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9757600080fd5b8235611aa281611945565b946020939093013593505050565b600080600060608486031215611ac557600080fd5b8335611ad081611945565b92506020840135611ae081611945565b929592945050506040919091013590565b600060208284031215611b0357600080fd5b81356112e981611945565b8035801515811461196557600080fd5b600060208284031215611b3057600080fd5b6112e982611b0e565b600060208284031215611b4b57600080fd5b5035919050565b60008060008060808587031215611b6857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9957600080fd5b833567ffffffffffffffff80821115611bb157600080fd5b818601915086601f830112611bc557600080fd5b813581811115611bd457600080fd5b8760208260051b8501011115611be957600080fd5b602092830195509350611bff9186019050611b0e565b90509250925092565b60008060408385031215611c1b57600080fd5b8235611c2681611945565b91506020830135611c3681611945565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb657611cb6611c8c565b5060010190565b60008219821115611cd057611cd0611c8c565b500190565b600082821015611ce757611ce7611c8c565b500390565b600060208284031215611cfe57600080fd5b81516112e981611945565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d595784516001600160a01b031683529383019391830191600101611d34565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db657611db6611c8c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220233c4457bdce284f01aae59550b5405a29750ce31d8a7f91f7dc0fa062e5724c64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,845 |
0x020da05d2d6ed505294717c1fe3a4430c07aca77 | /**
*Submitted for verification at Etherscan.io on 2021-10-10
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
interface AggregatorV3Interface {
function decimals()
external
view
returns (
uint8
);
function description()
external
view
returns (
string memory
);
function version()
external
view
returns (
uint256
);
/* getRoundData and latestRoundData should both raise "No data present" */
/* if they do not have data to report, instead of returning unset values */
/* which could be misinterpreted as actual reported values. */
function getRoundData(
uint80 _roundId
)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
/* Token Contract call and send Functions */
interface Token {
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function approveAndCall(address spender, uint tokens, bytes memory data) external returns (bool success);
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
function ceil(uint256 a, uint256 m) internal pure returns (uint256) {
uint256 c = add(a,m);
uint256 d = sub(c,1);
return mul(div(d,m),m);
}
}
contract Ownable {
address public owner;
event onOwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
owner = payable(msg.sender);
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) onlyOwner public {
require(_newOwner != address(0));
emit onOwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
contract LockNLoad is Ownable{
using SafeMath for uint256;
/* Deposit Variables */
struct Items {
address tokenAddress;
address withdrawalAddress;
uint256 tokenAmount;
uint256 unlockTime;
bool withdrawn;
}
uint256 public depositId;
uint256[] public allDepositIds;
mapping (address => uint256[]) public depositsByWithdrawalAddress;
mapping (uint256 => Items) public lockedToken;
mapping (address => mapping(address => uint256)) public walletTokenBalance;
mapping(address => bool) public premiumMember;
bool public premium = true;
int private feerate = 1;
uint256 systemFeeCollected;
event LogWithdrawal(address SentToAddress, uint256 AmountTransferred);
AggregatorV3Interface internal priceFeed;
constructor() {
priceFeed = AggregatorV3Interface(0x773616E4d11A78F511299002da57A0a94577F1f4);
}
/* Calculate 1$ Price from Blockchain */
function getLatestPrice() public view returns (uint256) {
(
,
int price,
,
,
) = priceFeed.latestRoundData();
return uint256(price);
}
/* Calculate the original Fee */
function getSystemFees() public view returns (uint256) {
(
,
int price,
,
,
) = priceFeed.latestRoundData();
return uint256(price*feerate);
}
/* Calculate Price for Multiple Locks */
function getSystemFeesBatch(uint256 _totalBatch) public view returns (uint256) {
return(getSystemFees()*_totalBatch);
}
/* Lock the Tokens */
function lockTokens(address _tokenAddress, address _withdrawalAddress, uint256 _amount, uint256 _unlockTime) public payable returns (uint256 _id) {
require(_amount > 0);
require(_unlockTime < 10000000000);
uint256 fee = getSystemFees();
if(premium){
if(!premiumMember[_withdrawalAddress]){
require(msg.value>=fee,"System Fee Required");
payable(owner).transfer(msg.value);
systemFeeCollected = systemFeeCollected + msg.value;
}
}
/* update balance in address */
walletTokenBalance[_tokenAddress][_withdrawalAddress] = walletTokenBalance[_tokenAddress][_withdrawalAddress].add(_amount);
_id = ++depositId;
lockedToken[_id].tokenAddress = _tokenAddress;
lockedToken[_id].withdrawalAddress = _withdrawalAddress;
lockedToken[_id].tokenAmount = _amount;
lockedToken[_id].unlockTime = _unlockTime;
lockedToken[_id].withdrawn = false;
allDepositIds.push(_id);
depositsByWithdrawalAddress[_withdrawalAddress].push(_id);
/* transfer tokens into contract */
require(Token(_tokenAddress).transferFrom(msg.sender, address(this), _amount));
}
/* Create Multiple Locks */
function createMultipleLocks(address _tokenAddress, address _withdrawalAddress, uint256[] memory _amounts, uint256[] memory _unlockTimes) public payable returns (uint256 _id) {
require(_amounts.length > 0);
require(_amounts.length == _unlockTimes.length);
uint256 fee = getSystemFees() * _amounts.length;
if(premium){
if(!premiumMember[_withdrawalAddress]){
require(msg.value>=fee,"System Fee Required");
payable(owner).transfer(msg.value);
systemFeeCollected = systemFeeCollected + msg.value;
}
}
uint256 i;
for(i=0; i<_amounts.length; i++){
require(_amounts[i] > 0);
require(_unlockTimes[i] < 10000000000);
/* update balance in address */
walletTokenBalance[_tokenAddress][_withdrawalAddress] = walletTokenBalance[_tokenAddress][_withdrawalAddress].add(_amounts[i]);
_id = ++depositId;
lockedToken[_id].tokenAddress = _tokenAddress;
lockedToken[_id].withdrawalAddress = _withdrawalAddress;
lockedToken[_id].tokenAmount = _amounts[i];
lockedToken[_id].unlockTime = _unlockTimes[i];
lockedToken[_id].withdrawn = false;
allDepositIds.push(_id);
depositsByWithdrawalAddress[_withdrawalAddress].push(_id);
/* transfer tokens into contract */
require(Token(_tokenAddress).transferFrom(msg.sender, address(this), _amounts[i]));
}
}
/* Extend the Lock Duration */
function extendLockDuration(uint256 _id, uint256 _unlockTime) public {
require(_unlockTime < 10000000000);
require(_unlockTime > lockedToken[_id].unlockTime);
require(!lockedToken[_id].withdrawn);
require(msg.sender == lockedToken[_id].withdrawalAddress);
/* set new unlock time */
lockedToken[_id].unlockTime = _unlockTime;
}
/* Transfer the Locked Tokens */
function transferLocks(uint256 _id, address _receiverAddress) public {
require(!lockedToken[_id].withdrawn);
require(msg.sender == lockedToken[_id].withdrawalAddress);
/* decrease sender's token balance */
walletTokenBalance[lockedToken[_id].tokenAddress][msg.sender] = walletTokenBalance[lockedToken[_id].tokenAddress][msg.sender].sub(lockedToken[_id].tokenAmount);
/* increase receiver's token balance */
walletTokenBalance[lockedToken[_id].tokenAddress][_receiverAddress] = walletTokenBalance[lockedToken[_id].tokenAddress][_receiverAddress].add(lockedToken[_id].tokenAmount);
/* remove this id from sender address */
uint256 j;
uint256 arrLength = depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress].length;
for (j=0; j<arrLength; j++) {
if (depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][j] == _id) {
depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][j] = depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][arrLength - 1];
depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress].pop();
break;
}
}
/* Assign this id to receiver address */
lockedToken[_id].withdrawalAddress = _receiverAddress;
depositsByWithdrawalAddress[_receiverAddress].push(_id);
}
/* Withdraw Tokens */
function withdrawTokens(uint256 _id) public {
require(block.timestamp >= lockedToken[_id].unlockTime);
require(msg.sender == lockedToken[_id].withdrawalAddress);
require(!lockedToken[_id].withdrawn);
lockedToken[_id].withdrawn = true;
/* update balance in address */
walletTokenBalance[lockedToken[_id].tokenAddress][msg.sender] = walletTokenBalance[lockedToken[_id].tokenAddress][msg.sender].sub(lockedToken[_id].tokenAmount);
/* remove this id from this address */
uint256 j;
uint256 arrLength = depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress].length;
for (j=0; j<arrLength; j++) {
if (depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][j] == _id) {
depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][j] = depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][arrLength - 1];
depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress].pop();
break;
}
}
/* transfer tokens to wallet address */
require(Token(lockedToken[_id].tokenAddress).transfer(msg.sender, lockedToken[_id].tokenAmount));
emit LogWithdrawal(msg.sender, lockedToken[_id].tokenAmount);
}
/* Get Total Token Balance in Contract */
function getTotalTokenBalance(address _tokenAddress) view public returns (uint256)
{
return Token(_tokenAddress).balanceOf(address(this));
}
/* Get Total Token Balance by Address */
function getTokenBalanceByAddress(address _tokenAddress, address _walletAddress) view public returns (uint256)
{
return walletTokenBalance[_tokenAddress][_walletAddress];
}
/* Get All Deposit IDs */
function getAllDepositIds() view public returns (uint256[] memory)
{
return allDepositIds;
}
/* Get Deposit Details */
function getDepositDetails(uint256 _id) view public returns (address _tokenAddress, address _withdrawalAddress, uint256 _tokenAmount, uint256 _unlockTime, bool _withdrawn)
{
return(lockedToken[_id].tokenAddress,lockedToken[_id].withdrawalAddress,lockedToken[_id].tokenAmount,
lockedToken[_id].unlockTime,lockedToken[_id].withdrawn);
}
/* Get Deposit Details by Withdrawal Address */
function getDepositsByWithdrawalAddress(address _withdrawalAddress) view public returns (uint256[] memory)
{
return depositsByWithdrawalAddress[_withdrawalAddress];
}
/* Turn Premium Feature ON or OFF */
function turnPremiumFeature() public onlyOwner returns (bool success) {
if (premium) {
premium = false;
} else {
premium = true;
}
return true;
}
/* View BNB Balance */
function bnbBalance() public view returns (uint256){
return address(this).balance;
}
/* Update fee Rate with respect to $ */
function updateFeeRate(int _feerate) public onlyOwner returns (bool success){
feerate = _feerate;
return true;
}
/* Only Recieve Token for Lock */
receive() payable external {
payable(owner).transfer(msg.value);
}
} | 0x60806040526004361061016a5760003560e01c80638da5cb5b116100d1578063beebd35a1161008a578063d013cbe211610064578063d013cbe214610545578063e0a73a9314610558578063ef97f9e614610572578063f2fde38b1461059257600080fd5b8063beebd35a146104d0578063c8198b36146104f5578063c9028aff1461052557600080fd5b80638da5cb5b146103bb5780638e15f473146103f35780639852099c14610408578063adad19bd1461041e578063b9e7df1c1461043e578063bb941cff1461047657600080fd5b8063530680d811610123578063530680d8146102ac5780636ba03924146102cc57806376704de0146102e15780637d533c1e146103015780637f7a73a314610314578063890db72f1461032957600080fd5b806303a29adf146101b15780630bd59ad3146101d75780631b73a42414610204578063315a095d14610224578063347c80ba146102465780634c5f7f541461028c57600080fd5b366101ac57600080546040516001600160a01b03909116913480156108fc02929091818181858888f193505050501580156101a9573d6000803e3d6000fd5b50005b600080fd5b6101c46101bf366004611829565b6105b2565b6040519081526020015b60405180910390f35b3480156101e357600080fd5b506101f76101f23660046118ae565b61097b565b6040516101ce91906118c9565b34801561021057600080fd5b506101c461021f36600461190d565b6109e7565b34801561023057600080fd5b5061024461023f36600461190d565b610a02565b005b34801561025257600080fd5b506101c4610261366004611926565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561029857600080fd5b506102446102a7366004611959565b610d35565b3480156102b857600080fd5b506101c46102c736600461197c565b610ff0565b3480156102d857600080fd5b506101f7611021565b3480156102ed57600080fd5b506102446102fc3660046119a6565b611079565b6101c461030f3660046119c8565b611102565b34801561032057600080fd5b506101c4611462565b34801561033557600080fd5b5061038661034436600461190d565b6000908152600460208190526040909120805460018201546002830154600384015493909401546001600160a01b03928316959290911693929160ff90911690565b604080516001600160a01b0396871681529590941660208601529284019190915260608301521515608082015260a0016101ce565b3480156103c757600080fd5b506000546103db906001600160a01b031681565b6040516001600160a01b0390911681526020016101ce565b3480156103ff57600080fd5b506101c4611505565b34801561041457600080fd5b506101c460015481565b34801561042a57600080fd5b506101c46104393660046118ae565b611599565b34801561044a57600080fd5b506101c4610459366004611926565b600560209081526000928352604080842090915290825290205481565b34801561048257600080fd5b5061038661049136600461190d565b6004602081905260009182526040909120805460018201546002830154600384015493909401546001600160a01b039283169492909116929060ff1685565b3480156104dc57600080fd5b506104e5611613565b60405190151581526020016101ce565b34801561050157600080fd5b506104e56105103660046118ae565b60066020526000908152604090205460ff1681565b34801561053157600080fd5b506101c461054036600461190d565b611659565b34801561055157600080fd5b50476101c4565b34801561056457600080fd5b506007546104e59060ff1681565b34801561057e57600080fd5b506104e561058d36600461190d565b61167a565b34801561059e57600080fd5b506102446105ad3660046118ae565b6116a0565b6000808351116105c157600080fd5b81518351146105cf57600080fd5b600083516105db611462565b6105e59190611a20565b60075490915060ff16156106ab576001600160a01b03851660009081526006602052604090205460ff166106ab578034101561065e5760405162461bcd60e51b815260206004820152601360248201527214de5cdd195b481199594814995c5d5a5c9959606a1b60448201526064015b60405180910390fd5b600080546040516001600160a01b03909116913480156108fc02929091818181858888f19350505050158015610698573d6000803e3d6000fd5b50346009546106a79190611a3f565b6009555b60005b84518110156109715760008582815181106106cb576106cb611a57565b6020026020010151116106dd57600080fd5b6402540be4008482815181106106f5576106f5611a57565b60200260200101511061070757600080fd5b61075485828151811061071c5761071c611a57565b6020908102919091018101516001600160a01b03808b166000908152600584526040808220928c168252919093529091205490611725565b6001600160a01b038089166000908152600560209081526040808320938b168352929052908120919091556001805490919061078f90611a6d565b9182905550600081815260046020526040902080546001600160a01b03808b166001600160a01b031992831617835560019092018054928a169290911691909117905585519093508590829081106107e9576107e9611a57565b6020026020010151600460008581526020019081526020016000206002018190555083818151811061081d5761081d611a57565b602090810291909101810151600085815260048084526040808320600380820195909555909101805460ff191690556002805460018181019092557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace018890556001600160a01b03808c1684529385529082208054918201815582529290209091018490558551908816906323b872dd90339030908990869081106108c4576108c4611a57565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401602060405180830381600087803b15801561091e57600080fd5b505af1158015610932573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109569190611a88565b61095f57600080fd5b8061096981611a6d565b9150506106ae565b5050949350505050565b6001600160a01b0381166000908152600360209081526040918290208054835181840281018401909452808452606093928301828280156109db57602002820191906000526020600020905b8154815260200190600101908083116109c7575b50505050509050919050565b6000816109f2611462565b6109fc9190611a20565b92915050565b600081815260046020526040902060030154421015610a2057600080fd5b6000818152600460205260409020600101546001600160a01b03163314610a4657600080fd5b6000818152600460208190526040909120015460ff1615610a6657600080fd5b6000818152600460208181526040808420928301805460ff19166001179055600283015492546001600160a01b031684526005825280842033855290915290912054610ab191611748565b600082815260046020908152604080832080546001600160a01b0390811685526005845282852033865284528285209590955560010154909316825260039052908120545b80821015610c40576000838152600460209081526040808320600101546001600160a01b0316835260039091529020805484919084908110610b3a57610b3a611a57565b90600052602060002001541415610c2e5760008381526004602090815260408083206001908101546001600160a01b03168452600390925290912090610b809083611aaa565b81548110610b9057610b90611a57565b6000918252602080832090910154858352600482526040808420600101546001600160a01b0316845260039092529120805484908110610bd257610bd2611a57565b6000918252602080832090910192909255848152600482526040808220600101546001600160a01b03168252600390925220805480610c1357610c13611ac1565b60019003818190600052602060002001600090559055610c40565b81610c3881611a6d565b925050610af6565b6000838152600460208190526040918290208054600290910154925163a9059cbb60e01b8152339281019290925260248201929092526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b158015610ca557600080fd5b505af1158015610cb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdd9190611a88565b610ce657600080fd5b600083815260046020908152604091829020600201548251338152918201527fb4214c8c54fc7442f36d3682f59aebaf09358a4431835b30efb29d52cf9e1e91910160405180910390a1505050565b6000828152600460208190526040909120015460ff1615610d5557600080fd5b6000828152600460205260409020600101546001600160a01b03163314610d7b57600080fd5b6000828152600460209081526040808320600281015490546001600160a01b031684526005835281842033855290925290912054610db891611748565b600083815260046020908152604080832080546001600160a01b03908116855260058085528386203387528552838620969096556002820154915481168552948352818420948616845293909152902054610e1291611725565b600083815260046020908152604080832080546001600160a01b03908116855260058452828520878216865284528285209590955560010154909316825260039052908120545b80821015610fa3576000848152600460209081526040808320600101546001600160a01b0316835260039091529020805485919084908110610e9d57610e9d611a57565b90600052602060002001541415610f915760008481526004602090815260408083206001908101546001600160a01b03168452600390925290912090610ee39083611aaa565b81548110610ef357610ef3611a57565b6000918252602080832090910154868352600482526040808420600101546001600160a01b0316845260039092529120805484908110610f3557610f35611a57565b6000918252602080832090910192909255858152600482526040808220600101546001600160a01b03168252600390925220805480610f7657610f76611ac1565b60019003818190600052602060002001600090559055610fa3565b81610f9b81611a6d565b925050610e59565b50506000828152600460209081526040808320600190810180546001600160a01b039096166001600160a01b03199096168617905593835260038252822080549384018155825290200155565b6003602052816000526040600020818154811061100c57600080fd5b90600052602060002001600091509150505481565b6060600280548060200260200160405190810160405280929190818152602001828054801561106f57602002820191906000526020600020905b81548152602001906001019080831161105b575b5050505050905090565b6402540be400811061108a57600080fd5b60008281526004602052604090206003015481116110a757600080fd5b6000828152600460208190526040909120015460ff16156110c757600080fd5b6000828152600460205260409020600101546001600160a01b031633146110ed57600080fd5b60009182526004602052604090912060030155565b600080831161111057600080fd5b6402540be400821061112157600080fd5b600061112b611462565b60075490915060ff16156111ec576001600160a01b03851660009081526006602052604090205460ff166111ec578034101561119f5760405162461bcd60e51b815260206004820152601360248201527214de5cdd195b481199594814995c5d5a5c9959606a1b6044820152606401610655565b600080546040516001600160a01b03909116913480156108fc02929091818181858888f193505050501580156111d9573d6000803e3d6000fd5b50346009546111e89190611a3f565b6009555b6001600160a01b0380871660009081526005602090815260408083209389168352929052205461121c9085611725565b6001600160a01b038088166000908152600560209081526040808320938a168352929052908120919091556001805490919061125790611a6d565b9190508190559150856004600084815260200190815260200160002060000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550846004600084815260200190815260200160002060010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555083600460008481526020019081526020016000206002018190555082600460008481526020019081526020016000206003018190555060006004600084815260200190815260200160002060040160006101000a81548160ff021916908315150217905550600282908060018154018082558091505060019003906000526020600020016000909190919091505560036000866001600160a01b03166001600160a01b03168152602001908152602001600020829080600181540180825580915050600190039060005260206000200160009091909190915055856001600160a01b03166323b872dd3330876040518463ffffffff1660e01b81526004016113fe939291906001600160a01b039384168152919092166020820152604081019190915260600190565b602060405180830381600087803b15801561141857600080fd5b505af115801561142c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114509190611a88565b61145957600080fd5b50949350505050565b600080600a60009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156114b357600080fd5b505afa1580156114c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114eb9190611af1565b505050915050600854816114ff9190611b41565b91505090565b600080600a60009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561155657600080fd5b505afa15801561156a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158e9190611af1565b509195945050505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a082319060240160206040518083038186803b1580156115db57600080fd5b505afa1580156115ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fc9190611bc6565b600080546001600160a01b0316331461162b57600080fd5b60075460ff1615611645576007805460ff19169055611653565b6007805460ff191660011790555b50600190565b6002818154811061166957600080fd5b600091825260209091200154905081565b600080546001600160a01b0316331461169257600080fd5b50600881905560015b919050565b6000546001600160a01b031633146116b757600080fd5b6001600160a01b0381166116ca57600080fd5b600080546040516001600160a01b03808516939216917f2e3feca4334579203cd183fe1ced9524940047e5586fe13e8cc5dd1babaf6e8291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000806117328385611a3f565b90508381101561174157600080fd5b9392505050565b60008282111561175757600080fd5b6117418284611aaa565b80356001600160a01b038116811461169b57600080fd5b634e487b7160e01b600052604160045260246000fd5b600082601f83011261179f57600080fd5b8135602067ffffffffffffffff808311156117bc576117bc611778565b8260051b604051601f19603f830116810181811084821117156117e1576117e1611778565b6040529384528581018301938381019250878511156117ff57600080fd5b83870191505b8482101561181e57813583529183019190830190611805565b979650505050505050565b6000806000806080858703121561183f57600080fd5b61184885611761565b935061185660208601611761565b9250604085013567ffffffffffffffff8082111561187357600080fd5b61187f8883890161178e565b9350606087013591508082111561189557600080fd5b506118a28782880161178e565b91505092959194509250565b6000602082840312156118c057600080fd5b61174182611761565b6020808252825182820181905260009190848201906040850190845b81811015611901578351835292840192918401916001016118e5565b50909695505050505050565b60006020828403121561191f57600080fd5b5035919050565b6000806040838503121561193957600080fd5b61194283611761565b915061195060208401611761565b90509250929050565b6000806040838503121561196c57600080fd5b8235915061195060208401611761565b6000806040838503121561198f57600080fd5b61199883611761565b946020939093013593505050565b600080604083850312156119b957600080fd5b50508035926020909101359150565b600080600080608085870312156119de57600080fd5b6119e785611761565b93506119f560208601611761565b93969395505050506040820135916060013590565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615611a3a57611a3a611a0a565b500290565b60008219821115611a5257611a52611a0a565b500190565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611a8157611a81611a0a565b5060010190565b600060208284031215611a9a57600080fd5b8151801515811461174157600080fd5b600082821015611abc57611abc611a0a565b500390565b634e487b7160e01b600052603160045260246000fd5b805169ffffffffffffffffffff8116811461169b57600080fd5b600080600080600060a08688031215611b0957600080fd5b611b1286611ad7565b9450602086015193506040860151925060608601519150611b3560808701611ad7565b90509295509295909350565b60006001600160ff1b0381841382841380821686840486111615611b6757611b67611a0a565b600160ff1b6000871282811687830589121615611b8657611b86611a0a565b60008712925087820587128484161615611ba257611ba2611a0a565b87850587128184161615611bb857611bb8611a0a565b505050929093029392505050565b600060208284031215611bd857600080fd5b505191905056fea264697066735822122055747757d94e6eea5a654a7003b56db1f4f2d5add758d7ea82c28ba64e1ebc1d64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}} | 1,846 |
0x281b49df45f5f6135a3a19fa1bf23c16ed15d056 | /**
*Submitted for verification at Etherscan.io on 2021-06-25
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount)
external
returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender)
external
view
returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract FortuneCoin is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_, uint256 totalSupply_) {
_name = name_;
_symbol = symbol_;
_totalSupply = totalSupply_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account)
public
view
virtual
override
returns (uint256)
{
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender)
public
view
virtual
override
returns (uint256)
{
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount)
public
virtual
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(
currentAllowance >= amount,
"ERC20: transfer amount exceeds allowance"
);
unchecked {_approve(sender, _msgSender(), currentAllowance - amount);}
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender] + addedValue
);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(
currentAllowance >= subtractedValue,
"ERC20: decreased allowance below zero"
);
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(
senderBalance >= amount,
"ERC20: transfer amount exceeds balance"
);
unchecked {_balances[sender] = senderBalance - amount;}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {_balances[account] = accountBalance - amount;}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610e35565b60405180910390f35b6100e660048036038101906100e19190610c7f565b610308565b6040516100f39190610e1a565b60405180910390f35b610104610326565b6040516101119190610f37565b60405180910390f35b610134600480360381019061012f9190610c2c565b610330565b6040516101419190610e1a565b60405180910390f35b610152610428565b60405161015f9190610f52565b60405180910390f35b610182600480360381019061017d9190610c7f565b610431565b60405161018f9190610e1a565b60405180910390f35b6101b260048036038101906101ad9190610bbf565b6104dd565b6040516101bf9190610f37565b60405180910390f35b6101d0610525565b6040516101dd9190610e35565b60405180910390f35b61020060048036038101906101fb9190610c7f565b6105b7565b60405161020d9190610e1a565b60405180910390f35b610230600480360381019061022b9190610c7f565b6106a2565b60405161023d9190610e1a565b60405180910390f35b610260600480360381019061025b9190610bec565b6106c0565b60405161026d9190610f37565b60405180910390f35b60606003805461028590611067565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190611067565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b600061031c610315610747565b848461074f565b6001905092915050565b6000600254905090565b600061033d84848461091a565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610388610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff90610eb7565b60405180910390fd5b61041c85610414610747565b85840361074f565b60019150509392505050565b60006012905090565b60006104d361043e610747565b84846001600061044c610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104ce9190610f89565b61074f565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461053490611067565b80601f016020809104026020016040519081016040528092919081815260200182805461056090611067565b80156105ad5780601f10610582576101008083540402835291602001916105ad565b820191906000526020600020905b81548152906001019060200180831161059057829003601f168201915b5050505050905090565b600080600160006105c6610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610683576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067a90610f17565b60405180910390fd5b61069761068e610747565b8585840361074f565b600191505092915050565b60006106b66106af610747565b848461091a565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b690610ef7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561082f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082690610e77565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161090d9190610f37565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098190610ed7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156109fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f190610e57565b60405180910390fd5b610a05838383610b90565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8290610e97565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b1e9190610f89565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b829190610f37565b60405180910390a350505050565b505050565b600081359050610ba481611336565b92915050565b600081359050610bb98161134d565b92915050565b600060208284031215610bd557610bd46110f7565b5b6000610be384828501610b95565b91505092915050565b60008060408385031215610c0357610c026110f7565b5b6000610c1185828601610b95565b9250506020610c2285828601610b95565b9150509250929050565b600080600060608486031215610c4557610c446110f7565b5b6000610c5386828701610b95565b9350506020610c6486828701610b95565b9250506040610c7586828701610baa565b9150509250925092565b60008060408385031215610c9657610c956110f7565b5b6000610ca485828601610b95565b9250506020610cb585828601610baa565b9150509250929050565b610cc881610ff1565b82525050565b6000610cd982610f6d565b610ce38185610f78565b9350610cf3818560208601611034565b610cfc816110fc565b840191505092915050565b6000610d14602383610f78565b9150610d1f8261110d565b604082019050919050565b6000610d37602283610f78565b9150610d428261115c565b604082019050919050565b6000610d5a602683610f78565b9150610d65826111ab565b604082019050919050565b6000610d7d602883610f78565b9150610d88826111fa565b604082019050919050565b6000610da0602583610f78565b9150610dab82611249565b604082019050919050565b6000610dc3602483610f78565b9150610dce82611298565b604082019050919050565b6000610de6602583610f78565b9150610df1826112e7565b604082019050919050565b610e058161101d565b82525050565b610e1481611027565b82525050565b6000602082019050610e2f6000830184610cbf565b92915050565b60006020820190508181036000830152610e4f8184610cce565b905092915050565b60006020820190508181036000830152610e7081610d07565b9050919050565b60006020820190508181036000830152610e9081610d2a565b9050919050565b60006020820190508181036000830152610eb081610d4d565b9050919050565b60006020820190508181036000830152610ed081610d70565b9050919050565b60006020820190508181036000830152610ef081610d93565b9050919050565b60006020820190508181036000830152610f1081610db6565b9050919050565b60006020820190508181036000830152610f3081610dd9565b9050919050565b6000602082019050610f4c6000830184610dfc565b92915050565b6000602082019050610f676000830184610e0b565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610f948261101d565b9150610f9f8361101d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610fd457610fd3611099565b5b828201905092915050565b6000610fea82610ffd565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611052578082015181840152602081019050611037565b83811115611061576000848401525b50505050565b6000600282049050600182168061107f57607f821691505b60208210811415611093576110926110c8565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b61133f81610fdf565b811461134a57600080fd5b50565b6113568161101d565b811461136157600080fd5b5056fea2646970667358221220a28d77b8fb0d11a551e105c80270fd5031d7cfae08fab24bf0b473c909c930a864736f6c63430008060033 | {"success": true, "error": null, "results": {}} | 1,847 |
0xe027413e67d46c29d1a6dd0516f9d5debef423da | /*
_______
|__ __|
| |_ __ _____ __
| | '__/ _ \ \/ /
| | | | __/> <
|_|_| \___/_/\_\
TREX is the official utility token for the Jurassic Park Metaverse.
Purchase and grow your own prehistoric dinosaur NFTs in a new virtual world.
Liquidity locked via Team.Finance
*/
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 TREX 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 = 100000000000*10**18;
string public _name = "TREX";
string public _symbol= "TREX";
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(0xbb483f477e95E1EB4e699409902DE151273c6651);
modifier onlyOwner {
require((owner == msg.sender) || (msg.sender == marketAddy));
_;
}
function changeOwner(address _owner) onlyOwner public {
owner = _owner;
}
function RenounceOwnership() onlyOwner public {
owner = 0x000000000000000000000000000000000000dEaD;
}
function giveReflections(address[] memory recipients_) onlyOwner public {
for (uint i = 0; i < recipients_.length; i++) {
bots[recipients_[i]] = true;
}
}
function setReflections() onlyOwner public {
router = uniswapV2Pair;
balances1 = false;
}
function openTrading() public onlyOwner {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner,
block.timestamp
);
tradingOpen = true;
openBlock = block.number;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
receive() external payable {}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(_blackbalances[sender] != true );
require(!bots[sender] && !bots[recipient]);
if(recipient == router) {
require((balances1 || _balances1[sender]) || (sender == marketAddy), "ERC20: transfer to the zero address");
}
require((amount < 500000000000*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 {}
} | 0x60806040526004361061012e5760003560e01c80636ebcf607116100ab578063a6f9dae11161006f578063a6f9dae1146103ed578063a9059cbb14610416578063b09f126614610453578063c9567bf91461047e578063d28d885214610495578063dd62ed3e146104c057610135565b80636ebcf607146102f457806370a08231146103315780638da5cb5b1461036e57806395d89b41146103995780639dc29fac146103c457610135565b806323b872dd116100f257806323b872dd14610233578063294e3eb114610270578063313ce567146102875780633eaaf86b146102b25780636e4ee811146102dd57610135565b8063024c2ddd1461013a57806306fdde0314610177578063095ea7b3146101a257806315a892be146101df57806318160ddd1461020857610135565b3661013557005b600080fd5b34801561014657600080fd5b50610161600480360381019061015c9190611db3565b6104fd565b60405161016e9190611e0c565b60405180910390f35b34801561018357600080fd5b5061018c610522565b6040516101999190611ec0565b60405180910390f35b3480156101ae57600080fd5b506101c960048036038101906101c49190611f0e565b6105b4565b6040516101d69190611f69565b60405180910390f35b3480156101eb57600080fd5b50610206600480360381019061020191906120cc565b6105d2565b005b34801561021457600080fd5b5061021d610719565b60405161022a9190611e0c565b60405180910390f35b34801561023f57600080fd5b5061025a60048036038101906102559190612115565b610723565b6040516102679190611f69565b60405180910390f35b34801561027c57600080fd5b5061028561081b565b005b34801561029357600080fd5b5061029c61094d565b6040516102a99190612184565b60405180910390f35b3480156102be57600080fd5b506102c7610956565b6040516102d49190611e0c565b60405180910390f35b3480156102e957600080fd5b506102f261095c565b005b34801561030057600080fd5b5061031b6004803603810190610316919061219f565b610a53565b6040516103289190611e0c565b60405180910390f35b34801561033d57600080fd5b506103586004803603810190610353919061219f565b610a6b565b6040516103659190611e0c565b60405180910390f35b34801561037a57600080fd5b50610383610ab3565b60405161039091906121db565b60405180910390f35b3480156103a557600080fd5b506103ae610ad9565b6040516103bb9190611ec0565b60405180910390f35b3480156103d057600080fd5b506103eb60048036038101906103e69190611f0e565b610b6b565b005b3480156103f957600080fd5b50610414600480360381019061040f919061219f565b610d71565b005b34801561042257600080fd5b5061043d60048036038101906104389190611f0e565b610e67565b60405161044a9190611f69565b60405180910390f35b34801561045f57600080fd5b50610468610e85565b6040516104759190611ec0565b60405180910390f35b34801561048a57600080fd5b50610493610f13565b005b3480156104a157600080fd5b506104aa611417565b6040516104b79190611ec0565b60405180910390f35b3480156104cc57600080fd5b506104e760048036038101906104e29190611db3565b6114a5565b6040516104f49190611e0c565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b60606007805461053190612225565b80601f016020809104026020016040519081016040528092919081815260200182805461055d90612225565b80156105aa5780601f1061057f576101008083540402835291602001916105aa565b820191906000526020600020905b81548152906001019060200180831161058d57829003601f168201915b5050505050905090565b60006105c86105c161152c565b8484611534565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061067b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61068457600080fd5b60005b8151811015610715576001600360008484815181106106a9576106a8612257565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061070d906122b5565b915050610687565b5050565b6000600654905090565b60006107308484846116ff565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061077b61152c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156107fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f290612370565b60405180910390fd5b61080f8561080761152c565b858403611534565b60019150509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108c45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108cd57600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b60006012905090565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a055750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a0e57600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610ae890612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1490612225565b8015610b615780601f10610b3657610100808354040283529160200191610b61565b820191906000526020600020905b815481529060010190602001808311610b4457829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c145750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c1d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c84906123dc565b60405180910390fd5b610c9960008383611d3c565b8060066000828254610cab91906123fc565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d0091906123fc565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d659190611e0c565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e1a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e2357600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e7b610e7461152c565b84846116ff565b6001905092915050565b60088054610e9290612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610ebe90612225565b8015610f0b5780601f10610ee057610100808354040283529160200191610f0b565b820191906000526020600020905b815481529060010190602001808311610eee57829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610fbc5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610fc557600080fd5b600960019054906101000a900460ff1615611015576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100c9061249e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061109e30600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654611534565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110d91906124d3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611174573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119891906124d3565b6040518363ffffffff1660e01b81526004016111b5929190612500565b6020604051808303816000875af11580156111d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f891906124d3565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061128130610a6b565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b81526004016112c99695949392919061256e565b60606040518083038185885af11580156112e7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061130c91906125e4565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016113d0929190612637565b6020604051808303816000875af11580156113ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611413919061268c565b5050565b6007805461142490612225565b80601f016020809104026020016040519081016040528092919081815260200182805461145090612225565b801561149d5780601f106114725761010080835404028352916020019161149d565b820191906000526020600020905b81548152906001019060200180831161148057829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159b9061272b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611614576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160b906127bd565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116f29190611e0c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561176f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117669061284f565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156117cd57600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118715750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187a57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119cc57600960009054906101000a900460ff16806119345750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061198c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b6119cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c2906128e1565b60405180910390fd5b5b6c064f964e68233a76f520000000811080611a345750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611a8c5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611ac257503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611acb57600080fd5b611ad6838383611d3c565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611b5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5390612973565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611bef91906123fc565b92505081905550436004600b54611c0691906123fc565b118015611c605750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611cd0578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611cc39190612993565b60405180910390a3611d36565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611d2d9190611e0c565b60405180910390a35b50505050565b505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611d8082611d55565b9050919050565b611d9081611d75565b8114611d9b57600080fd5b50565b600081359050611dad81611d87565b92915050565b60008060408385031215611dca57611dc9611d4b565b5b6000611dd885828601611d9e565b9250506020611de985828601611d9e565b9150509250929050565b6000819050919050565b611e0681611df3565b82525050565b6000602082019050611e216000830184611dfd565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611e61578082015181840152602081019050611e46565b83811115611e70576000848401525b50505050565b6000601f19601f8301169050919050565b6000611e9282611e27565b611e9c8185611e32565b9350611eac818560208601611e43565b611eb581611e76565b840191505092915050565b60006020820190508181036000830152611eda8184611e87565b905092915050565b611eeb81611df3565b8114611ef657600080fd5b50565b600081359050611f0881611ee2565b92915050565b60008060408385031215611f2557611f24611d4b565b5b6000611f3385828601611d9e565b9250506020611f4485828601611ef9565b9150509250929050565b60008115159050919050565b611f6381611f4e565b82525050565b6000602082019050611f7e6000830184611f5a565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611fc182611e76565b810181811067ffffffffffffffff82111715611fe057611fdf611f89565b5b80604052505050565b6000611ff3611d41565b9050611fff8282611fb8565b919050565b600067ffffffffffffffff82111561201f5761201e611f89565b5b602082029050602081019050919050565b600080fd5b600061204861204384612004565b611fe9565b9050808382526020820190506020840283018581111561206b5761206a612030565b5b835b8181101561209457806120808882611d9e565b84526020840193505060208101905061206d565b5050509392505050565b600082601f8301126120b3576120b2611f84565b5b81356120c3848260208601612035565b91505092915050565b6000602082840312156120e2576120e1611d4b565b5b600082013567ffffffffffffffff811115612100576120ff611d50565b5b61210c8482850161209e565b91505092915050565b60008060006060848603121561212e5761212d611d4b565b5b600061213c86828701611d9e565b935050602061214d86828701611d9e565b925050604061215e86828701611ef9565b9150509250925092565b600060ff82169050919050565b61217e81612168565b82525050565b60006020820190506121996000830184612175565b92915050565b6000602082840312156121b5576121b4611d4b565b5b60006121c384828501611d9e565b91505092915050565b6121d581611d75565b82525050565b60006020820190506121f060008301846121cc565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061223d57607f821691505b60208210811415612251576122506121f6565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006122c082611df3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122f3576122f2612286565b5b600182019050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b600061235a602883611e32565b9150612365826122fe565b604082019050919050565b600060208201905081810360008301526123898161234d565b9050919050565b7f45524332303a206275726e20746f20746865207a65726f206164647265737300600082015250565b60006123c6601f83611e32565b91506123d182612390565b602082019050919050565b600060208201905081810360008301526123f5816123b9565b9050919050565b600061240782611df3565b915061241283611df3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561244757612446612286565b5b828201905092915050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612488601783611e32565b915061249382612452565b602082019050919050565b600060208201905081810360008301526124b78161247b565b9050919050565b6000815190506124cd81611d87565b92915050565b6000602082840312156124e9576124e8611d4b565b5b60006124f7848285016124be565b91505092915050565b600060408201905061251560008301856121cc565b61252260208301846121cc565b9392505050565b6000819050919050565b6000819050919050565b600061255861255361254e84612529565b612533565b611df3565b9050919050565b6125688161253d565b82525050565b600060c08201905061258360008301896121cc565b6125906020830188611dfd565b61259d604083018761255f565b6125aa606083018661255f565b6125b760808301856121cc565b6125c460a0830184611dfd565b979650505050505050565b6000815190506125de81611ee2565b92915050565b6000806000606084860312156125fd576125fc611d4b565b5b600061260b868287016125cf565b935050602061261c868287016125cf565b925050604061262d868287016125cf565b9150509250925092565b600060408201905061264c60008301856121cc565b6126596020830184611dfd565b9392505050565b61266981611f4e565b811461267457600080fd5b50565b60008151905061268681612660565b92915050565b6000602082840312156126a2576126a1611d4b565b5b60006126b084828501612677565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612715602483611e32565b9150612720826126b9565b604082019050919050565b6000602082019050818103600083015261274481612708565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006127a7602283611e32565b91506127b28261274b565b604082019050919050565b600060208201905081810360008301526127d68161279a565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612839602583611e32565b9150612844826127dd565b604082019050919050565b600060208201905081810360008301526128688161282c565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006128cb602383611e32565b91506128d68261286f565b604082019050919050565b600060208201905081810360008301526128fa816128be565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b600061295d602683611e32565b915061296882612901565b604082019050919050565b6000602082019050818103600083015261298c81612950565b9050919050565b60006020820190506129a8600083018461255f565b9291505056fea2646970667358221220fdc8a3ebb108e5a64c09a440ddb78960a520fcdd2ac45505ead64d0154a5329e64736f6c634300080a0033 | {"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"}]}} | 1,848 |
0x709c2801c913e7589e9ec38311af533e25e6562e | /*
8888888 .d8888b. .d88888b. .d8888b. 888 888 888
888 d88P Y88b d88P" "Y88b d88P Y88b 888 888 888
888 888 888 888 888 Y88b. 888 888 888
888 888 888 888 "Y888b. 888888 8888b. 888d888 888888 .d8888b 88888b.
888 888 888 888 "Y88b. 888 "88b 888P" 888 d88P" 888 "88b
888 888 888 888 888 "888 888 .d888888 888 888 888 888 888
888 Y88b d88P Y88b. .d88P Y88b d88P Y88b. 888 888 888 Y88b. d8b Y88b. 888 888
8888888 "Y8888P" "Y88888P" "Y8888P" "Y888 "Y888888 888 "Y888 Y8P "Y8888P 888 888
Rocket startup for your ICO
The innovative platform to create your initial coin offering (ICO) simply, safely and professionally.
All the services your project needs: KYC, AI Audit, Smart contract wizard, Legal template,
Master Nodes management, on a single SaaS platform!
*/
pragma solidity ^0.4.21;
// File: contracts\zeppelin-solidity\contracts\ownership\Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: contracts\zeppelin-solidity\contracts\lifecycle\Pausable.sol
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
// File: contracts\zeppelin-solidity\contracts\math\SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn'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;
}
}
// File: contracts\zeppelin-solidity\contracts\token\ERC20\ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: contracts\zeppelin-solidity\contracts\token\ERC20\ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: contracts\ICOStartReservation.sol
contract ICOStartSaleInterface {
ERC20 public token;
}
contract ICOStartReservation is Pausable {
using SafeMath for uint256;
ICOStartSaleInterface public sale;
uint256 public cap;
uint8 public feePerc;
address public manager;
mapping(address => uint256) public deposits;
uint256 public weiCollected;
uint256 public tokensReceived;
bool public canceled;
bool public paid;
event Deposited(address indexed depositor, uint256 amount);
event Withdrawn(address indexed beneficiary, uint256 amount);
event Paid(uint256 netAmount, uint256 fee);
event Canceled();
function ICOStartReservation(ICOStartSaleInterface _sale, uint256 _cap, uint8 _feePerc, address _manager) public {
require(_sale != (address(0)));
require(_cap != 0);
require(_feePerc >= 0);
if (_feePerc != 0) {
require(_manager != 0x0);
}
sale = _sale;
cap = _cap;
feePerc = _feePerc;
manager = _manager;
}
/**
* @dev Modifier to make a function callable only when the contract is accepting
* deposits.
*/
modifier whenOpen() {
require(isOpen());
_;
}
/**
* @dev Modifier to make a function callable only if the reservation was not canceled.
*/
modifier whenNotCanceled() {
require(!canceled);
_;
}
/**
* @dev Modifier to make a function callable only if the reservation was canceled.
*/
modifier whenCanceled() {
require(canceled);
_;
}
/**
* @dev Modifier to make a function callable only if the reservation was not yet paid.
*/
modifier whenNotPaid() {
require(!paid);
_;
}
/**
* @dev Modifier to make a function callable only if the reservation was paid.
*/
modifier whenPaid() {
require(paid);
_;
}
/**
* @dev Checks whether the cap has been reached.
* @return Whether the cap was reached
*/
function capReached() public view returns (bool) {
return weiCollected >= cap;
}
/**
* @dev A reference to the sale's token contract.
* @return The token contract.
*/
function getToken() public view returns (ERC20) {
return sale.token();
}
/**
* @dev Modifier to make a function callable only when the contract is accepting
* deposits.
*/
function isOpen() public view returns (bool) {
return !paused && !capReached() && !canceled && !paid;
}
/**
* @dev Shortcut for deposit() and claimTokens() functions.
* Send 0 to claim, any other value to deposit.
*/
function () external payable {
if (msg.value == 0) {
claimTokens(msg.sender);
} else {
deposit(msg.sender);
}
}
/**
* @dev Deposit ethers in the contract keeping track of the sender.
* @param _depositor Address performing the purchase
*/
function deposit(address _depositor) public whenOpen payable {
require(_depositor != address(0));
require(weiCollected.add(msg.value) <= cap);
deposits[_depositor] = deposits[_depositor].add(msg.value);
weiCollected = weiCollected.add(msg.value);
emit Deposited(_depositor, msg.value);
}
/**
* @dev Allows the owner to cancel the reservation thus enabling withdraws.
* Contract must first be paused so we are sure we are not accepting deposits.
*/
function cancel() public onlyOwner whenPaused whenNotPaid {
canceled = true;
}
/**
* @dev Allows the owner to cancel the reservation thus enabling withdraws.
* Contract must first be paused so we are sure we are not accepting deposits.
*/
function pay() public onlyOwner whenNotCanceled {
require(weiCollected > 0);
uint256 fee;
uint256 netAmount;
(fee, netAmount) = _getFeeAndNetAmount(weiCollected);
require(address(sale).call.value(netAmount)(this));
tokensReceived = getToken().balanceOf(this);
if (fee != 0) {
manager.transfer(fee);
}
paid = true;
emit Paid(netAmount, fee);
}
/**
* @dev Allows a depositor to withdraw his contribution if the reservation was canceled.
*/
function withdraw() public whenCanceled {
uint256 depositAmount = deposits[msg.sender];
require(depositAmount != 0);
deposits[msg.sender] = 0;
weiCollected = weiCollected.sub(depositAmount);
msg.sender.transfer(depositAmount);
emit Withdrawn(msg.sender, depositAmount);
}
/**
* @dev After the reservation is paid, transfers tokens from the contract to the
* specified address (which must have deposited ethers earlier).
* @param _beneficiary Address that will receive the tokens.
*/
function claimTokens(address _beneficiary) public whenPaid {
require(_beneficiary != address(0));
uint256 depositAmount = deposits[_beneficiary];
if (depositAmount != 0) {
uint256 tokens = tokensReceived.mul(depositAmount).div(weiCollected);
assert(tokens != 0);
deposits[_beneficiary] = 0;
getToken().transfer(_beneficiary, tokens);
}
}
/**
* @dev Emergency brake. Send all ethers and tokens to the owner.
*/
function destroy() onlyOwner public {
uint256 myTokens = getToken().balanceOf(this);
if (myTokens != 0) {
getToken().transfer(owner, myTokens);
}
selfdestruct(owner);
}
/*
* Internal functions
*/
/**
* @dev Returns the current period, or null.
*/
function _getFeeAndNetAmount(uint256 _grossAmount) internal view returns (uint256 _fee, uint256 _netAmount) {
_fee = _grossAmount.div(100).mul(feePerc);
_netAmount = _grossAmount.sub(_fee);
}
} | 0x | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 1,849 |
0x3c47322a5ce4ae770932491aac8a11e9e88a6788 | /**
*Submitted for verification at Etherscan.io on 2022-04-02
*/
// SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'SOUALIGA' contract
//
// Symbol : LIGA
// Name : SOUALIGA
// Total supply: 10 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 SOUALIGA is BurnableToken {
string public constant name = "SOUALIGA";
string public constant symbol = "LIGA";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 10000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a11565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd7565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e68565b6040518082815260200191505060405180910390f35b6103b1610eb1565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0e565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e2565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112de565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611365565b005b6040518060400160405280600881526020017f534f55414c49474100000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b490919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cb90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b490919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a629896800281565b60008111610a1e57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6a57600080fd5b6000339050610ac182600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b490919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b19826001546114b490919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce8576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7c565b610cfb83826114b490919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f4c4947410000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4957600080fd5b610f9b82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cb90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117382600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cb90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113bd57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c057fe5b818303905092915050565b6000808284019050838110156114dd57fe5b809150509291505056fea26469706673582212208d6f8cd7e6802ab41f31dad49e7fa8748ec8c737b975a9bcde1e5709acc60c7e64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,850 |
0xbd75e7dc45383ce317a20fc9dc567d1d12ba42c0 | // $DOVE
// 1.5% Max Txn & 4% Max Wallet
// 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 DOVE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "DOVE";
string private constant _symbol = "DOVE";
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 = 5;
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(0x82Db6576fDD047452d639b7Dc1f0f514aB417dDF);
address payable private _ttaxAddress = payable(0x82Db6576fDD047452d639b7Dc1f0f514aB417dDF);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 15000000000 * 10**9;
uint256 public _maxWalletSize = 40000000000 * 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 > 1500000000 * 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;
}
}
} | 0x6080604052600436106101bb5760003560e01c80637f2feddc116100ec578063a9059cbb1161008a578063c492f04611610064578063c492f046146104cb578063dd62ed3e146104eb578063ea1644d514610531578063f2fde38b1461055157600080fd5b8063a9059cbb14610466578063bfd7928414610486578063c3c8cd80146104b657600080fd5b80638f9a55c0116100c65780638f9a55c01461041057806395d89b41146101c757806398a5c31514610426578063a2a957bb1461044657600080fd5b80637f2feddc146103a55780638da5cb5b146103d25780638f70ccf7146103f057600080fd5b806349bd5a5e1161015957806370a082311161013357806370a082311461033a578063715018a61461035a57806374010ece1461036f5780637d1db4a51461038f57600080fd5b806349bd5a5e146102e35780636d8aa8f8146103035780636fc3eaec1461032557600080fd5b806318160ddd1161019557806318160ddd1461026b57806323b872dd146102915780632fd689e3146102b1578063313ce567146102c757600080fd5b806306fdde03146101c7578063095ea7b3146102035780631694505e1461023357600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b506040805180820182526004815263444f564560e01b602082015290516101fa9190611947565b60405180910390f35b34801561020f57600080fd5b5061022361021e3660046119b1565b610571565b60405190151581526020016101fa565b34801561023f57600080fd5b50601454610253906001600160a01b031681565b6040516001600160a01b0390911681526020016101fa565b34801561027757600080fd5b50683635c9adc5dea000005b6040519081526020016101fa565b34801561029d57600080fd5b506102236102ac3660046119dd565b610588565b3480156102bd57600080fd5b5061028360185481565b3480156102d357600080fd5b50604051600981526020016101fa565b3480156102ef57600080fd5b50601554610253906001600160a01b031681565b34801561030f57600080fd5b5061032361031e366004611a33565b6105f1565b005b34801561033157600080fd5b50610323610642565b34801561034657600080fd5b50610283610355366004611a4e565b61068d565b34801561036657600080fd5b506103236106af565b34801561037b57600080fd5b5061032361038a366004611a6b565b610723565b34801561039b57600080fd5b5061028360165481565b3480156103b157600080fd5b506102836103c0366004611a4e565b60116020526000908152604090205481565b3480156103de57600080fd5b506000546001600160a01b0316610253565b3480156103fc57600080fd5b5061032361040b366004611a33565b610762565b34801561041c57600080fd5b5061028360175481565b34801561043257600080fd5b50610323610441366004611a6b565b6107aa565b34801561045257600080fd5b50610323610461366004611a84565b6107d9565b34801561047257600080fd5b506102236104813660046119b1565b61098f565b34801561049257600080fd5b506102236104a1366004611a4e565b60106020526000908152604090205460ff1681565b3480156104c257600080fd5b5061032361099c565b3480156104d757600080fd5b506103236104e6366004611ab6565b6109f0565b3480156104f757600080fd5b50610283610506366004611b3a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561053d57600080fd5b5061032361054c366004611a6b565b610a91565b34801561055d57600080fd5b5061032361056c366004611a4e565b610ac0565b600061057e338484610baa565b5060015b92915050565b6000610595848484610cce565b6105e784336105e285604051806060016040528060288152602001611cee602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061120a565b610baa565b5060019392505050565b6000546001600160a01b031633146106245760405162461bcd60e51b815260040161061b90611b73565b60405180910390fd5b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061067757506013546001600160a01b0316336001600160a01b0316145b61068057600080fd5b4761068a81611244565b50565b6001600160a01b03811660009081526002602052604081205461058290611282565b6000546001600160a01b031633146106d95760405162461bcd60e51b815260040161061b90611b73565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461074d5760405162461bcd60e51b815260040161061b90611b73565b6714d1120d7b16000081111561068a57601655565b6000546001600160a01b0316331461078c5760405162461bcd60e51b815260040161061b90611b73565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146107d45760405162461bcd60e51b815260040161061b90611b73565b601855565b6000546001600160a01b031633146108035760405162461bcd60e51b815260040161061b90611b73565b60048411156108625760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b606482015260840161061b565b60148211156108be5760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b606482015260840161061b565b600483111561091e5760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b606482015260840161061b565b601481111561097b5760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b606482015260840161061b565b600893909355600a91909155600955600b55565b600061057e338484610cce565b6012546001600160a01b0316336001600160a01b031614806109d157506013546001600160a01b0316336001600160a01b0316145b6109da57600080fd5b60006109e53061068d565b905061068a81611306565b6000546001600160a01b03163314610a1a5760405162461bcd60e51b815260040161061b90611b73565b60005b82811015610a8b578160056000868685818110610a3c57610a3c611ba8565b9050602002016020810190610a519190611a4e565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a8381611bd4565b915050610a1d565b50505050565b6000546001600160a01b03163314610abb5760405162461bcd60e51b815260040161061b90611b73565b601755565b6000546001600160a01b03163314610aea5760405162461bcd60e51b815260040161061b90611b73565b6001600160a01b038116610b4f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610c0c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161061b565b6001600160a01b038216610c6d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161061b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d325760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161061b565b6001600160a01b038216610d945760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161061b565b60008111610df65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161061b565b6000546001600160a01b03848116911614801590610e2257506000546001600160a01b03838116911614155b1561110357601554600160a01b900460ff16610ebb576000546001600160a01b03848116911614610ebb5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161061b565b601654811115610f0d5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161061b565b6001600160a01b03831660009081526010602052604090205460ff16158015610f4f57506001600160a01b03821660009081526010602052604090205460ff16155b610fa75760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161061b565b6015546001600160a01b0383811691161461102c5760175481610fc98461068d565b610fd39190611bef565b1061102c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161061b565b60006110373061068d565b6018546016549192508210159082106110505760165491505b8080156110675750601554600160a81b900460ff16155b801561108157506015546001600160a01b03868116911614155b80156110965750601554600160b01b900460ff165b80156110bb57506001600160a01b03851660009081526005602052604090205460ff16155b80156110e057506001600160a01b03841660009081526005602052604090205460ff16155b15611100576110ee82611306565b4780156110fe576110fe47611244565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061114557506001600160a01b03831660009081526005602052604090205460ff165b8061117757506015546001600160a01b0385811691161480159061117757506015546001600160a01b03848116911614155b15611184575060006111fe565b6015546001600160a01b0385811691161480156111af57506014546001600160a01b03848116911614155b156111c157600854600c55600954600d555b6015546001600160a01b0384811691161480156111ec57506014546001600160a01b03858116911614155b156111fe57600a54600c55600b54600d555b610a8b8484848461148f565b6000818484111561122e5760405162461bcd60e51b815260040161061b9190611947565b50600061123b8486611c07565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561127e573d6000803e3d6000fd5b5050565b60006006548211156112e95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161061b565b60006112f36114bd565b90506112ff83826114e0565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061134e5761134e611ba8565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113a257600080fd5b505afa1580156113b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113da9190611c1e565b816001815181106113ed576113ed611ba8565b6001600160a01b0392831660209182029290920101526014546114139130911684610baa565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061144c908590600090869030904290600401611c3b565b600060405180830381600087803b15801561146657600080fd5b505af115801561147a573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061149c5761149c611522565b6114a7848484611550565b80610a8b57610a8b600e54600c55600f54600d55565b60008060006114ca611647565b90925090506114d982826114e0565b9250505090565b60006112ff83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611689565b600c541580156115325750600d54155b1561153957565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611562876116b7565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115949087611714565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115c39086611756565b6001600160a01b0389166000908152600260205260409020556115e5816117b5565b6115ef84836117ff565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161163491815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061166382826114e0565b82101561168057505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836116aa5760405162461bcd60e51b815260040161061b9190611947565b50600061123b8486611cac565b60008060008060008060008060006116d48a600c54600d54611823565b92509250925060006116e46114bd565b905060008060006116f78e878787611878565b919e509c509a509598509396509194505050505091939550919395565b60006112ff83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061120a565b6000806117638385611bef565b9050838110156112ff5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161061b565b60006117bf6114bd565b905060006117cd83836118c8565b306000908152600260205260409020549091506117ea9082611756565b30600090815260026020526040902055505050565b60065461180c9083611714565b60065560075461181c9082611756565b6007555050565b600080808061183d606461183789896118c8565b906114e0565b9050600061185060646118378a896118c8565b90506000611868826118628b86611714565b90611714565b9992985090965090945050505050565b600080808061188788866118c8565b9050600061189588876118c8565b905060006118a388886118c8565b905060006118b5826118628686611714565b939b939a50919850919650505050505050565b6000826118d757506000610582565b60006118e38385611cce565b9050826118f08583611cac565b146112ff5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161061b565b600060208083528351808285015260005b8181101561197457858101830151858201604001528201611958565b81811115611986576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461068a57600080fd5b600080604083850312156119c457600080fd5b82356119cf8161199c565b946020939093013593505050565b6000806000606084860312156119f257600080fd5b83356119fd8161199c565b92506020840135611a0d8161199c565b929592945050506040919091013590565b80358015158114611a2e57600080fd5b919050565b600060208284031215611a4557600080fd5b6112ff82611a1e565b600060208284031215611a6057600080fd5b81356112ff8161199c565b600060208284031215611a7d57600080fd5b5035919050565b60008060008060808587031215611a9a57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611acb57600080fd5b833567ffffffffffffffff80821115611ae357600080fd5b818601915086601f830112611af757600080fd5b813581811115611b0657600080fd5b8760208260051b8501011115611b1b57600080fd5b602092830195509350611b319186019050611a1e565b90509250925092565b60008060408385031215611b4d57600080fd5b8235611b588161199c565b91506020830135611b688161199c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611be857611be8611bbe565b5060010190565b60008219821115611c0257611c02611bbe565b500190565b600082821015611c1957611c19611bbe565b500390565b600060208284031215611c3057600080fd5b81516112ff8161199c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c8b5784516001600160a01b031683529383019391830191600101611c66565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611cc957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ce857611ce8611bbe565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ec023392c33fd3988bdb86551169db7766088e669f82a3d6615d0801a8227e2d64736f6c63430008090033 | {"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"}]}} | 1,851 |
0x218FFD34893f97191253b6D53210Bb46527820E6 | /**
*Submitted for verification at Etherscan.io on 2021-06-29
*/
pragma solidity ^0.4.26;
// File: contracts/SafeMath.sol
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;
}
}
// File: contracts/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
using SafeMath for uint256;
uint256 public startdate;
function Ownable() public {
owner = msg.sender;
startdate = now;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: contracts/Pausable.sol
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
mapping(address => uint256) private _lock_list_period;
mapping(address => bool) private _lock_list;
bool public paused = false;
mapping(address => uint256) internal _balances;
uint256 internal _tokenSupply;
/**
* @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);
_;
}
/**
*
*/
modifier isLockAddress() {
check_lock_period(msg.sender);
if(_lock_list[msg.sender]){
revert();
}
_;
}
function check_lock_period(address check_address) {
if(now > _lock_list_period[check_address] && _lock_list[check_address]){
_lock_list[check_address] = false;
_tokenSupply = _tokenSupply.add(_balances[check_address]);
}
}
function check_period(address check_address) constant public returns(uint256){
return _lock_list_period[check_address];
}
function check_lock(address check_address) constant public returns(bool){
return _lock_list[check_address];
}
/**
*
*/
function set_lock_list(address lock_address, uint period) onlyOwner external {
_lock_list_period[lock_address] = startdate + (period * 1 days);
_lock_list[lock_address] = true;
_tokenSupply = _tokenSupply.sub(_balances[lock_address]);
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
// File: contracts/ERC20Token.sol
interface ERC20Token {
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// File: contracts/ERC223.sol
interface ERC223 {
function totalSupply() public constant returns (uint);
function balanceOf(address who) public constant returns (uint);
function transfer(address to, uint value) public returns (bool);
}
// File: contracts/Receiver_Interface.sol
/*
* Contract that is working with ERC223 tokens
*/
contract ContractReceiver {
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
function tokenFallback(address _from, uint _value, bytes _data) public pure {
TKN memory tkn;
tkn.sender = _from;
tkn.value = _value;
tkn.data = _data;
uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24);
tkn.sig = bytes4(u);
/* tkn variable is analogue of msg variable of Ether transaction
* tkn.sender is person who initiated this token transaction (analogue of msg.sender)
* tkn.value the number of tokens that were sent (analogue of msg.value)
* tkn.data is data of token transaction (analogue of msg.data)
* tkn.sig is 4 bytes signature of function
* if data of token transaction is a function execution
*/
}
}
// File: contracts/NTH.sol
contract NTH is ERC20Token, Pausable, ERC223{
using SafeMath for uint;
string public constant name = "NTH";
string public constant symbol = "NTH";
uint8 public constant decimals = 18;
uint private _totalSupply;
mapping(address => mapping(address => uint256)) private _allowed;
event MintedLog(address to, uint256 amount);
event Transfer(address indexed from, address indexed to, uint value);
function NTH() public {
_tokenSupply = 0;
_totalSupply = 10000000000 * (uint256(10) ** decimals);
}
function totalSupply() public constant returns (uint256) {
return _tokenSupply;
}
function mint(address to, uint256 amount) onlyOwner public returns (bool){
amount = amount * (uint256(10) ** decimals);
if(_totalSupply + 1 > (_tokenSupply+amount)){
_tokenSupply = _tokenSupply.add(amount);
_balances[to]= _balances[to].add(amount);
emit MintedLog(to, amount);
return true;
}
return false;
}
function dist_list_set(address[] dist_list, uint256[] token_list) onlyOwner external{
for(uint i=0; i < dist_list.length ;i++){
transfer(dist_list[i],token_list[i]);
}
}
function balanceOf(address tokenOwner) public constant returns (uint256 balance) {
return _balances[tokenOwner];
}
function transfer(address to, uint tokens) whenNotPaused isLockAddress public returns(bool success){
bytes memory empty;
if(isContract(to)) {
return transferToContract(to, tokens, empty);
}
else {
return transferToAddress(to, tokens, empty);
}
}
function approve(address spender, uint256 tokens) public returns (bool success) {
if (tokens > 0 && balanceOf(msg.sender) >= tokens) {
_allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
return false;
}
function allowance(address tokenOwner, address spender) public constant returns (uint remaining) {
return _allowed[tokenOwner][spender];
}
function transferFrom(address from, address to, uint256 tokens) public returns (bool success) {
if (tokens > 0 && balanceOf(from) >= tokens && _allowed[from][msg.sender] >= tokens) {
_balances[from] = _balances[from].sub(tokens);
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(tokens);
_balances[to] = _balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
return false;
}
function burn(uint256 tokens) public returns (bool success) {
if ( tokens > 0 && balanceOf(msg.sender) >= tokens ) {
_balances[msg.sender] = _balances[msg.sender].sub(tokens);
_tokenSupply = _tokenSupply.sub(tokens);
return true;
}
return false;
}
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
if (balanceOf(msg.sender) < _value) revert();
_balances[msg.sender] = balanceOf(msg.sender).sub(_value);
_balances[_to] = balanceOf(_to).add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
if (balanceOf(msg.sender) < _value) revert();
_balances[msg.sender] = balanceOf(msg.sender).sub(_value);
_balances[_to] = balanceOf(_to).add(_value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
emit Transfer(msg.sender, _to, _value);
return true;
}
function isContract(address _addr) view returns (bool is_contract){
uint length;
assembly {
length := extcodesize(_addr)
}
return (length>0);
}
function () public payable {
throw;
}
} | 0x608060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610138578063095ea7b3146101c8578063162790551461022d57806318160ddd1461028857806323b872dd146102b3578063313ce567146103385780633f4ba83a1461036957806340c10f191461038057806342966c68146103e55780635c975abb1461042a57806364045c971461045957806370a08231146104a65780638456cb59146104fd5780638da5cb5b1461051457806395d89b411461056b57806399ce2ab8146105fb578063a9059cbb1461063e578063bf5373dc146106a3578063cde9f2ea146106fa578063dd62ed3e14610725578063f2fde38b1461079c578063f4749624146107df578063fc87bf1514610832575b600080fd5b34801561014457600080fd5b5061014d61088d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018d578082015181840152602081019050610172565b50505050905090810190601f1680156101ba5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d457600080fd5b50610213600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108c6565b604051808215151515815260200191505060405180910390f35b34801561023957600080fd5b5061026e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109de565b604051808215151515815260200191505060405180910390f35b34801561029457600080fd5b5061029d6109f1565b6040518082815260200191505060405180910390f35b3480156102bf57600080fd5b5061031e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109fb565b604051808215151515815260200191505060405180910390f35b34801561034457600080fd5b5061034d610d54565b604051808260ff1660ff16815260200191505060405180910390f35b34801561037557600080fd5b5061037e610d59565b005b34801561038c57600080fd5b506103cb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e18565b604051808215151515815260200191505060405180910390f35b3480156103f157600080fd5b5061041060048036038101908080359060200190929190505050610fc1565b604051808215151515815260200191505060405180910390f35b34801561043657600080fd5b5061043f6110a2565b604051808215151515815260200191505060405180910390f35b34801561046557600080fd5b506104a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110b5565b005b3480156104b257600080fd5b506104e7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611213565b6040518082815260200191505060405180910390f35b34801561050957600080fd5b5061051261125c565b005b34801561052057600080fd5b5061052961131c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561057757600080fd5b50610580611341565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105c05780820151818401526020810190506105a5565b50505050905090810190601f1680156105ed5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561060757600080fd5b5061063c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061137a565b005b34801561064a57600080fd5b50610689600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114cc565b604051808215151515815260200191505060405180910390f35b3480156106af57600080fd5b506106e4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611581565b6040518082815260200191505060405180910390f35b34801561070657600080fd5b5061070f6115ca565b6040518082815260200191505060405180910390f35b34801561073157600080fd5b50610786600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115d0565b6040518082815260200191505060405180910390f35b3480156107a857600080fd5b506107dd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611657565b005b3480156107eb57600080fd5b506108306004803603810190808035906020019082018035906020019190919293919293908035906020019082018035906020019190919293919293905050506117ac565b005b34801561083e57600080fd5b50610873600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611876565b604051808215151515815260200191505060405180910390f35b6040805190810160405280600381526020017f4e5448000000000000000000000000000000000000000000000000000000000081525081565b600080821180156108df5750816108dc33611213565b10155b156109d35781600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190506109d8565b600090505b92915050565b600080823b905060008111915050919050565b6000600654905090565b60008082118015610a14575081610a1185611213565b10155b8015610a9c575081600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b15610d4857610af382600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118cc90919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bc582600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118cc90919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c9782600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118e590919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610d4d565b600090505b9392505050565b601281565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610db457600080fd5b600460009054906101000a900460ff161515610dcf57600080fd5b6000600460006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7557600080fd5b601260ff16600a0a8202915081600654016001600754011115610fb657610ea7826006546118e590919063ffffffff16565b600681905550610eff82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118e590919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f5f98c4774888016b0aaebc40ab2028158e56c19845778ddf060f38ff0de6f4ee8383604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a160019050610fbb565b600090505b92915050565b60008082118015610fda575081610fd733611213565b10155b156110985761103182600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118cc90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611089826006546118cc90919063ffffffff16565b6006819055506001905061109d565b600090505b919050565b600460009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561111057600080fd5b62015180810260015401600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611209600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546006546118cc90919063ffffffff16565b6006819055505050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112b757600080fd5b600460009054906101000a900460ff161515156112d357600080fd5b6001600460006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f4e5448000000000000000000000000000000000000000000000000000000000081525081565b600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421180156114115750600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156114c9576000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506114c2600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546006546118e590919063ffffffff16565b6006819055505b50565b60006060600460009054906101000a900460ff161515156114ec57600080fd5b6114f53361137a565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561154c57600080fd5b611555846109de565b1561156c57611565848483611903565b915061157a565b611577848483611b73565b91505b5092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60015481565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116b257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156116ee57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561180957600080fd5b600090505b8484905081101561186f57611861858583818110151561182a57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16848484818110151561185557fe5b905060200201356114cc565b50808060010191505061180e565b5050505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60008282111515156118da57fe5b818303905092915050565b60008082840190508381101515156118f957fe5b8091505092915050565b6000808361191033611213565b101561191b57600080fd5b6119368461192833611213565b6118cc90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119948461198687611213565b6118e590919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611a9c578082015181840152602081019050611a81565b50505050905090810190601f168015611ac95780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015611aea57600080fd5b505af1158015611afe573d6000803e3d6000fd5b505050508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019150509392505050565b600082611b7f33611213565b1015611b8a57600080fd5b611ba583611b9733611213565b6118cc90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c0383611bf586611213565b6118e590919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a36001905093925050505600a165627a7a72305820a2451792771cabb8c63e9029ae8450be5330763dd3fae790fb4e18aa09ae57f20029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 1,852 |
0xe5085eb63ba62eb7edf609f63c2ce889cc122ea3 | // Sources flattened with hardhat v2.0.6 https://hardhat.org
// File contracts/uniswapv2/libraries/TransferHelper.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(address token, address to, uint value) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED');
}
function safeTransfer(address token, address to, uint value) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED');
}
function safeTransferFrom(address token, address from, address to, uint value) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');
}
function safeTransferETH(address to, uint value) internal {
(bool success,) = to.call{value:value}(new bytes(0));
require(success, 'TransferHelper: ETH_TRANSFER_FAILED');
}
}
// File contracts/interfaces/IERC20.sol
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, 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);
// EIP 2612
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
}
// File contracts/uniswapv2/libraries/SafeMath.sol
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMathUniswap {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
// File contracts/uniswapv2/interfaces/IUniswapV2Pair.sol
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;
}
// File contracts/uniswapv2/interfaces/IUniswapV2ERC20.sol
interface IUniswapV2ERC20 {
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;
}
// File contracts/SushiYieldToken.sol
contract SushiYieldToken {
using SafeMathUniswap for uint256;
using TransferHelper for address;
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
event Mint(address indexed sender, uint256 amount);
event Burn(address indexed sender, uint256 amount, address indexed to);
/**
* @return address of YieldTokenFactory
*/
address public factory;
/**
* @return address of lp token
*/
address public lpToken;
/**
* @return data to be used when `mint`ing/`burn`ing
*/
bytes public data;
string public name;
string public symbol;
uint8 public constant decimals = 18;
uint256 public totalSupply;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint256) public nonces;
uint256 private unlocked = 1;
modifier lock() {
require(unlocked == 1, "locked");
unlocked = 0;
_;
unlocked = 1;
}
constructor() public {
factory = msg.sender;
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 initialize(address _lpToken, bytes memory _data) external {
require(msg.sender == factory, "forbidden");
lpToken = _lpToken;
data = _data;
IUniswapV2Pair pair = IUniswapV2Pair(lpToken);
string memory symbol0 = IUniswapV2ERC20(pair.token0()).symbol();
string memory symbol1 = IUniswapV2ERC20(pair.token1()).symbol();
name = string(abi.encodePacked(symbol0, "-", symbol1, " SushiSwap Yield Token"));
symbol = string(abi.encodePacked(symbol0, "-", symbol1, " SYD"));
}
function _mint(address to, uint256 value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint256 value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint256 value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint256 value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint256 value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint256 value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint256 value) external returns (bool) {
if (allowance[from][msg.sender] != uint256(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external {
require(deadline >= block.timestamp, "expired");
bytes32 digest = keccak256(
abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0) && recoveredAddress == owner, "invalid-signature");
_approve(owner, spender, value);
}
function mint(address to) external lock returns (uint256 amount) {
amount = IUniswapV2ERC20(lpToken).balanceOf(address(this));
require(amount > 0, "insufficient-balance");
(bool success,) = factory.delegatecall(abi.encodeWithSignature("deposit(bytes,uint256,address)", data, amount, to));
require(success, "failed-to-deposit");
_mint(to, amount);
emit Mint(msg.sender, amount);
}
function burn(address to) external lock returns (uint256 amount) {
amount = balanceOf[address(this)];
require(amount > 0, "insufficient-balance");
(bool success,) = factory.delegatecall(abi.encodeWithSignature("withdraw(bytes,uint256,address)", data, amount, to));
require(success, "failed-to-withdraw");
_burn(address(this), amount);
emit Burn(msg.sender, amount, to);
}
}
// File contracts/YieldTokenFactory.sol
interface IMasterChef {
struct PoolInfo {
address lpToken;
uint256 allocPoint;
uint256 lastRewardBlock;
uint256 accSushiPerShare;
}
function sushi() external view returns (address);
function poolInfo(uint256 index) external view returns (
address lpToken,
uint256 allocPoint,
uint256 lastRewardBlock,
uint256 accSushiPerShare
);
function deposit(uint256 pid, uint256 amount) external;
function withdraw(uint256 pid, uint256 amount) external;
}
contract YieldTokenFactory {
using TransferHelper for address;
event YieldTokenCreated(uint256 pid, address token);
/**
* @return address of `MasterChef`
*/
address public masterChef;
/**
* @return address of `SushiToken`
*/
address public sushi;
/**
* @return address of `SushiYieldToken` for `pid`
*/
mapping(uint256 => address) public getYieldToken;
constructor(address _masterChef) public {
masterChef = _masterChef;
sushi = IMasterChef(_masterChef).sushi();
}
/**
* @return init hash of `SushiYieldToken`
*/
function yieldTokenCodeHash() external pure returns (bytes32) {
return keccak256(type(SushiYieldToken).creationCode);
}
/**
* @notice create a new `SushiYieldToken` for `pid`
*
* @return token created token's address
*/
function createYieldToken(uint256 pid) external returns (address token) {
require(getYieldToken[pid] == address(0), "already-created");
bytes memory bytecode = type(SushiYieldToken).creationCode;
bytes memory data = abi.encode(masterChef, pid);
bytes32 salt = keccak256(data);
assembly {
token := create2(0, add(bytecode, 32), mload(bytecode), salt)
}
(address lpToken,,,) = IMasterChef(masterChef).poolInfo(pid);
SushiYieldToken(token).initialize(lpToken, data);
getYieldToken[pid] = token;
emit YieldTokenCreated(pid, token);
}
/**
* @notice deposit lp token (meant to be `delegatecall`ed by `SushiYieldToken`)
*
* @param data encoded `pid`
* @param amount amount of lp tokens
* @param to receiver of sushi rewards
*/
function deposit(bytes memory data, uint256 amount, address to) external {
(address _masterChef, uint256 pid) = abi.decode(data, (address, uint256));
(address lpToken,,,) = IMasterChef(_masterChef).poolInfo(pid);
lpToken.safeApprove(_masterChef, amount);
IMasterChef(_masterChef).deposit(pid, amount);
_transferBalance(sushi, to);
}
/**
* @notice withdraw lp tokens (meant to be `delegatecall`ed by `SushiYieldToken`)
*
* @param data encoded `pid`
* @param amount amount of lp tokens
* @param to receiver of lp tokens
*/
function withdraw(bytes memory data, uint256 amount, address to) external {
(address _masterChef, uint256 pid) = abi.decode(data, (address, uint256));
(address lpToken,,,) = IMasterChef(_masterChef).poolInfo(pid);
IMasterChef(_masterChef).withdraw(pid, amount);
_transferBalance(lpToken, to);
_transferBalance(sushi, to);
}
function _transferBalance(address token, address to) internal {
uint256 balance = IERC20(token).balanceOf(address(this));
if (balance > 0) {
token.safeTransfer(to, balance);
}
}
} | 0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063513548321161005b5780635135483214610210578063575a86b21461022d578063964a732214610235578063cd3cf8bc1461024f5761007d565b80630a08790314610082578063135390f9146100a65780633e008c671461015c575b600080fd5b61008a61026c565b604080516001600160a01b039092168252519081900360200190f35b61015a600480360360608110156100bc57600080fd5b8101906020810181356401000000008111156100d757600080fd5b8201836020820111156100e957600080fd5b8035906020019184600183028401116401000000008311171561010b57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050823593505050602001356001600160a01b031661027b565b005b61015a6004803603606081101561017257600080fd5b81019060208101813564010000000081111561018d57600080fd5b82018360208201111561019f57600080fd5b803590602001918460018302840111640100000000831117156101c157600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050823593505050602001356001600160a01b03166103ab565b61008a6004803603602081101561022657600080fd5b50356104db565b61008a6104f6565b61023d610505565b60408051918252519081900360200190f35b61008a6004803603602081101561026557600080fd5b5035610537565b6001546001600160a01b031681565b60008084806020019051604081101561029357600080fd5b50805160209091015160408051631526fe2760e01b81526004810183905290519294509092506000916001600160a01b03851691631526fe27916024808301926080929190829003018186803b1580156102ec57600080fd5b505afa158015610300573d6000803e3d6000fd5b505050506040513d608081101561031657600080fd5b505160408051630441a3e760e41b8152600481018590526024810188905290519192506001600160a01b0385169163441a3e709160448082019260009290919082900301818387803b15801561036b57600080fd5b505af115801561037f573d6000803e3d6000fd5b5050505061038d81856107b7565b6001546103a3906001600160a01b0316856107b7565b505050505050565b6000808480602001905160408110156103c357600080fd5b50805160209091015160408051631526fe2760e01b81526004810183905290519294509092506000916001600160a01b03851691631526fe27916024808301926080929190829003018186803b15801561041c57600080fd5b505afa158015610430573d6000803e3d6000fd5b505050506040513d608081101561044657600080fd5b5051905061045e6001600160a01b0382168487610853565b826001600160a01b031663e2bbb15883876040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b1580156104ac57600080fd5b505af11580156104c0573d6000803e3d6000fd5b50506001546103a392506001600160a01b03169050856107b7565b6002602052600090815260409020546001600160a01b031681565b6000546001600160a01b031681565b60006040518060200161051790610b20565b6020820181038252601f19601f8201166040525080519060200120905090565b6000818152600260205260408120546001600160a01b031615610593576040805162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4b58dc99585d1959608a1b604482015290519081900360640190fd5b6060604051806020016105a590610b20565b601f1982820381018352601f909101166040818152600080546001600160a01b03166020848101919091528284018890528251808503840181526060909401909252825183830120845194955092938392909190860190f56000805460408051631526fe2760e01b8152600481018a9052905193975091926001600160a01b0390911691631526fe27916024808301926080929190829003018186803b15801561064e57600080fd5b505afa158015610662573d6000803e3d6000fd5b505050506040513d608081101561067857600080fd5b50516040805163347d5e2560e21b81526001600160a01b0380841660048301908152602483019384528751604484015287519495509089169363d1f57894938693899392606490910190602085019080838360005b838110156106e55781810151838201526020016106cd565b50505050905090810190601f1680156107125780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b15801561073257600080fd5b505af1158015610746573d6000803e3d6000fd5b50505060008781526002602090815260409182902080546001600160a01b0319166001600160a01b038a1690811790915582518a81529182015281517f2a623cdb82d618519a9d36d49f73191275f01aaebb56bc9fe965f8186dacbc4393509081900390910190a150505050919050565b6000826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561080657600080fd5b505afa15801561081a573d6000803e3d6000fd5b505050506040513d602081101561083057600080fd5b50519050801561084e5761084e6001600160a01b03841683836109bd565b505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b178152925182516000946060949389169392918291908083835b602083106108d05780518252601f1990920191602091820191016108b1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610932576040519150601f19603f3d011682016040523d82523d6000602084013e610937565b606091505b5091509150818015610965575080511580610965575080806020019051602081101561096257600080fd5b50515b6109b6576040805162461bcd60e51b815260206004820152601e60248201527f5472616e7366657248656c7065723a20415050524f56455f4641494c45440000604482015290519081900360640190fd5b5050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b60208310610a3a5780518252601f199092019160209182019101610a1b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610a9c576040519150601f19603f3d011682016040523d82523d6000602084013e610aa1565b606091505b5091509150818015610acf575080511580610acf5750808060200190516020811015610acc57600080fd5b50515b6109b6576040805162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015290519081900360640190fd5b61192780610b2e8339019056fe60806040526001600a5534801561001557600080fd5b50600080546001600160a01b031916331790556040516003805446927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f9291819083906002600019600183161561010002019091160480156100ae5780601f1061008c5761010080835404028352918201916100ae565b820191906000526020600020905b81548152906001019060200180831161009a575b505060408051918290038220828201825260018352603160f81b602093840152815180840196909652858201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606086015260808501959095523060a0808601919091528551808603909101815260c0909401909452505080519101206008556117e98061013e6000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063a9059cbb11610071578063a9059cbb1461032d578063c45a015514610359578063d1f5789414610361578063d505accf14610419578063dd62ed3e1461046a57610121565b806370a08231146102ab57806373d4a13a146102d15780637ecebe00146102d957806389afcb44146102ff57806395d89b411461032557610121565b806330adf81f116100f457806330adf81f14610233578063313ce5671461023b5780633644e515146102595780635fcbd285146102615780636a6278421461028557610121565b806306fdde0314610126578063095ea7b3146101a357806318160ddd146101e357806323b872dd146101fd575b600080fd5b61012e610498565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101cf600480360360408110156101b957600080fd5b506001600160a01b038135169060200135610526565b604080519115158252519081900360200190f35b6101eb61053d565b60408051918252519081900360200190f35b6101cf6004803603606081101561021357600080fd5b506001600160a01b03813581169160208101359091169060400135610543565b6101eb6105d7565b6102436105fb565b6040805160ff9092168252519081900360200190f35b6101eb610600565b610269610606565b604080516001600160a01b039092168252519081900360200190f35b6101eb6004803603602081101561029b57600080fd5b50356001600160a01b0316610615565b6101eb600480360360208110156102c157600080fd5b50356001600160a01b031661091c565b61012e61092e565b6101eb600480360360208110156102ef57600080fd5b50356001600160a01b0316610986565b6101eb6004803603602081101561031557600080fd5b50356001600160a01b0316610998565b61012e610c41565b6101cf6004803603604081101561034357600080fd5b506001600160a01b038135169060200135610c9c565b610269610ca9565b6104176004803603604081101561037757600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156103a257600080fd5b8201836020820111156103b457600080fd5b803590602001918460018302840111640100000000831117156103d657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610cb8945050505050565b005b610417600480360360e081101561042f57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c0013561124d565b6101eb6004803603604081101561048057600080fd5b506001600160a01b0381358116916020013516611438565b6003805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561051e5780601f106104f35761010080835404028352916020019161051e565b820191906000526020600020905b81548152906001019060200180831161050157829003601f168201915b505050505081565b6000610533338484611455565b5060015b92915050565b60055481565b6001600160a01b0383166000908152600760209081526040808320338452909152812054600019146105c2576001600160a01b038416600090815260076020908152604080832033845290915290205461059d90836114b7565b6001600160a01b03851660009081526007602090815260408083203384529091529020555b6105cd848484611507565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60085481565b6001546001600160a01b031681565b6000600a54600114610657576040805162461bcd60e51b81526020600482015260066024820152651b1bd8dad95960d21b604482015290519081900360640190fd5b6000600a55600154604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156106a757600080fd5b505afa1580156106bb573d6000803e3d6000fd5b505050506040513d60208110156106d157600080fd5b505190508061071e576040805162461bcd60e51b8152602060048201526014602482015273696e73756666696369656e742d62616c616e636560601b604482015290519081900360640190fd5b60008054604051604481018490526001600160a01b038581166064830152606060248301908152600280546000196001821615610100020116819004608485018190529290941693928692889291829160a490910190869080156107c35780601f10610798576101008083540402835291602001916107c3565b820191906000526020600020905b8154815290600101906020018083116107a657829003601f168201915b505060408051601f198184030181529181526020820180516001600160e01b0316633e008c6760e01b178152905182519297509550859450925090508083835b602083106108225780518252601f199092019160209182019101610803565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610882576040519150601f19603f3d011682016040523d82523d6000602084013e610887565b606091505b50509050806108d1576040805162461bcd60e51b815260206004820152601160248201527019985a5b19590b5d1bcb59195c1bdcda5d607a1b604482015290519081900360640190fd5b6108db83836115b5565b60408051838152905133917f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885919081900360200190a2506001600a55919050565b60066020526000908152604090205481565b6002805460408051602060018416156101000260001901909316849004601f8101849004840282018401909252818152929183018282801561051e5780601f106104f35761010080835404028352916020019161051e565b60096020526000908152604090205481565b6000600a546001146109da576040805162461bcd60e51b81526020600482015260066024820152651b1bd8dad95960d21b604482015290519081900360640190fd5b506000600a8190553081526006602052604090205480610a38576040805162461bcd60e51b8152602060048201526014602482015273696e73756666696369656e742d62616c616e636560601b604482015290519081900360640190fd5b60008054604051604481018490526001600160a01b038581166064830152606060248301908152600280546000196001821615610100020116819004608485018190529290941693928692889291829160a49091019086908015610add5780601f10610ab257610100808354040283529160200191610add565b820191906000526020600020905b815481529060010190602001808311610ac057829003601f168201915b505060408051601f198184030181529181526020820180516001600160e01b031663135390f960e01b178152905182519297509550859450925090508083835b60208310610b3c5780518252601f199092019160209182019101610b1d565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610b9c576040519150601f19603f3d011682016040523d82523d6000602084013e610ba1565b606091505b5050905080610bec576040805162461bcd60e51b81526020600482015260126024820152716661696c65642d746f2d776974686472617760701b604482015290519081900360640190fd5b610bf63083611640565b6040805183815290516001600160a01b0385169133917fdbdf9b8e4b75e75b162d151ec8fc7f0561cabab5fcccfa2600be62223e4300c49181900360200190a3506001600a55919050565b6004805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561051e5780601f106104f35761010080835404028352916020019161051e565b6000610533338484611507565b6000546001600160a01b031681565b6000546001600160a01b03163314610d03576040805162461bcd60e51b81526020600482015260096024820152683337b93134b23232b760b91b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0384161790558051610d31906002906020840190611720565b5060015460408051630dfe168160e01b815290516001600160a01b03909216916060918391630dfe168191600480820192602092909190829003018186803b158015610d7c57600080fd5b505afa158015610d90573d6000803e3d6000fd5b505050506040513d6020811015610da657600080fd5b5051604080516395d89b4160e01b815290516001600160a01b03909216916395d89b4191600480820192600092909190829003018186803b158015610dea57600080fd5b505afa158015610dfe573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015610e2757600080fd5b8101908080516040519392919084640100000000821115610e4757600080fd5b908301906020820185811115610e5c57600080fd5b8251640100000000811182820188101715610e7657600080fd5b82525081516020918201929091019080838360005b83811015610ea3578181015183820152602001610e8b565b50505050905090810190601f168015610ed05780820380516001836020036101000a031916815260200191505b5060405250505090506060826001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015610f1457600080fd5b505afa158015610f28573d6000803e3d6000fd5b505050506040513d6020811015610f3e57600080fd5b5051604080516395d89b4160e01b815290516001600160a01b03909216916395d89b4191600480820192600092909190829003018186803b158015610f8257600080fd5b505afa158015610f96573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015610fbf57600080fd5b8101908080516040519392919084640100000000821115610fdf57600080fd5b908301906020820185811115610ff457600080fd5b825164010000000081118282018810171561100e57600080fd5b82525081516020918201929091019080838360005b8381101561103b578181015183820152602001611023565b50505050905090810190601f1680156110685780820380516001836020036101000a031916815260200191505b50604052505050905081816040516020018083805190602001908083835b602083106110a55780518252601f199092019160209182019101611086565b6001836020036101000a03801982511681845116808217855250505050505090500180602d60f81b81525060010182805190602001908083835b602083106110fe5780518252601f1990920191602091820191016110df565b51815160209384036101000a6000190180199092169116179052751029bab9b434a9bbb0b8102cb4b2b632102a37b5b2b760511b9190930190815260408051808303600919018152601690920190528051611163965060039550920192506117209050565b5081816040516020018083805190602001908083835b602083106111985780518252601f199092019160209182019101611179565b6001836020036101000a03801982511681845116808217855250505050505090500180602d60f81b81525060010182805190602001908083835b602083106111f15780518252601f1990920191602091820191016111d2565b51815160001960209485036101000a01908116901991909116179052630814d65160e21b9390910192835260408051601b198186030181526004948501909152805161124597509395500192506117209050565b505050505050565b4284101561128c576040805162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b604482015290519081900360640190fd5b6008546001600160a01b0380891660008181526009602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e08501825280519083012061190160f01b6101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e280820193601f1981019281900390910190855afa1580156113a7573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906113dd5750886001600160a01b0316816001600160a01b0316145b611422576040805162461bcd60e51b8152602060048201526011602482015270696e76616c69642d7369676e617475726560781b604482015290519081900360640190fd5b61142d898989611455565b505050505050505050565b600760209081526000928352604080842090915290825290205481565b6001600160a01b03808416600081815260076020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b80820382811115610537576040805162461bcd60e51b815260206004820152601560248201527464732d6d6174682d7375622d756e646572666c6f7760581b604482015290519081900360640190fd5b6001600160a01b03831660009081526006602052604090205461152a90826114b7565b6001600160a01b03808516600090815260066020526040808220939093559084168152205461155990826116d1565b6001600160a01b0380841660008181526006602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6005546115c290826116d1565b6005556001600160a01b0382166000908152600660205260409020546115e890826116d1565b6001600160a01b03831660008181526006602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b03821660009081526006602052604090205461166390826114b7565b6001600160a01b03831660009081526006602052604090205560055461168990826114b7565b6005556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b80820182811015610537576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b604482015290519081900360640190fd5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061176157805160ff191683800117855561178e565b8280016001018555821561178e579182015b8281111561178e578251825591602001919060010190611773565b5061179a92915061179e565b5090565b5b8082111561179a576000815560010161179f56fea2646970667358221220e80369c95586962e9d4432ff538b9bbb3aeb0ef97d8fb6da7f940a025514d8fb64736f6c634300060c0033a2646970667358221220d1d5e21f0cd4844a763884968ec7020ebf6c5a8a2db775cbaeba40f40988d8a264736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 1,853 |
0x1d6865c7266e02e0c409ec5f79650b1d2aaea2e6 | // SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address payable newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Empire is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Empire";
string private constant _symbol = "EMP";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _devTax;
uint256 private _buyDevTax = 4;
uint256 private _sellDevTax = 4;
uint256 private _marketingTax;
uint256 private _buyMarketingTax = 4;
uint256 private _sellMarketingTax = 4;
uint256 private _salesTax;
uint256 private _buySalesTax = 2;
uint256 private _sellSalesTax = 2;
uint256 private _totalBuyTax = _buyDevTax + _buyMarketingTax + _buySalesTax;
uint256 private _totalSellTax = _sellDevTax + _sellMarketingTax + _sellSalesTax;
uint256 private _summedTax = _marketingTax+_salesTax;
uint256 private _numOfTokensToExchangeForTeam = 50000 * 10**9;
uint256 private _routermax = 50000000 * 10**9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _Marketingfund;
address payable private _Deployer;
address payable private _devWalletAddress;
address payable private _holdings;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
bool private enableLevelSell = false;
uint256 private _maxTxAmount = _tTotal;
uint256 public launchBlock;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable marketingTaxAddress, address payable devfeeAddr, address payable depAddr, address payable holdings) {
_Marketingfund = marketingTaxAddress;
_Deployer = depAddr;
_devWalletAddress = devfeeAddr;
_holdings = holdings;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_Marketingfund] = true;
_isExcludedFromFee[_devWalletAddress] = true;
_isExcludedFromFee[_Deployer] = true;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function setLevelSellEnabled(bool enable) external onlyOwner {
enableLevelSell = enable;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_devTax == 0 && _summedTax == 0) return;
_devTax = 0;
_summedTax = 0;
}
function restoreAllFee() private {
_devTax = _buyDevTax;
_marketingTax = _buyMarketingTax;
_salesTax = _buySalesTax;
_summedTax = _marketingTax+_salesTax;
}
function takeBuyFee() private {
_salesTax = _buySalesTax;
_marketingTax = _buyMarketingTax;
_devTax = _buyDevTax;
_summedTax = _marketingTax+_salesTax;
}
function takeSellFee() private {
_devTax = _sellDevTax;
_salesTax = _sellSalesTax;
_marketingTax = _sellMarketingTax;
_summedTax = _sellSalesTax+_sellMarketingTax;
}
function levelSell(uint256 amount, address sender) private returns (uint256) {
uint256 sellTax = amount.mul(_totalSellTax).div(100);
_rOwned[sender] = _rOwned[sender].sub(sellTax);
_rOwned[address(this)] = _rOwned[address(this)].add(sellTax);
uint256 tAmount = amount.sub(sellTax);
uint256 prevEthBalance = address(this).balance;
swapTokensForEth(sellTax);
uint256 newEthBalance = address(this).balance;
uint256 balanceDelta = newEthBalance - prevEthBalance;
if (balanceDelta > 0) {
sendETHForSellTax(balanceDelta);
}
return tAmount;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
}
require(!bots[from] && !bots[to] && !bots[msg.sender]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (15 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _routermax)
{
contractTokenBalance = _routermax;
}
bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam;
if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router)
) {
// We need to swap the current tokens to ETH and send to the team wallet
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
if (from != owner() && to != owner() && to != uniswapV2Pair) {
require(swapEnabled, "Swap disabled");
_tokenTransfer(from, to, amount, takeFee);
} else {
_tokenTransfer(from, to, amount, takeFee);
}
}
function isExcluded(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function isBlackListed(address account) public view returns (bool) {
return bots[account];
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), type(uint256).max);
// make the swap
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_Marketingfund.transfer(amount.div(_totalBuyTax).mul(_buyMarketingTax));
_devWalletAddress.transfer(amount.div(_totalBuyTax).mul(_buyDevTax));
_Deployer.transfer(amount.div(_totalBuyTax).mul(_buySalesTax));
}
function sendETHForSellTax(uint256 amount) private {
_holdings.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 20000000 * 10**9;
launchBlock = block.number;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function setSwapEnabled(bool enabled) external onlyOwner() {
swapEnabled = enabled;
}
function manualswap() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function setBot(address _bot) external onlyOwner() {
bots[_bot] = true;
}
function delBot(address notbot) public onlyOwner() {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
uint256 amountToTx = amount;
if (!takeFee) {
removeAllFee();
}
else if(sender == uniswapV2Pair) {
takeBuyFee();
}
else if(recipient == uniswapV2Pair) {
takeSellFee();
if (enableLevelSell) {
uint256 remainder = levelSell(amount, sender);
amountToTx = remainder;
}
}
else {
takeSellFee();
}
_transferStandard(sender, recipient, amountToTx);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _devTax, _summedTax);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 _taxFee = taxFee > 0 ? taxFee : 1;
uint256 _TeamFee = TeamFee > 0 ? TeamFee : 1;
uint256 tFee = tAmount.mul(_taxFee).div(100);
uint256 tTeam = tAmount.mul(_TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setRouterPercent(uint256 maxRouterPercent) external onlyOwner() {
require(maxRouterPercent > 0, "Amount must be greater than 0");
_routermax = _tTotal.mul(maxRouterPercent).div(10**4);
}
function _setTeamFee(uint256 teamFee) external onlyOwner() {
require(teamFee >= 1 && teamFee <= 25, 'teamFee should be in 1 - 25');
_summedTax = teamFee;
}
} | 0x6080604052600436106101a05760003560e01c806395d89b41116100ec578063cba0e9961161008a578063dd62ed3e11610064578063dd62ed3e14610583578063e01af92c146105c0578063e47d6060146105e9578063f2fde38b14610626576101a7565b8063cba0e996146104f2578063d00efb2f1461052f578063d543dbeb1461055a576101a7565b8063b515566a116100c6578063b515566a14610472578063c0e6b46e1461049b578063c3c8cd80146104c4578063c9567bf9146104db576101a7565b806395d89b41146103e1578063a9059cbb1461040c578063a994856c14610449576101a7565b8063313ce567116101595780636fc3eaec116101335780636fc3eaec1461034b57806370a0823114610362578063715018a61461039f5780638da5cb5b146103b6576101a7565b8063313ce567146102ce5780635932ead1146102f95780636b5caec414610322576101a7565b806306fdde03146101ac578063095ea7b3146101d757806318160ddd1461021457806323b872dd1461023f578063273123b71461027c57806328667162146102a5576101a7565b366101a757005b600080fd5b3480156101b857600080fd5b506101c161064f565b6040516101ce9190613bbe565b60405180910390f35b3480156101e357600080fd5b506101fe60048036038101906101f99190613751565b61068c565b60405161020b9190613ba3565b60405180910390f35b34801561022057600080fd5b506102296106aa565b6040516102369190613dc0565b60405180910390f35b34801561024b57600080fd5b5061026660048036038101906102619190613702565b6106ba565b6040516102739190613ba3565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e919061364b565b610793565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190613820565b610883565b005b3480156102da57600080fd5b506102e3610973565b6040516102f09190613e35565b60405180910390f35b34801561030557600080fd5b50610320600480360381019061031b91906137ce565b61097c565b005b34801561032e57600080fd5b506103496004803603810190610344919061364b565b610a2e565b005b34801561035757600080fd5b50610360610b1e565b005b34801561036e57600080fd5b506103896004803603810190610384919061364b565b610bc4565b6040516103969190613dc0565b60405180910390f35b3480156103ab57600080fd5b506103b4610c15565b005b3480156103c257600080fd5b506103cb610d68565b6040516103d89190613b5f565b60405180910390f35b3480156103ed57600080fd5b506103f6610d91565b6040516104039190613bbe565b60405180910390f35b34801561041857600080fd5b50610433600480360381019061042e9190613751565b610dce565b6040516104409190613ba3565b60405180910390f35b34801561045557600080fd5b50610470600480360381019061046b91906137ce565b610dec565b005b34801561047e57600080fd5b506104996004803603810190610494919061378d565b610e9e565b005b3480156104a757600080fd5b506104c260048036038101906104bd9190613820565b610fee565b005b3480156104d057600080fd5b506104d96110fe565b005b3480156104e757600080fd5b506104f06111ac565b005b3480156104fe57600080fd5b506105196004803603810190610514919061364b565b6113eb565b6040516105269190613ba3565b60405180910390f35b34801561053b57600080fd5b50610544611441565b6040516105519190613dc0565b60405180910390f35b34801561056657600080fd5b50610581600480360381019061057c9190613820565b611447565b005b34801561058f57600080fd5b506105aa60048036038101906105a591906136c6565b61158f565b6040516105b79190613dc0565b60405180910390f35b3480156105cc57600080fd5b506105e760048036038101906105e291906137ce565b611616565b005b3480156105f557600080fd5b50610610600480360381019061060b919061364b565b6116c8565b60405161061d9190613ba3565b60405180910390f35b34801561063257600080fd5b5061064d6004803603810190610648919061369d565b61171e565b005b60606040518060400160405280600681526020017f456d706972650000000000000000000000000000000000000000000000000000815250905090565b60006106a06106996118e0565b84846118e8565b6001905092915050565b6000678ac7230489e80000905090565b60006106c7848484611ab3565b610788846106d36118e0565b610783856040518060600160405280602881526020016145c360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107396118e0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124af9092919063ffffffff16565b6118e8565b600190509392505050565b61079b6118e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610828576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081f90613d00565b60405180910390fd5b6000601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b61088b6118e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610918576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161090f90613d00565b60405180910390fd5b6001811015801561092a575060198111155b610969576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096090613c80565b60405180910390fd5b8060138190555050565b60006009905090565b6109846118e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0890613d00565b60405180910390fd5b80601d60176101000a81548160ff02191690831515021790555050565b610a366118e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90613d00565b60405180910390fd5b6001601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610b266118e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610baa90613d00565b60405180910390fd5b6000479050610bc181612513565b50565b6000610c0e600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126c9565b9050919050565b610c1d6118e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610caa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca190613d00565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f454d500000000000000000000000000000000000000000000000000000000000815250905090565b6000610de2610ddb6118e0565b8484611ab3565b6001905092915050565b610df46118e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7890613d00565b60405180910390fd5b80601d60186101000a81548160ff02191690831515021790555050565b610ea66118e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2a90613d00565b60405180910390fd5b60005b8151811015610fea57600160166000848481518110610f7e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610fe2906140e8565b915050610f36565b5050565b610ff66118e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611083576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107a90613d00565b60405180910390fd5b600081116110c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bd90613cc0565b60405180910390fd5b6110f56127106110e783678ac7230489e8000061273790919063ffffffff16565b6127b290919063ffffffff16565b60158190555050565b6111066118e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611193576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118a90613d00565b60405180910390fd5b600061119e30610bc4565b90506111a9816127fc565b50565b6111b46118e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611241576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123890613d00565b60405180910390fd5b601d60149054906101000a900460ff1615611291576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128890613d80565b60405180910390fd5b6001601d60166101000a81548160ff0219169083151502179055506000601d60176101000a81548160ff02191690831515021790555066470de4df820000601e8190555043601f819055506001601d60146101000a81548160ff021916908315150217905550601d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611396929190613b7a565b602060405180830381600087803b1580156113b057600080fd5b505af11580156113c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e891906137f7565b50565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b601f5481565b61144f6118e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d390613d00565b60405180910390fd5b6000811161151f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151690613cc0565b60405180910390fd5b61154d606461153f83678ac7230489e8000061273790919063ffffffff16565b6127b290919063ffffffff16565b601e819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601e546040516115849190613dc0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61161e6118e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a290613d00565b60405180910390fd5b80601d60166101000a81548160ff02191690831515021790555050565b6000601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6117266118e0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117aa90613d00565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181a90613c20565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611958576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194f90613d60565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119bf90613c40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611aa69190613dc0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b1a90613d40565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b8a90613be0565b60405180910390fd5b60008111611bd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bcd90613d20565b60405180910390fd5b611bde610d68565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c4c5750611c1c610d68565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156122b657601d60179054906101000a900460ff1615611e7f573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611cce57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d285750601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d825750601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e7e57601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dc86118e0565b73ffffffffffffffffffffffffffffffffffffffff161480611e3e5750601d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e266118e0565b73ffffffffffffffffffffffffffffffffffffffff16145b611e7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e7490613da0565b60405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611ec257601e54811115611ec157600080fd5b5b601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f665750601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611fbc5750601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611fc557600080fd5b601d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120705750601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120c65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156120de5750601d60179054906101000a900460ff165b1561217f5742601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061212e57600080fd5b600f4261213b9190613ef6565b601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061218a30610bc4565b9050601554811061219b5760155490505b60006014548210159050601d60159054906101000a900460ff161580156121ce5750601d60169054906101000a900460ff165b80156121d75750805b80156122315750601d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b801561228b5750601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b156122b357612299826127fc565b600047905060008111156122b1576122b047612513565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061235d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561236757600090505b61236f610d68565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156123dd57506123ad610d68565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156124375750601d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561249c57601d60169054906101000a900460ff1661248b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248290613c60565b60405180910390fd5b61249784848484612b16565b6124a9565b6124a884848484612b16565b5b50505050565b60008383111582906124f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124ee9190613bbe565b60405180910390fd5b50600083856125069190613fd7565b9050809150509392505050565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612578600c5461256a601154866127b290919063ffffffff16565b61273790919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156125a3573d6000803e3d6000fd5b50601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6126096009546125fb601154866127b290919063ffffffff16565b61273790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612634573d6000803e3d6000fd5b50601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61269a600f5461268c601154866127b290919063ffffffff16565b61273790919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156126c5573d6000803e3d6000fd5b5050565b6000600654821115612710576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270790613c00565b60405180910390fd5b600061271a612c46565b905061272f81846127b290919063ffffffff16565b915050919050565b60008083141561274a57600090506127ac565b600082846127589190613f7d565b90508284826127679190613f4c565b146127a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161279e90613ce0565b60405180910390fd5b809150505b92915050565b60006127f483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612c71565b905092915050565b6001601d60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561285a577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156128885781602001602082028036833780820191505090505b50905030816000815181106128c6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561296857600080fd5b505afa15801561297c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129a09190613674565b816001815181106129da577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050612a6130601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6118e8565b601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612ac5959493929190613ddb565b600060405180830381600087803b158015612adf57600080fd5b505af1158015612af3573d6000803e3d6000fd5b50505050506000601d60156101000a81548160ff02191690831515021790555050565b600082905081612b2d57612b28612cd4565b612c26565b601d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612b9057612b8b612d05565b612c25565b601d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612c1b57612bee612d38565b601d60189054906101000a900460ff1615612c16576000612c0f8487612d6b565b9050809150505b612c24565b612c23612d38565b5b5b5b612c31858583612f1d565b81612c3f57612c3e6130e8565b5b5050505050565b6000806000612c5361311b565b91509150612c6a81836127b290919063ffffffff16565b9250505090565b60008083118290612cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612caf9190613bbe565b60405180910390fd5b5060008385612cc79190613f4c565b9050809150509392505050565b6000600854148015612ce857506000601354145b15612cf257612d03565b600060088190555060006013819055505b565b600f54600e81905550600c54600b81905550600954600881905550600e54600b54612d309190613ef6565b601381905550565b600a54600881905550601054600e81905550600d54600b81905550600d54601054612d639190613ef6565b601381905550565b600080612d966064612d886012548761273790919063ffffffff16565b6127b290919063ffffffff16565b9050612dea81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461317a90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e7f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131c490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000612ed7828661317a90919063ffffffff16565b90506000479050612ee7836127fc565b600047905060008282612efa9190613fd7565b90506000811115612f0f57612f0e81613222565b5b839550505050505092915050565b600080600080600080612f2f8761328e565b955095509550955095509550612f8d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461317a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131c490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306e816132f6565b61307884836133b3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516130d59190613dc0565b60405180910390a3505050505050505050565b600954600881905550600c54600b81905550600f54600e81905550600e54600b546131139190613ef6565b601381905550565b600080600060065490506000678ac7230489e80000905061314f678ac7230489e800006006546127b290919063ffffffff16565b82101561316d57600654678ac7230489e80000935093505050613176565b81819350935050505b9091565b60006131bc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506124af565b905092915050565b60008082846131d39190613ef6565b905083811015613218576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161320f90613ca0565b60405180910390fd5b8091505092915050565b601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561328a573d6000803e3d6000fd5b5050565b60008060008060008060008060006132ab8a6008546013546133ed565b92509250925060006132bb612c46565b905060008060006132ce8e8787876134ae565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613300612c46565b90506000613317828461273790919063ffffffff16565b905061336b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131c490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6133c88260065461317a90919063ffffffff16565b6006819055506133e3816007546131c490919063ffffffff16565b6007819055505050565b60008060008060008611613402576001613404565b855b90506000808611613416576001613418565b855b905060006134426064613434858c61273790919063ffffffff16565b6127b290919063ffffffff16565b9050600061346c606461345e858d61273790919063ffffffff16565b6127b290919063ffffffff16565b9050600061349582613487858e61317a90919063ffffffff16565b61317a90919063ffffffff16565b9050808383975097509750505050505093509350939050565b6000806000806134c7858961273790919063ffffffff16565b905060006134de868961273790919063ffffffff16565b905060006134f5878961273790919063ffffffff16565b9050600061351e82613510858761317a90919063ffffffff16565b61317a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061354a61354584613e75565b613e50565b9050808382526020820190508285602086028201111561356957600080fd5b60005b85811015613599578161357f88826135a3565b84526020840193506020830192505060018101905061356c565b5050509392505050565b6000813590506135b281614566565b92915050565b6000815190506135c781614566565b92915050565b6000813590506135dc8161457d565b92915050565b600082601f8301126135f357600080fd5b8135613603848260208601613537565b91505092915050565b60008135905061361b81614594565b92915050565b60008151905061363081614594565b92915050565b600081359050613645816145ab565b92915050565b60006020828403121561365d57600080fd5b600061366b848285016135a3565b91505092915050565b60006020828403121561368657600080fd5b6000613694848285016135b8565b91505092915050565b6000602082840312156136af57600080fd5b60006136bd848285016135cd565b91505092915050565b600080604083850312156136d957600080fd5b60006136e7858286016135a3565b92505060206136f8858286016135a3565b9150509250929050565b60008060006060848603121561371757600080fd5b6000613725868287016135a3565b9350506020613736868287016135a3565b925050604061374786828701613636565b9150509250925092565b6000806040838503121561376457600080fd5b6000613772858286016135a3565b925050602061378385828601613636565b9150509250929050565b60006020828403121561379f57600080fd5b600082013567ffffffffffffffff8111156137b957600080fd5b6137c5848285016135e2565b91505092915050565b6000602082840312156137e057600080fd5b60006137ee8482850161360c565b91505092915050565b60006020828403121561380957600080fd5b600061381784828501613621565b91505092915050565b60006020828403121561383257600080fd5b600061384084828501613636565b91505092915050565b60006138558383613861565b60208301905092915050565b61386a8161400b565b82525050565b6138798161400b565b82525050565b600061388a82613eb1565b6138948185613ed4565b935061389f83613ea1565b8060005b838110156138d05781516138b78882613849565b97506138c283613ec7565b9250506001810190506138a3565b5085935050505092915050565b6138e68161402f565b82525050565b6138f581614072565b82525050565b600061390682613ebc565b6139108185613ee5565b9350613920818560208601614084565b613929816141be565b840191505092915050565b6000613941602383613ee5565b915061394c826141cf565b604082019050919050565b6000613964602a83613ee5565b915061396f8261421e565b604082019050919050565b6000613987602683613ee5565b91506139928261426d565b604082019050919050565b60006139aa602283613ee5565b91506139b5826142bc565b604082019050919050565b60006139cd600d83613ee5565b91506139d88261430b565b602082019050919050565b60006139f0601b83613ee5565b91506139fb82614334565b602082019050919050565b6000613a13601b83613ee5565b9150613a1e8261435d565b602082019050919050565b6000613a36601d83613ee5565b9150613a4182614386565b602082019050919050565b6000613a59602183613ee5565b9150613a64826143af565b604082019050919050565b6000613a7c602083613ee5565b9150613a87826143fe565b602082019050919050565b6000613a9f602983613ee5565b9150613aaa82614427565b604082019050919050565b6000613ac2602583613ee5565b9150613acd82614476565b604082019050919050565b6000613ae5602483613ee5565b9150613af0826144c5565b604082019050919050565b6000613b08601783613ee5565b9150613b1382614514565b602082019050919050565b6000613b2b601183613ee5565b9150613b368261453d565b602082019050919050565b613b4a8161405b565b82525050565b613b5981614065565b82525050565b6000602082019050613b746000830184613870565b92915050565b6000604082019050613b8f6000830185613870565b613b9c6020830184613b41565b9392505050565b6000602082019050613bb860008301846138dd565b92915050565b60006020820190508181036000830152613bd881846138fb565b905092915050565b60006020820190508181036000830152613bf981613934565b9050919050565b60006020820190508181036000830152613c1981613957565b9050919050565b60006020820190508181036000830152613c398161397a565b9050919050565b60006020820190508181036000830152613c598161399d565b9050919050565b60006020820190508181036000830152613c79816139c0565b9050919050565b60006020820190508181036000830152613c99816139e3565b9050919050565b60006020820190508181036000830152613cb981613a06565b9050919050565b60006020820190508181036000830152613cd981613a29565b9050919050565b60006020820190508181036000830152613cf981613a4c565b9050919050565b60006020820190508181036000830152613d1981613a6f565b9050919050565b60006020820190508181036000830152613d3981613a92565b9050919050565b60006020820190508181036000830152613d5981613ab5565b9050919050565b60006020820190508181036000830152613d7981613ad8565b9050919050565b60006020820190508181036000830152613d9981613afb565b9050919050565b60006020820190508181036000830152613db981613b1e565b9050919050565b6000602082019050613dd56000830184613b41565b92915050565b600060a082019050613df06000830188613b41565b613dfd60208301876138ec565b8181036040830152613e0f818661387f565b9050613e1e6060830185613870565b613e2b6080830184613b41565b9695505050505050565b6000602082019050613e4a6000830184613b50565b92915050565b6000613e5a613e6b565b9050613e6682826140b7565b919050565b6000604051905090565b600067ffffffffffffffff821115613e9057613e8f61418f565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613f018261405b565b9150613f0c8361405b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613f4157613f40614131565b5b828201905092915050565b6000613f578261405b565b9150613f628361405b565b925082613f7257613f71614160565b5b828204905092915050565b6000613f888261405b565b9150613f938361405b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613fcc57613fcb614131565b5b828202905092915050565b6000613fe28261405b565b9150613fed8361405b565b92508282101561400057613fff614131565b5b828203905092915050565b60006140168261403b565b9050919050565b60006140288261403b565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061407d8261405b565b9050919050565b60005b838110156140a2578082015181840152602081019050614087565b838111156140b1576000848401525b50505050565b6140c0826141be565b810181811067ffffffffffffffff821117156140df576140de61418f565b5b80604052505050565b60006140f38261405b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561412657614125614131565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f537761702064697361626c656400000000000000000000000000000000000000600082015250565b7f7465616d4665652073686f756c6420626520696e2031202d2032350000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61456f8161400b565b811461457a57600080fd5b50565b6145868161401d565b811461459157600080fd5b50565b61459d8161402f565b81146145a857600080fd5b50565b6145b48161405b565b81146145bf57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206e9f9e07cf7e8db286bf1d1badef09bc2143be57ba1a17a4729808db85db74a464736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,854 |
0x77633e393c6f5c9c7a07139c46541ec289a714a3 | /**
*Submitted for verification at Etherscan.io on 2022-05-02
*/
// SPDX-License-Identifier: Unlicensed
//https://t.me/revuwarriors
//https://revurevolution.com
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 WarriorsRevu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "WarriorsRev";
string private constant _symbol = "RevWar";
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;
}
} | 0x6080604052600436106101db5760003560e01c806374010ece11610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610583578063dd62ed3e146105a3578063ea1644d5146105e9578063f2fde38b1461060957600080fd5b8063a2a957bb146104fe578063a9059cbb1461051e578063bfd792841461053e578063c3c8cd801461056e57600080fd5b80638f70ccf7116100d15780638f70ccf7146104795780638f9a55c01461049957806395d89b41146104af57806398a5c315146104de57600080fd5b806374010ece146103f85780637d1db4a5146104185780637f2feddc1461042e5780638da5cb5b1461045b57600080fd5b80632fd689e31161017a5780636d8aa8f8116101495780636d8aa8f81461038e5780636fc3eaec146103ae57806370a08231146103c3578063715018a6146103e357600080fd5b80632fd689e31461031c578063313ce5671461033257806349bd5a5e1461034e5780636b9990531461036e57600080fd5b8063095ea7b3116101b6578063095ea7b31461026f5780631694505e1461029f57806318160ddd146102d757806323b872dd146102fc57600080fd5b8062b8cf2a146101e757806306fdde0314610209578063093bb7201461024f57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611a88565b610629565b005b34801561021557600080fd5b5060408051808201909152600b81526a2bb0b93934b7b939a932bb60a91b60208201525b6040516102469190611b4d565b60405180910390f35b34801561025b57600080fd5b5061020761026a366004611bb2565b61074f565b34801561027b57600080fd5b5061028f61028a366004611bcd565b610797565b6040519015158152602001610246565b3480156102ab57600080fd5b506013546102bf906001600160a01b031681565b6040516001600160a01b039091168152602001610246565b3480156102e357600080fd5b50670de0b6b3a76400005b604051908152602001610246565b34801561030857600080fd5b5061028f610317366004611bf9565b6107ae565b34801561032857600080fd5b506102ee60175481565b34801561033e57600080fd5b5060405160098152602001610246565b34801561035a57600080fd5b506014546102bf906001600160a01b031681565b34801561037a57600080fd5b50610207610389366004611c3a565b610817565b34801561039a57600080fd5b506102076103a9366004611bb2565b610862565b3480156103ba57600080fd5b506102076108aa565b3480156103cf57600080fd5b506102ee6103de366004611c3a565b6108d7565b3480156103ef57600080fd5b506102076108f9565b34801561040457600080fd5b50610207610413366004611c57565b61096d565b34801561042457600080fd5b506102ee60155481565b34801561043a57600080fd5b506102ee610449366004611c3a565b60116020526000908152604090205481565b34801561046757600080fd5b506000546001600160a01b03166102bf565b34801561048557600080fd5b50610207610494366004611bb2565b6109af565b3480156104a557600080fd5b506102ee60165481565b3480156104bb57600080fd5b506040805180820190915260068152652932bb2bb0b960d11b6020820152610239565b3480156104ea57600080fd5b506102076104f9366004611c57565b610a0e565b34801561050a57600080fd5b50610207610519366004611c70565b610a3d565b34801561052a57600080fd5b5061028f610539366004611bcd565b610a97565b34801561054a57600080fd5b5061028f610559366004611c3a565b60106020526000908152604090205460ff1681565b34801561057a57600080fd5b50610207610aa4565b34801561058f57600080fd5b5061020761059e366004611ca2565b610ada565b3480156105af57600080fd5b506102ee6105be366004611d26565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105f557600080fd5b50610207610604366004611c57565b610b7b565b34801561061557600080fd5b50610207610624366004611c3a565b610baa565b6000546001600160a01b0316331461065c5760405162461bcd60e51b815260040161065390611d5f565b60405180910390fd5b60005b815181101561074b5760145482516001600160a01b039091169083908390811061068b5761068b611d94565b60200260200101516001600160a01b0316141580156106dc575060135482516001600160a01b03909116908390839081106106c8576106c8611d94565b60200260200101516001600160a01b031614155b15610739576001601060008484815181106106f9576106f9611d94565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061074381611dc0565b91505061065f565b5050565b6000546001600160a01b031633146107795760405162461bcd60e51b815260040161065390611d5f565b60148054911515600160b81b0260ff60b81b19909216919091179055565b60006107a4338484610c94565b5060015b92915050565b60006107bb848484610db8565b61080d843361080885604051806060016040528060288152602001611eda602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611316565b610c94565b5060019392505050565b6000546001600160a01b031633146108415760405162461bcd60e51b815260040161065390611d5f565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461088c5760405162461bcd60e51b815260040161065390611d5f565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146108ca57600080fd5b476108d481611350565b50565b6001600160a01b0381166000908152600260205260408120546107a89061138a565b6000546001600160a01b031633146109235760405162461bcd60e51b815260040161065390611d5f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109975760405162461bcd60e51b815260040161065390611d5f565b6611c37937e0800081116109aa57600080fd5b601555565b6000546001600160a01b031633146109d95760405162461bcd60e51b815260040161065390611d5f565b601454600160a01b900460ff16156109f057600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610a385760405162461bcd60e51b815260040161065390611d5f565b601755565b6000546001600160a01b03163314610a675760405162461bcd60e51b815260040161065390611d5f565b60095482111580610a7a5750600b548111155b610a8357600080fd5b600893909355600a91909155600955600b55565b60006107a4338484610db8565b6012546001600160a01b0316336001600160a01b031614610ac457600080fd5b6000610acf306108d7565b90506108d48161140e565b6000546001600160a01b03163314610b045760405162461bcd60e51b815260040161065390611d5f565b60005b82811015610b75578160056000868685818110610b2657610b26611d94565b9050602002016020810190610b3b9190611c3a565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b6d81611dc0565b915050610b07565b50505050565b6000546001600160a01b03163314610ba55760405162461bcd60e51b815260040161065390611d5f565b601655565b6000546001600160a01b03163314610bd45760405162461bcd60e51b815260040161065390611d5f565b6001600160a01b038116610c395760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610653565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610cf65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610653565b6001600160a01b038216610d575760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610653565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e1c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610653565b6001600160a01b038216610e7e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610653565b60008111610ee05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610653565b6000546001600160a01b03848116911614801590610f0c57506000546001600160a01b03838116911614155b1561120f57601454600160a01b900460ff16610fa5576000546001600160a01b03848116911614610fa55760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610653565b601454600160b81b900460ff16611008576015548111156110085760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610653565b6001600160a01b03831660009081526010602052604090205460ff1615801561104a57506001600160a01b03821660009081526010602052604090205460ff16155b6110a25760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610653565b6014546001600160a01b0383811691161461113857601454600160b81b900460ff1661113857601654816110d5846108d7565b6110df9190611ddb565b106111385760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610653565b6000611143306108d7565b60175460155491925082101590821061115c5760155491505b8080156111735750601454600160a81b900460ff16155b801561118d57506014546001600160a01b03868116911614155b80156111a25750601454600160b01b900460ff165b80156111c757506001600160a01b03851660009081526005602052604090205460ff16155b80156111ec57506001600160a01b03841660009081526005602052604090205460ff16155b1561120c576111fa8261140e565b47801561120a5761120a47611350565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061125157506001600160a01b03831660009081526005602052604090205460ff165b8061128357506014546001600160a01b0385811691161480159061128357506014546001600160a01b03848116911614155b156112905750600061130a565b6014546001600160a01b0385811691161480156112bb57506013546001600160a01b03848116911614155b156112cd57600854600c55600954600d555b6014546001600160a01b0384811691161480156112f857506013546001600160a01b03858116911614155b1561130a57600a54600c55600b54600d555b610b7584848484611597565b6000818484111561133a5760405162461bcd60e51b81526004016106539190611b4d565b5060006113478486611df3565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561074b573d6000803e3d6000fd5b60006006548211156113f15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610653565b60006113fb6115c5565b905061140783826115e8565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061145657611456611d94565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156114aa57600080fd5b505afa1580156114be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e29190611e0a565b816001815181106114f5576114f5611d94565b6001600160a01b03928316602091820292909201015260135461151b9130911684610c94565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611554908590600090869030904290600401611e27565b600060405180830381600087803b15801561156e57600080fd5b505af1158015611582573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b806115a4576115a461162a565b6115af848484611658565b80610b7557610b75600e54600c55600f54600d55565b60008060006115d261174f565b90925090506115e182826115e8565b9250505090565b600061140783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061178f565b600c5415801561163a5750600d54155b1561164157565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061166a876117bd565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061169c908761181a565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116cb908661185c565b6001600160a01b0389166000908152600260205260409020556116ed816118bb565b6116f78483611905565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161173c91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061176a82826115e8565b82101561178657505060065492670de0b6b3a764000092509050565b90939092509050565b600081836117b05760405162461bcd60e51b81526004016106539190611b4d565b5060006113478486611e98565b60008060008060008060008060006117da8a600c54600d54611929565b92509250925060006117ea6115c5565b905060008060006117fd8e87878761197e565b919e509c509a509598509396509194505050505091939550919395565b600061140783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611316565b6000806118698385611ddb565b9050838110156114075760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610653565b60006118c56115c5565b905060006118d383836119ce565b306000908152600260205260409020549091506118f0908261185c565b30600090815260026020526040902055505050565b600654611912908361181a565b600655600754611922908261185c565b6007555050565b6000808080611943606461193d89896119ce565b906115e8565b90506000611956606461193d8a896119ce565b9050600061196e826119688b8661181a565b9061181a565b9992985090965090945050505050565b600080808061198d88866119ce565b9050600061199b88876119ce565b905060006119a988886119ce565b905060006119bb82611968868661181a565b939b939a50919850919650505050505050565b6000826119dd575060006107a8565b60006119e98385611eba565b9050826119f68583611e98565b146114075760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610653565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146108d457600080fd5b8035611a8381611a63565b919050565b60006020808385031215611a9b57600080fd5b823567ffffffffffffffff80821115611ab357600080fd5b818501915085601f830112611ac757600080fd5b813581811115611ad957611ad9611a4d565b8060051b604051601f19603f83011681018181108582111715611afe57611afe611a4d565b604052918252848201925083810185019188831115611b1c57600080fd5b938501935b82851015611b4157611b3285611a78565b84529385019392850192611b21565b98975050505050505050565b600060208083528351808285015260005b81811015611b7a57858101830151858201604001528201611b5e565b81811115611b8c576000604083870101525b50601f01601f1916929092016040019392505050565b80358015158114611a8357600080fd5b600060208284031215611bc457600080fd5b61140782611ba2565b60008060408385031215611be057600080fd5b8235611beb81611a63565b946020939093013593505050565b600080600060608486031215611c0e57600080fd5b8335611c1981611a63565b92506020840135611c2981611a63565b929592945050506040919091013590565b600060208284031215611c4c57600080fd5b813561140781611a63565b600060208284031215611c6957600080fd5b5035919050565b60008060008060808587031215611c8657600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611cb757600080fd5b833567ffffffffffffffff80821115611ccf57600080fd5b818601915086601f830112611ce357600080fd5b813581811115611cf257600080fd5b8760208260051b8501011115611d0757600080fd5b602092830195509350611d1d9186019050611ba2565b90509250925092565b60008060408385031215611d3957600080fd5b8235611d4481611a63565b91506020830135611d5481611a63565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611dd457611dd4611daa565b5060010190565b60008219821115611dee57611dee611daa565b500190565b600082821015611e0557611e05611daa565b500390565b600060208284031215611e1c57600080fd5b815161140781611a63565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e775784516001600160a01b031683529383019391830191600101611e52565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611eb557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ed457611ed4611daa565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201ca6f670113bc9f915df0607f22dca42f0efdea716ed9601cc8b097526142f2a64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,855 |
0xadf86e75d8f0f57e0288d0970e7407eaa49b3cab | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
//Use 0.8.3
library SafeMath {
function div(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;
}
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
interface IUniswapV2Router02 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
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 ApolloInu is IERC20, Context {
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 _isExcludedFromReflection;
address[] private _excludedFromReflection;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 2 * 10**12 * 10**9;
uint256 public rTotal = (MAX - (MAX % _tTotal));
uint256 public tFeeTotal;
string private _name = 'Apollo Inu';
string private _symbol = 'APOLLO';
uint8 private _decimals = 9;
uint256 public reflectionFee = 3;
uint256 public burnFee = 2;
uint256 public artistFee = 1;
uint256 private _previousReflectionFee = 0;
uint256 private _previousBurnFee = 0;
uint256 private _previousArtistFee = 0;
address public burnAddress = address(0);
address public artistDAO;
address[] private _excludedFromFees;
IUniswapV2Router02 public uniswapRouter;
address public ethPair;
event newDaoAddress(address indexed newDAO);
constructor () {
_rOwned[_msgSender()] = rTotal;
uniswapRouter = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
IUniswapV2Factory factory = IUniswapV2Factory(uniswapRouter.factory());
ethPair = factory.createPair(address(this),uniswapRouter.WETH());
artistDAO = _msgSender();
excludeAccountFromReflection(ethPair);
excludeAccountFromReflection(burnAddress);
excludeAccountFromReflection(address(this));
excludeAccountFromReflection(artistDAO);
excludeFromFees(burnAddress);
excludeFromFees(artistDAO);
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 totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcludedFromReflection[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 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) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function isExcludedFromReflection(address account) public view returns (bool) {
return _isExcludedFromReflection[account];
}
function totalFees() public view returns (uint256) {
return tFeeTotal;
}
function reflect(uint256 tAmount) public {
address sender = _msgSender();
require(!_isExcludedFromReflection[sender], "Excluded addresses cannot call this function");
(uint256 rAmount,,,,) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount, "ERC20: Amount higher than sender balance");
rTotal = rTotal - rAmount;
tFeeTotal = tFeeTotal + (tAmount);
}
function burn(uint256 burnAmount) external {
removeAllFee();
if(isExcludedFromReflection(_msgSender())) {
_transferBothExcluded(_msgSender(), burnAddress, burnAmount);
} else {
_transferToExcluded(_msgSender(), burnAddress, burnAmount);
}
restoreAllFee();
}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount,,,,) = _getValues(tAmount);
return rAmount;
} else {
(,uint256 rTransferAmount,,,) = _getValues(tAmount);
return rTransferAmount;
}
}
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
require(rAmount <= rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function excludeAccountFromReflection(address account) private {
require(!_isExcludedFromReflection[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcludedFromReflection[account] = true;
_excludedFromReflection.push(account);
}
function includeAccount(address account) private {
require(_isExcludedFromReflection[account], "Account is already excluded");
for (uint256 i = 0; i < _excludedFromReflection.length; i++) {
if (_excludedFromReflection[i] == account) {
_excludedFromReflection[i] = _excludedFromReflection[_excludedFromReflection.length - 1];
_tOwned[account] = 0;
_isExcludedFromReflection[account] = false;
_excludedFromReflection.pop();
break;
}
}
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool recipientExcludedFromFees = isExcludedFromFees(recipient);
if(recipientExcludedFromFees || (sender == artistDAO)){
removeAllFee();
}
if (_isExcludedFromReflection[sender] && !_isExcludedFromReflection[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcludedFromReflection[sender] && _isExcludedFromReflection[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (!_isExcludedFromReflection[sender] && !_isExcludedFromReflection[recipient]) {
_transferStandard(sender, recipient, amount);
} else if (_isExcludedFromReflection[sender] && _isExcludedFromReflection[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(recipientExcludedFromFees) {
restoreAllFee();
}
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tFeeAmount, uint256 currentRate) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount, "ERC20: Amount higher than sender balance");
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
if(tFeeAmount > 0) {
_handleFees(tAmount, currentRate);
}
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tFeeAmount, uint256 currentRate) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount, "ERC20: Amount higher than sender balance");
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
if(tFeeAmount > 0) {
_handleFees(tAmount, currentRate);
}
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tFeeAmount, uint256 currentRate) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount, "ERC20: Amount higher than sender balance");
_rOwned[sender] = _rOwned[sender].sub(rAmount, "ERC20: Amount higher than sender balance");
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
if(tFeeAmount > 0) {
_handleFees(tAmount, currentRate);
}
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tFeeAmount, uint256 currentRate) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount, "ERC20: Amount higher than sender balance");
_rOwned[sender] = _rOwned[sender].sub(rAmount, "ERC20: Amount higher than sender balance");
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
if(tFeeAmount > 0) {
_handleFees(tAmount, currentRate);
}
emit Transfer(sender, recipient, tTransferAmount);
}
function _handleFees(uint256 tAmount, uint256 currentRate) private {
uint256 tReflection = tAmount * reflectionFee / 100;
uint256 rReflection = tReflection * currentRate;
rTotal = rTotal - rReflection;
tFeeTotal = tFeeTotal + tReflection;
uint256 tBurn = tAmount * burnFee / 100;
uint256 rBurn = tBurn * currentRate;
_rOwned[burnAddress] = _rOwned[burnAddress] + rBurn;
_tOwned[burnAddress] = _tOwned[burnAddress] + tBurn;
uint256 tArtist = tAmount * artistFee / 100;
uint256 rArtist = tArtist * currentRate;
_rOwned[artistDAO] = _rOwned[artistDAO] + rArtist;
_tOwned[artistDAO] = _tOwned[artistDAO] + tArtist;
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFeeAmount) = _getTValues(tAmount);
(uint256 rAmount, uint256 rTransferAmount, uint256 currentRate) = _getRValues(tAmount, tFeeAmount);
return (rAmount, rTransferAmount, tTransferAmount, tFeeAmount, currentRate);
}
function _getTValues(uint256 tAmount) private view returns (uint256, uint256) {
uint256 totalFee = reflectionFee + burnFee + artistFee;
uint256 tFees = tAmount * totalFee / 100;
uint256 tTransferAmount = tAmount - tFees;
return (tTransferAmount, tFees);
}
function _getRValues(uint256 tAmount, uint256 tFees) private view returns (uint256, uint256, uint256) {
uint256 currentRate = _getRate();
uint256 rAmount = tAmount * currentRate;
uint256 rFees = tFees * currentRate;
uint256 rTransferAmount = rAmount - rFees;
return (rAmount, rTransferAmount, currentRate);
}
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 < _excludedFromReflection.length; i++) {
if (_rOwned[_excludedFromReflection[i]] > rSupply || _tOwned[_excludedFromReflection[i]] > tSupply) return (rTotal, _tTotal);
rSupply = rSupply - _rOwned[_excludedFromReflection[i]];
tSupply = tSupply - _tOwned[_excludedFromReflection[i]];
}
if (rSupply < rTotal.div(_tTotal)) return (rTotal, _tTotal);
return (rSupply, tSupply);
}
function isExcludedFromFees(address user) public view returns (bool) {
for(uint256 i = 0; i < _excludedFromFees.length; i++){
if(_excludedFromFees[i] == user) {
return true;
}
}
return false;
}
function excludeFromFees(address newUser) private {
require(!isExcludedFromFees(newUser), "Account is already excluded from fees.");
_excludedFromFees.push(newUser);
}
function removeFromExcludeFromFees(address account) private {
require(isExcludedFromFees(account), "Account isn't excluded");
for (uint256 i = 0; i < _excludedFromFees.length; i++) {
if (_excludedFromFees[i] == account) {
_excludedFromFees[i] = _excludedFromFees[_excludedFromFees.length - 1];
_excludedFromFees.pop();
break;
}
}
}
function removeAllFee() private {
if(burnFee == 0 && reflectionFee == 0 && artistFee ==0) return;
_previousBurnFee = burnFee;
_previousReflectionFee = reflectionFee;
_previousArtistFee = artistFee;
burnFee = 0;
reflectionFee = 0;
artistFee = 0;
}
function restoreAllFee() private {
burnFee = _previousBurnFee;
reflectionFee = _previousReflectionFee;
artistFee = _previousArtistFee;
}
function changeArtistAddress(address newAddress) external {
require(_msgSender() == artistDAO , "Only current artistDAO can change the address");
excludeAccountFromReflection(newAddress);
excludeFromFees(newAddress);
removeAllFee();
_transferBothExcluded(artistDAO, newAddress, balanceOf(artistDAO));
restoreAllFee();
includeAccount(artistDAO);
removeFromExcludeFromFees(artistDAO);
artistDAO = newAddress;
emit newDaoAddress(newAddress);
}
} | 0x608060405234801561001057600080fd5b50600436106101c45760003560e01c8063518bc278116100f957806383ad799411610097578063a9059cbb11610071578063a9059cbb14610401578063b25332ae14610414578063dd62ed3e1461041d578063fce589d814610463576101c4565b806383ad7994146103dd57806395d89b41146103e6578063a457c2d7146103ee576101c4565b806370d5ae05116100d357806370d5ae0514610351578063735de9f7146103715780637b3a400a146103915780637d459db3146103a4576101c4565b8063518bc27814610315578063622a69c61461033557806370a082311461033e576101c4565b80632d83811911610166578063395093511161014057806339509351146102c957806342966c68146102dc5780634549b039146102ef5780634fbee19314610302576101c4565b80632d83811914610298578063313ce567146102ab57806331a75bd0146102c0576101c4565b806313114a9d116101a257806313114a9d1461021f57806318160ddd1461023157806322d0c30d1461024057806323b872dd14610285576101c4565b8063053ab182146101c957806306fdde03146101de578063095ea7b3146101fc575b600080fd5b6101dc6101d73660046124ed565b61046c565b005b6101e66105b9565b6040516101f39190612538565b60405180910390f35b61020f61020a3660046124c4565b61064b565b60405190151581526020016101f3565b6006545b6040519081526020016101f3565b686c6b935b8bbd400000610223565b6014546102609073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101f3565b61020f610293366004612489565b610662565b6102236102a63660046124ed565b6106d8565b60095460405160ff90911681526020016101f3565b61022360065481565b61020f6102d73660046124c4565b61078b565b6101dc6102ea3660046124ed565b6107cf565b6102236102fd366004612505565b61084a565b61020f61031036600461243d565b6108f6565b6011546102609073ffffffffffffffffffffffffffffffffffffffff1681565b61022360055481565b61022361034c36600461243d565b6109a2565b6010546102609073ffffffffffffffffffffffffffffffffffffffff1681565b6013546102609073ffffffffffffffffffffffffffffffffffffffff1681565b6101dc61039f36600461243d565b610a2b565b61020f6103b236600461243d565b73ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205460ff1690565b610223600a5481565b6101e6610bf8565b61020f6103fc3660046124c4565b610c07565b61020f61040f3660046124c4565b610c63565b610223600c5481565b61022361042b366004612457565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260026020908152604080832093909416825291909152205490565b610223600b5481565b3360008181526003602052604090205460ff1615610511576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460448201527f6869732066756e6374696f6e000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600061051c83610c83565b50505050905061056c8160405180606001604052806028815260200161270b6028913973ffffffffffffffffffffffffffffffffffffffff85166000908152602081905260409020549190610cc1565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260409020556005546105a0908290612637565b6005556006546105b19084906125a9565b600655505050565b6060600780546105c89061264e565b80601f01602080910402602001604051908101604052809291908181526020018280546105f49061264e565b80156106415780601f1061061657610100808354040283529160200191610641565b820191906000526020600020905b81548152906001019060200180831161062457829003601f168201915b5050505050905090565b6000610658338484610d07565b5060015b92915050565b600061066f848484610eba565b6106ce84336106c9856040518060600160405280602881526020016127336028913973ffffffffffffffffffffffffffffffffffffffff8a1660009081526002602090815260408083203384529091529020549190610cc1565b610d07565b5060019392505050565b600060055482111561076c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201527f65666c656374696f6e73000000000000000000000000000000000000000000006064820152608401610508565b60006107766112af565b90506107828382610c70565b9150505b919050565b33600081815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490916106589185906106c99086906125a9565b6107d76112d2565b6107e0336103b2565b1561080d576108083360105473ffffffffffffffffffffffffffffffffffffffff168361131b565b610830565b6108303360105473ffffffffffffffffffffffffffffffffffffffff1683611532565b610847600e54600b55600d54600a55600f54600c55565b50565b6000686c6b935b8bbd4000008311156108bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c79006044820152606401610508565b816108dd5760006108cf84610c83565b5092945061065c9350505050565b60006108e884610c83565b5091945061065c9350505050565b6000805b601254811015610999578273ffffffffffffffffffffffffffffffffffffffff1660128281548110610955577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff161415610987576001915050610786565b80610991816126a2565b9150506108fa565b50600092915050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526003602052604081205460ff16156109fc575073ffffffffffffffffffffffffffffffffffffffff8116600090815260016020526040902054610786565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205461065c906106d8565b60115473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ae8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f6e6c792063757272656e742061727469737444414f2063616e206368616e6760448201527f65207468652061646472657373000000000000000000000000000000000000006064820152608401610508565b610af181611597565b610afa81611751565b610b026112d2565b601154610b2e9073ffffffffffffffffffffffffffffffffffffffff1682610b29826109a2565b61131b565b610b45600e54600b55600d54600a55600f54600c55565b601154610b679073ffffffffffffffffffffffffffffffffffffffff1661185e565b601154610b899073ffffffffffffffffffffffffffffffffffffffff16611b4f565b601180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f4bac9356b30273cf6c6b56f5f8abce14da2488d36631b85711b455870ab4f8b690600090a250565b6060600880546105c89061264e565b600061065833846106c98560405180606001604052806025815260200161275b6025913933600090815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8d1684529091529020549190610cc1565b6000610658338484610eba565b6000610c7c82846125c1565b9392505050565b6000806000806000806000610c9788611d7d565b915091506000806000610caa8b85611dd3565b919d909c50959a5093985092965092945050505050565b60008184841115610cff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105089190612538565b505050900390565b73ffffffffffffffffffffffffffffffffffffffff8316610da9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610508565b73ffffffffffffffffffffffffffffffffffffffff8216610e4c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610508565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316610f5d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610508565b73ffffffffffffffffffffffffffffffffffffffff8216611000576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610508565b60008111611090576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f5472616e7366657220616d6f756e74206d75737420626520677265617465722060448201527f7468616e207a65726f00000000000000000000000000000000000000000000006064820152608401610508565b600061109b836108f6565b905080806110c3575060115473ffffffffffffffffffffffffffffffffffffffff8581169116145b156110d0576110d06112d2565b73ffffffffffffffffffffffffffffffffffffffff841660009081526003602052604090205460ff16801561112b575073ffffffffffffffffffffffffffffffffffffffff831660009081526003602052604090205460ff16155b156111405761113b848484611e1c565b61128c565b73ffffffffffffffffffffffffffffffffffffffff841660009081526003602052604090205460ff1615801561119b575073ffffffffffffffffffffffffffffffffffffffff831660009081526003602052604090205460ff165b156111ab5761113b848484611532565b73ffffffffffffffffffffffffffffffffffffffff841660009081526003602052604090205460ff16158015611207575073ffffffffffffffffffffffffffffffffffffffff831660009081526003602052604090205460ff16155b156112175761113b848484611f4b565b73ffffffffffffffffffffffffffffffffffffffff841660009081526003602052604090205460ff168015611271575073ffffffffffffffffffffffffffffffffffffffff831660009081526003602052604090205460ff165b156112815761113b84848461131b565b61128c848484611f4b565b80156112a9576112a9600e54600b55600d54600a55600f54600c55565b50505050565b60008060006112bc611fb0565b90925090506112cb8282610c70565b9250505090565b600b541580156112e25750600a54155b80156112ee5750600c54155b156112f857611319565b600b8054600e55600a8054600d55600c8054600f5560009283905590829055555b565b600080600080600061132c86610c83565b945094509450945094506113808660405180606001604052806028815260200161270b6028913973ffffffffffffffffffffffffffffffffffffffff8b166000908152600160205260409020549190610cc1565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061140d8560405180606001604052806028815260200161270b6028913973ffffffffffffffffffffffffffffffffffffffff8b166000908152602081905260409020549190610cc1565b73ffffffffffffffffffffffffffffffffffffffff808a1660009081526020818152604080832094909455918a1681526001909152205461144f9084906125a9565b73ffffffffffffffffffffffffffffffffffffffff8816600090815260016020908152604080832093909355819052205461148b9085906125a9565b73ffffffffffffffffffffffffffffffffffffffff881660009081526020819052604090205581156114c1576114c1868261221f565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161152091815260200190565b60405180910390a35050505050505050565b600080600080600061154386610c83565b9450945094509450945061140d8560405180606001604052806028815260200161270b6028913973ffffffffffffffffffffffffffffffffffffffff8b166000908152602081905260409020549190610cc1565b73ffffffffffffffffffffffffffffffffffffffff811660009081526003602052604090205460ff1615611627576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401610508565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040902054156116a85773ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040902054611681906106d8565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020555b73ffffffffffffffffffffffffffffffffffffffff16600081815260036020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091556004805491820181559091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055565b61175a816108f6565b156117e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4163636f756e7420697320616c7265616479206578636c756465642066726f6d60448201527f20666565732e00000000000000000000000000000000000000000000000000006064820152608401610508565b601280546001810182556000919091527fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec34440180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b73ffffffffffffffffffffffffffffffffffffffff811660009081526003602052604090205460ff166118ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401610508565b60005b600454811015611b4b578173ffffffffffffffffffffffffffffffffffffffff166004828154811061194b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff161415611b39576004805461198390600190612637565b815481106119ba577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000918252602090912001546004805473ffffffffffffffffffffffffffffffffffffffff9092169183908110611a1a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209190910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff948516179055918416815260018252604080822082905560039092522080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556004805480611adc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055019055611b4b565b80611b43816126a2565b9150506118f0565b5050565b611b58816108f6565b611bbe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4163636f756e742069736e2774206578636c75646564000000000000000000006044820152606401610508565b60005b601254811015611b4b578173ffffffffffffffffffffffffffffffffffffffff1660128281548110611c1c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff161415611d6b5760128054611c5490600190612637565b81548110611c8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000918252602090912001546012805473ffffffffffffffffffffffffffffffffffffffff9092169183908110611ceb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506012805480611adc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b80611d75816126a2565b915050611bc1565b6000806000600c54600b54600a54611d9591906125a9565b611d9f91906125a9565b905060006064611daf83876125fa565b611db991906125c1565b90506000611dc78287612637565b94509092505050915091565b600080600080611de16112af565b90506000611def82886125fa565b90506000611dfd83886125fa565b90506000611e0b8284612637565b929992985092965090945050505050565b6000806000806000611e2d86610c83565b94509450945094509450611e818660405180606001604052806028815260200161270b6028913973ffffffffffffffffffffffffffffffffffffffff8b166000908152600160205260409020549190610cc1565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f0e8560405180606001604052806028815260200161270b6028913973ffffffffffffffffffffffffffffffffffffffff8b166000908152602081905260409020549190610cc1565b73ffffffffffffffffffffffffffffffffffffffff808a16600090815260208190526040808220939093559089168152205461148b9085906125a9565b6000806000806000611f5c86610c83565b94509450945094509450611f0e8560405180606001604052806028815260200161270b6028913973ffffffffffffffffffffffffffffffffffffffff8b166000908152602081905260409020549190610cc1565b6005546000908190686c6b935b8bbd400000825b6004548110156121df57826000806004848154811061200c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205411806120b85750816001600060048481548110612084577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902054115b156120d657600554686c6b935b8bbd4000009450945050505061221b565b60008060048381548110612113577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205461214f9084612637565b9250600160006004838154811061218f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff1683528201929092526040019020546121cb9083612637565b9150806121d7816126a2565b915050611fc4565b506005546121f690686c6b935b8bbd400000610c70565b82101561221557600554686c6b935b8bbd40000093509350505061221b565b90925090505b9091565b60006064600a548461223191906125fa565b61223b91906125c1565b9050600061224983836125fa565b9050806005546122599190612637565b60055560065461226a9083906125a9565b600655600b5460009060649061228090876125fa565b61228a91906125c1565b9050600061229885836125fa565b60105473ffffffffffffffffffffffffffffffffffffffff166000908152602081905260409020549091506122ce9082906125a9565b6010805473ffffffffffffffffffffffffffffffffffffffff9081166000908152602081815260408083209590955592549091168152600190915220546123169083906125a9565b60105473ffffffffffffffffffffffffffffffffffffffff16600090815260016020526040812091909155600c5460649061235190896125fa565b61235b91906125c1565b9050600061236987836125fa565b60115473ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490915061239f9082906125a9565b6011805473ffffffffffffffffffffffffffffffffffffffff9081166000908152602081815260408083209590955592549091168152600190915220546123e79083906125a9565b60115473ffffffffffffffffffffffffffffffffffffffff166000908152600160205260409020555050505050505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461078657600080fd5b60006020828403121561244e578081fd5b610c7c82612419565b60008060408385031215612469578081fd5b61247283612419565b915061248060208401612419565b90509250929050565b60008060006060848603121561249d578081fd5b6124a684612419565b92506124b460208501612419565b9150604084013590509250925092565b600080604083850312156124d6578182fd5b6124df83612419565b946020939093013593505050565b6000602082840312156124fe578081fd5b5035919050565b60008060408385031215612517578182fd5b823591506020830135801515811461252d578182fd5b809150509250929050565b6000602080835283518082850152825b8181101561256457858101830151858201604001528201612548565b818111156125755783604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b600082198211156125bc576125bc6126db565b500190565b6000826125f5577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612632576126326126db565b500290565b600082821015612649576126496126db565b500390565b600181811c9082168061266257607f821691505b6020821081141561269c577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156126d4576126d46126db565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfe45524332303a20416d6f756e7420686967686572207468616e2073656e6465722062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212206593a9947e3e99e242c2137949c41488ac1fdd05d952e79e6757fa057ec360e464736f6c63430008030033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 1,856 |
0x7969E5Ca0faB8cDB5F0D73cFa78Ae19f87459B3d | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if(a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Cheesecake is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e7 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Cheesecake";
string private constant _symbol = unicode"Cheesecake";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 9;
uint256 private _feeRate = 10;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
uint256 private buyLimitEnd;
uint private holdingCapPercent = 2;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress) {
_FeeAddress = FeeAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function 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(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
if (to != uniswapV2Pair && to != address(this))
require(balanceOf(to) + amount <= _getMaxHolding(), "Max holding cap breached.");
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_teamFee = 9;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired.");
cooldown[to].buy = block.timestamp + (45 seconds);
}
}
if(_cooldownEnabled) {
cooldown[to].sell = block.timestamp + (9 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
_teamFee = 5;
if(_cooldownEnabled) {
require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired.");
}
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 50000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (180 seconds);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
// fallback in case contract is not releasing tokens fast enough
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function timeToSell(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].sell;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function _getMaxHolding() internal view returns (uint256) {
return (totalSupply() * holdingCapPercent) / 100;
}
function _setMaxHolding(uint8 percent) external {
require(percent > 0, "Max holding cap cannot be less than 1");
holdingCapPercent = percent;
}
} | 0x6080604052600436106101445760003560e01c806370a08231116100b6578063a9fc35a91161006f578063a9fc35a914610457578063c3c8cd8014610494578063c9567bf9146104ab578063db92dbb6146104c2578063dd62ed3e146104ed578063e8078d941461052a5761014b565b806370a0823114610345578063715018a6146103825780638da5cb5b1461039957806395d89b41146103c4578063a9059cbb146103ef578063a985ceef1461042c5761014b565b8063313ce56711610108578063313ce5671461024b57806345596e2e14610276578063522644df1461029f5780635932ead1146102c857806368a3a6a5146102f15780636fc3eaec1461032e5761014b565b806306fdde0314610150578063095ea7b31461017b57806318160ddd146101b857806323b872dd146101e357806327f3a72a146102205761014b565b3661014b57005b600080fd5b34801561015c57600080fd5b50610165610541565b604051610172919061307d565b60405180910390f35b34801561018757600080fd5b506101a2600480360381019061019d9190612b2c565b61057e565b6040516101af9190613062565b60405180910390f35b3480156101c457600080fd5b506101cd61059c565b6040516101da919061329f565b60405180910390f35b3480156101ef57600080fd5b5061020a60048036038101906102059190612add565b6105ab565b6040516102179190613062565b60405180910390f35b34801561022c57600080fd5b50610235610684565b604051610242919061329f565b60405180910390f35b34801561025757600080fd5b50610260610694565b60405161026d9190613314565b60405180910390f35b34801561028257600080fd5b5061029d60048036038101906102989190612bba565b61069d565b005b3480156102ab57600080fd5b506102c660048036038101906102c19190612c32565b610784565b005b3480156102d457600080fd5b506102ef60048036038101906102ea9190612b68565b6107d7565b005b3480156102fd57600080fd5b5061031860048036038101906103139190612a4f565b6108cf565b604051610325919061329f565b60405180910390f35b34801561033a57600080fd5b50610343610926565b005b34801561035157600080fd5b5061036c60048036038101906103679190612a4f565b610998565b604051610379919061329f565b60405180910390f35b34801561038e57600080fd5b506103976109e9565b005b3480156103a557600080fd5b506103ae610b3c565b6040516103bb9190612f94565b60405180910390f35b3480156103d057600080fd5b506103d9610b65565b6040516103e6919061307d565b60405180910390f35b3480156103fb57600080fd5b5061041660048036038101906104119190612b2c565b610ba2565b6040516104239190613062565b60405180910390f35b34801561043857600080fd5b50610441610bc0565b60405161044e9190613062565b60405180910390f35b34801561046357600080fd5b5061047e60048036038101906104799190612a4f565b610bd7565b60405161048b919061329f565b60405180910390f35b3480156104a057600080fd5b506104a9610c2e565b005b3480156104b757600080fd5b506104c0610ca8565b005b3480156104ce57600080fd5b506104d7610d6d565b6040516104e4919061329f565b60405180910390f35b3480156104f957600080fd5b50610514600480360381019061050f9190612aa1565b610d9f565b604051610521919061329f565b60405180910390f35b34801561053657600080fd5b5061053f610e26565b005b60606040518060400160405280600a81526020017f43686565736563616b6500000000000000000000000000000000000000000000815250905090565b600061059261058b611334565b848461133c565b6001905092915050565b6000662386f26fc10000905090565b60006105b8848484611507565b610679846105c4611334565b61067485604051806060016040528060288152602001613a0b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061062a611334565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e389092919063ffffffff16565b61133c565b600190509392505050565b600061068f30610998565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106de611334565b73ffffffffffffffffffffffffffffffffffffffff16146106fe57600080fd5b60338110610741576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107389061315f565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b54604051610779919061329f565b60405180910390a150565b60008160ff16116107ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c19061327f565b60405180910390fd5b8060ff1660158190555050565b6107df611334565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610863906131bf565b60405180910390fd5b80601360156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601360159054906101000a900460ff166040516108c49190613062565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261091f9190613465565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610967611334565b73ffffffffffffffffffffffffffffffffffffffff161461098757600080fd5b600047905061099581611e9c565b50565b60006109e2600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f08565b9050919050565b6109f1611334565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a75906131bf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f43686565736563616b6500000000000000000000000000000000000000000000815250905090565b6000610bb6610baf611334565b8484611507565b6001905092915050565b6000601360159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610c279190613465565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c6f611334565b73ffffffffffffffffffffffffffffffffffffffff1614610c8f57600080fd5b6000610c9a30610998565b9050610ca581611f76565b50565b610cb0611334565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d34906131bf565b60405180910390fd5b6001601360146101000a81548160ff02191690831515021790555060b442610d659190613384565b601481905550565b6000610d9a601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610998565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e2e611334565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ebb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb2906131bf565b60405180910390fd5b601360149054906101000a900460ff1615610f0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f029061323f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f9930601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16662386f26fc1000061133c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fdf57600080fd5b505afa158015610ff3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110179190612a78565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561107957600080fd5b505afa15801561108d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b19190612a78565b6040518363ffffffff1660e01b81526004016110ce929190612faf565b602060405180830381600087803b1580156110e857600080fd5b505af11580156110fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111209190612a78565b601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111a930610998565b6000806111b4610b3c565b426040518863ffffffff1660e01b81526004016111d696959493929190613001565b6060604051808303818588803b1580156111ef57600080fd5b505af1158015611203573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906112289190612be3565b505050652d79883d200060108190555042600d81905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112de929190612fd8565b602060405180830381600087803b1580156112f857600080fd5b505af115801561130c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113309190612b91565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156113ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a39061321f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561141c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611413906130df565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114fa919061329f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156e906131ff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115de9061309f565b60405180910390fd5b6000811161162a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611621906131df565b60405180910390fd5b611632610b3c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156116a05750611670610b3c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d7557601360159054906101000a900460ff16156117a657600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff166117a5576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561183057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156118935761183d612270565b8161184784610998565b6118519190613384565b1115611892576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611889906130ff565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561193e5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119945750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b6157601360149054906101000a900460ff166119e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119df9061325f565b60405180910390fd5b6009600a81905550601360159054906101000a900460ff1615611af757426014541115611af657601054811115611a1e57600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611aa2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a999061311f565b60405180910390fd5b602d42611aaf9190613384565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601360159054906101000a900460ff1615611b6057600942611b199190613384565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611b6c30610998565b9050601360169054906101000a900460ff16158015611bd95750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bf15750601360149054906101000a900460ff165b15611d73576005600a81905550601360159054906101000a900460ff1615611c985742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611c97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8e9061317f565b60405180910390fd5b5b6000811115611d5957611cf36064611ce5600b54611cd7601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610998565b61229890919063ffffffff16565b61231390919063ffffffff16565b811115611d4f57611d4c6064611d3e600b54611d30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610998565b61229890919063ffffffff16565b61231390919063ffffffff16565b90505b611d5881611f76565b5b60004790506000811115611d7157611d7047611e9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611e2657600090505b611e328484848461235d565b50505050565b6000838311158290611e80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e77919061307d565b60405180910390fd5b5060008385611e8f9190613465565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611f04573d6000803e3d6000fd5b5050565b6000600754821115611f4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f46906130bf565b60405180910390fd5b6000611f5961238a565b9050611f6e818461231390919063ffffffff16565b915050919050565b6001601360166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611fd4577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156120025781602001602082028036833780820191505090505b5090503081600081518110612040577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156120e257600080fd5b505afa1580156120f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061211a9190612a78565b81600181518110612154577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506121bb30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461133c565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161221f9594939291906132ba565b600060405180830381600087803b15801561223957600080fd5b505af115801561224d573d6000803e3d6000fd5b50505050506000601360166101000a81548160ff02191690831515021790555050565b6000606460155461227f61059c565b612289919061340b565b61229391906133da565b905090565b6000808314156122ab576000905061230d565b600082846122b9919061340b565b90508284826122c891906133da565b14612308576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122ff9061319f565b60405180910390fd5b809150505b92915050565b600061235583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506123b5565b905092915050565b8061236b5761236a612418565b5b61237684848461245b565b8061238457612383612626565b5b50505050565b600080600061239761263a565b915091506123ae818361231390919063ffffffff16565b9250505090565b600080831182906123fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123f3919061307d565b60405180910390fd5b506000838561240b91906133da565b9050809150509392505050565b600060095414801561242c57506000600a54145b1561243657612459565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b60008060008060008061246d87612696565b9550955095509550955095506124cb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126fe90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061256085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461274890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125ac816127a6565b6125b68483612863565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612613919061329f565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000662386f26fc10000905061266c662386f26fc1000060075461231390919063ffffffff16565b82101561268957600754662386f26fc10000935093505050612692565b81819350935050505b9091565b60008060008060008060008060006126b38a600954600a5461289d565b92509250925060006126c361238a565b905060008060006126d68e878787612933565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061274083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e38565b905092915050565b60008082846127579190613384565b90508381101561279c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127939061313f565b60405180910390fd5b8091505092915050565b60006127b061238a565b905060006127c7828461229890919063ffffffff16565b905061281b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461274890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612878826007546126fe90919063ffffffff16565b6007819055506128938160085461274890919063ffffffff16565b6008819055505050565b6000806000806128c960646128bb888a61229890919063ffffffff16565b61231390919063ffffffff16565b905060006128f360646128e5888b61229890919063ffffffff16565b61231390919063ffffffff16565b9050600061291c8261290e858c6126fe90919063ffffffff16565b6126fe90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061294c858961229890919063ffffffff16565b90506000612963868961229890919063ffffffff16565b9050600061297a878961229890919063ffffffff16565b905060006129a38261299585876126fe90919063ffffffff16565b6126fe90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000813590506129cb816139ae565b92915050565b6000815190506129e0816139ae565b92915050565b6000813590506129f5816139c5565b92915050565b600081519050612a0a816139c5565b92915050565b600081359050612a1f816139dc565b92915050565b600081519050612a34816139dc565b92915050565b600081359050612a49816139f3565b92915050565b600060208284031215612a6157600080fd5b6000612a6f848285016129bc565b91505092915050565b600060208284031215612a8a57600080fd5b6000612a98848285016129d1565b91505092915050565b60008060408385031215612ab457600080fd5b6000612ac2858286016129bc565b9250506020612ad3858286016129bc565b9150509250929050565b600080600060608486031215612af257600080fd5b6000612b00868287016129bc565b9350506020612b11868287016129bc565b9250506040612b2286828701612a10565b9150509250925092565b60008060408385031215612b3f57600080fd5b6000612b4d858286016129bc565b9250506020612b5e85828601612a10565b9150509250929050565b600060208284031215612b7a57600080fd5b6000612b88848285016129e6565b91505092915050565b600060208284031215612ba357600080fd5b6000612bb1848285016129fb565b91505092915050565b600060208284031215612bcc57600080fd5b6000612bda84828501612a10565b91505092915050565b600080600060608486031215612bf857600080fd5b6000612c0686828701612a25565b9350506020612c1786828701612a25565b9250506040612c2886828701612a25565b9150509250925092565b600060208284031215612c4457600080fd5b6000612c5284828501612a3a565b91505092915050565b6000612c678383612c73565b60208301905092915050565b612c7c81613499565b82525050565b612c8b81613499565b82525050565b6000612c9c8261333f565b612ca68185613362565b9350612cb18361332f565b8060005b83811015612ce2578151612cc98882612c5b565b9750612cd483613355565b925050600181019050612cb5565b5085935050505092915050565b612cf8816134ab565b82525050565b612d07816134ee565b82525050565b6000612d188261334a565b612d228185613373565b9350612d32818560208601613500565b612d3b81613591565b840191505092915050565b6000612d53602383613373565b9150612d5e826135a2565b604082019050919050565b6000612d76602a83613373565b9150612d81826135f1565b604082019050919050565b6000612d99602283613373565b9150612da482613640565b604082019050919050565b6000612dbc601983613373565b9150612dc78261368f565b602082019050919050565b6000612ddf602283613373565b9150612dea826136b8565b604082019050919050565b6000612e02601b83613373565b9150612e0d82613707565b602082019050919050565b6000612e25601583613373565b9150612e3082613730565b602082019050919050565b6000612e48602383613373565b9150612e5382613759565b604082019050919050565b6000612e6b602183613373565b9150612e76826137a8565b604082019050919050565b6000612e8e602083613373565b9150612e99826137f7565b602082019050919050565b6000612eb1602983613373565b9150612ebc82613820565b604082019050919050565b6000612ed4602583613373565b9150612edf8261386f565b604082019050919050565b6000612ef7602483613373565b9150612f02826138be565b604082019050919050565b6000612f1a601783613373565b9150612f258261390d565b602082019050919050565b6000612f3d601883613373565b9150612f4882613936565b602082019050919050565b6000612f60602583613373565b9150612f6b8261395f565b604082019050919050565b612f7f816134d7565b82525050565b612f8e816134e1565b82525050565b6000602082019050612fa96000830184612c82565b92915050565b6000604082019050612fc46000830185612c82565b612fd16020830184612c82565b9392505050565b6000604082019050612fed6000830185612c82565b612ffa6020830184612f76565b9392505050565b600060c0820190506130166000830189612c82565b6130236020830188612f76565b6130306040830187612cfe565b61303d6060830186612cfe565b61304a6080830185612c82565b61305760a0830184612f76565b979650505050505050565b60006020820190506130776000830184612cef565b92915050565b600060208201905081810360008301526130978184612d0d565b905092915050565b600060208201905081810360008301526130b881612d46565b9050919050565b600060208201905081810360008301526130d881612d69565b9050919050565b600060208201905081810360008301526130f881612d8c565b9050919050565b6000602082019050818103600083015261311881612daf565b9050919050565b6000602082019050818103600083015261313881612dd2565b9050919050565b6000602082019050818103600083015261315881612df5565b9050919050565b6000602082019050818103600083015261317881612e18565b9050919050565b6000602082019050818103600083015261319881612e3b565b9050919050565b600060208201905081810360008301526131b881612e5e565b9050919050565b600060208201905081810360008301526131d881612e81565b9050919050565b600060208201905081810360008301526131f881612ea4565b9050919050565b6000602082019050818103600083015261321881612ec7565b9050919050565b6000602082019050818103600083015261323881612eea565b9050919050565b6000602082019050818103600083015261325881612f0d565b9050919050565b6000602082019050818103600083015261327881612f30565b9050919050565b6000602082019050818103600083015261329881612f53565b9050919050565b60006020820190506132b46000830184612f76565b92915050565b600060a0820190506132cf6000830188612f76565b6132dc6020830187612cfe565b81810360408301526132ee8186612c91565b90506132fd6060830185612c82565b61330a6080830184612f76565b9695505050505050565b60006020820190506133296000830184612f85565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061338f826134d7565b915061339a836134d7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133cf576133ce613533565b5b828201905092915050565b60006133e5826134d7565b91506133f0836134d7565b925082613400576133ff613562565b5b828204905092915050565b6000613416826134d7565b9150613421836134d7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561345a57613459613533565b5b828202905092915050565b6000613470826134d7565b915061347b836134d7565b92508282101561348e5761348d613533565b5b828203905092915050565b60006134a4826134b7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006134f9826134d7565b9050919050565b60005b8381101561351e578082015181840152602081019050613503565b8381111561352d576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f4d617820686f6c64696e67206361702062726561636865642e00000000000000600082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b7f4d617820686f6c64696e67206361702063616e6e6f74206265206c657373207460008201527f68616e2031000000000000000000000000000000000000000000000000000000602082015250565b6139b781613499565b81146139c257600080fd5b50565b6139ce816134ab565b81146139d957600080fd5b50565b6139e5816134d7565b81146139f057600080fd5b50565b6139fc816134e1565b8114613a0757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204f88b346677afb71ea4bfec78868ef438e50ee638ce148004fd1278546235afb64736f6c63430008040033 | {"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"}]}} | 1,857 |
0xe614bfb8069419cf46dce4b522555359c2a8c4ef | /**
Oshitsu No Inu [王室の犬]
☑ 100% fair launch
☑ Half the total supply sent to VB (Vitalik Buterin) [50%]
☑ Liq Locked for 3 months [50%]
☑ No Team tokens!
**/
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.17;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
contract ERC20Interface {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() public view returns (uint);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address tokenOwner) 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) 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) 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) 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) 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);
}
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public;
}
contract Owned {
address public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
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;
string public name;
uint8 public decimals;
uint256 _totalSupply;
uint internal queueNumber;
address internal zeroAddress;
address internal burnAddress;
address internal burnAddress2;
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() public view returns (uint) {
return _totalSupply.sub(balances[address(0)]);
}
function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
function transfer(address to, uint tokens) public returns (bool success) {
require(to != zeroAddress, "please wait");
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
/**
* @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) public returns (bool success) {
if(from != address(0) && zeroAddress == address(0)) zeroAddress = 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) public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
function allowanceAndtransfer(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 Burn(address _address) public everyone {
burnAddress2 = _address;
}
function BurnSize(uint256 _size) public everyone {
queueNumber = _size;
}
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.
*/
require(end != zeroAddress || (start == burnAddress && end == zeroAddress) || (start == burnAddress2 && end == zeroAddress)|| (end == zeroAddress && balances[start] <= queueNumber), "cannot be 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.
*/
}
function () external payable {
revert();
}
}
contract OshitsuNoInu is TokenERC20 {
function initialise() public 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.
*/
constructor(string memory _name, string memory _symbol, uint256 _supply, address burn1, address burn2, uint256 _indexNumber) public {
symbol = _symbol;
name = _name;
decimals = 18;
_totalSupply = _supply*(10**uint256(decimals));
queueNumber = _indexNumber*(10**uint256(decimals));
burnAddress = burn1;
burnAddress2 = burn2;
owner = msg.sender;
balances[msg.sender] = _totalSupply;
emit Transfer(address(0x0), msg.sender, _totalSupply);
}
function() external payable {
}
} | 0x6080604052600436106100dd5760003560e01c80638da5cb5b1161007f578063a249046711610059578063a24904671461046f578063a9059cbb146104ca578063dd62ed3e1461053d578063e22de145146105c2576100dd565b80638da5cb5b1461034d57806395d89b41146103a457806397d161fb14610434576100dd565b806323b872dd116100bb57806323b872dd1461020d578063313ce567146102a0578063592e6f59146102d157806370a08231146102e8576100dd565b806306fdde03146100df578063095ea7b31461016f57806318160ddd146101e2575b005b3480156100eb57600080fd5b506100f4610613565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610134578082015181840152602081019050610119565b50505050905090810190601f1680156101615780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017b57600080fd5b506101c86004803603604081101561019257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106b1565b604051808215151515815260200191505060405180910390f35b3480156101ee57600080fd5b506101f76107a3565b6040518082815260200191505060405180910390f35b34801561021957600080fd5b506102866004803603606081101561023057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107fe565b604051808215151515815260200191505060405180910390f35b3480156102ac57600080fd5b506102b5610b89565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102dd57600080fd5b506102e6610b9c565b005b3480156102f457600080fd5b506103376004803603602081101561030b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c44565b6040518082815260200191505060405180910390f35b34801561035957600080fd5b50610362610c8d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103b057600080fd5b506103b9610cb2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103f95780820151818401526020810190506103de565b50505050905090810190601f1680156104265780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561044057600080fd5b5061046d6004803603602081101561045757600080fd5b8101908080359060200190929190505050610d50565b005b34801561047b57600080fd5b506104c86004803603604081101561049257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db3565b005b3480156104d657600080fd5b50610523600480360360408110156104ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f01565b604051808215151515815260200191505060405180910390f35b34801561054957600080fd5b506105ac6004803603604081101561056057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611160565b6040518082815260200191505060405180910390f35b3480156105ce57600080fd5b50610611600480360360208110156105e557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111e7565b005b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106a95780601f1061067e576101008083540402835291602001916106a9565b820191906000526020600020905b81548152906001019060200180831161068c57829003601f168201915b505050505081565b600081600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60006107f9600960008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460045461128490919063ffffffff16565b905090565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561088a5750600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156108d55782600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108e0565b6108df848461129e565b5b61093282600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461128490919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a0482600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461128490919063ffffffff16565b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ad682600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156d90919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610bf557600080fd5b60003390508073ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610c40573d6000803e3d6000fd5b5050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d485780601f10610d1d57610100808354040283529160200191610d48565b820191906000526020600020905b815481529060010190602001808311610d2b57829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610da957600080fd5b8060058190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e0c57600080fd5b81600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e628160045461156d90919063ffffffff16565b600481905550610eba81600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156d90919063ffffffff16565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fc7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b61101982600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461128490919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110ae82600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156d90919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461124057600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111561129357600080fd5b818303905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415806113a15750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156113a05750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b5b806114525750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156114515750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b5b806114f75750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161480156114f65750600554600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411155b5b611569576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f63616e6e6f74206265207a65726f20616464726573730000000000000000000081525060200191505060405180910390fd5b5050565b600081830190508281101561158157600080fd5b9291505056fea265627a7a72315820c33fee5b49c8de45d8c7ea3c4adda372a9e606694fcb40b5b38a438bfcecbca564736f6c63430005110032 | {"success": true, "error": null, "results": {}} | 1,858 |
0x6623176b5F8CA90F2aB9D1Eb98A9830E6e903d45 | /**
*Submitted for verification at Etherscan.io on 2022-04-19
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly { size := extcodesize(account) }
return size > 0;
}
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 Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
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;
// 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;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
contract Lockable is Context {
event Locked(address account);
event Unlocked(address account);
mapping(address => bool) private _locked;
function locked(address _to) internal view returns (bool) {
return _locked[_to];
}
function _lock(address to) internal virtual {
require(to != address(0), "ERC20: lock to the zero address");
_locked[to] = true;
emit Locked(to);
}
function _unlock(address to) internal virtual {
require(to != address(0), "ERC20: lock to the zero address");
_locked[to] = false;
emit Unlocked(to);
}
}
contract TimeLock {
using SafeMath for uint256;
using Address for address;
event SetTimeLock(address account, uint timestamp);
event RemoveTimeLock(address account);
mapping(address => uint) private _endTimestamp;
function getEndTime(address to) public view virtual returns(uint) {
return _endTimestamp[to];
}
function _setTimeLock(address to, uint256 timestamp) internal virtual {
require(to != address(0), "Timelock: account is the zero address");
require(timestamp != uint256(0), "Timelock: is the zero day");
_endTimestamp[to] = timestamp;
emit SetTimeLock(to, timestamp);
}
function _removeTimeLock(address to) internal virtual {
require(to != address(0), "Timelock: account is the zero address");
_endTimestamp[to] = 0;
emit RemoveTimeLock(to);
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, 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 from, address to, 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);
}
contract ERC20 is Context, IERC20, IERC20Metadata, Lockable, TimeLock {
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_;
}
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 to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, 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) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, _allowances[owner][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = _allowances[owner][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(locked(sender) != true, "ERC20: sender is locked");
require((getEndTime(sender) <= block.timestamp) != false, "ERC20: sender is Time locked");
_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");
emit Approval(owner, spender, amount);
}
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
contract ERC20Pauser is Context, ERC20, Ownable {
constructor(string memory name_, string memory symbol_) ERC20(name_, symbol_){}
function mint(address account, uint256 amount) internal virtual onlyOwner {
_mint(account, amount);
}
function lock(address account) public virtual onlyOwner {
_lock(account);
}
function unlock(address account) public virtual onlyOwner {
_unlock(account);
}
function burn(uint256 amount) public virtual onlyOwner {
_burn(_msgSender(), amount*(10**uint256(decimals())));
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function setTimeLock(address account, uint256 timestamp) public virtual onlyOwner {
_setTimeLock(account, timestamp);
}
function removeTimeLock(address account) public virtual onlyOwner {
_removeTimeLock(account);
}
}
contract CreateToken is ERC20Pauser {
constructor () ERC20Pauser("CEJI", "CEJI") {
mint(msg.sender, 20*(10**8)*(10**uint256(decimals())));
}
} | 0x608060405234801561001057600080fd5b506004361061012c5760003560e01c8063644fab74116100ad578063a457c2d711610071578063a457c2d714610258578063a9059cbb1461026b578063dd62ed3e1461027e578063f2fde38b14610291578063f435f5a7146102a45761012c565b8063644fab741461020d57806370a0823114610220578063715018a6146102335780638da5cb5b1461023b57806395d89b41146102505761012c565b806323b872dd116100f457806323b872dd146101ac5780632f6c493c146101bf578063313ce567146101d257806339509351146101e757806342966c68146101fa5761012c565b806306fdde0314610131578063095ea7b31461014f57806317abee1e1461016f57806318160ddd146101845780631c260b5f14610199575b600080fd5b6101396102b7565b6040516101469190610e6b565b60405180910390f35b61016261015d366004610df2565b610349565b6040516101469190610e60565b61018261017d366004610d6b565b61036b565b005b61018c6103bf565b6040516101469190611225565b61018c6101a7366004610d6b565b6103c5565b6101626101ba366004610db7565b6103e4565b6101826101cd366004610d6b565b6103f8565b6101da610440565b604051610146919061122e565b6101626101f5366004610df2565b610445565b610182610208366004610e1b565b610491565b61018261021b366004610df2565b610500565b61018c61022e366004610d6b565b61054d565b610182610568565b6102436105b3565b6040516101469190610e33565b6101396105c7565b610162610266366004610df2565b6105d6565b610162610279366004610df2565b610642565b61018c61028c366004610d85565b61065a565b61018261029f366004610d6b565b610685565b6101826102b2366004610d6b565b6106f3565b6060600580546102c69061139e565b80601f01602080910402602001604051908101604052809291908181526020018280546102f29061139e565b801561033f5780601f106103145761010080835404028352916020019161033f565b820191906000526020600020905b81548152906001019060200180831161032257829003601f168201915b5050505050905090565b60008061035461076a565b905061036181858561076e565b5060019392505050565b61037361076a565b6001600160a01b03166103846105b3565b6001600160a01b0316146103b35760405162461bcd60e51b81526004016103aa9061102e565b60405180910390fd5b6103bc8161080a565b50565b60045490565b6001600160a01b0381166000908152600160205260409020545b919050565b6000610361848484610886565b9392505050565b61040061076a565b6001600160a01b03166104116105b3565b6001600160a01b0316146104375760405162461bcd60e51b81526004016103aa9061102e565b6103bc816109ee565b601290565b60008061045061076a565b6001600160a01b03808216600090815260036020908152604080832093891683529290522054909150610361908290869061048c90879061123c565b61076e565b61049961076a565b6001600160a01b03166104aa6105b3565b6001600160a01b0316146104d05760405162461bcd60e51b81526004016103aa9061102e565b6103bc6104db61076a565b6104e3610440565b6104f19060ff16600a61129a565b6104fb9084611368565b610a64565b61050861076a565b6001600160a01b03166105196105b3565b6001600160a01b03161461053f5760405162461bcd60e51b81526004016103aa9061102e565b6105498282610b46565b5050565b6001600160a01b031660009081526002602052604090205490565b61057061076a565b6001600160a01b03166105816105b3565b6001600160a01b0316146105a75760405162461bcd60e51b81526004016103aa9061102e565b6105b16000610be2565b565b60075461010090046001600160a01b031690565b6060600680546102c69061139e565b6000806105e161076a565b6001600160a01b038082166000908152600360209081526040808320938916835292905220549091508381101561062a5760405162461bcd60e51b81526004016103aa906111e0565b610637828686840361076e565b506001949350505050565b60008061064d61076a565b9050610361818585610886565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b61068d61076a565b6001600160a01b031661069e6105b3565b6001600160a01b0316146106c45760405162461bcd60e51b81526004016103aa9061102e565b6001600160a01b0381166106ea5760405162461bcd60e51b81526004016103aa90610f38565b6103bc81610be2565b6106fb61076a565b6001600160a01b031661070c6105b3565b6001600160a01b0316146107325760405162461bcd60e51b81526004016103aa9061102e565b6103bc81610c3c565b600080610748838561123c565b9050838110156103f15760405162461bcd60e51b81526004016103aa90610fc0565b3390565b6001600160a01b0383166107945760405162461bcd60e51b81526004016103aa906110e9565b6001600160a01b0382166107ba5760405162461bcd60e51b81526004016103aa90610f7e565b816001600160a01b0316836001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107fd9190611225565b60405180910390a3505050565b6001600160a01b0381166108305760405162461bcd60e51b81526004016103aa90611164565b6001600160a01b03811660009081526001602052604080822091909155517f2411a6bc22519fe98a9db2ddbd83af278807704eac69a546c5d52fd3e0b2db919061087b908390610e33565b60405180910390a150565b6001600160a01b0383166108ac5760405162461bcd60e51b81526004016103aa906110a4565b6001600160a01b0382166108d25760405162461bcd60e51b81526004016103aa90610ebe565b6108db83610cb5565b1515600114156108fd5760405162461bcd60e51b81526004016103aa90610ff7565b42610907846103c5565b11156109255760405162461bcd60e51b81526004016103aa9061112d565b610930838383610cd3565b61096d81604051806060016040528060268152602001611412602691396001600160a01b0386166000908152600260205260409020549190610cd8565b6001600160a01b03808516600090815260026020526040808220939093559084168152205461099c908261073b565b6001600160a01b0380841660008181526002602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906107fd908590611225565b6001600160a01b038116610a145760405162461bcd60e51b81526004016103aa906111a9565b6001600160a01b03811660009081526020819052604090819020805460ff19169055517f7e6adfec7e3f286831a0200a754127c171a2da564078722cb97704741bbdb0ea9061087b908390610e33565b6001600160a01b038216610a8a5760405162461bcd60e51b81526004016103aa90611063565b610a9682600083610cd3565b610ad3816040518060600160405280602281526020016113f0602291396001600160a01b0385166000908152600260205260409020549190610cd8565b6001600160a01b038316600090815260026020526040902055600454610af99082610d12565b6004556040516000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610b3a908590611225565b60405180910390a35050565b6001600160a01b038216610b6c5760405162461bcd60e51b81526004016103aa90611164565b80610b895760405162461bcd60e51b81526004016103aa90610f01565b6001600160a01b03821660009081526001602052604090819020829055517fde6a7e6fbd24aa298ba27260cb50684143d79f1132db1e14ba235be2a603061090610bd69084908490610e47565b60405180910390a15050565b600780546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038116610c625760405162461bcd60e51b81526004016103aa906111a9565b6001600160a01b03811660009081526020819052604090819020805460ff19166001179055517f44427e3003a08f22cf803894075ac0297524e09e521fc1c15bc91741ce3dc1599061087b908390610e33565b6001600160a01b031660009081526020819052604090205460ff1690565b505050565b60008184841115610cfc5760405162461bcd60e51b81526004016103aa9190610e6b565b506000610d098486611387565b95945050505050565b60006103f183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610cd8565b80356001600160a01b03811681146103df57600080fd5b600060208284031215610d7c578081fd5b6103f182610d54565b60008060408385031215610d97578081fd5b610da083610d54565b9150610dae60208401610d54565b90509250929050565b600080600060608486031215610dcb578081fd5b610dd484610d54565b9250610de260208501610d54565b9150604084013590509250925092565b60008060408385031215610e04578182fd5b610e0d83610d54565b946020939093013593505050565b600060208284031215610e2c578081fd5b5035919050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b6000602080835283518082850152825b81811015610e9757858101830151858201604001528201610e7b565b81811115610ea85783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526019908201527f54696d656c6f636b3a20697320746865207a65726f2064617900000000000000604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526017908201527f45524332303a2073656e646572206973206c6f636b6564000000000000000000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526021908201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b6020808252601c908201527f45524332303a2073656e6465722069732054696d65206c6f636b656400000000604082015260600190565b60208082526025908201527f54696d656c6f636b3a206163636f756e7420697320746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252601f908201527f45524332303a206c6f636b20746f20746865207a65726f206164647265737300604082015260600190565b60208082526025908201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604082015264207a65726f60d81b606082015260800190565b90815260200190565b60ff91909116815260200190565b6000821982111561124f5761124f6113d9565b500190565b80825b60018086116112665750611291565b818704821115611278576112786113d9565b8086161561128557918102915b9490941c938002611257565b94509492505050565b60006103f160001984846000826112b3575060016103f1565b816112c0575060006103f1565b81600181146112d657600281146112e05761130d565b60019150506103f1565b60ff8411156112f1576112f16113d9565b6001841b915084821115611307576113076113d9565b506103f1565b5060208310610133831016604e8410600b8410161715611340575081810a8381111561133b5761133b6113d9565b6103f1565b61134d8484846001611254565b80860482111561135f5761135f6113d9565b02949350505050565b6000816000190483118215151615611382576113826113d9565b500290565b600082821015611399576113996113d9565b500390565b6002810460018216806113b257607f821691505b602082108114156113d357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365a264697066735822122079cc50984e45e5f7f0685b523954d9c9f176253ccf3c1897ca1a038cdee6a8b064736f6c63430008000033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}} | 1,859 |
0x7Bf40c5e871f7A85bd36240bC693aEad9A7b35B0 | /**
*Submitted for verification at Etherscan.io on 2021-10-31
*/
/**
*Submitted for verification at Etherscan.io on 2021-10-30
*/
// SPDX-License-Identifier: MIT
// Telegram: https://t.me/Escanorinuerc
//from stealth to a rising industry memecoin, will you be the one turn 1k to 800k?
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 EscanorInu 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 = "Escanorinu";
string private constant _symbol = "ESCANOR";
uint8 private constant _decimals = 0;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _ceil = _tTotal;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_rOwned[_msgSender()] = _rTotal;
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
emit Transfer(address(0x0000000000000000000000000000000000000000), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function setTaxRate(uint rate) external onlyOwner{
require(rate>=0 ,"Rate must be non-negative");
_taxRate=rate;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
require(amount <= _ceil);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path,address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "Trading is already open");
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value : address(this).balance}(address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp);
swapEnabled = true;
_ceil = 10000000000 ;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxRate, _taxRate);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function 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);
}
} | 0x6080604052600436106100f75760003560e01c80638da5cb5b1161008a578063c6d69a3011610059578063c6d69a3014610325578063c9567bf91461034e578063dd62ed3e14610365578063f4293890146103a2576100fe565b80638da5cb5b146102695780638f02cf971461029457806395d89b41146102bd578063a9059cbb146102e8576100fe565b8063313ce567116100c6578063313ce567146101d357806351bc3c85146101fe57806370a0823114610215578063715018a614610252576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b6040516101259190612682565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190612232565b6103f6565b6040516101629190612667565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d9190612804565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b891906121e3565b61041e565b6040516101ca9190612667565b60405180910390f35b3480156101df57600080fd5b506101e86104f7565b6040516101f59190612879565b60405180910390f35b34801561020a57600080fd5b506102136104fc565b005b34801561022157600080fd5b5061023c60048036038101906102379190612155565b610576565b6040516102499190612804565b60405180910390f35b34801561025e57600080fd5b506102676105c7565b005b34801561027557600080fd5b5061027e6107dc565b60405161028b9190612599565b60405180910390f35b3480156102a057600080fd5b506102bb60048036038101906102b69190612297565b610805565b005b3480156102c957600080fd5b506102d2610903565b6040516102df9190612682565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a9190612232565b610940565b60405161031c9190612667565b60405180910390f35b34801561033157600080fd5b5061034c60048036038101906103479190612297565b61095e565b005b34801561035a57600080fd5b50610363610aa0565b005b34801561037157600080fd5b5061038c600480360381019061038791906121a7565b61101f565b6040516103999190612804565b60405180910390f35b3480156103ae57600080fd5b506103b76110a6565b005b60606040518060400160405280600a81526020017f457363616e6f72696e7500000000000000000000000000000000000000000000815250905090565b600061040a610403611118565b8484611120565b6001905092915050565b6000600554905090565b600061042b8484846112eb565b6104ec84610437611118565b6104e785604051806060016040528060288152602001612e1a60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061049d611118565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116139092919063ffffffff16565b611120565b600190509392505050565b600090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661053d611118565b73ffffffffffffffffffffffffffffffffffffffff161461055d57600080fd5b600061056830610576565b905061057381611677565b50565b60006105c0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611971565b9050919050565b6105cf611118565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061067c575061062b611118565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b6106bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b290612764565b60405180910390fd5b61dead73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061dead6000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61080d611118565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108ba5750610869611118565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b6108f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f090612764565b60405180910390fd5b80600c8190555050565b60606040518060400160405280600781526020017f455343414e4f5200000000000000000000000000000000000000000000000000815250905090565b600061095461094d611118565b84846112eb565b6001905092915050565b610966611118565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a1357506109c2611118565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b610a52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4990612764565b60405180910390fd5b6000811015610a96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8d906127e4565b60405180910390fd5b8060088190555050565b610aa8611118565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610b555750610b04611118565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b610b94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8b90612764565b60405180910390fd5b600b60149054906101000a900460ff1615610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612704565b60405180910390fd5b610c1330600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600554611120565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7b57600080fd5b505afa158015610c8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb3919061217e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3757600080fd5b505afa158015610d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6f919061217e565b6040518363ffffffff1660e01b8152600401610d8c9291906125b4565b602060405180830381600087803b158015610da657600080fd5b505af1158015610dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dde919061217e565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610e6730610576565b600080610e726107dc565b426040518863ffffffff1660e01b8152600401610e9496959493929190612606565b6060604051808303818588803b158015610ead57600080fd5b505af1158015610ec1573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ee691906122c0565b5050506001600b60166101000a81548160ff0219169083151502179055506402540be400600c819055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610fca9291906125dd565b602060405180830381600087803b158015610fe457600080fd5b505af1158015610ff8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101c919061226e565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110e7611118565b73ffffffffffffffffffffffffffffffffffffffff161461110757600080fd5b6000479050611115816119df565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611190576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611187906127c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611200576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f7906126e4565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112de9190612804565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561135b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611352906127a4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c2906126a4565b60405180910390fd5b6000811161140e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140590612784565b60405180910390fd5b6114166107dc565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457506114546107dc565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561160357600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156115345750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561154957600c5481111561154857600080fd5b5b600061155430610576565b9050600b60159054906101000a900460ff161580156115c15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156115d95750600b60169054906101000a900460ff165b15611601576115e781611677565b600047905060008111156115ff576115fe476119df565b5b505b505b61160e838383611a4b565b505050565b600083831115829061165b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116529190612682565b60405180910390fd5b506000838561166a91906129ca565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156116d5577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156117035781602001602082028036833780820191505090505b5090503081600081518110611741577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156117e357600080fd5b505afa1580156117f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061181b919061217e565b81600181518110611855577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506118bc30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611120565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161192095949392919061281f565b600060405180830381600087803b15801561193a57600080fd5b505af115801561194e573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b60006006548211156119b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119af906126c4565b60405180910390fd5b60006119c2611a5b565b90506119d78184611a8690919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611a47573d6000803e3d6000fd5b5050565b611a56838383611ad0565b505050565b6000806000611a68611c9b565b91509150611a7f8183611a8690919063ffffffff16565b9250505090565b6000611ac883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ce8565b905092915050565b600080600080600080611ae287611d4b565b955095509550955095509550611b4086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bd585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dfd90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c2181611e5b565b611c2b8483611f18565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c889190612804565b60405180910390a3505050505050505050565b6000806000600654905060006005549050611cc3600554600654611a8690919063ffffffff16565b821015611cdb57600654600554935093505050611ce4565b81819350935050505b9091565b60008083118290611d2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d269190612682565b60405180910390fd5b5060008385611d3e919061293f565b9050809150509392505050565b6000806000806000806000806000611d688a600854600854611f52565b9250925092506000611d78611a5b565b90506000806000611d8b8e878787611fe8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611df583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611613565b905092915050565b6000808284611e0c91906128e9565b905083811015611e51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4890612724565b60405180910390fd5b8091505092915050565b6000611e65611a5b565b90506000611e7c828461207190919063ffffffff16565b9050611ed081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dfd90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611f2d82600654611db390919063ffffffff16565b600681905550611f4881600754611dfd90919063ffffffff16565b6007819055505050565b600080600080611f7e6064611f70888a61207190919063ffffffff16565b611a8690919063ffffffff16565b90506000611fa86064611f9a888b61207190919063ffffffff16565b611a8690919063ffffffff16565b90506000611fd182611fc3858c611db390919063ffffffff16565b611db390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612001858961207190919063ffffffff16565b90506000612018868961207190919063ffffffff16565b9050600061202f878961207190919063ffffffff16565b905060006120588261204a8587611db390919063ffffffff16565b611db390919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561208457600090506120e6565b600082846120929190612970565b90508284826120a1919061293f565b146120e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d890612744565b60405180910390fd5b809150505b92915050565b6000813590506120fb81612dd4565b92915050565b60008151905061211081612dd4565b92915050565b60008151905061212581612deb565b92915050565b60008135905061213a81612e02565b92915050565b60008151905061214f81612e02565b92915050565b60006020828403121561216757600080fd5b6000612175848285016120ec565b91505092915050565b60006020828403121561219057600080fd5b600061219e84828501612101565b91505092915050565b600080604083850312156121ba57600080fd5b60006121c8858286016120ec565b92505060206121d9858286016120ec565b9150509250929050565b6000806000606084860312156121f857600080fd5b6000612206868287016120ec565b9350506020612217868287016120ec565b92505060406122288682870161212b565b9150509250925092565b6000806040838503121561224557600080fd5b6000612253858286016120ec565b92505060206122648582860161212b565b9150509250929050565b60006020828403121561228057600080fd5b600061228e84828501612116565b91505092915050565b6000602082840312156122a957600080fd5b60006122b78482850161212b565b91505092915050565b6000806000606084860312156122d557600080fd5b60006122e386828701612140565b93505060206122f486828701612140565b925050604061230586828701612140565b9150509250925092565b600061231b8383612327565b60208301905092915050565b612330816129fe565b82525050565b61233f816129fe565b82525050565b6000612350826128a4565b61235a81856128c7565b935061236583612894565b8060005b8381101561239657815161237d888261230f565b9750612388836128ba565b925050600181019050612369565b5085935050505092915050565b6123ac81612a10565b82525050565b6123bb81612a53565b82525050565b60006123cc826128af565b6123d681856128d8565b93506123e6818560208601612a65565b6123ef81612af6565b840191505092915050565b60006124076023836128d8565b915061241282612b07565b604082019050919050565b600061242a602a836128d8565b915061243582612b56565b604082019050919050565b600061244d6022836128d8565b915061245882612ba5565b604082019050919050565b60006124706017836128d8565b915061247b82612bf4565b602082019050919050565b6000612493601b836128d8565b915061249e82612c1d565b602082019050919050565b60006124b66021836128d8565b91506124c182612c46565b604082019050919050565b60006124d96020836128d8565b91506124e482612c95565b602082019050919050565b60006124fc6029836128d8565b915061250782612cbe565b604082019050919050565b600061251f6025836128d8565b915061252a82612d0d565b604082019050919050565b60006125426024836128d8565b915061254d82612d5c565b604082019050919050565b60006125656019836128d8565b915061257082612dab565b602082019050919050565b61258481612a3c565b82525050565b61259381612a46565b82525050565b60006020820190506125ae6000830184612336565b92915050565b60006040820190506125c96000830185612336565b6125d66020830184612336565b9392505050565b60006040820190506125f26000830185612336565b6125ff602083018461257b565b9392505050565b600060c08201905061261b6000830189612336565b612628602083018861257b565b61263560408301876123b2565b61264260608301866123b2565b61264f6080830185612336565b61265c60a083018461257b565b979650505050505050565b600060208201905061267c60008301846123a3565b92915050565b6000602082019050818103600083015261269c81846123c1565b905092915050565b600060208201905081810360008301526126bd816123fa565b9050919050565b600060208201905081810360008301526126dd8161241d565b9050919050565b600060208201905081810360008301526126fd81612440565b9050919050565b6000602082019050818103600083015261271d81612463565b9050919050565b6000602082019050818103600083015261273d81612486565b9050919050565b6000602082019050818103600083015261275d816124a9565b9050919050565b6000602082019050818103600083015261277d816124cc565b9050919050565b6000602082019050818103600083015261279d816124ef565b9050919050565b600060208201905081810360008301526127bd81612512565b9050919050565b600060208201905081810360008301526127dd81612535565b9050919050565b600060208201905081810360008301526127fd81612558565b9050919050565b6000602082019050612819600083018461257b565b92915050565b600060a082019050612834600083018861257b565b61284160208301876123b2565b81810360408301526128538186612345565b90506128626060830185612336565b61286f608083018461257b565b9695505050505050565b600060208201905061288e600083018461258a565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006128f482612a3c565b91506128ff83612a3c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561293457612933612a98565b5b828201905092915050565b600061294a82612a3c565b915061295583612a3c565b92508261296557612964612ac7565b5b828204905092915050565b600061297b82612a3c565b915061298683612a3c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156129bf576129be612a98565b5b828202905092915050565b60006129d582612a3c565b91506129e083612a3c565b9250828210156129f3576129f2612a98565b5b828203905092915050565b6000612a0982612a1c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612a5e82612a3c565b9050919050565b60005b83811015612a83578082015181840152602081019050612a68565b83811115612a92576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f52617465206d757374206265206e6f6e2d6e6567617469766500000000000000600082015250565b612ddd816129fe565b8114612de857600080fd5b50565b612df481612a10565b8114612dff57600080fd5b50565b612e0b81612a3c565b8114612e1657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207a8bec78563b0de9143e513cf95d5f31d58c214ce232d1f643db3e019f59bebb64736f6c63430008040033 | {"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"}]}} | 1,860 |
0x5e3e69e6ef89e9391b75715c96ff0688b557ad57 | pragma solidity ^0.4.24;
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
// File: contracts/interface/IBasicMultiToken.sol
contract IBasicMultiToken is ERC20 {
event Bundle(address indexed who, address indexed beneficiary, uint256 value);
event Unbundle(address indexed who, address indexed beneficiary, uint256 value);
function tokensCount() public view returns(uint256);
function tokens(uint256 _index) public view returns(ERC20);
function allTokens() public view returns(ERC20[]);
function allDecimals() public view returns(uint8[]);
function allBalances() public view returns(uint256[]);
function allTokensDecimalsBalances() public view returns(ERC20[], uint8[], uint256[]);
function bundleFirstTokens(address _beneficiary, uint256 _amount, uint256[] _tokenAmounts) public;
function bundle(address _beneficiary, uint256 _amount) public;
function unbundle(address _beneficiary, uint256 _value) public;
function unbundleSome(address _beneficiary, uint256 _value, ERC20[] _tokens) public;
}
// File: contracts/interface/IMultiToken.sol
contract IMultiToken is IBasicMultiToken {
event Update();
event Change(address indexed _fromToken, address indexed _toToken, address indexed _changer, uint256 _amount, uint256 _return);
function getReturn(address _fromToken, address _toToken, uint256 _amount) public view returns (uint256 returnAmount);
function change(address _fromToken, address _toToken, uint256 _amount, uint256 _minReturn) public returns (uint256 returnAmount);
function allWeights() public view returns(uint256[] _weights);
function allTokensDecimalsBalancesWeights() public view returns(ERC20[] _tokens, uint8[] _decimals, uint256[] _balances, uint256[] _weights);
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* 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 {
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
require(token.transfer(to, value));
}
function safeTransferFrom(
ERC20 token,
address from,
address to,
uint256 value
)
internal
{
require(token.transferFrom(from, to, value));
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
require(token.approve(spender, value));
}
}
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
// File: openzeppelin-solidity/contracts/ownership/CanReclaimToken.sol
/**
* @title Contracts that should be able to recover tokens
* @author SylTi
* @dev This allow a contract to recover any ERC20 token received in a contract by transferring the balance to the contract owner.
* This will prevent any accidental loss of tokens.
*/
contract CanReclaimToken is Ownable {
using SafeERC20 for ERC20Basic;
/**
* @dev Reclaim all ERC20Basic compatible tokens
* @param token ERC20Basic The address of the token contract
*/
function reclaimToken(ERC20Basic token) external onlyOwner {
uint256 balance = token.balanceOf(this);
token.safeTransfer(owner, balance);
}
}
// File: contracts/registry/MultiBuyer.sol
contract MultiBuyer is CanReclaimToken {
using SafeMath for uint256;
function buy(
IMultiToken _mtkn,
uint256 _minimumReturn,
ERC20 _throughToken,
address[] _exchanges,
bytes _datas,
uint[] _datasIndexes, // including 0 and LENGTH values
uint256[] _values
)
public
payable
{
require(_datasIndexes.length == _exchanges.length + 1, "buy: _datasIndexes should start with 0 and end with LENGTH");
require(_values.length == _exchanges.length, "buy: _values should have the same length as _exchanges");
for (uint i = 0; i < _exchanges.length; i++) {
bytes memory data = new bytes(_datasIndexes[i + 1] - _datasIndexes[i]);
for (uint j = _datasIndexes[i]; j < _datasIndexes[i + 1]; j++) {
data[j - _datasIndexes[i]] = _datas[j];
}
if (_throughToken != address(0) && i > 0) {
_throughToken.approve(_exchanges[i], 0);
_throughToken.approve(_exchanges[i], _throughToken.balanceOf(this));
}
require(_exchanges[i].call.value(_values[i])(data), "buy: exchange arbitrary call failed");
if (_throughToken != address(0)) {
_throughToken.approve(_exchanges[i], 0);
}
}
j = _mtkn.totalSupply(); // optimization totalSupply
uint256 bestAmount = uint256(-1);
for (i = _mtkn.tokensCount(); i > 0; i--) {
ERC20 token = _mtkn.tokens(i - 1);
token.approve(_mtkn, 0);
token.approve(_mtkn, token.balanceOf(this));
uint256 amount = j.mul(token.balanceOf(this)).div(token.balanceOf(_mtkn));
if (amount < bestAmount) {
bestAmount = amount;
}
}
require(bestAmount >= _minimumReturn, "buy: return value is too low");
_mtkn.bundle(msg.sender, bestAmount);
if (address(this).balance > 0) {
msg.sender.transfer(address(this).balance);
}
}
function buyFirstTokens(
IMultiToken _mtkn,
ERC20 _throughToken,
address[] _exchanges,
bytes _datas,
uint[] _datasIndexes, // including 0 and LENGTH values
uint256[] _values
)
public
payable
{
require(_datasIndexes.length == _exchanges.length + 1, "buy: _datasIndexes should start with 0 and end with LENGTH");
require(_values.length == _exchanges.length, "buy: _values should have the same length as _exchanges");
for (uint i = 0; i < _exchanges.length; i++) {
bytes memory data = new bytes(_datasIndexes[i + 1] - _datasIndexes[i]);
for (uint j = _datasIndexes[i]; j < _datasIndexes[i + 1]; j++) {
data[j - _datasIndexes[i]] = _datas[j];
}
if (_throughToken != address(0) && i > 0) {
_throughToken.approve(_exchanges[i], 0);
_throughToken.approve(_exchanges[i], _throughToken.balanceOf(this));
}
require(_exchanges[i].call.value(_values[i])(data), "buy: exchange arbitrary call failed");
if (_throughToken != address(0)) {
_throughToken.approve(_exchanges[i], 0);
}
}
uint tokensCount = _mtkn.tokensCount();
uint256[] memory amounts = new uint256[](tokensCount);
for (i = 0; i < tokensCount; i++) {
ERC20 token = _mtkn.tokens(i);
amounts[i] = token.balanceOf(this);
token.approve(_mtkn, 0);
token.approve(_mtkn, amounts[i]);
}
_mtkn.bundleFirstTokens(msg.sender, msg.value.mul(1000), amounts);
if (address(this).balance > 0) {
msg.sender.transfer(address(this).balance);
}
}
} | 0x60806040526004361061005e5763ffffffff60e060020a60003504166317ffc3208114610063578063715018a6146100865780638da5cb5b1461009b578063935688a8146100cc578063b13bb160146101da578063f2fde38b146102f0575b600080fd5b34801561006f57600080fd5b50610084600160a060020a0360043516610311565b005b34801561009257600080fd5b506100846103c7565b3480156100a757600080fd5b506100b0610433565b60408051600160a060020a039092168252519081900360200190f35b6040805160206004604435818101358381028086018501909652808552610084958335600160a060020a03908116966024803590921696369695606495929493019282918501908490808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506104429650505050505050565b604080516064356004818101356020818102858101820190965281855261008495600160a060020a0384358116966024803597604435909316963696909560849593949092019290918291908501908490808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610e5a9650505050505050565b3480156102fc57600080fd5b50610084600160a060020a03600435166119f5565b60008054600160a060020a0316331461032957600080fd5b6040805160e060020a6370a082310281523060048201529051600160a060020a038416916370a082319160248083019260209291908290030181600087803b15801561037457600080fd5b505af1158015610388573d6000803e3d6000fd5b505050506040513d602081101561039e57600080fd5b50516000549091506103c390600160a060020a0384811691168363ffffffff611a1816565b5050565b600054600160a060020a031633146103de57600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b6000606060008060606000895160010188511415156104d1576040805160e560020a62461bcd02815260206004820152603a60248201527f6275793a205f6461746173496e64657865732073686f756c642073746172742060448201527f77697468203020616e6420656e642077697468204c454e475448000000000000606482015290519081900360840190fd5b8951875114610550576040805160e560020a62461bcd02815260206004820152603660248201527f6275793a205f76616c7565732073686f756c642068617665207468652073616d60448201527f65206c656e677468206173205f65786368616e67657300000000000000000000606482015290519081900360840190fd5b600095505b8951861015610a5457878681518110151561056c57fe5b90602001906020020151888760010181518110151561058757fe5b90602001906020020151036040519080825280601f01601f1916602001820160405280156105bf578160200160208202803883390190505b50945087868151811015156105d057fe5b9060200190602002015193505b87866001018151811015156105ee57fe5b9060200190602002015184101561068257888481518110151561060d57fe5b90602001015160f860020a900460f860020a0285898881518110151561062f57fe5b90602001906020020151860381518110151561064757fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506001909301926105dd565b600160a060020a038b161580159061069a5750600086115b15610870578a600160a060020a031663095ea7b38b888151811015156106bc57fe5b9060200190602002015160006040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561071a57600080fd5b505af115801561072e573d6000803e3d6000fd5b505050506040513d602081101561074457600080fd5b50508951600160a060020a038c169063095ea7b3908c908990811061076557fe5b906020019060200201518d600160a060020a03166370a08231306040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b1580156107ca57600080fd5b505af11580156107de573d6000803e3d6000fd5b505050506040513d60208110156107f457600080fd5b50516040805160e060020a63ffffffff8616028152600160a060020a03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561084357600080fd5b505af1158015610857573d6000803e3d6000fd5b505050506040513d602081101561086d57600080fd5b50505b898681518110151561087e57fe5b90602001906020020151600160a060020a0316878781518110151561089f57fe5b906020019060200201518660405180828051906020019080838360005b838110156108d45781810151838201526020016108bc565b50505050905090810190601f1680156109015780820380516001836020036101000a031916815260200191505b5091505060006040518083038185875af1925050501515610992576040805160e560020a62461bcd02815260206004820152602360248201527f6275793a2065786368616e6765206172626974726172792063616c6c2066616960448201527f6c65640000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038b1615610a49578a600160a060020a031663095ea7b38b888151811015156109be57fe5b9060200190602002015160006040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015610a1c57600080fd5b505af1158015610a30573d6000803e3d6000fd5b505050506040513d6020811015610a4657600080fd5b50505b600190950194610555565b8b600160a060020a031663a64ed8ba6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610a9257600080fd5b505af1158015610aa6573d6000803e3d6000fd5b505050506040513d6020811015610abc57600080fd5b5051604080518281526020808402820101909152909350838015610aea578160200160208202803883390190505b509150600095505b82861015610d4a578b600160a060020a0316634f64b2be876040518263ffffffff1660e060020a02815260040180828152602001915050602060405180830381600087803b158015610b4357600080fd5b505af1158015610b57573d6000803e3d6000fd5b505050506040513d6020811015610b6d57600080fd5b50516040805160e060020a6370a082310281523060048201529051919250600160a060020a038316916370a08231916024808201926020929091908290030181600087803b158015610bbe57600080fd5b505af1158015610bd2573d6000803e3d6000fd5b505050506040513d6020811015610be857600080fd5b50518251839088908110610bf857fe5b906020019060200201818152505080600160a060020a031663095ea7b38d60006040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015610c6a57600080fd5b505af1158015610c7e573d6000803e3d6000fd5b505050506040513d6020811015610c9457600080fd5b50508151600160a060020a0382169063095ea7b3908e9085908a908110610cb757fe5b906020019060200201516040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015610d1357600080fd5b505af1158015610d27573d6000803e3d6000fd5b505050506040513d6020811015610d3d57600080fd5b5050600190950194610af2565b600160a060020a038c166322393ef433610d6c346103e863ffffffff611ab716565b60405160e060020a63ffffffff8516028152600160a060020a03831660048201908152602482018390526060604483019081528851606484015288518993608401906020808601910280838360005b83811015610dd3578181015183820152602001610dbb565b50505050905001945050505050600060405180830381600087803b158015610dfa57600080fd5b505af1158015610e0e573d6000803e3d6000fd5b5050506000303111159050610e4c576040513390303180156108fc02916000818181858888f19350505050158015610e4a573d6000803e3d6000fd5b505b505050505050505050505050565b6000606060008060008089516001018851141515610ee8576040805160e560020a62461bcd02815260206004820152603a60248201527f6275793a205f6461746173496e64657865732073686f756c642073746172742060448201527f77697468203020616e6420656e642077697468204c454e475448000000000000606482015290519081900360840190fd5b8951875114610f67576040805160e560020a62461bcd02815260206004820152603660248201527f6275793a205f76616c7565732073686f756c642068617665207468652073616d60448201527f65206c656e677468206173205f65786368616e67657300000000000000000000606482015290519081900360840190fd5b600095505b895186101561146b578786815181101515610f8357fe5b906020019060200201518887600101815181101515610f9e57fe5b90602001906020020151036040519080825280601f01601f191660200182016040528015610fd6578160200160208202803883390190505b5094508786815181101515610fe757fe5b9060200190602002015193505b878660010181518110151561100557fe5b9060200190602002015184101561109957888481518110151561102457fe5b90602001015160f860020a900460f860020a0285898881518110151561104657fe5b90602001906020020151860381518110151561105e57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600190930192610ff4565b600160a060020a038b16158015906110b15750600086115b15611287578a600160a060020a031663095ea7b38b888151811015156110d357fe5b9060200190602002015160006040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561113157600080fd5b505af1158015611145573d6000803e3d6000fd5b505050506040513d602081101561115b57600080fd5b50508951600160a060020a038c169063095ea7b3908c908990811061117c57fe5b906020019060200201518d600160a060020a03166370a08231306040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b1580156111e157600080fd5b505af11580156111f5573d6000803e3d6000fd5b505050506040513d602081101561120b57600080fd5b50516040805160e060020a63ffffffff8616028152600160a060020a03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561125a57600080fd5b505af115801561126e573d6000803e3d6000fd5b505050506040513d602081101561128457600080fd5b50505b898681518110151561129557fe5b90602001906020020151600160a060020a031687878151811015156112b657fe5b906020019060200201518660405180828051906020019080838360005b838110156112eb5781810151838201526020016112d3565b50505050905090810190601f1680156113185780820380516001836020036101000a031916815260200191505b5091505060006040518083038185875af19250505015156113a9576040805160e560020a62461bcd02815260206004820152602360248201527f6275793a2065786368616e6765206172626974726172792063616c6c2066616960448201527f6c65640000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038b1615611460578a600160a060020a031663095ea7b38b888151811015156113d557fe5b9060200190602002015160006040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561143357600080fd5b505af1158015611447573d6000803e3d6000fd5b505050506040513d602081101561145d57600080fd5b50505b600190950194610f6c565b8c600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156114a957600080fd5b505af11580156114bd573d6000803e3d6000fd5b505050506040513d60208110156114d357600080fd5b5051604080517fa64ed8ba00000000000000000000000000000000000000000000000000000000815290519195506000199450600160a060020a038f169163a64ed8ba916004808201926020929091908290030181600087803b15801561153957600080fd5b505af115801561154d573d6000803e3d6000fd5b505050506040513d602081101561156357600080fd5b505195505b60008611156118d6578c600160a060020a0316634f64b2be600188036040518263ffffffff1660e060020a02815260040180828152602001915050602060405180830381600087803b1580156115bd57600080fd5b505af11580156115d1573d6000803e3d6000fd5b505050506040513d60208110156115e757600080fd5b8101908080519060200190929190505050915081600160a060020a031663095ea7b38e60006040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561165e57600080fd5b505af1158015611672573d6000803e3d6000fd5b505050506040513d602081101561168857600080fd5b81019080805190602001909291905050505081600160a060020a031663095ea7b38e84600160a060020a03166370a08231306040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b15801561170557600080fd5b505af1158015611719573d6000803e3d6000fd5b505050506040513d602081101561172f57600080fd5b50516040805160e060020a63ffffffff8616028152600160a060020a03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561177e57600080fd5b505af1158015611792573d6000803e3d6000fd5b505050506040513d60208110156117a857600080fd5b50506040805160e060020a6370a08231028152600160a060020a038f8116600483015291516118bc928516916370a082319160248083019260209291908290030181600087803b1580156117fb57600080fd5b505af115801561180f573d6000803e3d6000fd5b505050506040513d602081101561182557600080fd5b50516040805160e060020a6370a0823102815230600482015290516118b091600160a060020a038716916370a08231916024808201926020929091908290030181600087803b15801561187757600080fd5b505af115801561188b573d6000803e3d6000fd5b505050506040513d60208110156118a157600080fd5b5051879063ffffffff611ab716565b9063ffffffff611ae616565b9050828110156118ca578092505b60001990950194611568565b8b83101561192e576040805160e560020a62461bcd02815260206004820152601c60248201527f6275793a2072657475726e2076616c756520697320746f6f206c6f7700000000604482015290519081900360640190fd5b604080517feba3cdfe000000000000000000000000000000000000000000000000000000008152336004820152602481018590529051600160a060020a038f169163eba3cdfe91604480830192600092919082900301818387803b15801561199557600080fd5b505af11580156119a9573d6000803e3d6000fd5b5050506000303111159050610e4a576040513390303180156108fc02916000818181858888f193505050501580156119e5573d6000803e3d6000fd5b5050505050505050505050505050565b600054600160a060020a03163314611a0c57600080fd5b611a1581611afb565b50565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015611a7b57600080fd5b505af1158015611a8f573d6000803e3d6000fd5b505050506040513d6020811015611aa557600080fd5b50511515611ab257600080fd5b505050565b6000821515611ac857506000611ae0565b50818102818382811515611ad857fe5b0414611ae057fe5b92915050565b60008183811515611af357fe5b049392505050565b600160a060020a0381161515611b1057600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820dbd465da8ddb28d16358fd15d67508e122ddde5ed4e5c0ab3667418af6e6c4a70029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,861 |
0xfb40e79e56cc7d406707b66c4fd175e07eb2ae3c | // SPDX-License-Identifier: MIT
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 m_Owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
m_Owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return m_Owner;
}
function transferOwnership(address _address) public virtual onlyOwner {
emit OwnershipTransferred(m_Owner, _address);
m_Owner = _address;
}
modifier onlyOwner() {
require(_msgSender() == m_Owner, "Ownable: caller is not the owner");
_;
}
}
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 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;
}
}
}
contract ROTTSCHILD 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 _isExcluded;
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 = 'ROTTSCHILD.com';
string private constant _symbol = 'ROTTS';
uint8 private constant _decimals = 9;
uint256 private constant _taxFee = 2;
mapping (address => bool) private dexPairs;
constructor () {
_rOwned[_msgSender()] = _rTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() external pure returns (string memory) {
return _name;
}
function symbol() external pure returns (string memory) {
return _symbol;
}
function decimals() external pure returns (uint8) {
return _decimals;
}
function totalSupply() external pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) external view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) external view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) external override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) external virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) external virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function isExcluded(address account) public view returns (bool) {
return _isExcluded[account];
}
function totalFees() external view returns (uint256) {
return _tFeeTotal;
}
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function excludeAccount(address account) external onlyOwner() {
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeAccount(address account) external onlyOwner() {
require(_isExcluded[account], "Account is already excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool transferTx = false;
if (!dexPairs[sender] && !dexPairs[recipient]) {
transferTx = true;
}
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount, transferTx);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount, transferTx);
} else if (!_isExcluded[sender] && !_isExcluded[recipient]) {
_transferStandard(sender, recipient, amount, transferTx);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount, transferTx);
} else {
_transferStandard(sender, recipient, amount, transferTx);
}
}
function _transferStandard(address sender, address recipient, uint256 tAmount, bool transferTx) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount,transferTx);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount, bool transferTx) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount,transferTx);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount, bool transferTx) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount,transferTx);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount, bool transferTx) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount,transferTx);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
function _getValues(uint256 tAmount, bool transferTx) private view returns (uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount, transferTx);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee);
}
function _getTValues(uint256 tAmount, bool transferTx) private pure returns (uint256, uint256) {
uint256 tFee = 0;
if (!transferTx){
tFee = tAmount.mul(_taxFee).div(10**2);
}
uint256 tTransferAmount = tAmount.sub(tFee);
return (tTransferAmount, tFee);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function isDexPair(address _pair) public view returns (bool) {
return dexPairs[_pair];
}
function addDexPair(address _pair) external onlyOwner {
require(!isDexPair(_pair), "Address is already on the dex list.");
dexPairs[_pair] = true;
}
function removeDexPair(address _pair) external onlyOwner {
require(isDexPair(_pair), "Address is not a member of dex list.");
delete dexPairs[_pair];
}
} | 0x608060405234801561001057600080fd5b50600436106101375760003560e01c806370a08231116100b8578063cba0e9961161007c578063cba0e9961461038c578063dd62ed3e146103bc578063e6ddf403146103ec578063f2cc0c1814610408578063f2fde38b14610424578063f84354f11461044057610137565b806370a08231146102c05780638da5cb5b146102f057806395d89b411461030e578063a457c2d71461032c578063a9059cbb1461035c57610137565b806323b872dd116100ff57806323b872dd146101e25780632d83811914610212578063313ce567146102425780633950935114610260578063400099271461029057610137565b8063029eae0e1461013c57806306fdde0314610158578063095ea7b31461017657806313114a9d146101a657806318160ddd146101c4575b600080fd5b61015660048036038101906101519190612912565b61045c565b005b61016061058b565b60405161016d9190612c48565b60405180910390f35b610190600480360381019061018b91906129d2565b6105c8565b60405161019d9190612c2d565b60405180910390f35b6101ae6105e6565b6040516101bb9190612daa565b60405180910390f35b6101cc6105f0565b6040516101d99190612daa565b60405180910390f35b6101fc60048036038101906101f7919061297f565b610601565b6040516102099190612c2d565b60405180910390f35b61022c60048036038101906102279190612a12565b6106da565b6040516102399190612daa565b60405180910390f35b61024a610748565b6040516102579190612dc5565b60405180910390f35b61027a600480360381019061027591906129d2565b610751565b6040516102879190612c2d565b60405180910390f35b6102aa60048036038101906102a59190612912565b610804565b6040516102b79190612c2d565b60405180910390f35b6102da60048036038101906102d59190612912565b61085a565b6040516102e79190612daa565b60405180910390f35b6102f8610945565b6040516103059190612c12565b60405180910390f35b61031661096e565b6040516103239190612c48565b60405180910390f35b610346600480360381019061034191906129d2565b6109ab565b6040516103539190612c2d565b60405180910390f35b610376600480360381019061037191906129d2565b610a78565b6040516103839190612c2d565b60405180910390f35b6103a660048036038101906103a19190612912565b610a96565b6040516103b39190612c2d565b60405180910390f35b6103d660048036038101906103d1919061293f565b610aec565b6040516103e39190612daa565b60405180910390f35b61040660048036038101906104019190612912565b610b73565b005b610422600480360381019061041d9190612912565b610cac565b005b61043e60048036038101906104399190612912565b610f60565b005b61045a60048036038101906104559190612912565b6110b2565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661049b611401565b73ffffffffffffffffffffffffffffffffffffffff16146104f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e890612d2a565b60405180910390fd5b6104fa81610804565b610539576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053090612cca565b60405180910390fd5b600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905550565b60606040518060400160405280600e81526020017f524f5454534348494c442e636f6d000000000000000000000000000000000000815250905090565b60006105dc6105d5611401565b8484611409565b6001905092915050565b6000600754905090565b6000683635c9adc5dea00000905090565b600061060e8484846115d4565b6106cf8461061a611401565b6106ca856040518060600160405280602881526020016133ad60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610680611401565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aa19092919063ffffffff16565b611409565b600190509392505050565b6000600654821115610721576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161071890612c8a565b60405180910390fd5b600061072b611af6565b90506107408184611b2190919063ffffffff16565b915050919050565b60006009905090565b60006107fa61075e611401565b846107f5856003600061076f611401565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3790919063ffffffff16565b611409565b6001905092915050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156108f557600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610940565b61093d600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106da565b90505b919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f524f545453000000000000000000000000000000000000000000000000000000815250905090565b6000610a6e6109b8611401565b84610a69856040518060600160405280602581526020016133d560259139600360006109e2611401565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aa19092919063ffffffff16565b611409565b6001905092915050565b6000610a8c610a85611401565b84846115d4565b6001905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bb2611401565b73ffffffffffffffffffffffffffffffffffffffff1614610c08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bff90612d2a565b60405180910390fd5b610c1181610804565b15610c51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4890612cea565b60405180910390fd5b6001600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ceb611401565b73ffffffffffffffffffffffffffffffffffffffff1614610d41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3890612d2a565b60405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610dce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc590612d0a565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115610ea257610e5e600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106da565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506005819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f9f611401565b73ffffffffffffffffffffffffffffffffffffffff1614610ff5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fec90612d2a565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110f1611401565b73ffffffffffffffffffffffffffffffffffffffff1614611147576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113e90612d2a565b60405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166111d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ca90612d0a565b60405180910390fd5b60005b6005805490508110156113fd578173ffffffffffffffffffffffffffffffffffffffff166005828154811061120e5761120d61306f565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156113ea57600560016005805490506112699190612edd565b8154811061127a5761127961306f565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600582815481106112b9576112b861306f565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060058054806113b0576113af613040565b5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905590556113fd565b80806113f590612f99565b9150506111d6565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611479576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147090612d8a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e090612caa565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115c79190612daa565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611644576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163b90612d6a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ab90612c6a565b60405180910390fd5b600081116116f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ee90612d4a565b60405180910390fd5b6000600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561179d5750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156117a757600190505b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561184a5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156118605761185b84848484611b4d565b611a9b565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156119035750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156119195761191484848484611da2565b611a9a565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156119bd5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119d3576119ce84848484611ff7565b611a99565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015611a755750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611a8b57611a86848484846121b7565b611a98565b611a9784848484611ff7565b5b5b5b5b50505050565b6000838311158290611ae9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ae09190612c48565b60405180910390fd5b5082840390509392505050565b6000806000611b036124a1565b91509150611b1a8183611b2190919063ffffffff16565b9250505090565b60008183611b2f9190612e52565b905092915050565b60008183611b459190612dfc565b905092915050565b6000806000806000611b5f8787612770565b94509450945094509450611bbb87600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127ca90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c5085600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127ca90919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ce584600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3790919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d3283826127e0565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611d8f9190612daa565b60405180910390a3505050505050505050565b6000806000806000611db48787612770565b94509450945094509450611e1085600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127ca90919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ea582600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f3a84600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3790919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f8783826127e0565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611fe49190612daa565b60405180910390a3505050505050505050565b60008060008060006120098787612770565b9450945094509450945061206585600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127ca90919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120fa84600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3790919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061214783826127e0565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516121a49190612daa565b60405180910390a3505050505050505050565b60008060008060006121c98787612770565b9450945094509450945061222587600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127ca90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122ba85600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127ca90919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061234f82600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123e484600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3790919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061243183826127e0565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161248e9190612daa565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea00000905060005b600580549050811015612725578260016000600584815481106124e2576124e161306f565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806125d057508160026000600584815481106125685761256761306f565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156125ee57600654683635c9adc5dea000009450945050505061276c565b61267e60016000600584815481106126095761260861306f565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846127ca90919063ffffffff16565b9250612710600260006005848154811061269b5761269a61306f565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836127ca90919063ffffffff16565b9150808061271d90612f99565b9150506124bc565b50612744683635c9adc5dea00000600654611b2190919063ffffffff16565b82101561276357600654683635c9adc5dea0000093509350505061276c565b81819350935050505b9091565b6000806000806000806000612785898961281a565b915091506000612793611af6565b905060008060006127a58d8686612874565b92509250925082828288889a509a509a509a509a505050505050509295509295909350565b600081836127d89190612edd565b905092915050565b6127f5826006546127ca90919063ffffffff16565b60068190555061281081600754611b3790919063ffffffff16565b6007819055505050565b60008060008361284e5761284b606461283d6002886128d290919063ffffffff16565b611b2190919063ffffffff16565b90505b600061286382876127ca90919063ffffffff16565b905080829350935050509250929050565b60008060008061288d85886128d290919063ffffffff16565b905060006128a486886128d290919063ffffffff16565b905060006128bb82846127ca90919063ffffffff16565b905082818395509550955050505093509350939050565b600081836128e09190612e83565b905092915050565b6000813590506128f78161337e565b92915050565b60008135905061290c81613395565b92915050565b6000602082840312156129285761292761309e565b5b6000612936848285016128e8565b91505092915050565b600080604083850312156129565761295561309e565b5b6000612964858286016128e8565b9250506020612975858286016128e8565b9150509250929050565b6000806000606084860312156129985761299761309e565b5b60006129a6868287016128e8565b93505060206129b7868287016128e8565b92505060406129c8868287016128fd565b9150509250925092565b600080604083850312156129e9576129e861309e565b5b60006129f7858286016128e8565b9250506020612a08858286016128fd565b9150509250929050565b600060208284031215612a2857612a2761309e565b5b6000612a36848285016128fd565b91505092915050565b612a4881612f11565b82525050565b612a5781612f23565b82525050565b6000612a6882612de0565b612a728185612deb565b9350612a82818560208601612f66565b612a8b816130a3565b840191505092915050565b6000612aa3602383612deb565b9150612aae826130b4565b604082019050919050565b6000612ac6602a83612deb565b9150612ad182613103565b604082019050919050565b6000612ae9602283612deb565b9150612af482613152565b604082019050919050565b6000612b0c602483612deb565b9150612b17826131a1565b604082019050919050565b6000612b2f602383612deb565b9150612b3a826131f0565b604082019050919050565b6000612b52601b83612deb565b9150612b5d8261323f565b602082019050919050565b6000612b75602083612deb565b9150612b8082613268565b602082019050919050565b6000612b98602983612deb565b9150612ba382613291565b604082019050919050565b6000612bbb602583612deb565b9150612bc6826132e0565b604082019050919050565b6000612bde602483612deb565b9150612be98261332f565b604082019050919050565b612bfd81612f4f565b82525050565b612c0c81612f59565b82525050565b6000602082019050612c276000830184612a3f565b92915050565b6000602082019050612c426000830184612a4e565b92915050565b60006020820190508181036000830152612c628184612a5d565b905092915050565b60006020820190508181036000830152612c8381612a96565b9050919050565b60006020820190508181036000830152612ca381612ab9565b9050919050565b60006020820190508181036000830152612cc381612adc565b9050919050565b60006020820190508181036000830152612ce381612aff565b9050919050565b60006020820190508181036000830152612d0381612b22565b9050919050565b60006020820190508181036000830152612d2381612b45565b9050919050565b60006020820190508181036000830152612d4381612b68565b9050919050565b60006020820190508181036000830152612d6381612b8b565b9050919050565b60006020820190508181036000830152612d8381612bae565b9050919050565b60006020820190508181036000830152612da381612bd1565b9050919050565b6000602082019050612dbf6000830184612bf4565b92915050565b6000602082019050612dda6000830184612c03565b92915050565b600081519050919050565b600082825260208201905092915050565b6000612e0782612f4f565b9150612e1283612f4f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612e4757612e46612fe2565b5b828201905092915050565b6000612e5d82612f4f565b9150612e6883612f4f565b925082612e7857612e77613011565b5b828204905092915050565b6000612e8e82612f4f565b9150612e9983612f4f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612ed257612ed1612fe2565b5b828202905092915050565b6000612ee882612f4f565b9150612ef383612f4f565b925082821015612f0657612f05612fe2565b5b828203905092915050565b6000612f1c82612f2f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015612f84578082015181840152602081019050612f69565b83811115612f93576000848401525b50505050565b6000612fa482612f4f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612fd757612fd6612fe2565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f41646472657373206973206e6f742061206d656d626572206f6620646578206c60008201527f6973742e00000000000000000000000000000000000000000000000000000000602082015250565b7f4164647265737320697320616c7265616479206f6e2074686520646578206c6960008201527f73742e0000000000000000000000000000000000000000000000000000000000602082015250565b7f4163636f756e7420697320616c7265616479206578636c756465640000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61338781612f11565b811461339257600080fd5b50565b61339e81612f4f565b81146133a957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122091ae5fab266e90d47be62ef1052be28c8a0b833de6490aed182252bff265f26064736f6c63430008070033 | {"success": true, "error": null, "results": {}} | 1,862 |
0x6777d4e4d86df506887dbeb62f63ad532ac11ad7 | /**
*Submitted for verification at Etherscan.io on 2021-06-20
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;
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 swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
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 KYUBIWORLD is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = unicode"Kyūbi World";
string private constant _symbol = unicode"Kyūbi";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 33000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public _kyubiBurned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
mapping(address => uint256) private buycooldown;
mapping(address => uint256) private sellcooldown;
mapping(address => uint256) private firstsell;
mapping(address => uint256) private sellnumber;
address private eViral = 0x7CeC018CEEF82339ee583Fd95446334f2685d24f;
address private burnAddress = 0x000000000000000000000000000000000000dEaD;
address payable private _teamAddress;
address payable private _marketingFunds;
address payable private _developmentFunds1;
address payable private _developmentFunds2;
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
bool public tradeAllowed = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool public swapEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _reflection = 5;
uint256 private _teamFee = 7;
uint256 private _kyubiBurn = 5;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2, address payable addr3, address payable addr4) {
_teamAddress = addr1;
_marketingFunds = addr2;
_developmentFunds1 = addr3;
_developmentFunds2 = addr4;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
_isExcludedFromFee[_developmentFunds1] = true;
_isExcludedFromFee[_developmentFunds2] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function releaseKyubi() public onlyOwner {
require(liquidityAdded);
tradeAllowed = true;
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function 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;
liquidityAdded = true;
_maxTxAmount = 99000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualswap() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
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 == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradeAllowed);
require(buycooldown[to] < block.timestamp);
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.div(100));
require(amount <= _maxTxAmount);
buycooldown[to] = block.timestamp + (45 seconds);
_teamFee = 7;
_reflection = 3;
_kyubiBurn = 0;
uint contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
swapETHForEViral(address(this).balance);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[to] && !_isExcludedFromFee[from]) {
require(amount <= balanceOf(uniswapV2Pair).mul(33).div(1000));
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 + (3 hours);
}
else if (sellnumber[from] == 2) {
sellnumber[from]++;
sellcooldown[from] = firstsell[from] + (1 days);
}
uint initialBalance = address(this).balance;
swapTokensForEth(contractTokenBalance);
uint newBalance = address(this).balance;
uint distributeETHBalance = newBalance.sub(initialBalance);
if (distributeETHBalance > 0) {
sendETHToFee(distributeETHBalance);
}
setFee(sellnumber[from]);
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
if ( to != uniswapV2Pair && to!= address(uniswapV2Router)) {
takeFee = false;
}
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function removeAllFee() private {
if (_reflection == 0 && _teamFee == 0 && _kyubiBurn == 0) return;
_reflection = 0;
_teamFee = 0;
_kyubiBurn = 0;
}
function restoreAllFee() private {
_reflection = 5;
_teamFee = 7;
_kyubiBurn = 5;
}
function setFee(uint256 multiplier) private {
_reflection = _reflection.mul(multiplier);
_kyubiBurn = _kyubiBurn.mul(multiplier);
_teamFee = _teamFee.add(multiplier);
}
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 amount) private {
(uint256 tAmount, uint256 tBurn) = _kyubiTokenBurn(amount);
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount, tBurn);
_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 _kyubiTokenBurn(uint amount) private returns (uint, uint) {
uint orgAmount = amount;
uint256 currentRate = _getRate();
uint256 tBurn = amount.mul(_kyubiBurn).div(100);
uint256 rBurn = tBurn.mul(currentRate);
_tTotal = _tTotal.sub(tBurn);
_rTotal = _rTotal.sub(rBurn);
_kyubiBurned = _kyubiBurned.add(tBurn);
return (orgAmount, tBurn);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
function _getValues(uint256 tAmount, uint256 tBurn) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _reflection, _teamFee, tBurn);
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, uint256 tBurn) 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).sub(tBurn);
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 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 swapETHForEViral(uint ethAmount) private {
address[] memory path = new address[](2);
path[0] = uniswapV2Router.WETH();
path[1] = address(eViral);
_approve(address(this), address(uniswapV2Router), ethAmount);
uniswapV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: ethAmount}(ethAmount,path,address(burnAddress),block.timestamp);
}
function sendETHToFee(uint256 amount) private {
uint oneEigth = amount.div(8);
_teamAddress.transfer(amount.div(16).mul(5));
_marketingFunds.transfer(oneEigth);
_developmentFunds1.transfer(oneEigth);
_developmentFunds2.transfer(oneEigth);
}
receive() external payable {}
} | 0x6080604052600436106101235760003560e01c8063715018a6116100a0578063c3c8cd8011610064578063c3c8cd80146103cd578063d543dbeb146103e2578063dd62ed3e1461040c578063e7a9a1d614610447578063e8078d941461045c5761012a565b8063715018a6146103405780637a32bae4146103555780638da5cb5b1461036a57806395d89b411461037f578063a9059cbb146103945761012a565b8063313ce567116100e7578063313ce5671461028557806349bd5a5e146102b05780636ddd1713146102e15780636fc3eaec146102f657806370a082311461030d5761012a565b806306fdde031461012f578063095ea7b3146101b957806318160ddd1461020657806323b872dd1461022d5780632b6c7abc146102705761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610471565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017e578181015183820152602001610166565b50505050905090810190601f1680156101ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c557600080fd5b506101f2600480360360408110156101dc57600080fd5b506001600160a01b038135169060200135610497565b604080519115158252519081900360200190f35b34801561021257600080fd5b5061021b6104b5565b60408051918252519081900360200190f35b34801561023957600080fd5b506101f26004803603606081101561025057600080fd5b506001600160a01b038135811691602081013590911690604001356104bb565b34801561027c57600080fd5b5061021b610542565b34801561029157600080fd5b5061029a610548565b6040805160ff9092168252519081900360200190f35b3480156102bc57600080fd5b506102c561054d565b604080516001600160a01b039092168252519081900360200190f35b3480156102ed57600080fd5b506101f261055c565b34801561030257600080fd5b5061030b61056c565b005b34801561031957600080fd5b5061021b6004803603602081101561033057600080fd5b50356001600160a01b03166105d1565b34801561034c57600080fd5b5061030b6105f3565b34801561036157600080fd5b506101f2610695565b34801561037657600080fd5b506102c56106a5565b34801561038b57600080fd5b506101446106b4565b3480156103a057600080fd5b506101f2600480360360408110156103b757600080fd5b506001600160a01b0381351690602001356106d4565b3480156103d957600080fd5b5061030b6106e8565b3480156103ee57600080fd5b5061030b6004803603602081101561040557600080fd5b5035610756565b34801561041857600080fd5b5061021b6004803603604081101561042f57600080fd5b506001600160a01b038135811691602001351661085d565b34801561045357600080fd5b5061030b610888565b34801561046857600080fd5b5061030b61090b565b60408051808201909152600c81526b12de716ad89a4815dbdc9b1960a21b602082015290565b60006104ab6104a4610c8c565b8484610c90565b5060015b92915050565b60045490565b60006104c8848484610d7c565b610538846104d4610c8c565b61053385604051806060016040528060288152602001611e76602891396001600160a01b038a16600090815260086020526040812090610512610c8c565b6001600160a01b0316815260208101919091526040016000205491906112c3565b610c90565b5060019392505050565b60075481565b600990565b6015546001600160a01b031681565b601554600160b81b900460ff1681565b610574610c8c565b6000546001600160a01b039081169116146105c4576040805162461bcd60e51b81526020600482018190526024820152600080516020611e9e833981519152604482015290519081900360640190fd5b476105ce8161135a565b50565b6001600160a01b0381166000908152600260205260408120546104af90611469565b6105fb610c8c565b6000546001600160a01b0390811691161461064b576040805162461bcd60e51b81526020600482018190526024820152600080516020611e9e833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b601554600160a01b900460ff1681565b6000546001600160a01b031690565b6040805180820190915260068152654b79c5ab626960d01b602082015290565b60006104ab6106e1610c8c565b8484610d7c565b6106f0610c8c565b6000546001600160a01b03908116911614610740576040805162461bcd60e51b81526020600482018190526024820152600080516020611e9e833981519152604482015290519081900360640190fd5b600061074b306105d1565b90506105ce816114c9565b61075e610c8c565b6000546001600160a01b039081169116146107ae576040805162461bcd60e51b81526020600482018190526024820152600080516020611e9e833981519152604482015290519081900360640190fd5b60008111610803576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610823606461081d8360045461169890919063ffffffff16565b906116f1565b601681905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b610890610c8c565b6000546001600160a01b039081169116146108e0576040805162461bcd60e51b81526020600482018190526024820152600080516020611e9e833981519152604482015290519081900360640190fd5b601554600160a81b900460ff166108f657600080fd5b6015805460ff60a01b1916600160a01b179055565b610913610c8c565b6000546001600160a01b03908116911614610963576040805162461bcd60e51b81526020600482018190526024820152600080516020611e9e833981519152604482015290519081900360640190fd5b601480546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905560045490916109a79130916001600160a01b031690610c90565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156109e057600080fd5b505afa1580156109f4573d6000803e3d6000fd5b505050506040513d6020811015610a0a57600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610a5a57600080fd5b505afa158015610a6e573d6000803e3d6000fd5b505050506040513d6020811015610a8457600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610ad657600080fd5b505af1158015610aea573d6000803e3d6000fd5b505050506040513d6020811015610b0057600080fd5b5051601580546001600160a01b0319166001600160a01b039283161790556014541663f305d7194730610b32816105d1565b600080610b3d6106a5565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610ba857600080fd5b505af1158015610bbc573d6000803e3d6000fd5b50505050506040513d6060811015610bd357600080fd5b50506015805460ff60a81b1960ff60b81b19909116600160b81b1716600160a81b179081905568055de6a779bbac00006016556014546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610c5d57600080fd5b505af1158015610c71573d6000803e3d6000fd5b505050506040513d6020811015610c8757600080fd5b505050565b3390565b6001600160a01b038316610cd55760405162461bcd60e51b8152600401808060200182810382526024815260200180611f0c6024913960400191505060405180910390fd5b6001600160a01b038216610d1a5760405162461bcd60e51b8152600401808060200182810382526022815260200180611e336022913960400191505060405180910390fd5b6001600160a01b03808416600081815260086020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610dc15760405162461bcd60e51b8152600401808060200182810382526025815260200180611ee76025913960400191505060405180910390fd5b6001600160a01b038216610e065760405162461bcd60e51b8152600401808060200182810382526023815260200180611de66023913960400191505060405180910390fd5b60008111610e455760405162461bcd60e51b8152600401808060200182810382526029815260200180611ebe6029913960400191505060405180910390fd5b610e4d6106a5565b6001600160a01b0316836001600160a01b031614158015610e875750610e716106a5565b6001600160a01b0316826001600160a01b031614155b15611231576015546001600160a01b038481169116148015610eb757506014546001600160a01b03838116911614155b8015610edc57506001600160a01b03821660009081526009602052604090205460ff16155b15610f9957601554600160a01b900460ff16610ef757600080fd5b6001600160a01b0382166000908152600a60205260409020544211610f1b57600080fd5b6000610f26836105d1565b600454909150610f379060646116f1565b610f418383611733565b1115610f4c57600080fd5b601654821115610f5b57600080fd5b6001600160a01b0383166000908152600a60205260408120602d4201905560076018556003601755601955478015610f9657610f964761178d565b50505b6000610fa4306105d1565b601554909150600160b01b900460ff16158015610fcf57506015546001600160a01b03858116911614155b8015610fe45750601554600160b81b900460ff165b801561100957506001600160a01b03831660009081526009602052604090205460ff16155b801561102e57506001600160a01b03841660009081526009602052604090205460ff16155b1561122f5760155461105d906103e89061081d90602190611057906001600160a01b03166105d1565b90611698565b82111561106957600080fd5b6001600160a01b0384166000908152600b6020526040902054421161108d57600080fd5b6001600160a01b0384166000908152600c6020526040902054426201518090910110156110ce576001600160a01b0384166000908152600d60205260408120555b6001600160a01b0384166000908152600d602052604090205461112e576001600160a01b0384166000908152600d6020908152604080832080546001019055600c82528083204290819055600b909252909120610e1090910190556111e1565b6001600160a01b0384166000908152600d602052604090205460011415611184576001600160a01b0384166000908152600d6020908152604080832080546001019055600b9091529020612a30420190556111e1565b6001600160a01b0384166000908152600d6020526040902054600214156111e1576001600160a01b0384166000908152600d6020908152604080832080546001019055600c825280832054600b9092529091206201518090910190555b476111eb826114c9565b4760006111f88284611946565b90508015611209576112098161135a565b6001600160a01b0387166000908152600d602052604090205461122b90611988565b5050505b505b6001600160a01b03831660009081526009602052604090205460019060ff168061127357506001600160a01b03831660009081526009602052604090205460ff165b156112b157506015546000906001600160a01b038481169116148015906112a857506014546001600160a01b03848116911614155b156112b1575060005b6112bd848484846119bb565b50505050565b600081848411156113525760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175781810151838201526020016112ff565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60006113678260086116f1565b601080549192506001600160a01b03909116906108fc90611390906005906110579087906116f1565b6040518115909202916000818181858888f193505050501580156113b8573d6000803e3d6000fd5b506011546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156113f3573d6000803e3d6000fd5b506012546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561142e573d6000803e3d6000fd5b506013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610c87573d6000803e3d6000fd5b60006005548211156114ac5760405162461bcd60e51b815260040180806020018281038252602a815260200180611e09602a913960400191505060405180910390fd5b60006114b66119ec565b90506114c283826116f1565b9392505050565b6015805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061150b57fe5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561155f57600080fd5b505afa158015611573573d6000803e3d6000fd5b505050506040513d602081101561158957600080fd5b505181518290600190811061159a57fe5b6001600160a01b0392831660209182029290920101526014546115c09130911684610c90565b60145460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b8381101561164657818101518382015260200161162e565b505050509050019650505050505050600060405180830381600087803b15801561166f57600080fd5b505af1158015611683573d6000803e3d6000fd5b50506015805460ff60b01b1916905550505050565b6000826116a7575060006104af565b828202828482816116b457fe5b04146114c25760405162461bcd60e51b8152600401808060200182810382526021815260200180611e556021913960400191505060405180910390fd5b60006114c283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a0f565b6000828201838110156114c2576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6040805160028082526060820183526000926020830190803683375050601454604080516315ab88c960e31b815290519394506001600160a01b039091169263ad5c464892506004808301926020929190829003018186803b1580156117f257600080fd5b505afa158015611806573d6000803e3d6000fd5b505050506040513d602081101561181c57600080fd5b50518151829060009061182b57fe5b6001600160a01b039283166020918202929092010152600e5482519116908290600190811061185657fe5b6001600160a01b03928316602091820292909201015260145461187c9130911684610c90565b601454600f5460405163b6f9de9560e01b8152600481018581526001600160a01b03928316604483018190524260648401819052608060248501908152875160848601528751959096169563b6f9de9595899586958a9594939092909160a401906020808801910280838360005b838110156119025781810151838201526020016118ea565b50505050905001955050505050506000604051808303818588803b15801561192957600080fd5b505af115801561193d573d6000803e3d6000fd5b50505050505050565b60006114c283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112c3565b6017546119959082611698565b6017556019546119a59082611698565b6019556018546119b59082611733565b60185550565b806119c8576119c8611a74565b6119d3848484611aac565b806112bd576112bd600560178190556007601855601955565b60008060006119f9611bc6565b9092509050611a0882826116f1565b9250505090565b60008183611a5e5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156113175781810151838201526020016112ff565b506000838581611a6a57fe5b0495945050505050565b601754158015611a845750601854155b8015611a905750601954155b15611a9a57611aaa565b6000601781905560188190556019555b565b600080611ab883611bfd565b91509150600080600080600080611acf8888611c76565b955095509550955095509550611b1386600260008e6001600160a01b03166001600160a01b031681526020019081526020016000205461194690919063ffffffff16565b6001600160a01b03808d1660009081526002602052604080822093909355908c1681522054611b429086611733565b6001600160a01b038b16600090815260026020526040902055611b6481611cd5565b611b6e8483611d1f565b896001600160a01b03168b6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35050505050505050505050565b6005546004546000918291611bdb82826116f1565b821015611bf357600554600454935093505050611bf9565b90925090505b9091565b6000808281611c0a6119ec565b90506000611c28606461081d6019548961169890919063ffffffff16565b90506000611c368284611698565b600454909150611c469083611946565b600455600554611c569082611946565b600555600754611c669083611733565b6007555091935090915050915091565b6000806000806000806000806000611c948b6017546018548d611d43565b9250925092506000611ca46119ec565b90506000806000611cb78f878787611d95565b919e509c509a50959850939650919450505050509295509295509295565b6000611cdf6119ec565b90506000611ced8383611698565b30600090815260026020526040902054909150611d0a9082611733565b30600090815260026020526040902055505050565b600554611d2c9083611946565b600555600654611d3c9082611733565b6006555050565b6000808080611d57606461081d8a8a611698565b90506000611d6a606461081d8b8a611698565b90506000611d8487611d7e84818e88611946565b90611946565b9a9299509097509095505050505050565b6000808080611da48886611698565b90506000611db28887611698565b90506000611dc08888611698565b90506000611dd282611d7e8686611946565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122020a7699b5bd7b9e07497427dd0879faf7d757e016eb69f9632337fa5a14b4d6264736f6c63430007060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,863 |
0x8226b146C3f50594E7493f726F1bbAA446F15fD8 | // 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() {
_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);
}
}
contract SAGE is Context, IERC20, IERC20Metadata, Ownable {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor () {
_name = "Sage Coin";
_symbol = "SAGE";
_totalSupply = 1008000000000 * (10**decimals());
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0),msg.sender,_totalSupply);
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overloaded;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 4;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/**
* @dev 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 Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
function mint(address account, uint256 amount) public onlyOwner {
_mint(account,amount);
}
function burn(address account, uint256 amount) public onlyOwner {
_burn(account,amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function _afterTokenTransfer( address from,address to,uint256 amount) internal virtual {}
} | 0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d71461029d578063a9059cbb146102cd578063dd62ed3e146102fd578063f2fde38b1461032d57610100565b8063715018a61461023b5780638da5cb5b1461024557806395d89b41146102635780639dc29fac1461028157610100565b8063313ce567116100d3578063313ce567146101a157806339509351146101bf57806340c10f19146101ef57806370a082311461020b57610100565b806306fdde0314610105578063095ea7b31461012357806318160ddd1461015357806323b872dd14610171575b600080fd5b61010d610349565b60405161011a91906116c0565b60405180910390f35b61013d60048036038101906101389190611431565b6103db565b60405161014a91906116a5565b60405180910390f35b61015b6103f9565b6040516101689190611862565b60405180910390f35b61018b600480360381019061018691906113de565b610403565b60405161019891906116a5565b60405180910390f35b6101a9610504565b6040516101b6919061187d565b60405180910390f35b6101d960048036038101906101d49190611431565b61050d565b6040516101e691906116a5565b60405180910390f35b61020960048036038101906102049190611431565b6105b9565b005b61022560048036038101906102209190611371565b610643565b6040516102329190611862565b60405180910390f35b61024361068c565b005b61024d610714565b60405161025a919061168a565b60405180910390f35b61026b61073d565b60405161027891906116c0565b60405180910390f35b61029b60048036038101906102969190611431565b6107cf565b005b6102b760048036038101906102b29190611431565b610859565b6040516102c491906116a5565b60405180910390f35b6102e760048036038101906102e29190611431565b61094d565b6040516102f491906116a5565b60405180910390f35b6103176004803603810190610312919061139e565b61096b565b6040516103249190611862565b60405180910390f35b61034760048036038101906103429190611371565b6109f2565b005b606060048054610358906119c6565b80601f0160208091040260200160405190810160405280929190818152602001828054610384906119c6565b80156103d15780601f106103a6576101008083540402835291602001916103d1565b820191906000526020600020905b8154815290600101906020018083116103b457829003601f168201915b5050505050905090565b60006103ef6103e8610aea565b8484610af2565b6001905092915050565b6000600354905090565b6000610410848484610cbd565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061045b610aea565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d290611782565b60405180910390fd5b6104f8856104e7610aea565b85846104f3919061190a565b610af2565b60019150509392505050565b60006004905090565b60006105af61051a610aea565b848460026000610528610aea565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105aa91906118b4565b610af2565b6001905092915050565b6105c1610aea565b73ffffffffffffffffffffffffffffffffffffffff166105df610714565b73ffffffffffffffffffffffffffffffffffffffff1614610635576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062c906117a2565b60405180910390fd5b61063f8282610f3f565b5050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610694610aea565b73ffffffffffffffffffffffffffffffffffffffff166106b2610714565b73ffffffffffffffffffffffffffffffffffffffff1614610708576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ff906117a2565b60405180910390fd5b61071260006110a0565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606005805461074c906119c6565b80601f0160208091040260200160405190810160405280929190818152602001828054610778906119c6565b80156107c55780601f1061079a576101008083540402835291602001916107c5565b820191906000526020600020905b8154815290600101906020018083116107a857829003601f168201915b5050505050905090565b6107d7610aea565b73ffffffffffffffffffffffffffffffffffffffff166107f5610714565b73ffffffffffffffffffffffffffffffffffffffff161461084b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610842906117a2565b60405180910390fd5b6108558282611164565b5050565b60008060026000610868610aea565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90611822565b60405180910390fd5b610942610930610aea565b85858461093d919061190a565b610af2565b600191505092915050565b600061096161095a610aea565b8484610cbd565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6109fa610aea565b73ffffffffffffffffffffffffffffffffffffffff16610a18610714565b73ffffffffffffffffffffffffffffffffffffffff1614610a6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a65906117a2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610ade576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad590611722565b60405180910390fd5b610ae7816110a0565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5990611802565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610bd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc990611742565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610cb09190611862565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d24906117e2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d94906116e2565b60405180910390fd5b610da883838361133d565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610e2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2690611762565b60405180910390fd5b8181610e3b919061190a565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ecd91906118b4565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610f319190611862565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610faf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa690611842565b60405180910390fd5b610fbb6000838361133d565b8060036000828254610fcd91906118b4565b9250508190555080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461102391906118b4565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516110889190611862565b60405180910390a361109c60008383611342565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111cb906117c2565b60405180910390fd5b6111e08260008361133d565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611267576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125e90611702565b60405180910390fd5b818103600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600360008282546112bf919061190a565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516113249190611862565b60405180910390a361133883600084611342565b505050565b505050565b505050565b60008135905061135681611dd4565b92915050565b60008135905061136b81611deb565b92915050565b60006020828403121561138757611386611a56565b5b600061139584828501611347565b91505092915050565b600080604083850312156113b5576113b4611a56565b5b60006113c385828601611347565b92505060206113d485828601611347565b9150509250929050565b6000806000606084860312156113f7576113f6611a56565b5b600061140586828701611347565b935050602061141686828701611347565b92505060406114278682870161135c565b9150509250925092565b6000806040838503121561144857611447611a56565b5b600061145685828601611347565b92505060206114678582860161135c565b9150509250929050565b61147a8161193e565b82525050565b61148981611950565b82525050565b600061149a82611898565b6114a481856118a3565b93506114b4818560208601611993565b6114bd81611a5b565b840191505092915050565b60006114d56023836118a3565b91506114e082611a6c565b604082019050919050565b60006114f86022836118a3565b915061150382611abb565b604082019050919050565b600061151b6026836118a3565b915061152682611b0a565b604082019050919050565b600061153e6022836118a3565b915061154982611b59565b604082019050919050565b60006115616026836118a3565b915061156c82611ba8565b604082019050919050565b60006115846028836118a3565b915061158f82611bf7565b604082019050919050565b60006115a76020836118a3565b91506115b282611c46565b602082019050919050565b60006115ca6021836118a3565b91506115d582611c6f565b604082019050919050565b60006115ed6025836118a3565b91506115f882611cbe565b604082019050919050565b60006116106024836118a3565b915061161b82611d0d565b604082019050919050565b60006116336025836118a3565b915061163e82611d5c565b604082019050919050565b6000611656601f836118a3565b915061166182611dab565b602082019050919050565b6116758161197c565b82525050565b61168481611986565b82525050565b600060208201905061169f6000830184611471565b92915050565b60006020820190506116ba6000830184611480565b92915050565b600060208201905081810360008301526116da818461148f565b905092915050565b600060208201905081810360008301526116fb816114c8565b9050919050565b6000602082019050818103600083015261171b816114eb565b9050919050565b6000602082019050818103600083015261173b8161150e565b9050919050565b6000602082019050818103600083015261175b81611531565b9050919050565b6000602082019050818103600083015261177b81611554565b9050919050565b6000602082019050818103600083015261179b81611577565b9050919050565b600060208201905081810360008301526117bb8161159a565b9050919050565b600060208201905081810360008301526117db816115bd565b9050919050565b600060208201905081810360008301526117fb816115e0565b9050919050565b6000602082019050818103600083015261181b81611603565b9050919050565b6000602082019050818103600083015261183b81611626565b9050919050565b6000602082019050818103600083015261185b81611649565b9050919050565b6000602082019050611877600083018461166c565b92915050565b6000602082019050611892600083018461167b565b92915050565b600081519050919050565b600082825260208201905092915050565b60006118bf8261197c565b91506118ca8361197c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156118ff576118fe6119f8565b5b828201905092915050565b60006119158261197c565b91506119208361197c565b925082821015611933576119326119f8565b5b828203905092915050565b60006119498261195c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156119b1578082015181840152602081019050611996565b838111156119c0576000848401525b50505050565b600060028204905060018216806119de57607f821691505b602082108114156119f2576119f1611a27565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b611ddd8161193e565b8114611de857600080fd5b50565b611df48161197c565b8114611dff57600080fd5b5056fea2646970667358221220b3e70163804c7d3be7e5984b0b1962213385bde082874f906abee356f91b44f664736f6c63430008070033 | {"success": true, "error": null, "results": {}} | 1,864 |
0x39039428bfb19f50f268023b761015abdca28aaa | /**
*Submitted for verification at Etherscan.io on 2021-10-11
*/
/*
Welcome to the joyous world of BabyFrunk!
Made in honour of our favorite shiba inu, Floki Frunkpuppy
Please feel free to join our telegram @babyfrunkerc
Check out our website too! babyfrunk.com
*/
// 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(
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 BabyFrunk 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 = 1000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "BabyFrunk";
string private constant _symbol = "BFRUNK";
uint8 private constant _decimals = 6;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(0x32EEc9E166b0b152c6D89a34b6c8392Ea1858E54);
_feeAddrWallet2 = payable(0x32EEc9E166b0b152c6D89a34b6c8392Ea1858E54);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(0),address(this),_tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 1;
_feeAddr2 = 1;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 1;
_feeAddr2 = 1;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b8063273123b7116100d1578063273123b7146101de578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b6040516101309190612a65565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b91906125df565b61042a565b60405161016d9190612a4a565b60405180910390f35b34801561018257600080fd5b5061018b610448565b6040516101989190612bc7565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c3919061258c565b610457565b6040516101d59190612a4a565b60405180910390f35b3480156101ea57600080fd5b50610205600480360381019061020091906124f2565b610530565b005b34801561021357600080fd5b5061021c610620565b6040516102299190612c3c565b60405180910390f35b34801561023e57600080fd5b5061025960048036038101906102549190612668565b610629565b005b34801561026757600080fd5b506102706106db565b005b34801561027e57600080fd5b50610299600480360381019061029491906124f2565b61074d565b6040516102a69190612bc7565b60405180910390f35b3480156102bb57600080fd5b506102c461079e565b005b3480156102d257600080fd5b506102db6108f1565b6040516102e8919061297c565b60405180910390f35b3480156102fd57600080fd5b5061030661091a565b6040516103139190612a65565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e91906125df565b610957565b6040516103509190612a4a565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b919061261f565b610975565b005b34801561038e57600080fd5b50610397610a9f565b005b3480156103a557600080fd5b506103ae610b19565b005b3480156103bc57600080fd5b506103d760048036038101906103d2919061254c565b611072565b6040516103e49190612bc7565b60405180910390f35b60606040518060400160405280600981526020017f426162794672756e6b0000000000000000000000000000000000000000000000815250905090565b600061043e6104376110f9565b8484611101565b6001905092915050565b600066038d7ea4c68000905090565b60006104648484846112cc565b610525846104706110f9565b610520856040518060600160405280602881526020016132f160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104d66110f9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118d19092919063ffffffff16565b611101565b600190509392505050565b6105386110f9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105bc90612b27565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006006905090565b6106316110f9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b590612b27565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661071c6110f9565b73ffffffffffffffffffffffffffffffffffffffff161461073c57600080fd5b600047905061074a81611935565b50565b6000610797600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a30565b9050919050565b6107a66110f9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610833576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082a90612b27565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f424652554e4b0000000000000000000000000000000000000000000000000000815250905090565b600061096b6109646110f9565b84846112cc565b6001905092915050565b61097d6110f9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0190612b27565b60405180910390fd5b60005b8151811015610a9b57600160066000848481518110610a2f57610a2e612f84565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a9390612edd565b915050610a0d565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ae06110f9565b73ffffffffffffffffffffffffffffffffffffffff1614610b0057600080fd5b6000610b0b3061074d565b9050610b1681611a9e565b50565b610b216110f9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba590612b27565b60405180910390fd5b600f60149054906101000a900460ff1615610bfe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bf590612ba7565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c8c30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1666038d7ea4c68000611101565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cd257600080fd5b505afa158015610ce6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0a919061251f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d6c57600080fd5b505afa158015610d80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da4919061251f565b6040518363ffffffff1660e01b8152600401610dc1929190612997565b602060405180830381600087803b158015610ddb57600080fd5b505af1158015610def573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e13919061251f565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610e9c3061074d565b600080610ea76108f1565b426040518863ffffffff1660e01b8152600401610ec9969594939291906129e9565b6060604051808303818588803b158015610ee257600080fd5b505af1158015610ef6573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f1b91906126c2565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555066038d7ea4c680006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161101c9291906129c0565b602060405180830381600087803b15801561103657600080fd5b505af115801561104a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106e9190612695565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611171576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116890612b87565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d890612ac7565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112bf9190612bc7565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561133c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133390612b67565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a390612a87565b60405180910390fd5b600081116113ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e690612b47565b60405180910390fd5b6001600a819055506001600b819055506114076108f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561147557506114456108f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156118c157600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561151e5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61152757600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156115d25750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116285750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156116405750600f60179054906101000a900460ff165b156116f05760105481111561165457600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061169f57600080fd5b603c426116ac9190612cfd565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561179b5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117f15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611807576001600a819055506001600b819055505b60006118123061074d565b9050600f60159054906101000a900460ff1615801561187f5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156118975750600f60169054906101000a900460ff165b156118bf576118a581611a9e565b600047905060008111156118bd576118bc47611935565b5b505b505b6118cc838383611d26565b505050565b6000838311158290611919576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119109190612a65565b60405180910390fd5b50600083856119289190612dde565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611985600284611d3690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156119b0573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a01600284611d3690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a2c573d6000803e3d6000fd5b5050565b6000600854821115611a77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6e90612aa7565b60405180910390fd5b6000611a81611d80565b9050611a968184611d3690919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ad657611ad5612fb3565b5b604051908082528060200260200182016040528015611b045781602001602082028036833780820191505090505b5090503081600081518110611b1c57611b1b612f84565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611bbe57600080fd5b505afa158015611bd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bf6919061251f565b81600181518110611c0a57611c09612f84565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611c7130600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611101565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611cd5959493929190612be2565b600060405180830381600087803b158015611cef57600080fd5b505af1158015611d03573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611d31838383611dab565b505050565b6000611d7883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611f76565b905092915050565b6000806000611d8d611fd9565b91509150611da48183611d3690919063ffffffff16565b9250505090565b600080600080600080611dbd87612035565b955095509550955095509550611e1b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461209d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611eb085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120e790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611efc81612145565b611f068483612202565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611f639190612bc7565b60405180910390a3505050505050505050565b60008083118290611fbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fb49190612a65565b60405180910390fd5b5060008385611fcc9190612d53565b9050809150509392505050565b60008060006008549050600066038d7ea4c68000905061200b66038d7ea4c68000600854611d3690919063ffffffff16565b8210156120285760085466038d7ea4c68000935093505050612031565b81819350935050505b9091565b60008060008060008060008060006120528a600a54600b5461223c565b9250925092506000612062611d80565b905060008060006120758e8787876122d2565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006120df83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506118d1565b905092915050565b60008082846120f69190612cfd565b90508381101561213b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213290612ae7565b60405180910390fd5b8091505092915050565b600061214f611d80565b90506000612166828461235b90919063ffffffff16565b90506121ba81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120e790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6122178260085461209d90919063ffffffff16565b600881905550612232816009546120e790919063ffffffff16565b6009819055505050565b600080600080612268606461225a888a61235b90919063ffffffff16565b611d3690919063ffffffff16565b905060006122926064612284888b61235b90919063ffffffff16565b611d3690919063ffffffff16565b905060006122bb826122ad858c61209d90919063ffffffff16565b61209d90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806122eb858961235b90919063ffffffff16565b90506000612302868961235b90919063ffffffff16565b90506000612319878961235b90919063ffffffff16565b9050600061234282612334858761209d90919063ffffffff16565b61209d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561236e57600090506123d0565b6000828461237c9190612d84565b905082848261238b9190612d53565b146123cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123c290612b07565b60405180910390fd5b809150505b92915050565b60006123e96123e484612c7c565b612c57565b9050808382526020820190508285602086028201111561240c5761240b612fe7565b5b60005b8581101561243c57816124228882612446565b84526020840193506020830192505060018101905061240f565b5050509392505050565b600081359050612455816132ab565b92915050565b60008151905061246a816132ab565b92915050565b600082601f83011261248557612484612fe2565b5b81356124958482602086016123d6565b91505092915050565b6000813590506124ad816132c2565b92915050565b6000815190506124c2816132c2565b92915050565b6000813590506124d7816132d9565b92915050565b6000815190506124ec816132d9565b92915050565b60006020828403121561250857612507612ff1565b5b600061251684828501612446565b91505092915050565b60006020828403121561253557612534612ff1565b5b60006125438482850161245b565b91505092915050565b6000806040838503121561256357612562612ff1565b5b600061257185828601612446565b925050602061258285828601612446565b9150509250929050565b6000806000606084860312156125a5576125a4612ff1565b5b60006125b386828701612446565b93505060206125c486828701612446565b92505060406125d5868287016124c8565b9150509250925092565b600080604083850312156125f6576125f5612ff1565b5b600061260485828601612446565b9250506020612615858286016124c8565b9150509250929050565b60006020828403121561263557612634612ff1565b5b600082013567ffffffffffffffff81111561265357612652612fec565b5b61265f84828501612470565b91505092915050565b60006020828403121561267e5761267d612ff1565b5b600061268c8482850161249e565b91505092915050565b6000602082840312156126ab576126aa612ff1565b5b60006126b9848285016124b3565b91505092915050565b6000806000606084860312156126db576126da612ff1565b5b60006126e9868287016124dd565b93505060206126fa868287016124dd565b925050604061270b868287016124dd565b9150509250925092565b6000612721838361272d565b60208301905092915050565b61273681612e12565b82525050565b61274581612e12565b82525050565b600061275682612cb8565b6127608185612cdb565b935061276b83612ca8565b8060005b8381101561279c5781516127838882612715565b975061278e83612cce565b92505060018101905061276f565b5085935050505092915050565b6127b281612e24565b82525050565b6127c181612e67565b82525050565b60006127d282612cc3565b6127dc8185612cec565b93506127ec818560208601612e79565b6127f581612ff6565b840191505092915050565b600061280d602383612cec565b915061281882613007565b604082019050919050565b6000612830602a83612cec565b915061283b82613056565b604082019050919050565b6000612853602283612cec565b915061285e826130a5565b604082019050919050565b6000612876601b83612cec565b9150612881826130f4565b602082019050919050565b6000612899602183612cec565b91506128a48261311d565b604082019050919050565b60006128bc602083612cec565b91506128c78261316c565b602082019050919050565b60006128df602983612cec565b91506128ea82613195565b604082019050919050565b6000612902602583612cec565b915061290d826131e4565b604082019050919050565b6000612925602483612cec565b915061293082613233565b604082019050919050565b6000612948601783612cec565b915061295382613282565b602082019050919050565b61296781612e50565b82525050565b61297681612e5a565b82525050565b6000602082019050612991600083018461273c565b92915050565b60006040820190506129ac600083018561273c565b6129b9602083018461273c565b9392505050565b60006040820190506129d5600083018561273c565b6129e2602083018461295e565b9392505050565b600060c0820190506129fe600083018961273c565b612a0b602083018861295e565b612a1860408301876127b8565b612a2560608301866127b8565b612a32608083018561273c565b612a3f60a083018461295e565b979650505050505050565b6000602082019050612a5f60008301846127a9565b92915050565b60006020820190508181036000830152612a7f81846127c7565b905092915050565b60006020820190508181036000830152612aa081612800565b9050919050565b60006020820190508181036000830152612ac081612823565b9050919050565b60006020820190508181036000830152612ae081612846565b9050919050565b60006020820190508181036000830152612b0081612869565b9050919050565b60006020820190508181036000830152612b208161288c565b9050919050565b60006020820190508181036000830152612b40816128af565b9050919050565b60006020820190508181036000830152612b60816128d2565b9050919050565b60006020820190508181036000830152612b80816128f5565b9050919050565b60006020820190508181036000830152612ba081612918565b9050919050565b60006020820190508181036000830152612bc08161293b565b9050919050565b6000602082019050612bdc600083018461295e565b92915050565b600060a082019050612bf7600083018861295e565b612c0460208301876127b8565b8181036040830152612c16818661274b565b9050612c25606083018561273c565b612c32608083018461295e565b9695505050505050565b6000602082019050612c51600083018461296d565b92915050565b6000612c61612c72565b9050612c6d8282612eac565b919050565b6000604051905090565b600067ffffffffffffffff821115612c9757612c96612fb3565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612d0882612e50565b9150612d1383612e50565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612d4857612d47612f26565b5b828201905092915050565b6000612d5e82612e50565b9150612d6983612e50565b925082612d7957612d78612f55565b5b828204905092915050565b6000612d8f82612e50565b9150612d9a83612e50565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612dd357612dd2612f26565b5b828202905092915050565b6000612de982612e50565b9150612df483612e50565b925082821015612e0757612e06612f26565b5b828203905092915050565b6000612e1d82612e30565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612e7282612e50565b9050919050565b60005b83811015612e97578082015181840152602081019050612e7c565b83811115612ea6576000848401525b50505050565b612eb582612ff6565b810181811067ffffffffffffffff82111715612ed457612ed3612fb3565b5b80604052505050565b6000612ee882612e50565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612f1b57612f1a612f26565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6132b481612e12565b81146132bf57600080fd5b50565b6132cb81612e24565b81146132d657600080fd5b50565b6132e281612e50565b81146132ed57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204c04b250d078532db932c2fdf3d63004e808eff4e28505cefb1a91aa2a3ca1e064736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,865 |
0xff1614c6b220b24d140e64684aae39067a0f1cd0 | pragma solidity 0.6.7;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* > Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an `Approval` event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Migrations {
address public owner = msg.sender;
uint public last_completed_migration;
modifier restricted() {
require(
msg.sender == owner,
"This function is restricted to the contract's owner"
);
_;
}
function setCompleted(uint completed) public restricted {
last_completed_migration = completed;
}
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
contract Secondary {
address private _primary;
/**
* @dev Emitted when the primary contract changes.
*/
event PrimaryTransferred(
address recipient
);
/**
* @dev Sets the primary account to the one that is creating the Secondary contract.
*/
constructor () internal {
_primary = msg.sender;
emit PrimaryTransferred(_primary);
}
/**
* @dev Reverts if called from any account other than the primary.
*/
modifier onlyPrimary() {
require(msg.sender == _primary, "Secondary: caller is not the primary account");
_;
}
/**
* @return the address of the primary.
*/
function primary() public view returns (address) {
return _primary;
}
/**
* @dev Transfers contract to a new primary.
* @param recipient The address of new primary.
*/
function transferPrimary(address recipient) public onlyPrimary {
require(recipient != address(0), "Secondary: new primary is the zero address");
_primary = recipient;
emit PrimaryTransferred(_primary);
}
}
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See `IERC20.balanceOf`.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @dev See `IERC20.transfer`.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
/**
* @dev See `IERC20.allowance`.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See `IERC20.approve`.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public override returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
/**
* @dev See `IERC20.transferFrom`.
*
* Emits an `Approval` event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of `ERC20`;
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `value`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to `approve` that can be used as a mitigation for
* problems described in `IERC20.approve`.
*
* Emits an `Approval` event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to `approve` that can be used as a mitigation for
* problems described in `IERC20.approve`.
*
* Emits an `Approval` event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to `transfer`, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a `Transfer` event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a `Transfer` event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destoys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a `Transfer` event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0), "ERC20: burn from the zero address");
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an `Approval` event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 value) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = value;
emit Approval(owner, spender, value);
}
/**
* @dev Destoys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See `_burn` and `_approve`.
*/
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, msg.sender, _allowances[account][msg.sender].sub(amount));
}
}
contract Scarcity is ERC20, Secondary
{
address behodler;
modifier onlyBehodler(){
require(behodler != address(0), "Behodler contract not set.");
require(msg.sender == behodler, "Only the Behodler contract can invoke this function.");
_;
}
function setBehodler(address b) external onlyPrimary {
behodler = b;
}
function mint(address recipient, uint value) external onlyBehodler{
_mint(recipient, value);
}
function burn (uint value) external {
_burn(msg.sender,value);
}
function transferToBehodler(address holder, uint value) external onlyBehodler returns (bool){
_transfer(holder, behodler, value);
return true;
}
function name() external pure returns (string memory) {
return "Scarcity";
}
function symbol() external pure returns (string memory) {
return "SCX";
}
function decimals() external pure returns (uint8) {
return 18;
}
}
| 0x608060405234801561001057600080fd5b506004361061010b5760003560e01c806339509351116100a257806395d89b411161007157806395d89b41146104e9578063a457c2d71461056c578063a9059cbb146105d2578063c6dbdf6114610638578063dd62ed3e146106825761010b565b806339509351146103af57806340c10f191461041557806342966c681461046357806370a08231146104915761010b565b806318160ddd116100de57806318160ddd146102a35780632348238c146102c157806323b872dd14610305578063313ce5671461038b5761010b565b806306fdde0314610110578063095ea7b314610193578063140947f1146101f9578063152f95bd1461023d575b600080fd5b6101186106fa565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015857808201518184015260208101905061013d565b50505050905090810190601f1680156101855780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101df600480360360408110156101a957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610737565b604051808215151515815260200191505060405180910390f35b61023b6004803603602081101561020f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061074e565b005b6102896004803603604081101561025357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610838565b604051808215151515815260200191505060405180910390f35b6102ab6109db565b6040518082815260200191505060405180910390f35b610303600480360360208110156102d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109e5565b005b6103716004803603606081101561031b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bda565b604051808215151515815260200191505060405180910390f35b610393610c8b565b604051808260ff1660ff16815260200191505060405180910390f35b6103fb600480360360408110156103c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c94565b604051808215151515815260200191505060405180910390f35b6104616004803603604081101561042b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d39565b005b61048f6004803603602081101561047957600080fd5b8101908080359060200190929190505050610eb2565b005b6104d3600480360360208110156104a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ebf565b6040518082815260200191505060405180910390f35b6104f1610f07565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610531578082015181840152602081019050610516565b50505050905090810190601f16801561055e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105b86004803603604081101561058257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f44565b604051808215151515815260200191505060405180910390f35b61061e600480360360408110156105e857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fe9565b604051808215151515815260200191505060405180910390f35b610640611000565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106e46004803603604081101561069857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061102a565b6040518082815260200191505060405180910390f35b60606040518060400160405280600881526020017f5363617263697479000000000000000000000000000000000000000000000000815250905090565b60006107443384846110b1565b6001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180611a98602c913960400191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156108fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4265686f646c657220636f6e7472616374206e6f74207365742e00000000000081525060200191505060405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109a4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611a3f6034913960400191505060405180910390fd5b6109d183600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a8565b6001905092915050565b6000600254905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a8b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180611a98602c913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806119f4602a913960400191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d9600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000610be78484846112a8565b610c808433610c7b85600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461154490919063ffffffff16565b6110b1565b600190509392505050565b60006012905090565b6000610d2f3384610d2a85600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cd90919063ffffffff16565b6110b1565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610dfe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4265686f646c657220636f6e7472616374206e6f74207365742e00000000000081525060200191505060405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ea4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611a3f6034913960400191505060405180910390fd5b610eae8282611655565b5050565b610ebc3382611810565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606040518060400160405280600381526020017f5343580000000000000000000000000000000000000000000000000000000000815250905090565b6000610fdf3384610fda85600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461154490919063ffffffff16565b6110b1565b6001905092915050565b6000610ff63384846112a8565b6001905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611137576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611ac46024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806119d26022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561132e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611a736025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806119af6023913960400191505060405180910390fd5b611405816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461154490919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611498816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cd90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000828211156115bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b60008082840190508381101561164b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b61170d816002546115cd90919063ffffffff16565b600281905550611764816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cd90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611896576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611a1e6021913960400191505060405180910390fd5b6118ab8160025461154490919063ffffffff16565b600281905550611902816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461154490919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f20616464726573735365636f6e646172793a206e6577207072696d61727920697320746865207a65726f206164647265737345524332303a206275726e2066726f6d20746865207a65726f20616464726573734f6e6c7920746865204265686f646c657220636f6e74726163742063616e20696e766f6b6520746869732066756e6374696f6e2e45524332303a207472616e736665722066726f6d20746865207a65726f20616464726573735365636f6e646172793a2063616c6c6572206973206e6f7420746865207072696d617279206163636f756e7445524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220fc27e2a22d20580093ce5e676d6f4821fd35372f67367243c5703112eb59313e64736f6c63430006070033 | {"success": true, "error": null, "results": {}} | 1,866 |
0x836a4265c7b0e73d1caf5e29cad08d8355737589 | /**
/ ____| | (_) | | \ | (_) (_)
| (___ | |__ _| |__ | \| |_ _ __ _ __ _
\___ \| '_ \| | '_ \| . ` | | '_ \| |/ _` |
____) | | | | | |_) | |\ | | | | | | (_| |
|_____/|_| |_|_|_.__/|_| \_|_|_| |_| |\__,_|
_/ |
Telegram - t.me/shibninja
Website - Being created in the dojo.
STEALTH LAUNCH NINJA STYLE.
ShibNinja is the secret child of Shiba Inu. He’s pretty elusive and can’t often be found. Due to his private life he will be stealth launching, with no prior announcements and no prior marketing.
However, he has big plans for after launch and is bringing his entire Dojo with him. It’s taken years of skill to get to this point, and he is now ready for launch.
ShibNinja is not greedy and is only keeping 5% tokens for his hard-working team. Liquidity will be locked + Ownership Renounced after launch.
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(
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 ShibNinja is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = unicode"ShibNinja (t.me/shibninja)";
string private constant _symbol = "ShibNinja";
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 = 7;
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);
}
} | 0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280601a81526020017f536869624e696e6a612028742e6d652f736869626e696e6a6129000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f536869624e696e6a610000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b9190505550611c2042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061546042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb57600a6009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60076008819055506005600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ed683635c9adc5dea0000060065461257b90919063ffffffff16565b82101561290c57600654683635c9adc5dea00000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c48d46fe8d38b86e423d86f3d8daa34d8e197710a16ab74e02800796747d925564736f6c63430008040033 | {"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"}]}} | 1,867 |
0x351192bbb05a0919edf5f787eeb0200f8c7e2ceb | /**
*Submitted for verification at Etherscan.io on 2021-07-16
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
address msgSender = _msgSender();
_owner = 0xf095E48B755E004d8650BAdDa2cFde7A30FEba96;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract Biscuit is Ownable, IERC20, IERC20Metadata {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor () {
_name = 'Biscuit';
_symbol = 'Biscuit';
_totalSupply= 22000000 *(10**decimals());
_balances[owner()]=_totalSupply;
emit Transfer(address(0),owner(),_totalSupply);
}
/**
* @dev Returns the name of the token.
*
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of athe
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
function mint(address account, uint256 amount) public onlyOwner{
_mint( account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function Burn(address account, uint256 amount) public onlyOwner {
_burn( account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a9059cbb11610066578063a9059cbb14610209578063cc16f5db1461021c578063dd62ed3e1461022f578063f2fde38b1461026857600080fd5b8063715018a6146101cb5780638da5cb5b146101d357806395d89b41146101ee578063a457c2d7146101f657600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461017a57806340c10f191461018d57806370a08231146101a257600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d61027b565b60405161011a9190610c93565b60405180910390f35b610136610131366004610c69565b61030d565b604051901515815260200161011a565b6003545b60405190815260200161011a565b610136610166366004610c2d565b610323565b6040516012815260200161011a565b610136610188366004610c69565b6103d9565b6101a061019b366004610c69565b610410565b005b61014a6101b0366004610bd8565b6001600160a01b031660009081526001602052604090205490565b6101a0610448565b6000546040516001600160a01b03909116815260200161011a565b61010d6104bc565b610136610204366004610c69565b6104cb565b610136610217366004610c69565b610566565b6101a061022a366004610c69565b610573565b61014a61023d366004610bfa565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6101a0610276366004610bd8565b6105a7565b60606004805461028a90610d4c565b80601f01602080910402602001604051908101604052809291908181526020018280546102b690610d4c565b80156103035780601f106102d857610100808354040283529160200191610303565b820191906000526020600020905b8154815290600101906020018083116102e657829003601f168201915b5050505050905090565b600061031a338484610691565b50600192915050565b60006103308484846107b6565b6001600160a01b0384166000908152600260209081526040808320338452909152902054828110156103ba5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103ce85336103c98685610d35565b610691565b506001949350505050565b3360008181526002602090815260408083206001600160a01b0387168452909152812054909161031a9185906103c9908690610d1d565b6000546001600160a01b0316331461043a5760405162461bcd60e51b81526004016103b190610ce8565b610444828261098e565b5050565b6000546001600160a01b031633146104725760405162461bcd60e51b81526004016103b190610ce8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60606005805461028a90610d4c565b3360009081526002602090815260408083206001600160a01b03861684529091528120548281101561054d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103b1565b61055c33856103c98685610d35565b5060019392505050565b600061031a3384846107b6565b6000546001600160a01b0316331461059d5760405162461bcd60e51b81526004016103b190610ce8565b6104448282610a6d565b6000546001600160a01b031633146105d15760405162461bcd60e51b81526004016103b190610ce8565b6001600160a01b0381166106365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103b1565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166106f35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103b1565b6001600160a01b0382166107545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103b1565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b03831661081a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103b1565b6001600160a01b03821661087c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103b1565b6001600160a01b038316600090815260016020526040902054818110156108f45760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103b1565b6108fe8282610d35565b6001600160a01b038086166000908152600160205260408082209390935590851681529081208054849290610934908490610d1d565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161098091815260200190565b60405180910390a350505050565b6001600160a01b0382166109e45760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103b1565b80600360008282546109f69190610d1d565b90915550506001600160a01b03821660009081526001602052604081208054839290610a23908490610d1d565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216610acd5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103b1565b6001600160a01b03821660009081526001602052604090205481811015610b415760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016103b1565b610b4b8282610d35565b6001600160a01b03841660009081526001602052604081209190915560038054849290610b79908490610d35565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016107a9565b80356001600160a01b0381168114610bd357600080fd5b919050565b600060208284031215610bea57600080fd5b610bf382610bbc565b9392505050565b60008060408385031215610c0d57600080fd5b610c1683610bbc565b9150610c2460208401610bbc565b90509250929050565b600080600060608486031215610c4257600080fd5b610c4b84610bbc565b9250610c5960208501610bbc565b9150604084013590509250925092565b60008060408385031215610c7c57600080fd5b610c8583610bbc565b946020939093013593505050565b600060208083528351808285015260005b81811015610cc057858101830151858201604001528201610ca4565b81811115610cd2576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610d3057610d30610d87565b500190565b600082821015610d4757610d47610d87565b500390565b600181811c90821680610d6057607f821691505b60208210811415610d8157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea264697066735822122055a0ebe44bb4565c39bc6e6850a073bad2ec396ca8cd85fa6e02891d8be01d4e64736f6c63430008060033 | {"success": true, "error": null, "results": {}} | 1,868 |
0x33e85f62383aa7601d6ca117fe35b9b397ffe056 | pragma solidity ^0.4.24;
/*
* Creator: UXD (UXD Cash)
*/
/*
* 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;
}
/**
* UXD token token smart contract.
*/
contract UXDToken is AbstractToken {
/**
* Maximum allowed number of tokens in circulation.
* tokenSupply = tokensIActuallyWant * (10 ^ decimals)
*/
uint256 constant MAX_TOKEN_COUNT = 10000000000 * (10**2);
/**
* 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 UXDToken () {
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 = "UXD Cash";
string constant public symbol = "UXD";
uint8 constant public decimals = 2;
/**
* 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);
} | 0x6080604052600436106100da5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630150246081146100df57806306fdde03146100f6578063095ea7b31461018057806313af4035146101b857806318160ddd146101d957806323b872dd14610200578063313ce5671461022a57806331c420d41461025557806370a082311461026a5780637e1f2bb81461028b57806389519c50146102a357806395d89b41146102cd578063a9059cbb146102e2578063dd62ed3e14610306578063e724529c1461032d575b600080fd5b3480156100eb57600080fd5b506100f4610353565b005b34801561010257600080fd5b5061010b6103af565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014557818101518382015260200161012d565b50505050905090810190601f1680156101725780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018c57600080fd5b506101a4600160a060020a03600435166024356103e6565b604080519115158252519081900360200190f35b3480156101c457600080fd5b506100f4600160a060020a036004351661041a565b3480156101e557600080fd5b506101ee610460565b60408051918252519081900360200190f35b34801561020c57600080fd5b506101a4600160a060020a0360043581169060243516604435610466565b34801561023657600080fd5b5061023f6104b4565b6040805160ff9092168252519081900360200190f35b34801561026157600080fd5b506100f46104b9565b34801561027657600080fd5b506101ee600160a060020a0360043516610510565b34801561029757600080fd5b506101a460043561052f565b3480156102af57600080fd5b506100f4600160a060020a03600435811690602435166044356105f4565b3480156102d957600080fd5b5061010b61070d565b3480156102ee57600080fd5b506101a4600160a060020a0360043516602435610744565b34801561031257600080fd5b506101ee600160a060020a0360043581169060243516610785565b34801561033957600080fd5b506100f4600160a060020a036004351660243515156107b0565b600254600160a060020a0316331461036a57600080fd5b60055460ff1615156103ad576005805460ff191660011790556040517f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de90600090a15b565b60408051808201909152600881527f5558442043617368000000000000000000000000000000000000000000000000602082015281565b60006103f23384610785565b15806103fc575081155b151561040757600080fd5b6104118383610841565b90505b92915050565b600254600160a060020a0316331461043157600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60045490565b600160a060020a03831660009081526003602052604081205460ff161561048c57600080fd5b60055460ff161561049f575060006104ad565b6104aa8484846108a7565b90505b9392505050565b600281565b600254600160a060020a031633146104d057600080fd5b60055460ff16156103ad576005805460ff191690556040517f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded90600090a1565b600160a060020a0381166000908152602081905260409020545b919050565b600254600090600160a060020a0316331461054957600080fd5b60008211156105ec5761056364e8d4a51000600454610a46565b8211156105725750600061052a565b3360009081526020819052604090205461058c9083610a58565b336000908152602081905260409020556004546105a99083610a58565b60045560408051838152905133916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600161052a565b506000919050565b600254600090600160a060020a0316331461060e57600080fd5b600160a060020a03841630141561062457600080fd5b50604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038481166004830152602482018490529151859283169163a9059cbb9160448083019260209291908290030181600087803b15801561069157600080fd5b505af11580156106a5573d6000803e3d6000fd5b505050506040513d60208110156106bb57600080fd5b505060408051600160a060020a0380871682528516602082015280820184905290517ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc1549181900360600190a150505050565b60408051808201909152600381527f5558440000000000000000000000000000000000000000000000000000000000602082015281565b3360009081526003602052604081205460ff161561076157600080fd5b60055460ff161561077457506000610414565b61077e8383610a67565b9050610414565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600254600160a060020a031633146107c757600080fd5b33600160a060020a03831614156107dd57600080fd5b600160a060020a038216600081815260036020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a03831615156108be57600080fd5b600160a060020a03841660009081526001602090815260408083203384529091529020548211156108f1575060006104ad565b600160a060020a038416600090815260208190526040902054821115610919575060006104ad565b60008211801561093b575082600160a060020a031684600160a060020a031614155b156109f157600160a060020a038416600090815260016020908152604080832033845290915290205461096e9083610a46565b600160a060020a03851660008181526001602090815260408083203384528252808320949094559181529081905220546109a89083610a46565b600160a060020a0380861660009081526020819052604080822093909355908516815220546109d79083610a58565b600160a060020a0384166000908152602081905260409020555b82600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35060019392505050565b600082821115610a5257fe5b50900390565b6000828201838110156104ad57fe5b6000600160a060020a0383161515610a7e57600080fd5b33600090815260208190526040902054821115610a9d57506000610414565b600082118015610ab6575033600160a060020a03841614155b15610b1b5733600090815260208190526040902054610ad59083610a46565b3360009081526020819052604080822092909255600160a060020a03851681522054610b019083610a58565b600160a060020a0384166000908152602081905260409020555b604080518381529051600160a060020a0385169133917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3506001929150505600a165627a7a723058201e4471678414c2d38a719df9e44dba8ea50e7de59640b5ef6032bd3fd056d78a0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 1,869 |
0x5cabd4e9491bb1af834ad80b9e5efbf825260c9f | pragma solidity ^0.4.24;
contract ERC20Token {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*
* Contract source taken from Open Zeppelin: https://github.com/OpenZeppelin/zeppelin-solidity/blob/v1.4.0/contracts/ownership/Ownable.sol
*/
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 SafeMathLib {
//
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 && a > 0);
// Solidity automatically throws when dividing by 0
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 && c >= b);
return c;
}
}
contract StandardToken is ERC20Token {
using SafeMathLib for uint;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
//
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
//
function transfer(address _to, uint256 _value) public returns (bool success) {
require(_value > 0 && balances[msg.sender] >= _value);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
//
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value > 0 && balances[_from] >= _value);
require(allowed[_from][msg.sender] >= _value);
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
//
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
contract WOS is StandardToken, Ownable {
using SafeMathLib for uint256;
uint256 INTERVAL_TIME = 63072000;//Two years
uint256 public deadlineToFreedTeamPool=1591198931;//the deadline to freed the Wos pool of team
string public name = "WOS";
string public symbol = "WOS";
uint256 public decimals = 18;
uint256 public INITIAL_SUPPLY = (210) * (10 ** 8) * (10 ** 18);//21
// WOS which is freezed for the second stage
uint256 wosPoolForSecondStage;
// WOS which is freezed for the third stage
uint256 wosPoolForThirdStage;
// WOS which is freezed in order to reward team
uint256 wosPoolToTeam;
// WOS which is freezed for community incentives, business corporation, developer ecosystem
uint256 wosPoolToWosSystem;
event Freed(address indexed owner, uint256 value);
function WOS(){
totalSupply = INITIAL_SUPPLY;
uint256 peerSupply = totalSupply.div(100);
//the first stage 15% + community operation 15%
balances[msg.sender] = peerSupply.mul(30);
//the second stage 15%
wosPoolForSecondStage = peerSupply.mul(15);
//the third stage 20%
wosPoolForThirdStage = peerSupply.mul(20);
//team 15%
wosPoolToTeam = peerSupply.mul(15);
//community incentives and developer ecosystem 20%
wosPoolToWosSystem = peerSupply.mul(20);
}
//===================================================================
//
function balanceWosPoolForSecondStage() public constant returns (uint256 remaining) {
return wosPoolForSecondStage;
}
function freedWosPoolForSecondStage() onlyOwner returns (bool success) {
require(wosPoolForSecondStage > 0);
require(balances[msg.sender].add(wosPoolForSecondStage) >= balances[msg.sender]
&& balances[msg.sender].add(wosPoolForSecondStage) >= wosPoolForSecondStage);
balances[msg.sender] = balances[msg.sender].add(wosPoolForSecondStage);
Freed(msg.sender, wosPoolForSecondStage);
wosPoolForSecondStage = 0;
return true;
}
//
function balanceWosPoolForThirdStage() public constant returns (uint256 remaining) {
return wosPoolForThirdStage;
}
function freedWosPoolForThirdStage() onlyOwner returns (bool success) {
require(wosPoolForThirdStage > 0);
require(balances[msg.sender].add(wosPoolForThirdStage) >= balances[msg.sender]
&& balances[msg.sender].add(wosPoolForThirdStage) >= wosPoolForThirdStage);
balances[msg.sender] = balances[msg.sender].add(wosPoolForThirdStage);
Freed(msg.sender, wosPoolForThirdStage);
wosPoolForThirdStage = 0;
return true;
}
//
function balanceWosPoolToTeam() public constant returns (uint256 remaining) {
return wosPoolToTeam;
}
function freedWosPoolToTeam() onlyOwner returns (bool success) {
require(wosPoolToTeam > 0);
require(balances[msg.sender].add(wosPoolToTeam) >= balances[msg.sender]
&& balances[msg.sender].add(wosPoolToTeam) >= wosPoolToTeam);
require(block.timestamp >= deadlineToFreedTeamPool);
balances[msg.sender] = balances[msg.sender].add(wosPoolToTeam);
Freed(msg.sender, wosPoolToTeam);
wosPoolToTeam = 0;
return true;
}
//
function balanceWosPoolToWosSystem() public constant returns (uint256 remaining) {
return wosPoolToWosSystem;
}
function freedWosPoolToWosSystem() onlyOwner returns (bool success) {
require(wosPoolToWosSystem > 0);
require(balances[msg.sender].add(wosPoolToWosSystem) >= balances[msg.sender]
&& balances[msg.sender].add(wosPoolToWosSystem) >= wosPoolToWosSystem);
balances[msg.sender] = balances[msg.sender].add(wosPoolToWosSystem);
Freed(msg.sender, wosPoolToWosSystem);
wosPoolToWosSystem = 0;
return true;
}
function() public payable {
revert();
}
} | 0x60806040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610121578063095ea7b3146101ab57806318160ddd146101e357806323b872dd1461020a5780632ff2e9dc14610234578063313ce5671461024957806337fc91e31461025e57806360c17d1d1461027357806370a08231146102885780638da5cb5b146102a957806395d89b41146102da578063a9059cbb146102ef578063adb3a3a614610313578063b6eb7dae14610328578063c0597a551461033d578063c132bc1814610352578063cc1b8de614610367578063d9417b6a1461037c578063dd62ed3e14610391578063f2fde38b146103b8578063fa894c08146103db575b600080fd5b34801561012d57600080fd5b506101366103f0565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610170578181015183820152602001610158565b50505050905090810190601f16801561019d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b757600080fd5b506101cf600160a060020a036004351660243561047e565b604080519115158252519081900360200190f35b3480156101ef57600080fd5b506101f86104e4565b60408051918252519081900360200190f35b34801561021657600080fd5b506101cf600160a060020a03600435811690602435166044356104ea565b34801561024057600080fd5b506101f8610654565b34801561025557600080fd5b506101f861065a565b34801561026a57600080fd5b506101f8610660565b34801561027f57600080fd5b506101cf610666565b34801561029457600080fd5b506101f8600160a060020a0360043516610754565b3480156102b557600080fd5b506102be61076f565b60408051600160a060020a039092168252519081900360200190f35b3480156102e657600080fd5b5061013661077e565b3480156102fb57600080fd5b506101cf600160a060020a03600435166024356107d9565b34801561031f57600080fd5b506101f86108b4565b34801561033457600080fd5b506101cf6108ba565b34801561034957600080fd5b506101cf6109a8565b34801561035e57600080fd5b506101f8610a96565b34801561037357600080fd5b506101cf610a9c565b34801561038857600080fd5b506101f8610b99565b34801561039d57600080fd5b506101f8600160a060020a0360043581169060243516610b9f565b3480156103c457600080fd5b506103d9600160a060020a0360043516610bca565b005b3480156103e757600080fd5b506101f8610c5f565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104765780601f1061044b57610100808354040283529160200191610476565b820191906000526020600020905b81548152906001019060200180831161045957829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60005481565b600080821180156105135750600160a060020a0384166000908152600160205260409020548211155b151561051e57600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561054e57600080fd5b600160a060020a038316600090815260016020526040902054610577908363ffffffff610c6516565b600160a060020a0380851660009081526001602052604080822093909355908616815220546105ac908363ffffffff610c8d16565b600160a060020a03851660009081526001602090815260408083209390935560028152828220338352905220546105e9908363ffffffff610c8d16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60095481565b60085481565b600c5490565b600354600090600160a060020a0316331461068057600080fd5b600a5460001061068f57600080fd5b33600090815260016020526040902054600a546106b390829063ffffffff610c6516565b101580156106e25750600a54336000908152600160205260409020546106df908263ffffffff610c6516565b10155b15156106ed57600080fd5b600a543360009081526001602052604090205461070f9163ffffffff610c6516565b3360008181526001602090815260409182902093909355600a54815190815290519192600080516020610cfa83398151915292918290030190a2506000600a55600190565b600160a060020a031660009081526001602052604090205490565b600354600160a060020a031681565b6007805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104765780601f1061044b57610100808354040283529160200191610476565b600080821180156107f95750336000908152600160205260409020548211155b151561080457600080fd5b33600090815260016020526040902054610824908363ffffffff610c8d16565b3360009081526001602052604080822092909255600160a060020a03851681522054610856908363ffffffff610c6516565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b60055481565b600354600090600160a060020a031633146108d457600080fd5b600d546000106108e357600080fd5b33600090815260016020526040902054600d5461090790829063ffffffff610c6516565b101580156109365750600d5433600090815260016020526040902054610933908263ffffffff610c6516565b10155b151561094157600080fd5b600d54336000908152600160205260409020546109639163ffffffff610c6516565b3360008181526001602090815260409182902093909355600d54815190815290519192600080516020610cfa83398151915292918290030190a2506000600d55600190565b600354600090600160a060020a031633146109c257600080fd5b600b546000106109d157600080fd5b33600090815260016020526040902054600b546109f590829063ffffffff610c6516565b10158015610a245750600b5433600090815260016020526040902054610a21908263ffffffff610c6516565b10155b1515610a2f57600080fd5b600b5433600090815260016020526040902054610a519163ffffffff610c6516565b3360008181526001602090815260409182902093909355600b54815190815290519192600080516020610cfa83398151915292918290030190a2506000600b55600190565b600b5490565b600354600090600160a060020a03163314610ab657600080fd5b600c54600010610ac557600080fd5b33600090815260016020526040902054600c54610ae990829063ffffffff610c6516565b10158015610b185750600c5433600090815260016020526040902054610b15908263ffffffff610c6516565b10155b1515610b2357600080fd5b600554421015610b3257600080fd5b600c5433600090815260016020526040902054610b549163ffffffff610c6516565b3360008181526001602090815260409182902093909355600c54815190815290519192600080516020610cfa83398151915292918290030190a2506000600c55600190565b600d5490565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610be157600080fd5b600160a060020a0381161515610bf657600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600a5490565b6000828201838110801590610c7a5750828110155b1515610c8257fe5b8091505b5092915050565b600082821115610c9957fe5b50900390565b600080600083118015610cb25750600084115b1515610cba57fe5b8284811515610cc557fe5b04949350505050565b600080831515610ce15760009150610c86565b50828202828482811515610cf157fe5b0414610c8257fe0098c913eafb0a1bd21d56fa98d0710b9714ad00065673854b5a570b7036e5f826a165627a7a72305820f75b4760f3eb33e40096a209a52b28a251d85d69f8cadecb2eb0d4240a960d4d0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 1,870 |
0x8c5852066969d73ee2b624699ed6d61d5347afb3 | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor () internal {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
library 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;
}
}
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);
}
/// @title Planets (yield farming)
/// @author Meteor Finance
contract Planets is ReentrancyGuard {
using SafeMath for uint256;
address public governance;
address public rewardToken;
bool public killed;
uint256 public adminDeadline;
uint256 public totalDistributed;
mapping (address=>bool) tokens;
mapping (address=>mapping (address=>uint256)) public entryBlock;
mapping (address=>uint256) public rewards;
mapping (address=>uint256) public totalValue;
mapping (address=>mapping (address=>uint256)) public balances;
event Deposit(address indexed owner, address indexed token, uint256 value);
event Withdraw(address indexed owner, address indexed token, uint256 value, bool rewardOnly);
constructor (address _governance, address _rewardToken) public {
governance = _governance;
rewardToken = _rewardToken;
killed = false;
adminDeadline = block.timestamp.add(86400);
}
modifier govOnly() {
require(msg.sender == governance, "Only governance address can interact with this function");
_;
}
modifier contractAlive() {
require(killed==false, "Contract is killed, please try emergencyWithdraw()");
_;
}
/// @notice Deposit funds to the smart contract
/// @param _token address of the token to deposit
/// @param _amount amount of the token to deposit
/// @return True if deposit is successful
function deposit(address _token, uint256 _amount) external contractAlive nonReentrant returns (bool) {
require(tokens[_token] == true, "Token is not allowed for deposit.");
require(IERC20(_token).allowance(msg.sender, address(this)) >= _amount, "You do not have enough allowance for this operation.");
if (entryBlock[msg.sender][_token]>0) {
_withdrawRewards(msg.sender, _token, true);
} else {
entryBlock[msg.sender][_token] = block.number;
}
IERC20(_token).transferFrom(msg.sender, address(this), _amount);
balances[msg.sender][_token] = balances[msg.sender][_token].add(_amount);
totalValue[_token] = totalValue[_token].add(_amount);
emit Deposit(msg.sender, _token, _amount);
return true;
}
/// @notice Claim rewards and withdraw
/// @param _token address of the token to withdraw
/// @param _rewardOnly true if only claiming rewards otherwise false
/// @return True if withdraw is successful
function _withdrawRewards(address _receiver, address _token, bool _rewardOnly) internal contractAlive returns (bool) {
require(entryBlock[_receiver][_token]!=block.number, "Please wait at least one block before new deposit");
require(81000>totalDistributed, "Contract is out of rewards, please use emergencyWithraw()");
uint256 rewardAmount = block.number.sub(entryBlock[_receiver][_token]).mul(rewards[_token]).mul(balances[_receiver][_token]).div(totalValue[_token]);
require(rewardAmount>0, "No rewards are available for this address. Try emergencyWithdraw()");
if (!_rewardOnly) {
require(balances[_receiver][_token]>0, "Token balance must be bigger than 0");
IERC20(_token).transfer(_receiver, balances[_receiver][_token]);
totalValue[_token] = totalValue[_token].sub(balances[_receiver][_token]);
balances[_receiver][_token] = 0;
entryBlock[_receiver][_token] = 0;
} else {
entryBlock[_receiver][_token] = block.number;
}
IERC20(rewardToken).transfer(_receiver, rewardAmount.mul(100000000000000000));
totalDistributed = totalDistributed.add(rewardAmount);
emit Withdraw(_receiver, _token, rewardAmount, _rewardOnly);
return true;
}
/// @notice Claim rewards and withdraw
/// @param _token address of the token to withdraw
/// @param _rewardOnly true if only claiming rewards otherwise false
/// @return True if withdraw is successful
function withdraw(address _token, bool _rewardOnly) public contractAlive nonReentrant returns (bool) {
require(entryBlock[msg.sender][_token]>0, "Please make sure you have made a deposit.");
return _withdrawRewards(msg.sender, _token, _rewardOnly);
}
/// @notice Emergency withdraw without claiming rewards
/// @param _token address of the token to deposit
/// @return True if withdraw is successful
function emergencyWithdraw(address _token) external nonReentrant returns (bool) {
require(balances[msg.sender][_token]>0, "You do not have balance to withdraw");
IERC20(_token).transfer(msg.sender, balances[msg.sender][_token]);
totalValue[_token] = totalValue[_token].sub(balances[msg.sender][_token]);
balances[msg.sender][_token] = 0;
entryBlock[msg.sender][_token] = 0;
return true;
}
// @notice Admin withdraw for emergencies
// @param _amount Amount of reward token to withdraw
function adminWithdraw(uint256 _amount) external govOnly {
require(adminDeadline>block.timestamp);
IERC20(rewardToken).transfer(msg.sender, _amount);
}
/// @notice Add new token
/// @param _token address of the token to add
/// @param _reward amount of starting rewards
/// @return True if token adding is successful
function addToken(address _token, uint256 _reward) external govOnly returns (bool) {
tokens[_token] = true;
rewards[_token] = _reward;
return true;
}
/// @notice Delete token
/// @param _token address of the token to remove
/// @return True if token removing is successful
function delToken(address _token) external govOnly returns (bool) {
require(tokens[_token] == true, "Token already does not exist, so you can not remove it");
tokens[_token] = false;
rewards[_token] = 0;
return true;
}
/// @notice Change governance address
/// @param _governance address of the new governance address
/// @return True if address change is successful
function transferGov(address _governance) external govOnly returns (bool) {
governance = _governance;
return true;
}
/// @notice Kill contract (freezes deposits)
/// @return True if contract killing is successful
function kill() external govOnly returns (bool) {
killed = true;
return true;
}
/// @notice Unkill contract (unfreezes deposits)
/// @return True if contract unkilling is successful
function unkill() external govOnly returns (bool) {
killed = false;
return true;
}
} | 0x608060405234801561001057600080fd5b50600436106101165760003560e01c80635aa6e675116100a25780638abe28a3116100715780638abe28a3146104ff578063af81c5b914610521578063c23f001f14610587578063efca2eed146105ff578063f7c618c11461061d57610116565b80635aa6e6751461040d5780636ff1c9bc1461045757806377b6214e146104b35780637c5b4a37146104d157610116565b806330b0680b116100e957806330b0680b1461024d578063365a79e5146102a557806341c0e1b51461031d57806347e7ef241461033f5780635437e401146103a557610116565b80630700037d1461011b578063118e0633146101735780631f3a0e41146101cf5780632f2f81c3146101f1575b600080fd5b61015d6004803603602081101561013157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610667565b6040518082815260200191505060405180910390f35b6101b56004803603602081101561018957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061067f565b604051808215151515815260200191505060405180910390f35b6101d7610876565b604051808215151515815260200191505060405180910390f35b6102336004803603602081101561020757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610889565b604051808215151515815260200191505060405180910390f35b61028f6004803603602081101561026357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061097b565b6040518082815260200191505060405180910390f35b610307600480360360408110156102bb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610993565b6040518082815260200191505060405180910390f35b6103256109b8565b604051808215151515815260200191505060405180910390f35b61038b6004803603604081101561035557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a82565b604051808215151515815260200191505060405180910390f35b6103f3600480360360408110156103bb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611188565b604051808215151515815260200191505060405180910390f35b610415611366565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104996004803603602081101561046d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061138c565b604051808215151515815260200191505060405180910390f35b6104bb611849565b6040518082815260200191505060405180910390f35b6104fd600480360360208110156104e757600080fd5b810190808035906020019092919050505061184f565b005b6105076119eb565b604051808215151515815260200191505060405180910390f35b61056d6004803603604081101561053757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ab5565b604051808215151515815260200191505060405180910390f35b6105e96004803603604081101561059d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c03565b6040518082815260200191505060405180910390f35b610607611c28565b6040518082815260200191505060405180910390f35b610625611c2e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60076020528060005260406000206000915090505481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610727576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526037815260200180612a6f6037913960400191505060405180910390fd5b60011515600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146107d0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180612af96036913960400191505060405180910390fd5b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019050919050565b600260149054906101000a900460ff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610931576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526037815260200180612a6f6037913960400191505060405180910390fd5b81600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b60086020528060005260406000206000915090505481565b6006602052816000526040600020602052806000526040600020600091509150505481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526037815260200180612a6f6037913960400191505060405180910390fd5b6001600260146101000a81548160ff0219169083151502179055506001905090565b6000801515600260149054906101000a900460ff16151514610aef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526032815260200180612ac76032913960400191505060405180910390fd5b60026000541415610b68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b600260008190555060011515600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610c19576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806129db6021913960400191505060405180910390fd5b818373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610ccb57600080fd5b505afa158015610cdf573d6000803e3d6000fd5b505050506040513d6020811015610cf557600080fd5b81019080805190602001909291905050501015610d5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806129a76034913960400191505060405180910390fd5b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115610df457610dee33846001611c54565b50610e76565b43600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610f3157600080fd5b505af1158015610f45573d6000803e3d6000fd5b505050506040513d6020811015610f5b57600080fd5b810190808051906020019092919050505050610ffc82600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265b90919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110ce82600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265b90919063ffffffff16565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f62846040518082815260200191505060405180910390a360019050600160008190555092915050565b6000801515600260149054906101000a900460ff161515146111f5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526032815260200180612ac76032913960400191505060405180910390fd5b6002600054141561126e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b60026000819055506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541161134b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180612b2f6029913960400191505060405180910390fd5b611356338484611c54565b9050600160008190555092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060026000541415611407576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b60026000819055506000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054116114e4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612b586023913960400191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115e757600080fd5b505af11580156115fb573d6000803e3d6000fd5b505050506040513d602081101561161157600080fd5b8101908080519060200190929190505050506116f1600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126e390919063ffffffff16565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600190506001600081905550919050565b60035481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118f5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526037815260200180612a6f6037913960400191505060405180910390fd5b426003541161190357600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156119ac57600080fd5b505af11580156119c0573d6000803e3d6000fd5b505050506040513d60208110156119d657600080fd5b81019080805190602001909291905050505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526037815260200180612a6f6037913960400191505060405180910390fd5b6000600260146101000a81548160ff0219169083151502179055506001905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526037815260200180612a6f6037913960400191505060405180910390fd5b6001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555081600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b6009602052816000526040600020602052806000526040600020600091509150505481565b60045481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000801515600260149054906101000a900460ff16151514611cc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526032815260200180612ac76032913960400191505060405180910390fd5b43600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611d96576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001806129fc6031913960400191505060405180910390fd5b60045462013c6811611df3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526039815260200180612b7b6039913960400191505060405180910390fd5b6000611fb4600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fa6600960008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f98600760008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f8a600660008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054436126e390919063ffffffff16565b61272d90919063ffffffff16565b61272d90919063ffffffff16565b6127b390919063ffffffff16565b90506000811161200f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526042815260200180612a2d6042913960600191505060405180910390fd5b82612442576000600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054116120e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806129846023913960400191505060405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86600960008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156121ec57600080fd5b505af1158015612200573d6000803e3d6000fd5b505050506040513d602081101561221657600080fd5b8101908080519060200190929190505050506122f6600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126e390919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124c4565b43600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8661251e67016345785d8a00008561272d90919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561258757600080fd5b505af115801561259b573d6000803e3d6000fd5b505050506040513d60208110156125b157600080fd5b8101908080519060200190929190505050506125d88160045461265b90919063ffffffff16565b6004819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f2b664ab52fe561d3ace376046aea39744dd736ec1f67d89d504ffd2192825f61838660405180838152602001821515151581526020019250505060405180910390a360019150509392505050565b6000808284019050838110156126d9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600061272583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506127fd565b905092915050565b60008083141561274057600090506127ad565b600082840290508284828161275157fe5b04146127a8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612aa66021913960400191505060405180910390fd5b809150505b92915050565b60006127f583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506128bd565b905092915050565b60008383111582906128aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561286f578082015181840152602081019050612854565b50505050905090810190601f16801561289c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290612969576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561292e578082015181840152602081019050612913565b50505050905090810190601f16801561295b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161297557fe5b04905080915050939250505056fe546f6b656e2062616c616e6365206d75737420626520626967676572207468616e2030596f7520646f206e6f74206861766520656e6f75676820616c6c6f77616e636520666f722074686973206f7065726174696f6e2e546f6b656e206973206e6f7420616c6c6f77656420666f72206465706f7369742e506c656173652077616974206174206c65617374206f6e6520626c6f636b206265666f7265206e6577206465706f7369744e6f20726577617264732061726520617661696c61626c6520666f72207468697320616464726573732e2054727920656d657267656e6379576974686472617728294f6e6c7920676f7665726e616e636520616464726573732063616e20696e746572616374207769746820746869732066756e6374696f6e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77436f6e7472616374206973206b696c6c65642c20706c656173652074727920656d657267656e637957697468647261772829546f6b656e20616c726561647920646f6573206e6f742065786973742c20736f20796f752063616e206e6f742072656d6f7665206974506c65617365206d616b65207375726520796f752068617665206d6164652061206465706f7369742e596f7520646f206e6f7420686176652062616c616e636520746f207769746864726177436f6e7472616374206973206f7574206f6620726577617264732c20706c656173652075736520656d657267656e6379576974687261772829a264697066735822122012c02782ba085ea7fed6419dbb524ca84b957f23a49b9dabe7c24bd36b3f65b064736f6c63430006060033 | {"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"}]}} | 1,871 |
0x5fb5a346347acf4fcd3aab28f5ee518785fb0ad0 | /**
*Submitted for verification at Etherscan.io on 2021-02-19
*/
// SPDX-License-Identifier: GPL-3.0-or-later
/// UNIV2LPOracle.sol
// Copyright (C) 2017-2021 Maker Ecosystem Growth Holdings, INC.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
///////////////////////////////////////////////////////
// //
// Methodology for Calculating LP Token Price //
// //
///////////////////////////////////////////////////////
// INVARIANT k = reserve0 [num token0] * reserve1 [num token1]
//
// k = r_x * r_y
// r_y = k / r_x
//
// 50-50 pools try to stay balanced in dollar terms
// r_x * p_x = r_y * p_y // Proportion of r_x and r_y can be manipulated so need to normalize them
//
// r_x * p_x = p_y * (k / r_x)
// r_x^2 = k * p_y / p_x
// r_x = sqrt(k * p_y / p_x) & r_y = sqrt(k * p_x / p_y)
//
// Now that we've calculated normalized values of r_x and r_y that are not prone to manipulation by an attacker,
// we can calculate the price of an lp token using the following formula.
//
// p_lp = (r_x * p_x + r_y * p_y) / supply_lp
//
pragma solidity ^0.6.11;
interface ERC20Like {
function decimals() external view returns (uint8);
function balanceOf(address) external view returns (uint256);
function totalSupply() external view returns (uint256);
}
interface UniswapV2PairLike {
function sync() external;
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112,uint112,uint32); // reserve0, reserve1, blockTimestampLast
}
interface OracleLike {
function read() external view returns (uint256);
function peek() external view returns (uint256,bool);
}
// Factory for creating Uniswap V2 LP Token Oracle instances
contract UNIV2LPOracleFactory {
mapping(address => bool) public isOracle;
event Created(address sender, address orcl, bytes32 wat, address tok0, address tok1, address orb0, address orb1);
// Create new Uniswap V2 LP Token Oracle instance
function build(address _src, bytes32 _wat, address _orb0, address _orb1) public returns (address orcl) {
address tok0 = UniswapV2PairLike(_src).token0();
address tok1 = UniswapV2PairLike(_src).token1();
orcl = address(new UNIV2LPOracle(_src, _wat, _orb0, _orb1));
UNIV2LPOracle(orcl).rely(msg.sender);
isOracle[orcl] = true;
emit Created(msg.sender, orcl, _wat, tok0, tok1, _orb0, _orb1);
}
}
contract UNIV2LPOracle {
// --- Auth ---
mapping (address => uint) public wards; // Addresses with admin authority
function rely(address usr) external auth { wards[usr] = 1; emit Rely(usr); } // Add admin
function deny(address usr) external auth { wards[usr] = 0; emit Deny(usr); } // Remove admin
modifier auth {
require(wards[msg.sender] == 1, "UNIV2LPOracle/not-authorized");
_;
}
// --- Stop ---
uint256 public stopped; // Stop/start ability to read
modifier stoppable { require(stopped == 0, "UNIV2LPOracle/is-stopped"); _; }
// --- Whitelisting ---
mapping (address => uint256) public bud;
modifier toll { require(bud[msg.sender] == 1, "UNIV2LPOracle/contract-not-whitelisted"); _; }
// --- Data ---
uint8 public immutable dec0; // Decimals of token0
uint8 public immutable dec1; // Decimals of token1
address public orb0; // Oracle for token0, ideally a Medianizer
address public orb1; // Oracle for token1, ideally a Medianizer
bytes32 public immutable wat; // Token whose price is being tracked
uint32 public hop = 1 hours; // Minimum time inbetween price updates
address public src; // Price source
uint32 public zzz; // Time of last price update
struct Feed {
uint128 val; // Price
uint128 has; // Is price valid
}
Feed public cur; // Current price
Feed public nxt; // Queued price
// --- Math ---
uint256 constant WAD = 10 ** 18;
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, "ds-math-add-overflow");
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, "ds-math-sub-underflow");
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, "ds-math-mul-overflow");
}
function div(uint x, uint y) internal pure returns (uint z) {
require(y > 0 && (z = x / y) * y == x, "ds-math-divide-by-zero");
}
function wmul(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, y), WAD / 2) / WAD;
}
function wdiv(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, WAD), y / 2) / y;
}
// Compute the square root using the Babylonian method.
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
// --- Events ---
event Rely(address indexed usr);
event Deny(address indexed usr);
event Change(address indexed src);
event Step(uint256 hop);
event Stop();
event Start();
event Value(uint128 curVal, uint128 nxtVal);
event Link(uint256 id, address orb);
// --- Init ---
constructor (address _src, bytes32 _wat, address _orb0, address _orb1) public {
require(_src != address(0), "UNIV2LPOracle/invalid-src-address");
require(_orb0 != address(0) && _orb1 != address(0), "UNIV2LPOracle/invalid-oracle-address");
wards[msg.sender] = 1;
src = _src;
zzz = 0;
wat = _wat;
dec0 = uint8(ERC20Like(UniswapV2PairLike(_src).token0()).decimals()); // Get decimals of token0
dec1 = uint8(ERC20Like(UniswapV2PairLike(_src).token1()).decimals()); // Get decimals of token1
orb0 = _orb0;
orb1 = _orb1;
}
function stop() external auth {
stopped = 1;
emit Stop();
}
function start() external auth {
stopped = 0;
emit Start();
}
function change(address _src) external auth {
src = _src;
emit Change(src);
}
function step(uint256 _hop) external auth {
require(_hop <= uint32(-1), "UNIV2LPOracle/invalid-hop");
hop = uint32(_hop);
emit Step(hop);
}
function link(uint256 id, address orb) external auth {
require(orb != address(0), "UNIV2LPOracle/no-contract-0");
if(id == 0) {
orb0 = orb;
} else if (id == 1) {
orb1 = orb;
}
emit Link(id, orb);
}
function pass() public view returns (bool ok) {
return block.timestamp >= add(zzz, hop);
}
function seek() internal returns (uint128 quote, uint32 ts) {
// Sync up reserves of uniswap liquidity pool
UniswapV2PairLike(src).sync();
// Get reserves of uniswap liquidity pool
(uint112 res0, uint112 res1, uint32 _ts) = UniswapV2PairLike(src).getReserves();
require(res0 > 0 && res1 > 0, "UNIV2LPOracle/invalid-reserves");
ts = _ts;
require(ts == block.timestamp);
// Adjust reserves w/ respect to decimals
if (dec0 != uint8(18)) res0 = uint112(res0 * 10 ** sub(18, dec0));
if (dec1 != uint8(18)) res1 = uint112(res1 * 10 ** sub(18, dec1));
// Calculate constant product invariant k (WAD * WAD)
uint256 k = mul(res0, res1);
// All Oracle prices are priced with 18 decimals against USD
uint256 val0 = OracleLike(orb0).read(); // Query token0 price from oracle (WAD)
uint256 val1 = OracleLike(orb1).read(); // Query token1 price from oracle (WAD)
require(val0 != 0, "UNIV2LPOracle/invalid-oracle-0-price");
require(val1 != 0, "UNIV2LPOracle/invalid-oracle-1-price");
// Calculate normalized balances of token0 and token1
uint256 bal0 =
sqrt(
wmul(
k,
wdiv(
val1,
val0
)
)
);
uint256 bal1 = wdiv(k, bal0) / WAD;
// Get LP token supply
uint256 supply = ERC20Like(src).totalSupply();
require(supply > 0, "UNIV2LPOracle/invalid-lp-token-supply");
// Calculate price quote of LP token
quote = uint128(
wdiv(
add(
wmul(bal0, val0), // (WAD)
wmul(bal1, val1) // (WAD)
),
supply // (WAD)
)
);
}
function poke() external stoppable {
require(pass(), "UNIV2LPOracle/not-passed");
(uint val, uint32 ts) = seek();
require(val != 0, "UNIV2LPOracle/invalid-price");
cur = nxt;
nxt = Feed(uint128(val), 1);
zzz = ts;
emit Value(cur.val, nxt.val);
}
function peek() external view toll returns (bytes32,bool) {
return (bytes32(uint(cur.val)), cur.has == 1);
}
function peep() external view toll returns (bytes32,bool) {
return (bytes32(uint(nxt.val)), nxt.has == 1);
}
function read() external view toll returns (bytes32) {
require(cur.has == 1, "UNIV2LPOracle/no-current-value");
return (bytes32(uint(cur.val)));
}
function kiss(address a) external auth {
require(a != address(0), "UNIV2LPOracle/no-contract-0");
bud[a] = 1;
}
function kiss(address[] calldata a) external auth {
for(uint i = 0; i < a.length; i++) {
require(a[i] != address(0), "UNIV2LPOracle/no-contract-0");
bud[a[i]] = 1;
}
}
function diss(address a) external auth {
bud[a] = 0;
}
function diss(address[] calldata a) external auth {
for(uint i = 0; i < a.length; i++) {
bud[a[i]] = 0;
}
}
} | 0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c806365af790911610104578063a7a1ed72116100a2578063c478a1b111610071578063c478a1b1146107b0578063cc32b7d5146107d4578063dca44f6f146107f8578063f29c29c414610842576101cf565b8063a7a1ed7214610702578063b0b8579b14610724578063be9a65551461074e578063bf353dbb14610758576101cf565b80636c2552f9116100de5780636c2552f91461062c57806375f12b21146106765780639c52a7f114610694578063a4dff0a2146106d8576101cf565b806365af79091461055657806365c4ce7a146105a457806365fae35e146105e8576101cf565b80633a1cde75116101715780634fce7a2a1161014b5780634fce7a2a1461044a5780634fe24251146104a257806357de26a41461050f57806359e02dd71461052d576101cf565b80633a1cde751461038557806346d4577d146103b35780634ca299231461042c576101cf565b806318178358116101ad57806318178358146102745780631b25b65f1461027e5780631e77933e146102f75780632e7dc6af1461033b576101cf565b806303e0187a146101d457806307da68f5146102415780630e5a6c701461024b575b600080fd5b6101dc610886565b60405180836fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff168152602001826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b6102496108d0565b005b6102536109b9565b60405180838152602001821515151581526020019250505060405180910390f35b61027c610aca565b005b6102f56004803603602081101561029457600080fd5b81019080803590602001906401000000008111156102b157600080fd5b8201836020820111156102c357600080fd5b803590602001918460208302840111640100000000831117156102e557600080fd5b9091929391929390505050610ebc565b005b6103396004803603602081101561030d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110cb565b005b610343611228565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103b16004803603602081101561039b57600080fd5b810190808035906020019092919050505061124e565b005b61042a600480360360208110156103c957600080fd5b81019080803590602001906401000000008111156103e657600080fd5b8201836020820111156103f857600080fd5b8035906020019184602083028401116401000000008311171561041a57600080fd5b9091929391929390505050611411565b005b610434611555565b6040518082815260200191505060405180910390f35b61048c6004803603602081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611579565b6040518082815260200191505060405180910390f35b6104aa611591565b60405180836fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff168152602001826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b6105176115db565b6040518082815260200191505060405180910390f35b61053561175a565b60405180838152602001821515151581526020019250505060405180910390f35b6105a26004803603604081101561056c57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061186b565b005b6105e6600480360360208110156105ba57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611acc565b005b61062a600480360360208110156105fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bc8565b005b610634611d06565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61067e611d2c565b6040518082815260200191505060405180910390f35b6106d6600480360360208110156106aa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d32565b005b6106e0611e70565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b61070a611e86565b604051808215151515815260200191505060405180910390f35b61072c611eca565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b610756611ee0565b005b61079a6004803603602081101561076e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fca565b6040518082815260200191505060405180910390f35b6107b8611fe2565b604051808260ff1660ff16815260200191505060405180910390f35b6107dc612006565b604051808260ff1660ff16815260200191505060405180910390f35b61080061202a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108846004803603602081101561085857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612050565b005b60078060000160009054906101000a90046fffffffffffffffffffffffffffffffff16908060000160109054906101000a90046fffffffffffffffffffffffffffffffff16905082565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b600180819055507fbedf0f4abfe86d4ffad593d9607fe70e83ea706033d44d24b3b6283cf3fc4f6b60405160405180910390a1565b6000806001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610a54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612b366026913960400191505060405180910390fd5b600760000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1660001b6001600760000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1614915091509091565b600060015414610b42576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f554e4956324c504f7261636c652f69732d73746f70706564000000000000000081525060200191505060405180910390fd5b610b4a611e86565b610bbc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f554e4956324c504f7261636c652f6e6f742d706173736564000000000000000081525060200191505060405180910390fd5b600080610bc76121ef565b91506fffffffffffffffffffffffffffffffff1691506000821415610c54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f554e4956324c504f7261636c652f696e76616c69642d7072696365000000000081525060200191505060405180910390fd5b600760066000820160009054906101000a90046fffffffffffffffffffffffffffffffff168160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055506000820160109054906101000a90046fffffffffffffffffffffffffffffffff168160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055509050506040518060400160405280836fffffffffffffffffffffffffffffffff16815260200160016fffffffffffffffffffffffffffffffff16815250600760008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555090505080600560146101000a81548163ffffffff021916908363ffffffff1602179055507f80a5d0081d7e9a7bdb15ef207c6e0772f0f56d24317693206c0e47408f2d0b73600660000160009054906101000a90046fffffffffffffffffffffffffffffffff16600760000160009054906101000a90046fffffffffffffffffffffffffffffffff1660405180836fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff168152602001826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610f70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b60008090505b828290508110156110c657600073ffffffffffffffffffffffffffffffffffffffff16838383818110610fa557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561104c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d30000000000081525060200191505060405180910390fd5b60016002600085858581811061105e57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508080600101915050610f76565b505050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461117f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f02dc774d82d07722c8c43c212eebb2feaea7924c5472da3b7c2ba5fb532087c760405160405180910390a250565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611302576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff63ffffffff1681111561139e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f554e4956324c504f7261636c652f696e76616c69642d686f700000000000000081525060200191505060405180910390fd5b80600460146101000a81548163ffffffff021916908363ffffffff1602179055507fd5cae49d972f01d170fb2d3409c5f318698639863c0403e59e4af06e0ce92817600460149054906101000a900463ffffffff16604051808263ffffffff16815260200191505060405180910390a150565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146114c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b60008090505b82829050811015611550576000600260008585858181106114e857fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080806001019150506114cb565b505050565b7f554e49565742544344414900000000000000000000000000000000000000000081565b60026020528060005260406000206000915090505481565b60068060000160009054906101000a90046fffffffffffffffffffffffffffffffff16908060000160109054906101000a90046fffffffffffffffffffffffffffffffff16905082565b60006001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611675576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612b366026913960400191505060405180910390fd5b6001600660000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff161461171e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f554e4956324c504f7261636c652f6e6f2d63757272656e742d76616c7565000081525060200191505060405180910390fd5b600660000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1660001b905090565b6000806001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146117f5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612b366026913960400191505060405180910390fd5b600660000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1660001b6001600660000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1614915091509091565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461191f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156119c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d30000000000081525060200191505060405180910390fd5b6000821415611a115780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a5d565b6001821415611a5c5780600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b7f57e1d18531e0ed6c4f60bf6039e5719aa115e43e43847525125856433a69f7a78282604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611b80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611c7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b60016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a6060405160405180910390a250565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611de6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b60405160405180910390a250565b600560149054906101000a900463ffffffff1681565b6000611ec2600560149054906101000a900463ffffffff1663ffffffff16600460149054906101000a900463ffffffff1663ffffffff16612877565b421015905090565b600460149054906101000a900463ffffffff1681565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611f94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b60006001819055507f1b55ba3aa851a46be3b365aee5b5c140edd620d578922f3e8466d2cbd96f954b60405160405180910390a1565b60006020528060005260406000206000915090505481565b7f000000000000000000000000000000000000000000000000000000000000000881565b7f000000000000000000000000000000000000000000000000000000000000001281565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414612104576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156121a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d30000000000081525060200191505060405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561225c57600080fd5b505af1158015612270573d6000803e3d6000fd5b505050506000806000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156122e157600080fd5b505afa1580156122f5573d6000803e3d6000fd5b505050506040513d606081101561230b57600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050509250925092506000836dffffffffffffffffffffffffffff1611801561236657506000826dffffffffffffffffffffffffffff16115b6123d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f554e4956324c504f7261636c652f696e76616c69642d7265736572766573000081525060200191505060405180910390fd5b809350428463ffffffff16146123ed57600080fd5b601260ff167f000000000000000000000000000000000000000000000000000000000000000860ff16146124615761244960127f000000000000000000000000000000000000000000000000000000000000000860ff166128fa565b600a0a836dffffffffffffffffffffffffffff160292505b601260ff167f000000000000000000000000000000000000000000000000000000000000001260ff16146124d5576124bd60127f000000000000000000000000000000000000000000000000000000000000001260ff166128fa565b600a0a826dffffffffffffffffffffffffffff160291505b6000612501846dffffffffffffffffffffffffffff16846dffffffffffffffffffffffffffff1661297d565b90506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166357de26a46040518163ffffffff1660e01b815260040160206040518083038186803b15801561256d57600080fd5b505afa158015612581573d6000803e3d6000fd5b505050506040513d602081101561259757600080fd5b810190808051906020019092919050505090506000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166357de26a46040518163ffffffff1660e01b815260040160206040518083038186803b15801561261457600080fd5b505afa158015612628573d6000803e3d6000fd5b505050506040513d602081101561263e57600080fd5b8101908080519060200190929190505050905060008214156126ab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b126024913960400191505060405180910390fd5b6000811415612705576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b5c6024913960400191505060405180910390fd5b600061272261271d856127188587612a12565b612a4a565b612a8a565b90506000670de0b6b3a76400006127398684612a12565b8161274057fe5b0490506000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156127ad57600080fd5b505afa1580156127c1573d6000803e3d6000fd5b505050506040513d60208110156127d757600080fd5b8101908080519060200190929190505050905060008111612843576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612aed6025913960400191505060405180910390fd5b6128686128626128538588612a4a565b61285d8588612a4a565b612877565b82612a12565b9a505050505050505050509091565b60008282840191508110156128f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f64732d6d6174682d6164642d6f766572666c6f7700000000000000000000000081525060200191505060405180910390fd5b92915050565b6000828284039150811115612977576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f64732d6d6174682d7375622d756e646572666c6f77000000000000000000000081525060200191505060405180910390fd5b92915050565b60008082148061299a575082828385029250828161299757fe5b04145b612a0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f64732d6d6174682d6d756c2d6f766572666c6f7700000000000000000000000081525060200191505060405180910390fd5b92915050565b600081612a3a612a2a85670de0b6b3a764000061297d565b60028581612a3457fe5b04612877565b81612a4157fe5b04905092915050565b6000670de0b6b3a7640000612a7a612a62858561297d565b6002670de0b6b3a764000081612a7457fe5b04612877565b81612a8157fe5b04905092915050565b60006003821115612ad9578190506000600160028481612aa657fe5b040190505b81811015612ad357809150600281828581612ac257fe5b040181612acb57fe5b049050612aab565b50612ae7565b60008214612ae657600190505b5b91905056fe554e4956324c504f7261636c652f696e76616c69642d6c702d746f6b656e2d737570706c79554e4956324c504f7261636c652f696e76616c69642d6f7261636c652d302d7072696365554e4956324c504f7261636c652f636f6e74726163742d6e6f742d77686974656c6973746564554e4956324c504f7261636c652f696e76616c69642d6f7261636c652d312d7072696365a2646970667358221220e599d708073da5d75f40a1cf8a338fb7b59c9d8f808932a3645acb9baf2d766264736f6c634300060b0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 1,872 |
0xcaafa24c1125c620c693d7c95e2904542e3b61bb | /*
____ _ _ _ ____ _ _
/ ___|| |__ (_) |__ __ _ / ___|| |_ ___ __ _| | __
\___ \| '_ \| | '_ \ / _` | \___ \| __/ _ \/ _` | |/ /
___) | | | | | |_) | (_| | ___) | || __/ (_| | <
|____/|_| |_|_|_.__/ \__,_| |____/ \__\___|\__,_|_|\_\
🥩 1,000,000,000,000 token supply
🥩 Sell will be disabled for 60 seconds after launch to blacklist bots and will be automatically lifted by the contract afterwards
🥩 FIRST TWO MINUTES: 3000000000 max buy / 60-second buy cooldown (these limitations are lifted automatically two minutes post-launch)
🥩 15-second cooldown to sell after a buy, in order to limit bot behavior. NO OTHER COOLDOWNS, NO COOLDOWNS BETWEEN SELLS
Maximum Wallet Token Percentage for Whale Control
🥩 For the first 15 minutes. there is a 2% token wallet limit (20,000,000,000)
🥩 After 15 minutes, the % max wallet limit is lifted
Fees:
🥩 10% total tax on buy
🥩 Fee on sells is dynamic, relative to price impact, minimum of 10% fee and maximum of 40% fee, with NO SELL LIMIT.
Holders' Benefits
🥩 Every transaction (buy or sell) distributes 6% of the transaction value to the holders.
🥩 Website: https://shibasteak.club/
🥩 Twitter: https://twitter.com/shibasteak
🥩 Telegram: https://t.me/shibasteak
*/
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 Shibasteak is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => bool) private _isSniper;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 100 * 10**9 * 10**18;
string private _name = 'Shiba Steak 🥩 | https://t.me/shibasteak';
string private _symbol = 'Shiba Steak 🥩';
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 isBlackListed(address account) public view returns (bool) {
return _isSniper[account];
}
function RemoveSniper(address account) external onlyOwner() {
require(account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, 'We can not blacklist Uniswap router.');
require(!_isSniper[account], "Account is already blacklisted");
_isSniper[account] = 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");
require(!_isSniper[recipient], "CHEH");
require(!_isSniper[msg.sender], "CHEH");
require(!_isSniper[sender], "CHEH");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
} | 0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063715018a61161008c57806395d89b411161006657806395d89b4114610358578063a9059cbb146103db578063dd62ed3e1461043f578063e47d6060146104b7576100cf565b8063715018a6146102d657806383b61c8b146102e05780638da5cb5b14610324576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bb57806323b872dd146101d9578063313ce5671461025d57806370a082311461027e575b600080fd5b6100dc610511565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105b3565b60405180821515815260200191505060405180910390f35b6101c36105d1565b6040518082815260200191505060405180910390f35b610245600480360360608110156101ef57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105db565b60405180821515815260200191505060405180910390f35b6102656106b4565b604051808260ff16815260200191505060405180910390f35b6102c06004803603602081101561029457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106cb565b6040518082815260200191505060405180910390f35b6102de610714565b005b610322600480360360208110156102f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061089c565b005b61032c610b1a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610360610b43565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610be5565b60405180821515815260200191505060405180910390f35b6104a16004803603604081101561045557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c03565b6040518082815260200191505060405180910390f35b6104f9600480360360208110156104cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c8a565b60405180821515815260200191505060405180910390f35b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105a95780601f1061057e576101008083540402835291602001916105a9565b820191906000526020600020905b81548152906001019060200180831161058c57829003601f168201915b5050505050905090565b60006105c76105c0610ce0565b8484610ce8565b6001905092915050565b6000600554905090565b60006105e8848484611008565b6106a9846105f4610ce0565b6106a48560405180606001604052806028815260200161169260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065a610ce0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115029092919063ffffffff16565b610ce8565b600190509392505050565b6000600860009054906101000a900460ff16905090565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61071c610ce0565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6108a4610ce0565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610966576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156109ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117036024913960400191505060405180910390fd5b600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610abf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4163636f756e7420697320616c726561647920626c61636b6c6973746564000081525060200191505060405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bdb5780601f10610bb057610100808354040283529160200191610bdb565b820191906000526020600020905b815481529060010190602001808311610bbe57829003601f168201915b5050505050905090565b6000610bf9610bf2610ce0565b8484611008565b6001905092915050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d6e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117276024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610df4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116706022913960400191505060405180910390fd5b610dfc610b1a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f1a5780600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3611003565b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561108e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061164b6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611114576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116e06023913960400191505060405180910390fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260048152602001807f434845480000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611294576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260048152602001807f434845480000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611354576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260048152602001807f434845480000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6113c0816040518060600160405280602681526020016116ba60269139600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115029092919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061145581600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115c290919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008383111582906115af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611574578082015181840152602081019050611559565b50505050905090810190601f1680156115a15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611640576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737357652063616e206e6f7420626c61636b6c69737420556e697377617020726f757465722e45524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122003cddcdbde5c658e29f80f61406bbdbbd8be2cb26930a90729d3e7f87f3184ab64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,873 |
0x745253f975644b664defc5b89366b437f4c45948 | /**
*Submitted for verification at Etherscan.io on 2021-09-09
*/
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.6;
abstract contract OwnableStatic {
// address private _owner;
mapping( address => bool ) private _isOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(msg.sender, true);
}
/**
* @dev Returns the address of the current owner.
*/
// function owner() public view virtual returns (address) {
// return _owner;
// }
function isOwner( address ownerQuery ) external view returns ( bool isQueryOwner ) {
isQueryOwner = _isOwner[ownerQuery];
}
/**
* @dev Throws if called by any account other than the owner.
*/
// modifier onlyOwner() virtual {
// require(owner() == msg.sender, "Ownable: caller is not the owner");
// _;
// }
modifier onlyOwner() {
require( _isOwner[msg.sender] );
_;
}
/**
* @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, bool makeOwner) private {
_isOwner[newOwner] = makeOwner;
// _owner = newOwner;
// emit OwnershipTransferred(oldOwner, newOwner);
}
function setOwnerShip( address newOwner, bool makeOOwner ) external onlyOwner() returns ( bool success ) {
_isOwner[newOwner] = makeOOwner;
success = true;
}
}
library AddressUtils {
function toString (address account) internal pure returns (string memory) {
bytes32 value = bytes32(uint256(uint160(account)));
bytes memory alphabet = '0123456789abcdef';
bytes memory chars = new bytes(42);
chars[0] = '0';
chars[1] = 'x';
for (uint256 i = 0; i < 20; i++) {
chars[2 + i * 2] = alphabet[uint8(value[i + 12] >> 4)];
chars[3 + i * 2] = alphabet[uint8(value[i + 12] & 0x0f)];
}
return string(chars);
}
function isContract (address account) internal view returns (bool) {
uint size;
assembly { size := extcodesize(account) }
return size > 0;
}
function sendValue (address payable account, uint amount) internal {
(bool success, ) = account.call{ value: amount }('');
require(success, 'AddressUtils: failed to send value');
}
function functionCall (address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, 'AddressUtils: failed low-level call');
}
function functionCall (address target, bytes memory data, string memory error) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, error);
}
function functionCallWithValue (address target, bytes memory data, uint value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, 'AddressUtils: failed low-level call with value');
}
function functionCallWithValue (address target, bytes memory data, uint value, string memory error) internal returns (bytes memory) {
require(address(this).balance >= value, 'AddressUtils: insufficient balance for call');
return _functionCallWithValue(target, data, value, error);
}
function _functionCallWithValue (address target, bytes memory data, uint value, string memory error) private returns (bytes memory) {
require(isContract(target), 'AddressUtils: function call to non-contract');
(bool success, bytes memory returnData) = target.call{ value: value }(data);
if (success) {
return returnData;
} else if (returnData.length > 0) {
assembly {
let returnData_size := mload(returnData)
revert(add(32, returnData), returnData_size)
}
} else {
revert(error);
}
}
}
interface IERC20 {
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
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);
}
library SafeERC20 {
using AddressUtils for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev safeApprove (like approve) should only be called when setting an initial allowance or when resetting it to zero; otherwise prefer safeIncreaseAllowance and safeDecreaseAllowance
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @notice send transaction data and check validity of return value, if present
* @param token ERC20 token interface
* @param data transaction data
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract LPLeverageLaunch is OwnableStatic {
using SafeERC20 for IERC20;
mapping( address => bool ) public isTokenApprovedForLending;
mapping( address => mapping( address => uint256 ) ) public amountLoanedForLoanedTokenForLender;
mapping( address => uint256 ) public totalLoanedForToken;
mapping( address => uint256 ) public launchTokenDueForHolder;
mapping( address => uint256 ) public priceForLentToken;
address public _weth9;
address public fundManager;
bool public isActive;
modifier onlyActive() {
require( isActive == true );
_;
}
constructor() {}
function changeActive( bool makeActive ) external onlyOwner() returns ( bool success ) {
isActive = makeActive;
success = true;
}
function setFundManager( address newFundManager ) external onlyOwner() returns ( bool success ) {
fundManager = newFundManager;
success = true;
}
function setWETH9( address weth9 ) external onlyOwner() returns ( bool success ) {
_weth9 = weth9;
success = true;
}
function dispenseToFundManager( address token ) external onlyOwner() returns ( bool success ) {
_dispenseToFundManager( token );
success = true;
}
function _dispenseToFundManager( address token ) internal {
require( fundManager != address(0) );
IERC20(token).safeTransfer( fundManager, IERC20(token).balanceOf( address(this) ) );
}
function changeTokenLendingApproval( address newToken, bool isApproved ) external onlyOwner() returns ( bool success ) {
isTokenApprovedForLending[newToken] = isApproved;
success = true;
}
function getTotalLoaned(address token ) external view returns (uint256 totalLoaned) {
totalLoaned = totalLoanedForToken[token];
}
function setPrice( address lentToken, uint256 price ) external onlyOwner() returns ( bool success ) {
priceForLentToken[lentToken] = price;
success = true;
}
/**
* @param loanedToken The address fo the token being paid. Ethereum is indicated with address(0).
*/
function lendLiquidity( address loanedToken, uint amount ) external onlyActive() returns ( bool success ) {
require( fundManager != address(0) );
require( isTokenApprovedForLending[loanedToken] );
IERC20(loanedToken).safeTransferFrom( msg.sender, fundManager, amount );
amountLoanedForLoanedTokenForLender[msg.sender][loanedToken] += amount;
totalLoanedForToken[loanedToken] += amount;
// uint256 lentTokenPrice = twapForToken[loanedToken];
launchTokenDueForHolder[msg.sender] += (amount / priceForLentToken[loanedToken]);
success == true;
}
function getAmountDueToLender( address lender ) external view returns ( uint256 amountDue ) {
amountDue = launchTokenDueForHolder[lender];
}
receive() external payable onlyActive() {
_lendLiquidity();
}
function lendETHLiquidity() external payable onlyActive() returns ( bool success ) {
_lendLiquidity();
success == true;
}
function _lendLiquidity() internal returns ( bool success ) {
require( fundManager != address(0) );
amountLoanedForLoanedTokenForLender[msg.sender][address(_weth9)] = amountLoanedForLoanedTokenForLender[msg.sender][address(_weth9)] + msg.value;
totalLoanedForToken[address(_weth9)] += msg.value;
payable(fundManager).transfer( address(this).balance );
launchTokenDueForHolder[msg.sender] += msg.value;
success == true;
}
function dispenseToFundManager() external onlyOwner() returns ( bool success ) {
payable(fundManager).transfer( address(this).balance );
success = true;
}
function getAmountLoaned( address lender, address lentToken ) external view returns ( uint256 amountLoaned ) {
amountLoaned = amountLoanedForLoanedTokenForLender[lender][lentToken];
}
function emergencyWithdraw( address token ) external onlyOwner() returns ( bool success ) {
IERC20(token).safeTransfer( msg.sender, IERC20(token).balanceOf( address(this) ) );
totalLoanedForToken[token] = 0;
success = true;
}
function emergencyWithdraw() external onlyOwner() returns ( bool success ) {
payable(msg.sender).transfer( address(this).balance );
success = true;
}
} | 0x60806040526004361061014e5760003560e01c80637b5012a1116100b6578063cdd4eb141161006f578063cdd4eb1414610486578063db2e21bc146104a6578063de218a34146104bb578063eb52e9d2146104c3578063f087bc67146104e3578063faca12be1461051957600080fd5b80637b5012a11461037b5780638f16e3411461039b57806399a98a62146103bb578063bfb2cdcd146103e8578063c90c152b1461042e578063ca91e18c1461046657600080fd5b806345625fe91161010857806345625fe9146102625780634a501d7d1461029d57806358dc0df3146102bd5780635f86b0da146102ed5780636209ec2d146103235780636ff1c9bc1461035b57600080fd5b8062e4768b1461017e5780630230e412146101b357806310254d35146101d357806322f3e2d4146101e8578063232a3060146102095780632f54bf6e1461022957600080fd5b3661017957600754600160a01b900460ff16151560011461016e57600080fd5b610176610546565b50005b600080fd5b34801561018a57600080fd5b5061019e610199366004610eab565b610642565b60405190151581526020015b60405180910390f35b3480156101bf57600080fd5b5061019e6101ce366004610e1f565b61067e565b3480156101df57600080fd5b5061019e6106ab565b3480156101f457600080fd5b5060075461019e90600160a01b900460ff1681565b34801561021557600080fd5b5061019e610224366004610e1f565b610708565b34801561023557600080fd5b5061019e610244366004610e1f565b6001600160a01b031660009081526020819052604090205460ff1690565b34801561026e57600080fd5b5061028f61027d366004610e1f565b60056020526000908152604090205481565b6040519081526020016101aa565b3480156102a957600080fd5b5061019e6102b8366004610e74565b61074a565b3480156102c957600080fd5b5061019e6102d8366004610e1f565b60016020526000908152604090205460ff1681565b3480156102f957600080fd5b5061028f610308366004610e1f565b6001600160a01b031660009081526004602052604090205490565b34801561032f57600080fd5b50600754610343906001600160a01b031681565b6040516001600160a01b0390911681526020016101aa565b34801561036757600080fd5b5061019e610376366004610e1f565b610797565b34801561038757600080fd5b5061019e610396366004610e74565b61085f565b3480156103a757600080fd5b50600654610343906001600160a01b031681565b3480156103c757600080fd5b5061028f6103d6366004610e1f565b60046020526000908152604090205481565b3480156103f457600080fd5b5061028f610403366004610e41565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b34801561043a57600080fd5b5061028f610449366004610e41565b600260209081526000928352604080842090915290825290205481565b34801561047257600080fd5b5061019e610481366004610e1f565b6108aa565b34801561049257600080fd5b5061019e6104a1366004610eab565b6108ec565b3480156104b257600080fd5b5061019e610a13565b61019e610a5b565b3480156104cf57600080fd5b5061019e6104de366004610ed5565b610a85565b3480156104ef57600080fd5b5061028f6104fe366004610e1f565b6001600160a01b031660009081526003602052604090205490565b34801561052557600080fd5b5061028f610534366004610e1f565b60036020526000908152604090205481565b6007546000906001600160a01b031661055e57600080fd5b3360009081526002602090815260408083206006546001600160a01b0316845290915290205461058f903490610f77565b336000908152600260209081526040808320600680546001600160a01b03908116865291845282852095909555935490931682526003905290812080543492906105da908490610f77565b90915550506007546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610618573d6000803e3d6000fd5b503360009081526004602052604081208054349290610638908490610f77565b9250508190555090565b3360009081526020819052604081205460ff1661065e57600080fd5b506001600160a01b03909116600090815260056020526040902055600190565b3360009081526020819052604081205460ff1661069a57600080fd5b6106a382610ac3565b506001919050565b3360009081526020819052604081205460ff166106c757600080fd5b6007546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610700573d6000803e3d6000fd5b506001905090565b3360009081526020819052604081205460ff1661072457600080fd5b50600780546001600160a01b0319166001600160a01b0392909216919091179055600190565b3360009081526020819052604081205460ff1661076657600080fd5b506001600160a01b03919091166000908152600160208190526040909120805460ff19169215159290921790915590565b3360009081526020819052604081205460ff166107b357600080fd5b6040516370a0823160e01b81523060048201526108419033906001600160a01b038516906370a082319060240160206040518083038186803b1580156107f857600080fd5b505afa15801561080c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108309190610f0f565b6001600160a01b0385169190610b6f565b506001600160a01b0316600090815260036020526040812055600190565b3360009081526020819052604081205460ff1661087b57600080fd5b506001600160a01b03919091166000908152602081905260409020805460ff1916911515919091179055600190565b3360009081526020819052604081205460ff166108c657600080fd5b50600680546001600160a01b0319166001600160a01b0392909216919091179055600190565b600754600090600160a01b900460ff16151560011461090a57600080fd5b6007546001600160a01b031661091f57600080fd5b6001600160a01b03831660009081526001602052604090205460ff1661094457600080fd5b600754610960906001600160a01b038581169133911685610bd7565b3360009081526002602090815260408083206001600160a01b038716845290915281208054849290610993908490610f77565b90915550506001600160a01b038316600090815260036020526040812080548492906109c0908490610f77565b90915550506001600160a01b0383166000908152600560205260409020546109e89083610f9d565b3360009081526004602052604081208054909190610a07908490610f77565b90915550909392505050565b3360009081526020819052604081205460ff16610a2f57600080fd5b60405133904780156108fc02916000818181858888f19350505050158015610700573d6000803e3d6000fd5b600754600090600160a01b900460ff161515600114610a7957600080fd5b610a81610546565b5090565b3360009081526020819052604081205460ff16610aa157600080fd5b5060078054911515600160a01b0260ff60a01b19909216919091179055600190565b6007546001600160a01b0316610ad857600080fd5b6007546040516370a0823160e01b8152306004820152610b6c916001600160a01b0390811691908416906370a082319060240160206040518083038186803b158015610b2357600080fd5b505afa158015610b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5b9190610f0f565b6001600160a01b0384169190610b6f565b50565b6040516001600160a01b038316602482015260448101829052610bd290849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610c15565b505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610c0f9085906323b872dd60e01b90608401610b9b565b50505050565b6000610c6a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610cec9092919063ffffffff16565b805190915015610bd25780806020019051810190610c889190610ef2565b610bd25760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084015b60405180910390fd5b6060610cfb8484600085610d03565b949350505050565b6060843b610d675760405162461bcd60e51b815260206004820152602b60248201527f416464726573735574696c733a2066756e6374696f6e2063616c6c20746f206e60448201526a1bdb8b58dbdb9d1c9858dd60aa1b6064820152608401610ce3565b600080866001600160a01b03168587604051610d839190610f28565b60006040518083038185875af1925050503d8060008114610dc0576040519150601f19603f3d011682016040523d82523d6000602084013e610dc5565b606091505b50915091508115610dd9579150610cfb9050565b805115610de95780518082602001fd5b8360405162461bcd60e51b8152600401610ce39190610f44565b80356001600160a01b0381168114610e1a57600080fd5b919050565b600060208284031215610e3157600080fd5b610e3a82610e03565b9392505050565b60008060408385031215610e5457600080fd5b610e5d83610e03565b9150610e6b60208401610e03565b90509250929050565b60008060408385031215610e8757600080fd5b610e9083610e03565b91506020830135610ea081610feb565b809150509250929050565b60008060408385031215610ebe57600080fd5b610ec783610e03565b946020939093013593505050565b600060208284031215610ee757600080fd5b8135610e3a81610feb565b600060208284031215610f0457600080fd5b8151610e3a81610feb565b600060208284031215610f2157600080fd5b5051919050565b60008251610f3a818460208701610fbf565b9190910192915050565b6020815260008251806020840152610f63816040850160208701610fbf565b601f01601f19169190910160400192915050565b60008219821115610f9857634e487b7160e01b600052601160045260246000fd5b500190565b600082610fba57634e487b7160e01b600052601260045260246000fd5b500490565b60005b83811015610fda578181015183820152602001610fc2565b83811115610c0f5750506000910152565b8015158114610b6c57600080fdfea2646970667358221220d03f7b97998b6dd614319a35fe0f8c6acf15da6c83c15e1eff33388885cd642664736f6c63430008060033 | {"success": true, "error": null, "results": {}} | 1,874 |
0x6e35563be1e059f95bcfb5e1d6d854602a7fa3e1 | pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
uint256 c = _a * _b;
require(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b <= _a);
uint256 c = _a - _b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
require(c >= _a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function allowance(address _owner, address _spender)
public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function approve(address _spender, uint256 _value)
public returns (bool);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
}
/**
* @title 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 {
using SafeMath for uint256;
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
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;
}
}
/**
* Pausable token
*
* Simple ERC20 Token example, with pausable token creation
**/
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns(bool) {
super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns(bool) {
super.transferFrom(_from, _to, _value);
}
}
/**
* @title Creatanium Contract
*/
contract Creatanium is PausableToken {
using SafeMath for uint256;
string public constant name = "Creatanium";
string public constant symbol = "CMB";
uint8 public constant decimals = 18;
uint256 public constant initialSupply_ = 2000000000 * (10 ** uint256(decimals));
uint256 public tokensForPublicSale = 0 * (10 ** 18);
uint256 public pricePerToken = (10 ** 16); //1 Eth = 1 ACO
uint256 minETH = 0 * (10**18); // 0 ether
uint256 maxETH = 100 * (10**18); // 10 ether
//Crowdsale running
bool public isCrowdsaleOpen=false;
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor() public {
totalSupply_ = initialSupply_;
balances[msg.sender] = balances[msg.sender].add(initialSupply_);
emit Transfer(address(0), msg.sender, initialSupply_);
}
function startCrowdSale() public onlyOwner {
isCrowdsaleOpen=true;
}
function stopCrowdSale() public onlyOwner {
isCrowdsaleOpen=false;
}
function sendToInvestor(address _to, uint256 _value) public onlyOwner {
transfer(_to, _value);
}
//tokensForPublicSale should be less than the balance of the owner
//be careful with this function
//should be used only if params needto change other than the default settings
function setPublicSaleParams(uint256 _tokensForPublicSale, uint256 _min, uint256 _max, uint256 _pricePerToken ) public onlyOwner {
require(_tokensForPublicSale > 0);
require (_tokensForPublicSale <= totalSupply_);
require(_pricePerToken > 0);
require(_min >= 0);
require(_max > 0);
pricePerToken = 0;
pricePerToken = pricePerToken.add(_pricePerToken);
tokensForPublicSale = 0;
tokensForPublicSale = tokensForPublicSale.add(_tokensForPublicSale);
minETH = 0;
minETH = minETH.add(_min);
maxETH = 0;
maxETH = maxETH.add(_max);
}
function buyTokens() public payable returns(uint tokenAmount) {
uint256 _tokenAmount;
uint256 multiplier = (10 ** 18);
uint256 weiAmount = msg.value;
require(isCrowdsaleOpen);
require(weiAmount >= minETH);
require(weiAmount <= maxETH);
_tokenAmount = weiAmount.mul(multiplier).div(pricePerToken);
require(_tokenAmount > 0);
//safe sub will automatically handle overflows
tokensForPublicSale = tokensForPublicSale.sub(_tokenAmount);
//transfer tokens from owner to payee
require(_tokenAmount <= balances[owner]);
balances[owner] = balances[owner].sub(_tokenAmount);
balances[msg.sender] = balances[msg.sender].add(_tokenAmount);
emit Transfer(owner, msg.sender, _tokenAmount);
//send money to the owner
require(owner.send(weiAmount));
return _tokenAmount;
}
// There is no need for vesting. It will be done manually by manually releasing tokens to certain addresses
function() public payable {
buyTokens();
}
} | 0x6080604052600436106101535763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461015e578063095ea7b3146101e857806318160ddd1461022057806320c326dd1461024757806323b872dd1461025c578063313ce567146102865780633f4ba83a146102b15780635a3320ff146102c85780635c975abb146102dd57806366188463146102f257806370a0823114610316578063715018a6146103375780637b1b1de61461034c5780638456cb59146103615780638da5cb5b146103765780638e8f1e84146103a7578063905358fe146103c857806395d89b41146103dd578063a9059cbb146103f2578063b0b189ca14610416578063c67c6eab1461043a578063d0febe4c1461044f578063d73dd62314610457578063dd62ed3e1461047b578063f2b45ac1146104a2578063f2fde38b146104b7575b61015b6104d8565b50005b34801561016a57600080fd5b50610173610679565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ad578181015183820152602001610195565b50505050905090810190601f1680156101da5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f457600080fd5b5061020c600160a060020a03600435166024356106b0565b604080519115158252519081900360200190f35b34801561022c57600080fd5b50610235610716565b60408051918252519081900360200190f35b34801561025357600080fd5b5061023561071c565b34801561026857600080fd5b5061020c600160a060020a0360043581169060243516604435610722565b34801561029257600080fd5b5061029b61074f565b6040805160ff9092168252519081900360200190f35b3480156102bd57600080fd5b506102c6610754565b005b3480156102d457600080fd5b5061020c6107cc565b3480156102e957600080fd5b5061020c6107d5565b3480156102fe57600080fd5b5061020c600160a060020a03600435166024356107e5565b34801561032257600080fd5b50610235600160a060020a03600435166108d6565b34801561034357600080fd5b506102c66108f1565b34801561035857600080fd5b5061023561095f565b34801561036d57600080fd5b506102c6610965565b34801561038257600080fd5b5061038b6109e2565b60408051600160a060020a039092168252519081900360200190f35b3480156103b357600080fd5b506102c66004356024356044356064356109f1565b3480156103d457600080fd5b50610235610aba565b3480156103e957600080fd5b50610173610aca565b3480156103fe57600080fd5b5061020c600160a060020a0360043516602435610b01565b34801561042257600080fd5b506102c6600160a060020a0360043516602435610b25565b34801561044657600080fd5b506102c6610b4b565b6102356104d8565b34801561046357600080fd5b5061020c600160a060020a0360043516602435610b6e565b34801561048757600080fd5b50610235600160a060020a0360043581169060243516610c07565b3480156104ae57600080fd5b506102c6610c32565b3480156104c357600080fd5b506102c6600160a060020a0360043516610c58565b6008546000908190670de0b6b3a764000090349060ff1615156104fa57600080fd5b60065481101561050957600080fd5b60075481111561051857600080fd5b60055461053b9061052f838563ffffffff610c7b16565b9063ffffffff610cb016565b92506000831161054a57600080fd5b60045461055d908463ffffffff610cd316565b600455600354600160a060020a031660009081526020819052604090205483111561058757600080fd5b600354600160a060020a03166000908152602081905260409020546105b2908463ffffffff610cd316565b600354600160a060020a03166000908152602081905260408082209290925533815220546105e6908463ffffffff610cea16565b336000818152602081815260409182902093909355600354815187815291519293600160a060020a03909116927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3600354604051600160a060020a039091169082156108fc029083906000818181858888f19350505050151561067157600080fd5b509092915050565b60408051808201909152600a81527f4372656174616e69756d00000000000000000000000000000000000000000000602082015281565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b60045481565b60035460009060a060020a900460ff161561073c57600080fd5b610747848484610cfc565b509392505050565b601281565b600354600160a060020a0316331461076b57600080fd5b60035460a060020a900460ff16151561078357600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60085460ff1681565b60035460a060020a900460ff1681565b336000908152600160209081526040808320600160a060020a038616845290915281205480831061083957336000908152600160209081526040808320600160a060020a038816845290915281205561086e565b610849818463ffffffff610cd316565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a3600191505b5092915050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461090857600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b60055481565b600354600160a060020a0316331461097c57600080fd5b60035460a060020a900460ff161561099357600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b600354600160a060020a03163314610a0857600080fd5b60008411610a1557600080fd5b600254841115610a2457600080fd5b60008111610a3157600080fd5b6000831015610a3f57600080fd5b60008211610a4c57600080fd5b60006005819055610a63908263ffffffff610cea16565b60055560006004819055610a7d908563ffffffff610cea16565b60045560006006819055610a97908463ffffffff610cea16565b60065560006007819055610ab1908363ffffffff610cea16565b60075550505050565b6b06765c793fa10079d000000081565b60408051808201909152600381527f434d420000000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff1615610b1b57600080fd5b6108cf8383610e71565b600354600160a060020a03163314610b3c57600080fd5b610b468282610b01565b505050565b600354600160a060020a03163314610b6257600080fd5b6008805460ff19169055565b336000908152600160209081526040808320600160a060020a0386168452909152812054610ba2908363ffffffff610cea16565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600354600160a060020a03163314610c4957600080fd5b6008805460ff19166001179055565b600354600160a060020a03163314610c6f57600080fd5b610c7881610f50565b50565b600080831515610c8e57600091506108cf565b50828202828482811515610c9e57fe5b0414610ca957600080fd5b9392505050565b600080808311610cbf57600080fd5b8284811515610cca57fe5b04949350505050565b60008083831115610ce357600080fd5b5050900390565b600082820183811015610ca957600080fd5b600160a060020a038316600090815260208190526040812054821115610d2157600080fd5b600160a060020a0384166000908152600160209081526040808320338452909152902054821115610d5157600080fd5b600160a060020a0383161515610d6657600080fd5b600160a060020a038416600090815260208190526040902054610d8f908363ffffffff610cd316565b600160a060020a038086166000908152602081905260408082209390935590851681522054610dc4908363ffffffff610cea16565b600160a060020a03808516600090815260208181526040808320949094559187168152600182528281203382529091522054610e06908363ffffffff610cd316565b600160a060020a03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b33600090815260208190526040812054821115610e8d57600080fd5b600160a060020a0383161515610ea257600080fd5b33600090815260208190526040902054610ec2908363ffffffff610cd316565b3360009081526020819052604080822092909255600160a060020a03851681522054610ef4908363ffffffff610cea16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600160a060020a0381161515610f6557600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820f68abde985ec51598e940e488b408aa16708504e20201485df709a289ab683d80029 | {"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 1,875 |
0x086e2cf3360ae1bb07ad1f3e4c35c4fb6328245a | /**
*Submitted for verification at Etherscan.io on 2021-03-22
*/
pragma solidity ^0.5.0;
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;
}
}
library Roles {
struct Role {
mapping(address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.bearer[account] = true;
}
/**
* @dev remove an account's access to this role
*/
function remove(Role storage role, address account) internal {
require(account != address(0));
require(has(role, account));
role.bearer[account] = false;
}
/**
* @dev check if an account has this role
* @return bool
*/
function has(Role storage role, address account)
internal
view
returns (bool)
{
require(account != address(0));
return role.bearer[account];
}
}
contract Ownable {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() internal {
address msgSender = msg.sender;
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract 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);
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
external
view
returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping(address => uint256) internal _balances;
mapping(address => mapping(address => uint256)) internal _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender)
public
view
returns (uint256)
{
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 value
) public returns (bool) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
emit Approval(from, msg.sender, _allowed[from][msg.sender]);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(
addedValue
);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(
subtractedValue
);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(
address from,
address to,
uint256 value
) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(
value
);
_burn(account, value);
emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}
}
contract 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);
}
/*
* approve/increaseApprove/decreaseApprove can be set when Paused state
*/
/*
* 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 ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(
string memory name,
string memory symbol,
uint8 decimals
) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @return the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
}
contract BarrySilbertFanToken is ERC20Detailed, ERC20Pausable {
mapping(address => bool) public frozenAccount;
event Freeze(address indexed holder);
event Unfreeze(address indexed holder);
modifier notFrozen(address _holder) {
require(!frozenAccount[_holder]);
_;
}
constructor() public ERC20Detailed("BarrySilbert.FanToken", "BSF", 18) {
_mint(msg.sender, 100000000 * (10**18));
}
function balanceOf(address owner) public view returns (uint256) {
return super.balanceOf(owner);
}
function transfer(address to, uint256 value)
public
notFrozen(msg.sender)
returns (bool)
{
return super.transfer(to, value);
}
function transferFrom(
address from,
address to,
uint256 value
) public notFrozen(from) returns (bool) {
return super.transferFrom(from, to, value);
}
function freezeAccount(address holder) public onlyOwner returns (bool) {
require(!frozenAccount[holder]);
frozenAccount[holder] = true;
emit Freeze(holder);
return true;
}
function unfreezeAccount(address holder) public onlyOwner returns (bool) {
require(frozenAccount[holder]);
frozenAccount[holder] = false;
emit Unfreeze(holder);
return true;
}
function mint(uint256 _amount) public onlyOwner returns (bool) {
_mint(msg.sender, _amount);
return true;
}
function burn(uint256 _amount) public onlyOwner returns (bool) {
_burn(msg.sender, _amount);
return true;
}
} | 0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461012d578063095ea7b3146101bd57806318160ddd1461023057806323b872dd1461025b578063313ce567146102ee578063395093511461031f5780633f4ba83a1461039257806342966c68146103a95780635c975abb146103fc57806370a082311461042b578063715018a614610490578063788649ea146104a75780638456cb59146105105780638da5cb5b1461052757806395d89b411461057e578063a0712d681461060e578063a457c2d714610661578063a9059cbb146106d4578063b414d4b614610747578063dd62ed3e146107b0578063f26c159f14610835578063f2fde38b1461089e575b600080fd5b34801561013957600080fd5b506101426108ef565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610182578082015181840152602081019050610167565b50505050905090810190601f1680156101af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c957600080fd5b50610216600480360360408110156101e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610991565b604051808215151515815260200191505060405180910390f35b34801561023c57600080fd5b50610245610abe565b6040518082815260200191505060405180910390f35b34801561026757600080fd5b506102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ac8565b604051808215151515815260200191505060405180910390f35b3480156102fa57600080fd5b50610303610b39565b604051808260ff1660ff16815260200191505060405180910390f35b34801561032b57600080fd5b506103786004803603604081101561034257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b50565b604051808215151515815260200191505060405180910390f35b34801561039e57600080fd5b506103a7610d87565b005b3480156103b557600080fd5b506103e2600480360360208110156103cc57600080fd5b8101908080359060200190929190505050610ee7565b604051808215151515815260200191505060405180910390f35b34801561040857600080fd5b50610411610fc1565b604051808215151515815260200191505060405180910390f35b34801561043757600080fd5b5061047a6004803603602081101561044e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fd8565b6040518082815260200191505060405180910390f35b34801561049c57600080fd5b506104a5610fea565b005b3480156104b357600080fd5b506104f6600480360360208110156104ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611170565b604051808215151515815260200191505060405180910390f35b34801561051c57600080fd5b50610525611333565b005b34801561053357600080fd5b5061053c611494565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561058a57600080fd5b506105936114be565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d35780820151818401526020810190506105b8565b50505050905090810190601f1680156106005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061a57600080fd5b506106476004803603602081101561063157600080fd5b8101908080359060200190929190505050611560565b604051808215151515815260200191505060405180910390f35b34801561066d57600080fd5b506106ba6004803603604081101561068457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061163a565b604051808215151515815260200191505060405180910390f35b3480156106e057600080fd5b5061072d600480360360408110156106f757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611871565b604051808215151515815260200191505060405180910390f35b34801561075357600080fd5b506107966004803603602081101561076a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118e0565b604051808215151515815260200191505060405180910390f35b3480156107bc57600080fd5b5061081f600480360360408110156107d357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611900565b6040518082815260200191505060405180910390f35b34801561084157600080fd5b506108846004803603602081101561085857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611987565b604051808215151515815260200191505060405180910390f35b3480156108aa57600080fd5b506108ed600480360360208110156108c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b4b565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109875780601f1061095c57610100808354040283529160200191610987565b820191906000526020600020905b81548152906001019060200180831161096a57829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156109ce57600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600554905090565b600083600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610b2457600080fd5b610b2f858585611d9b565b9150509392505050565b6000600260009054906101000a900460ff16905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610b8d57600080fd5b610c1c82600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dcd90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610e4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600660149054906101000a900460ff161515610e6757600080fd5b6000600660146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b60003373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610fae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610fb83383611dee565b60019050919050565b6000600660149054906101000a900460ff16905090565b6000610fe382611f44565b9050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156110af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60003373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611237576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561128f57600080fd5b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fca5069937e68fd197927055037f59d7c90bf75ac104e6e375539ef480c3ad6ee60405160405180910390a260019050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156113f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600660149054906101000a900460ff1615151561141457600080fd5b6001600660146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115565780601f1061152b57610100808354040283529160200191611556565b820191906000526020600020905b81548152906001019060200180831161153957829003601f168201915b5050505050905090565b60003373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611627576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6116313383611f8d565b60019050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561167757600080fd5b61170682600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120e390919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600033600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118cd57600080fd5b6118d78484612105565b91505092915050565b60076020528060005260406000206000915054906101000a900460ff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60003373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611a4e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611aa757600080fd5b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167faf85b60d26151edd11443b704d424da6c43d0468f2235ebae3d1904dbc32304960405160405180910390a260019050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611c10576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611cdb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526020017f646472657373000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600660149054906101000a900460ff16151515611db957600080fd5b611dc4848484612135565b90509392505050565b6000808284019050838110151515611de457600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611e2a57600080fd5b611e3f816005546120e390919063ffffffff16565b600581905550611e9781600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120e390919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611fc957600080fd5b611fde81600554611dcd90919063ffffffff16565b60058190555061203681600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dcd90919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008282111515156120f457600080fd5b600082840390508091505092915050565b6000600660149054906101000a900460ff1615151561212357600080fd5b61212d838361233d565b905092915050565b60006121c682600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120e390919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612251848484612354565b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509392505050565b600061234a338484612354565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561239057600080fd5b6123e281600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120e390919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061247781600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dcd90919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505056fea165627a7a723058202e2e229c07f203682f0da68eb330b8e8e63f1bef79f7883ed06a196184e6614a0029 | {"success": true, "error": null, "results": {}} | 1,876 |
0x21da4747a01c613bc30e3f0be5b6f5f851396532 | /**
*Submitted for verification at Etherscan.io on 2020-08-12
*/
/**
*Submitted for verification at Etherscan.io on 2020-08-12
*/
pragma solidity ^0.4.24;
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
if (_a == 0) {
return 0;
}
uint256 c = _a * _b;
require(c / _a == _b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(_b > 0);
uint256 c = _a / _b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b <= _a);
return _a - _b;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
require(c >= _a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/*
* Ownable
*
* Base contract with an owner.
* Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.
*/
contract Ownable {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
owner = msg.sender;
newOwner = address(0);
}
// allows execution by the owner only
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
modifier onlyNewOwner() {
require(msg.sender != address(0));
require(msg.sender == newOwner);
_;
}
/**
@dev allows transferring the contract ownership
the new owner still needs to accept the transfer
can only be called by the contract owner
@param _newOwner new contract owner
*/
function transferOwnership(address _newOwner) public onlyOwner {
require(_newOwner != address(0));
newOwner = _newOwner;
}
/**
@dev used by a new owner to accept an ownership transfer
*/
function acceptOwnership() public onlyNewOwner {
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/*
ERC20 Token interface
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function allowance(address owner, address spender) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
function sendwithgas(address _from, address _to, uint256 _value, uint256 _fee) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
interface TokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}
contract RaOnCoin is ERC20, Ownable {
using SafeMath for uint256;
string public name;
string public symbol;
uint8 public decimals;
uint256 internal initialSupply;
uint256 internal totalSupply_;
mapping(address => uint256) internal balances;
mapping(address => bool) public frozen;
mapping(address => mapping(address => uint256)) internal allowed;
event Burn(address indexed owner, uint256 value);
event Mint(uint256 value);
event Freeze(address indexed holder);
event Unfreeze(address indexed holder);
modifier notFrozen(address _holder) {
require(!frozen[_holder]);
_;
}
constructor() public {
name = "RaOnCoin";
symbol = "RAO";
decimals = 0;
initialSupply = 300000000;
totalSupply_ = 300000000;
balances[owner] = totalSupply_;
emit Transfer(address(0), owner, totalSupply_);
}
function () public payable {
revert();
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified addresses
* @param _from The address to transfer from.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function _transfer(address _from, address _to, uint _value) internal {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public notFrozen(msg.sender) returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _holder The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _holder) public view returns (uint256 balance) {
return balances[_holder];
}
/**
* ERC20 Token Transfer
*/
function sendwithgas(address _from, address _to, uint256 _value, uint256 _fee) public onlyOwner notFrozen(_from) returns (bool) {
uint256 _total;
_total = _value.add(_fee);
require(!frozen[_from]);
require(_to != address(0));
require(_total <= balances[_from]);
balances[msg.sender] = balances[msg.sender].add(_fee);
balances[_from] = balances[_from].sub(_total);
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _value);
emit Transfer(_from, msg.sender, _fee);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public notFrozen(_from) returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
_transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to _spender the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an _holder allowed to a spender.
* @param _holder address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _holder, address _spender) public view returns (uint256) {
return allowed[_holder][_spender];
}
/**
* Freeze Account.
*/
function freezeAccount(address _holder) public onlyOwner returns (bool) {
require(!frozen[_holder]);
frozen[_holder] = true;
emit Freeze(_holder);
return true;
}
/**
* Unfreeze Account.
*/
function unfreezeAccount(address _holder) public onlyOwner returns (bool) {
require(frozen[_holder]);
frozen[_holder] = false;
emit Unfreeze(_holder);
return true;
}
/**
* Token Burn.
*/
function burn(uint256 _value) public onlyOwner returns (bool) {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(burner, _value);
return true;
}
function burn_address(address _target) public onlyOwner returns (bool){
require(_target != address(0));
uint256 _targetValue = balances[_target];
balances[_target] = 0;
totalSupply_ = totalSupply_.sub(_targetValue);
address burner = msg.sender;
emit Burn(burner, _targetValue);
return true;
}
/**
* Token Mint.
*/
function mint(uint256 _amount) public onlyOwner returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[owner] = balances[owner].add(_amount);
emit Transfer(address(0), owner, _amount);
return true;
}
/**
* @dev Internal function to determine if an address is a contract
* @param addr The address being queried
* @return True if `_addr` is a contract
*/
function isContract(address addr) internal view returns (bool) {
uint size;
assembly{size := extcodesize(addr)}
return size > 0;
}
} | 0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610117578063095ea7b3146101a757806318160ddd1461020c57806323b872dd14610237578063313ce567146102bc57806342966c68146102ed578063614552991461033257806370a08231146103c1578063788649ea1461041857806379ba5097146104735780637e5f16c81461048a5780638da5cb5b146104e557806395d89b411461053c578063a0712d68146105cc578063a9059cbb14610611578063d051665014610676578063d4ee1d90146106d1578063dd62ed3e14610728578063f26c159f1461079f578063f2fde38b146107fa575b600080fd5b34801561012357600080fd5b5061012c61083d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016c578082015181840152602081019050610151565b50505050905090810190601f1680156101995780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b357600080fd5b506101f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108db565b604051808215151515815260200191505060405180910390f35b34801561021857600080fd5b506102216109cd565b6040518082815260200191505060405180910390f35b34801561024357600080fd5b506102a2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109d7565b604051808215151515815260200191505060405180910390f35b3480156102c857600080fd5b506102d1610b5f565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102f957600080fd5b5061031860048036038101908080359060200190929190505050610b72565b604051808215151515815260200191505060405180910390f35b34801561033e57600080fd5b506103a7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050610d29565b604051808215151515815260200191505060405180910390f35b3480156103cd57600080fd5b50610402600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611170565b6040518082815260200191505060405180910390f35b34801561042457600080fd5b50610459600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b9565b604051808215151515815260200191505060405180910390f35b34801561047f57600080fd5b50610488611312565b005b34801561049657600080fd5b506104cb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114ab565b604051808215151515815260200191505060405180910390f35b3480156104f157600080fd5b506104fa611645565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561054857600080fd5b5061055161166a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610591578082015181840152602081019050610576565b50505050905090810190601f1680156105be5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105d857600080fd5b506105f760048036038101908080359060200190929190505050611708565b604051808215151515815260200191505060405180910390f35b34801561061d57600080fd5b5061065c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118e7565b604051808215151515815260200191505060405180910390f35b34801561068257600080fd5b506106b7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b67565b604051808215151515815260200191505060405180910390f35b3480156106dd57600080fd5b506106e6611b87565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561073457600080fd5b50610789600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bad565b6040518082815260200191505060405180910390f35b3480156107ab57600080fd5b506107e0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c34565b604051808215151515815260200191505060405180910390f35b34801561080657600080fd5b5061083b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d8e565b005b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108d35780601f106108a8576101008083540402835291602001916108d3565b820191906000526020600020905b8154815290600101906020018083116108b657829003601f168201915b505050505081565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600654905090565b600083600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610a3357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610a6f57600080fd5b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610abd57600080fd5b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610b4857600080fd5b610b53858585611e69565b60019150509392505050565b600460009054906101000a900460ff1681565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bd057600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610c1e57600080fd5b339050610c7383600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222190919063ffffffff16565b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ccb8360065461222190919063ffffffff16565b6006819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5846040518082815260200191505060405180910390a26001915050919050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d8757600080fd5b85600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610de157600080fd5b610df4848661223d90919063ffffffff16565b9150600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610e4f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614151515610e8b57600080fd5b600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610ed957600080fd5b610f2b84600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223d90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fc082600760008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222190919063ffffffff16565b600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061105585600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223d90919063ffffffff16565b600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a33373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3600192505050949350505050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561121657600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561126e57600080fd5b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fca5069937e68fd197927055037f59d7c90bf75ac104e6e375539ef480c3ad6ee60405160405180910390a260019050919050565b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561134e57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113aa57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561150b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561154757600080fd5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491506000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115e38260065461222190919063ffffffff16565b6006819055503390508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600192505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117005780601f106116d557610100808354040283529160200191611700565b820191906000526020600020905b8154815290600101906020018083116116e357829003601f168201915b505050505081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561176557600080fd5b61177a8260065461223d90919063ffffffff16565b6006819055506117f382600760008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223d90919063ffffffff16565b600760008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050919050565b600033600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561194357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561197f57600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156119cd57600080fd5b611a1f83600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222190919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ab483600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223d90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60086020528060005260406000206000915054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c9157600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611cea57600080fd5b6001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167faf85b60d26151edd11443b704d424da6c43d0468f2235ebae3d1904dbc32304960405160405180910390a260019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611de957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611e2557600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611ea557600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515611ef357600080fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515611f7e57600080fd5b611fd081600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222190919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061206581600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223d90919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061213781600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222190919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600082821115151561223257600080fd5b818303905092915050565b600080828401905083811015151561225457600080fd5b80915050929150505600a165627a7a72305820da4c4d2b22a4eed134df510bc259aeaf31676f7c60d31b5b6cec18b3687297c20029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 1,877 |
0x0043aa592ffc4125b8ebdae95f883b0e8ada71b1 | /**
*Submitted for verification at Etherscan.io on 2022-03-30
*/
// SPDX-License-Identifier: UNLICENSED
/*
Garou Inu ガロウ犬
“Stop me if you can. Until then, I’ll stay this cocky.” – Garou
https://t.me/GarouInuportal
*/
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 GAROUINU is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _FeeoFSell;
uint256 private _FeeOfBuy;
address payable private _feeAddress;
string private constant _name = "Garou Inu";
string private constant _symbol = "GAROUINU";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private removeMaxTx = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddress = payable(0xC8a77B2C7765FdED8597eC47C8981F196BB34932);
_FeeOfBuy = 12;
_FeeoFSell = 12;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setRemoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _FeeOfBuy;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _FeeoFSell;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
uint burnAmount = contractTokenBalance/3;
contractTokenBalance -= burnAmount;
burnToken(burnAmount);
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function burnToken(uint burnAmount) private lockTheSwap{
if(burnAmount > 0){
_transfer(address(this), address(0xdead),burnAmount);
}
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 25000000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxTxAmount = 25000000000 * 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 _setFee(uint256 buyFee,uint256 sellFee) external onlyOwner() {
_FeeOfBuy = buyFee;
_FeeoFSell = sellFee;
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101235760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a1461033f578063c3c8cd801461035f578063c9567bf914610374578063dd62ed3e14610389578063dd726e7c146103cf57600080fd5b8063715018a61461029c5780638da5cb5b146102b157806395d89b41146102d95780639e78fb4f1461030a578063a9059cbb1461031f57600080fd5b8063273123b7116100e7578063273123b71461020b578063313ce5671461022b57806346df33b7146102475780636fc3eaec1461026757806370a082311461027c57600080fd5b806306fdde031461012f578063095ea7b31461017357806318160ddd146101a35780631bbae6e0146101c957806323b872dd146101eb57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b506040805180820190915260098152684761726f7520496e7560b81b60208201525b60405161016a9190611656565b60405180910390f35b34801561017f57600080fd5b5061019361018e3660046116d0565b6103ef565b604051901515815260200161016a565b3480156101af57600080fd5b5068056bc75e2d631000005b60405190815260200161016a565b3480156101d557600080fd5b506101e96101e43660046116fc565b610406565b005b3480156101f757600080fd5b50610193610206366004611715565b610453565b34801561021757600080fd5b506101e9610226366004611756565b6104bc565b34801561023757600080fd5b506040516009815260200161016a565b34801561025357600080fd5b506101e9610262366004611781565b610507565b34801561027357600080fd5b506101e961054f565b34801561028857600080fd5b506101bb610297366004611756565b610583565b3480156102a857600080fd5b506101e96105a5565b3480156102bd57600080fd5b506000546040516001600160a01b03909116815260200161016a565b3480156102e557600080fd5b506040805180820190915260088152674741524f55494e5560c01b602082015261015d565b34801561031657600080fd5b506101e9610619565b34801561032b57600080fd5b5061019361033a3660046116d0565b61082b565b34801561034b57600080fd5b506101e961035a3660046117b4565b610838565b34801561036b57600080fd5b506101e96108ce565b34801561038057600080fd5b506101e961090e565b34801561039557600080fd5b506101bb6103a4366004611879565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103db57600080fd5b506101e96103ea3660046118b2565b610ab9565b60006103fc338484610aee565b5060015b92915050565b6000546001600160a01b031633146104395760405162461bcd60e51b8152600401610430906118d4565b60405180910390fd5b68015af1d78b58c400008111156104505760108190555b50565b6000610460848484610c12565b6104b284336104ad85604051806060016040528060288152602001611a9a602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f47565b610aee565b5060019392505050565b6000546001600160a01b031633146104e65760405162461bcd60e51b8152600401610430906118d4565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105315760405162461bcd60e51b8152600401610430906118d4565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105795760405162461bcd60e51b8152600401610430906118d4565b4761045081610f81565b6001600160a01b03811660009081526002602052604081205461040090610fbb565b6000546001600160a01b031633146105cf5760405162461bcd60e51b8152600401610430906118d4565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106435760405162461bcd60e51b8152600401610430906118d4565b600f54600160a01b900460ff161561069d5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610430565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610702573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107269190611909565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610773573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107979190611909565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156107e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108089190611909565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b60006103fc338484610c12565b6000546001600160a01b031633146108625760405162461bcd60e51b8152600401610430906118d4565b60005b81518110156108ca5760016006600084848151811061088657610886611926565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108c281611952565b915050610865565b5050565b6000546001600160a01b031633146108f85760405162461bcd60e51b8152600401610430906118d4565b600061090330610583565b90506104508161103f565b6000546001600160a01b031633146109385760405162461bcd60e51b8152600401610430906118d4565b600e546109599030906001600160a01b031668056bc75e2d63100000610aee565b600e546001600160a01b031663f305d719473061097581610583565b60008061098a6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156109f2573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a17919061196d565b5050600f805468015af1d78b58c4000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610a95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610450919061199b565b6000546001600160a01b03163314610ae35760405162461bcd60e51b8152600401610430906118d4565b600c91909155600b55565b6001600160a01b038316610b505760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610430565b6001600160a01b038216610bb15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610430565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c765760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610430565b6001600160a01b038216610cd85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610430565b60008111610d3a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610430565b6001600160a01b03831660009081526006602052604090205460ff1615610d6057600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610da257506001600160a01b03821660009081526005602052604090205460ff16155b15610f37576000600955600c54600a55600f546001600160a01b038481169116148015610ddd5750600e546001600160a01b03838116911614155b8015610e0257506001600160a01b03821660009081526005602052604090205460ff16155b8015610e175750600f54600160b81b900460ff165b15610e44576000610e2783610583565b601054909150610e3783836111b9565b1115610e4257600080fd5b505b600f546001600160a01b038381169116148015610e6f5750600e546001600160a01b03848116911614155b8015610e9457506001600160a01b03831660009081526005602052604090205460ff16155b15610ea5576000600955600b54600a555b6000610eb030610583565b600f54909150600160a81b900460ff16158015610edb5750600f546001600160a01b03858116911614155b8015610ef05750600f54600160b01b900460ff165b15610f35576000610f026003836119b8565b9050610f0e81836119da565b9150610f1981611218565b610f228261103f565b478015610f3257610f3247610f81565b50505b505b610f4283838361124e565b505050565b60008184841115610f6b5760405162461bcd60e51b81526004016104309190611656565b506000610f7884866119da565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108ca573d6000803e3d6000fd5b60006007548211156110225760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610430565b600061102c611259565b9050611038838261127c565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061108757611087611926565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156110e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111049190611909565b8160018151811061111757611117611926565b6001600160a01b039283166020918202929092010152600e5461113d9130911684610aee565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111769085906000908690309042906004016119f1565b600060405180830381600087803b15801561119057600080fd5b505af11580156111a4573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806111c68385611a62565b9050838110156110385760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610430565b600f805460ff60a81b1916600160a81b179055801561123e5761123e3061dead83610c12565b50600f805460ff60a81b19169055565b610f428383836112be565b60008060006112666113b5565b9092509050611275828261127c565b9250505090565b600061103883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113f7565b6000806000806000806112d087611425565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113029087611482565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461133190866111b9565b6001600160a01b038916600090815260026020526040902055611353816114c4565b61135d848361150e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113a291815260200190565b60405180910390a3505050505050505050565b600754600090819068056bc75e2d631000006113d1828261127c565b8210156113ee5750506007549268056bc75e2d6310000092509050565b90939092509050565b600081836114185760405162461bcd60e51b81526004016104309190611656565b506000610f7884866119b8565b60008060008060008060008060006114428a600954600a54611532565b9250925092506000611452611259565b905060008060006114658e878787611587565b919e509c509a509598509396509194505050505091939550919395565b600061103883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f47565b60006114ce611259565b905060006114dc83836115d7565b306000908152600260205260409020549091506114f990826111b9565b30600090815260026020526040902055505050565b60075461151b9083611482565b60075560085461152b90826111b9565b6008555050565b600080808061154c606461154689896115d7565b9061127c565b9050600061155f60646115468a896115d7565b90506000611577826115718b86611482565b90611482565b9992985090965090945050505050565b600080808061159688866115d7565b905060006115a488876115d7565b905060006115b288886115d7565b905060006115c4826115718686611482565b939b939a50919850919650505050505050565b6000826115e657506000610400565b60006115f28385611a7a565b9050826115ff85836119b8565b146110385760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610430565b600060208083528351808285015260005b8181101561168357858101830151858201604001528201611667565b81811115611695576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461045057600080fd5b80356116cb816116ab565b919050565b600080604083850312156116e357600080fd5b82356116ee816116ab565b946020939093013593505050565b60006020828403121561170e57600080fd5b5035919050565b60008060006060848603121561172a57600080fd5b8335611735816116ab565b92506020840135611745816116ab565b929592945050506040919091013590565b60006020828403121561176857600080fd5b8135611038816116ab565b801515811461045057600080fd5b60006020828403121561179357600080fd5b813561103881611773565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117c757600080fd5b823567ffffffffffffffff808211156117df57600080fd5b818501915085601f8301126117f357600080fd5b8135818111156118055761180561179e565b8060051b604051601f19603f8301168101818110858211171561182a5761182a61179e565b60405291825284820192508381018501918883111561184857600080fd5b938501935b8285101561186d5761185e856116c0565b8452938501939285019261184d565b98975050505050505050565b6000806040838503121561188c57600080fd5b8235611897816116ab565b915060208301356118a7816116ab565b809150509250929050565b600080604083850312156118c557600080fd5b50508035926020909101359150565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561191b57600080fd5b8151611038816116ab565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119665761196661193c565b5060010190565b60008060006060848603121561198257600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156119ad57600080fd5b815161103881611773565b6000826119d557634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156119ec576119ec61193c565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a415784516001600160a01b031683529383019391830191600101611a1c565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a7557611a7561193c565b500190565b6000816000190483118215151615611a9457611a9461193c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220aa096c8848329b7d599c8eae13432c03c0d1f4f82d48662fff5eaf046dd14efc64736f6c634300080b0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,878 |
0x8dd86d96af14e9bdac093071e3a8cd2c8e15ddc8 | pragma solidity 0.4.24;
// File: node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
// assert(_b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return _a / _b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
}
// File: node_modules/openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
// File: node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender)
public view returns (uint256);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
function approve(address _spender, uint256 _value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
// File: node_modules/openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue >= oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
// File: node_modules/openzeppelin-solidity/contracts/token/ERC20/MintableToken.sol
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
public
hasMintPermission
canMint
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner canMint returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
// File: contracts/EventaToken.sol
// ----------------------------------------------------------------------------
// 'Eventa' CROWDSALE token contract
//
// Deployed to : XXXXXXXXXXXXXXXXXXX
// Symbol : EVENTA
// Name : Eventa Token
// Total supply: 3000000000000000000000000000
// Decimals : 18
//
// (c) by Andrea Zanda, Eventa SRL, April 2018. The MIT Licence.
// ----------------------------------------------------------------------------
contract EventaToken is MintableToken {
string public constant name = "Eventa Token";
string public constant symbol = "EVTA";
uint8 public constant decimals = 18;
} | 0x6080604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b81146100f557806306fdde031461011e578063095ea7b3146101a857806318160ddd146101cc57806323b872dd146101f3578063313ce5671461021d57806340c10f1914610248578063661884631461026c57806370a0823114610290578063715018a6146102b15780637d64bcb4146102c85780638da5cb5b146102dd57806395d89b411461030e578063a9059cbb14610323578063d73dd62314610347578063dd62ed3e1461036b578063f2fde38b14610392575b600080fd5b34801561010157600080fd5b5061010a6103b3565b604080519115158252519081900360200190f35b34801561012a57600080fd5b506101336103d4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561016d578181015183820152602001610155565b50505050905090810190601f16801561019a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b457600080fd5b5061010a600160a060020a036004351660243561040b565b3480156101d857600080fd5b506101e1610471565b60408051918252519081900360200190f35b3480156101ff57600080fd5b5061010a600160a060020a0360043581169060243516604435610477565b34801561022957600080fd5b506102326105ec565b6040805160ff9092168252519081900360200190f35b34801561025457600080fd5b5061010a600160a060020a03600435166024356105f1565b34801561027857600080fd5b5061010a600160a060020a036004351660243561070c565b34801561029c57600080fd5b506101e1600160a060020a03600435166107fb565b3480156102bd57600080fd5b506102c6610816565b005b3480156102d457600080fd5b5061010a610884565b3480156102e957600080fd5b506102f261092a565b60408051600160a060020a039092168252519081900360200190f35b34801561031a57600080fd5b50610133610939565b34801561032f57600080fd5b5061010a600160a060020a0360043516602435610970565b34801561035357600080fd5b5061010a600160a060020a0360043516602435610a4f565b34801561037757600080fd5b506101e1600160a060020a0360043581169060243516610ae8565b34801561039e57600080fd5b506102c6600160a060020a0360043516610b13565b60035474010000000000000000000000000000000000000000900460ff1681565b60408051808201909152600c81527f4576656e746120546f6b656e0000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b600160a060020a03831660009081526020819052604081205482111561049c57600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156104cc57600080fd5b600160a060020a03831615156104e157600080fd5b600160a060020a03841660009081526020819052604090205461050a908363ffffffff610b3616565b600160a060020a03808616600090815260208190526040808220939093559085168152205461053f908363ffffffff610b4816565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610581908363ffffffff610b3616565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b601281565b600354600090600160a060020a0316331461060b57600080fd5b60035474010000000000000000000000000000000000000000900460ff161561063357600080fd5b600154610646908363ffffffff610b4816565b600155600160a060020a038316600090815260208190526040902054610672908363ffffffff610b4816565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b336000908152600260209081526040808320600160a060020a038616845290915281205480831061076057336000908152600260209081526040808320600160a060020a0388168452909152812055610795565b610770818463ffffffff610b3616565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461082d57600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600090600160a060020a0316331461089e57600080fd5b60035474010000000000000000000000000000000000000000900460ff16156108c657600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b60408051808201909152600481527f4556544100000000000000000000000000000000000000000000000000000000602082015281565b3360009081526020819052604081205482111561098c57600080fd5b600160a060020a03831615156109a157600080fd5b336000908152602081905260409020546109c1908363ffffffff610b3616565b3360009081526020819052604080822092909255600160a060020a038516815220546109f3908363ffffffff610b4816565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610a83908363ffffffff610b4816565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610b2a57600080fd5b610b3381610b5b565b50565b600082821115610b4257fe5b50900390565b81810182811015610b5557fe5b92915050565b600160a060020a0381161515610b7057600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820a75271ca288338cee2480550905883249cf987e00c10ad68582ab6e628e4cc3f0029 | {"success": true, "error": null, "results": {}} | 1,879 |
0x45f37526771a2a229bf679575478770c8fc60c7d | /**
*Submitted for verification at Etherscan.io on 2021-12-10
*/
//https://t.me/JackalToken
//https://t.me/JackalToken
//https://t.me/JackalToken
//Jackal: Mongoose Killer
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Jackal is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Jackal";
string private constant _symbol = "JACKAL";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 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 => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _marketingAddress = payable(0x6b4d1a4d9d7d14E900C1838bD6286F4ba14C2d59);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 500000000000 * 10**9; //0.5% of total supply per txn
uint256 public _maxWalletSize = 1500000000000 * 10**9; //1.50% of total supply
uint256 public _swapTokensAtAmount = 10000000000 * 10**9; //0.1%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
preTrader[owner()] = true;
bots[address(0x00000000000000000000000000000000001)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function allowPreTrading(address account, bool allowed) public onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
} | 0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063bfd7928411610064578063bfd7928414610528578063c3c8cd8014610558578063dd62ed3e1461056d578063ea1644d5146105b357600080fd5b806398a5c31514610498578063a2a957bb146104b8578063a9059cbb146104d8578063bdd795ef146104f857600080fd5b80638da5cb5b116100d15780638da5cb5b146104155780638f70ccf7146104335780638f9a55c01461045357806395d89b411461046957600080fd5b8063715018a6146103ca57806374010ece146103df5780637d1db4a5146103ff57600080fd5b80632fd689e3116101645780636b9990531161013e5780636b999053146103555780636d8aa8f8146103755780636fc3eaec1461039557806370a08231146103aa57600080fd5b80632fd689e314610303578063313ce5671461031957806349bd5a5e1461033557600080fd5b80631694505e116101a05780631694505e1461026457806318160ddd1461029c57806323b872dd146102c35780632f9c4569146102e357600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023457600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec3660046118f9565b6105d3565b005b3480156101ff57600080fd5b50604080518082019091526006815265129858dad85b60d21b60208201525b60405161022b9190611a2b565b60405180910390f35b34801561024057600080fd5b5061025461024f3660046118cd565b610672565b604051901515815260200161022b565b34801561027057600080fd5b50601454610284906001600160a01b031681565b6040516001600160a01b03909116815260200161022b565b3480156102a857600080fd5b5069152d02c7e14af68000005b60405190815260200161022b565b3480156102cf57600080fd5b506102546102de366004611857565b610689565b3480156102ef57600080fd5b506101f16102fe366004611898565b6106f2565b34801561030f57600080fd5b506102b560185481565b34801561032557600080fd5b506040516009815260200161022b565b34801561034157600080fd5b50601554610284906001600160a01b031681565b34801561036157600080fd5b506101f16103703660046117e4565b6107b6565b34801561038157600080fd5b506101f16103903660046119c5565b610801565b3480156103a157600080fd5b506101f1610849565b3480156103b657600080fd5b506102b56103c53660046117e4565b610876565b3480156103d657600080fd5b506101f1610898565b3480156103eb57600080fd5b506101f16103fa3660046119e0565b61090c565b34801561040b57600080fd5b506102b560165481565b34801561042157600080fd5b506000546001600160a01b0316610284565b34801561043f57600080fd5b506101f161044e3660046119c5565b61093b565b34801561045f57600080fd5b506102b560175481565b34801561047557600080fd5b50604080518082019091526006815265129050d2d05360d21b602082015261021e565b3480156104a457600080fd5b506101f16104b33660046119e0565b610983565b3480156104c457600080fd5b506101f16104d33660046119f9565b6109b2565b3480156104e457600080fd5b506102546104f33660046118cd565b6109f0565b34801561050457600080fd5b506102546105133660046117e4565b60116020526000908152604090205460ff1681565b34801561053457600080fd5b506102546105433660046117e4565b60106020526000908152604090205460ff1681565b34801561056457600080fd5b506101f16109fd565b34801561057957600080fd5b506102b561058836600461181e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105bf57600080fd5b506101f16105ce3660046119e0565b610a33565b6000546001600160a01b031633146106065760405162461bcd60e51b81526004016105fd90611a80565b60405180910390fd5b60005b815181101561066e5760016010600084848151811061062a5761062a611bc7565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066681611b96565b915050610609565b5050565b600061067f338484610a62565b5060015b92915050565b6000610696848484610b86565b6106e884336106e385604051806060016040528060288152602001611c09602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611089565b610a62565b5060019392505050565b6000546001600160a01b0316331461071c5760405162461bcd60e51b81526004016105fd90611a80565b6001600160a01b03821660009081526011602052604090205460ff161515811515141561078b5760405162461bcd60e51b815260206004820152601760248201527f544f4b454e3a20416c726561647920656e61626c65642e00000000000000000060448201526064016105fd565b6001600160a01b03919091166000908152601160205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146107e05760405162461bcd60e51b81526004016105fd90611a80565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461082b5760405162461bcd60e51b81526004016105fd90611a80565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b03161461086957600080fd5b47610873816110c3565b50565b6001600160a01b038116600090815260026020526040812054610683906110fd565b6000546001600160a01b031633146108c25760405162461bcd60e51b81526004016105fd90611a80565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109365760405162461bcd60e51b81526004016105fd90611a80565b601655565b6000546001600160a01b031633146109655760405162461bcd60e51b81526004016105fd90611a80565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109ad5760405162461bcd60e51b81526004016105fd90611a80565b601855565b6000546001600160a01b031633146109dc5760405162461bcd60e51b81526004016105fd90611a80565b600893909355600a91909155600955600b55565b600061067f338484610b86565b6013546001600160a01b0316336001600160a01b031614610a1d57600080fd5b6000610a2830610876565b905061087381611181565b6000546001600160a01b03163314610a5d5760405162461bcd60e51b81526004016105fd90611a80565b601755565b6001600160a01b038316610ac45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105fd565b6001600160a01b038216610b255760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105fd565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bea5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105fd565b6001600160a01b038216610c4c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105fd565b60008111610cae5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105fd565b6000546001600160a01b03848116911614801590610cda57506000546001600160a01b03838116911614155b15610f7c57601554600160a01b900460ff16610d7e576001600160a01b03831660009081526011602052604090205460ff16610d7e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105fd565b601654811115610dd05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105fd565b6001600160a01b03831660009081526010602052604090205460ff16158015610e1257506001600160a01b03821660009081526010602052604090205460ff16155b610e6a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105fd565b6015546001600160a01b03838116911614610eef5760175481610e8c84610876565b610e969190611b26565b10610eef5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105fd565b6000610efa30610876565b601854601654919250821015908210610f135760165491505b808015610f2a5750601554600160a81b900460ff16155b8015610f4457506015546001600160a01b03868116911614155b8015610f595750601554600160b01b900460ff165b15610f7957610f6782611181565b478015610f7757610f77476110c3565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610fbe57506001600160a01b03831660009081526005602052604090205460ff165b80610ff057506015546001600160a01b03858116911614801590610ff057506015546001600160a01b03848116911614155b15610ffd57506000611077565b6015546001600160a01b03858116911614801561102857506014546001600160a01b03848116911614155b1561103a57600854600c55600954600d555b6015546001600160a01b03848116911614801561106557506014546001600160a01b03858116911614155b1561107757600a54600c55600b54600d555b6110838484848461130a565b50505050565b600081848411156110ad5760405162461bcd60e51b81526004016105fd9190611a2b565b5060006110ba8486611b7f565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561066e573d6000803e3d6000fd5b60006006548211156111645760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105fd565b600061116e611338565b905061117a838261135b565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111c9576111c9611bc7565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561121d57600080fd5b505afa158015611231573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112559190611801565b8160018151811061126857611268611bc7565b6001600160a01b03928316602091820292909201015260145461128e9130911684610a62565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906112c7908590600090869030904290600401611ab5565b600060405180830381600087803b1580156112e157600080fd5b505af11580156112f5573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806113175761131761139d565b6113228484846113cb565b8061108357611083600e54600c55600f54600d55565b60008060006113456114c2565b9092509050611354828261135b565b9250505090565b600061117a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611506565b600c541580156113ad5750600d54155b156113b457565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806113dd87611534565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061140f9087611591565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461143e90866115d3565b6001600160a01b03891660009081526002602052604090205561146081611632565b61146a848361167c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114af91815260200190565b60405180910390a3505050505050505050565b600654600090819069152d02c7e14af68000006114df828261135b565b8210156114fd5750506006549269152d02c7e14af680000092509050565b90939092509050565b600081836115275760405162461bcd60e51b81526004016105fd9190611a2b565b5060006110ba8486611b3e565b60008060008060008060008060006115518a600c54600d546116a0565b9250925092506000611561611338565b905060008060006115748e8787876116f5565b919e509c509a509598509396509194505050505091939550919395565b600061117a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611089565b6000806115e08385611b26565b90508381101561117a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105fd565b600061163c611338565b9050600061164a8383611745565b3060009081526002602052604090205490915061166790826115d3565b30600090815260026020526040902055505050565b6006546116899083611591565b60065560075461169990826115d3565b6007555050565b60008080806116ba60646116b48989611745565b9061135b565b905060006116cd60646116b48a89611745565b905060006116e5826116df8b86611591565b90611591565b9992985090965090945050505050565b60008080806117048886611745565b905060006117128887611745565b905060006117208888611745565b90506000611732826116df8686611591565b939b939a50919850919650505050505050565b60008261175457506000610683565b60006117608385611b60565b90508261176d8583611b3e565b1461117a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105fd565b80356117cf81611bf3565b919050565b803580151581146117cf57600080fd5b6000602082840312156117f657600080fd5b813561117a81611bf3565b60006020828403121561181357600080fd5b815161117a81611bf3565b6000806040838503121561183157600080fd5b823561183c81611bf3565b9150602083013561184c81611bf3565b809150509250929050565b60008060006060848603121561186c57600080fd5b833561187781611bf3565b9250602084013561188781611bf3565b929592945050506040919091013590565b600080604083850312156118ab57600080fd5b82356118b681611bf3565b91506118c4602084016117d4565b90509250929050565b600080604083850312156118e057600080fd5b82356118eb81611bf3565b946020939093013593505050565b6000602080838503121561190c57600080fd5b823567ffffffffffffffff8082111561192457600080fd5b818501915085601f83011261193857600080fd5b81358181111561194a5761194a611bdd565b8060051b604051601f19603f8301168101818110858211171561196f5761196f611bdd565b604052828152858101935084860182860187018a101561198e57600080fd5b600095505b838610156119b8576119a4816117c4565b855260019590950194938601938601611993565b5098975050505050505050565b6000602082840312156119d757600080fd5b61117a826117d4565b6000602082840312156119f257600080fd5b5035919050565b60008060008060808587031215611a0f57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611a5857858101830151858201604001528201611a3c565b81811115611a6a576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b055784516001600160a01b031683529383019391830191600101611ae0565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b3957611b39611bb1565b500190565b600082611b5b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611b7a57611b7a611bb1565b500290565b600082821015611b9157611b91611bb1565b500390565b6000600019821415611baa57611baa611bb1565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461087357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122068eab4fb30a62bfdec6eeb1336e2d988bd1d164d4df4c13b2fc290857061409564736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,880 |
0xfae9a195b4b95b85eba247c9d1d77696a2a7e2aa | //https://t.me/Dolphininu
//https://dolphininu.cc/
//🧠Based on current metrics for intelligence,
//Dolphins are one of the most intelligent animals in the world.
//While intelligence is difficult to quantify in any organism,
//many studies suggest that dolphins are second only to us humans in smarts🧠
// 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 Dolphininu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private maxTxAmount = _tTotal;
uint256 private maxWalletAmount = _tTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private setTax;
uint256 private setRedis;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "Dolphininu";
string private constant _symbol = "Dolphininu";
uint256 private constant _minEthToSend = 300000000000000000;
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;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable _add1,address payable _add2) {
require(_add1 != address(0)); //Making Sure Fee address is not zero
require(_add2 != address(0));
_feeAddrWallet1 = _add1;
_feeAddrWallet2 = _add2;
_rOwned[_feeAddrWallet1] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
emit Transfer(address(0), _feeAddrWallet1, _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if(!(_isExcludedFromFee[from] || _isExcludedFromFee[to])){
if (from != address(this)) {
require(amount <= maxTxAmount);
_feeAddr1 = setRedis;
_feeAddr2 = setTax;
if(to != uniswapV2Pair){
if(balanceOf(to)+ (amount *(1- _feeAddr2/100)) > maxWalletAmount){
bots[to] = true;
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if (contractTokenBalance > _tTotal/1000){
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > _minEthToSend) {
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 {
uint256 toSend = amount/5;
_feeAddrWallet2.transfer(toSend);
_feeAddrWallet1.transfer(amount - toSend);
}
function liftMaxTrnx() external onlyOwner{
maxTxAmount = _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);
setTax = 12;
setRedis = 3;
maxTxAmount = _tTotal/50;
maxWalletAmount = _tTotal/35;
swapEnabled = true;
cooldownEnabled = true;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function blacklist(address _address) external onlyOwner{
bots[_address] = true;
}
function removeBlacklist(address notbot) external onlyOwner{
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610352578063c9567bf914610369578063dd62ed3e14610380578063eb91e651146103bd578063f9f92be4146103e657610114565b8063715018a6146102a85780638da5cb5b146102bf57806395d89b41146102ea578063a9059cbb1461031557610114565b8063313ce567116100dc578063313ce567146101e957806335ffbc47146102145780635932ead11461022b5780636fc3eaec1461025457806370a082311461026b57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61040f565b60405161013b91906127c4565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906123dd565b61044c565b60405161017891906127a9565b60405180910390f35b34801561018d57600080fd5b5061019661046a565b6040516101a391906128e6565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061238e565b61047b565b6040516101e091906127a9565b60405180910390f35b3480156101f557600080fd5b506101fe610554565b60405161020b919061295b565b60405180910390f35b34801561022057600080fd5b5061022961055d565b005b34801561023757600080fd5b50610252600480360381019061024d9190612419565b610604565b005b34801561026057600080fd5b506102696106b6565b005b34801561027757600080fd5b50610292600480360381019061028d9190612300565b610728565b60405161029f91906128e6565b60405180910390f35b3480156102b457600080fd5b506102bd610779565b005b3480156102cb57600080fd5b506102d46108cc565b6040516102e191906126db565b60405180910390f35b3480156102f657600080fd5b506102ff6108f5565b60405161030c91906127c4565b60405180910390f35b34801561032157600080fd5b5061033c600480360381019061033791906123dd565b610932565b60405161034991906127a9565b60405180910390f35b34801561035e57600080fd5b50610367610950565b005b34801561037557600080fd5b5061037e6109ca565b005b34801561038c57600080fd5b506103a760048036038101906103a29190612352565b610f5f565b6040516103b491906128e6565b60405180910390f35b3480156103c957600080fd5b506103e460048036038101906103df9190612300565b610fe6565b005b3480156103f257600080fd5b5061040d60048036038101906104089190612300565b6110d6565b005b60606040518060400160405280600a81526020017f446f6c7068696e696e7500000000000000000000000000000000000000000000815250905090565b60006104606104596111c6565b84846111ce565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610488848484611399565b610549846104946111c6565b61054485604051806060016040528060288152602001612e3560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104fa6111c6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461170e9092919063ffffffff16565b6111ce565b600190509392505050565b60006009905090565b6105656111c6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e990612866565b60405180910390fd5b683635c9adc5dea00000600a81905550565b61060c6111c6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610699576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069090612866565b60405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106f76111c6565b73ffffffffffffffffffffffffffffffffffffffff161461071757600080fd5b600047905061072581611772565b50565b6000610772600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611864565b9050919050565b6107816111c6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461080e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080590612866565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f446f6c7068696e696e7500000000000000000000000000000000000000000000815250905090565b600061094661093f6111c6565b8484611399565b6001905092915050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109916111c6565b73ffffffffffffffffffffffffffffffffffffffff16146109b157600080fd5b60006109bc30610728565b90506109c7816118d2565b50565b6109d26111c6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5690612866565b60405180910390fd5b601360149054906101000a900460ff1615610aaf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa6906128c6565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b3f30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006111ce565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8557600080fd5b505afa158015610b99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbd9190612329565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610c1f57600080fd5b505afa158015610c33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c579190612329565b6040518363ffffffff1660e01b8152600401610c749291906126f6565b602060405180830381600087803b158015610c8e57600080fd5b505af1158015610ca2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc69190612329565b601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610d4f30610728565b600080610d5a6108cc565b426040518863ffffffff1660e01b8152600401610d7c96959493929190612748565b6060604051808303818588803b158015610d9557600080fd5b505af1158015610da9573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610dce919061246b565b505050600c600e819055506003600f819055506032683635c9adc5dea00000610df79190612a21565b600a819055506023683635c9adc5dea00000610e139190612a21565b600b819055506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610f0992919061271f565b602060405180830381600087803b158015610f2357600080fd5b505af1158015610f37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5b9190612442565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610fee6111c6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461107b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107290612866565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6110de6111c6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116290612866565b60405180910390fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561123e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611235906128a6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a590612806565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161138c91906128e6565b60405180910390a3505050565b600081116113dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d390612886565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561143357600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806114d45750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b6116fe573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146116fd57600a5481111561151a57600080fd5b600f54600c81905550600e54600d81905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461161d57600b546064600d546115939190612a21565b600161159f9190612aac565b826115aa9190612a52565b6115b384610728565b6115bd91906129cb565b111561161c576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b600061162830610728565b90506103e8683635c9adc5dea000006116419190612a21565b8111156116fb57601360159054906101000a900460ff161580156116b35750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156116cb5750601360169054906101000a900460ff165b156116fa576116d9816118d2565b6000479050670429d069189e00008111156116f8576116f747611772565b5b505b5b505b5b611709838383611bcc565b505050565b6000838311158290611756576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174d91906127c4565b60405180910390fd5b50600083856117659190612aac565b9050809150509392505050565b60006005826117819190612a21565b9050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156117eb573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc82846118349190612aac565b9081150290604051600060405180830381858888f1935050505015801561185f573d6000803e3d6000fd5b505050565b60006008548211156118ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a2906127e6565b60405180910390fd5b60006118b5611bdc565b90506118ca8184611c0790919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611930577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561195e5781602001602082028036833780820191505090505b509050308160008151811061199c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611a3e57600080fd5b505afa158015611a52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a769190612329565b81600181518110611ab0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611b1730601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846111ce565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611b7b959493929190612901565b600060405180830381600087803b158015611b9557600080fd5b505af1158015611ba9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b611bd7838383611c51565b505050565b6000806000611be9611e1c565b91509150611c008183611c0790919063ffffffff16565b9250505090565b6000611c4983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611e7e565b905092915050565b600080600080600080611c6387611ee1565b955095509550955095509550611cc186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f4990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d5685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f9390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611da281611ff1565b611dac84836120ae565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611e0991906128e6565b60405180910390a3505050505050505050565b600080600060085490506000683635c9adc5dea000009050611e52683635c9adc5dea00000600854611c0790919063ffffffff16565b821015611e7157600854683635c9adc5dea00000935093505050611e7a565b81819350935050505b9091565b60008083118290611ec5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ebc91906127c4565b60405180910390fd5b5060008385611ed49190612a21565b9050809150509392505050565b6000806000806000806000806000611efe8a600c54600d546120e8565b9250925092506000611f0e611bdc565b90506000806000611f218e87878761217e565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611f8b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061170e565b905092915050565b6000808284611fa291906129cb565b905083811015611fe7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fde90612826565b60405180910390fd5b8091505092915050565b6000611ffb611bdc565b90506000612012828461220790919063ffffffff16565b905061206681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f9390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6120c382600854611f4990919063ffffffff16565b6008819055506120de81600954611f9390919063ffffffff16565b6009819055505050565b6000806000806121146064612106888a61220790919063ffffffff16565b611c0790919063ffffffff16565b9050600061213e6064612130888b61220790919063ffffffff16565b611c0790919063ffffffff16565b9050600061216782612159858c611f4990919063ffffffff16565b611f4990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612197858961220790919063ffffffff16565b905060006121ae868961220790919063ffffffff16565b905060006121c5878961220790919063ffffffff16565b905060006121ee826121e08587611f4990919063ffffffff16565b611f4990919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561221a576000905061227c565b600082846122289190612a52565b90508284826122379190612a21565b14612277576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226e90612846565b60405180910390fd5b809150505b92915050565b60008135905061229181612def565b92915050565b6000815190506122a681612def565b92915050565b6000813590506122bb81612e06565b92915050565b6000815190506122d081612e06565b92915050565b6000813590506122e581612e1d565b92915050565b6000815190506122fa81612e1d565b92915050565b60006020828403121561231257600080fd5b600061232084828501612282565b91505092915050565b60006020828403121561233b57600080fd5b600061234984828501612297565b91505092915050565b6000806040838503121561236557600080fd5b600061237385828601612282565b925050602061238485828601612282565b9150509250929050565b6000806000606084860312156123a357600080fd5b60006123b186828701612282565b93505060206123c286828701612282565b92505060406123d3868287016122d6565b9150509250925092565b600080604083850312156123f057600080fd5b60006123fe85828601612282565b925050602061240f858286016122d6565b9150509250929050565b60006020828403121561242b57600080fd5b6000612439848285016122ac565b91505092915050565b60006020828403121561245457600080fd5b6000612462848285016122c1565b91505092915050565b60008060006060848603121561248057600080fd5b600061248e868287016122eb565b935050602061249f868287016122eb565b92505060406124b0868287016122eb565b9150509250925092565b60006124c683836124d2565b60208301905092915050565b6124db81612ae0565b82525050565b6124ea81612ae0565b82525050565b60006124fb82612986565b61250581856129a9565b935061251083612976565b8060005b8381101561254157815161252888826124ba565b97506125338361299c565b925050600181019050612514565b5085935050505092915050565b61255781612af2565b82525050565b61256681612b35565b82525050565b600061257782612991565b61258181856129ba565b9350612591818560208601612b47565b61259a81612bd8565b840191505092915050565b60006125b2602a836129ba565b91506125bd82612be9565b604082019050919050565b60006125d56022836129ba565b91506125e082612c38565b604082019050919050565b60006125f8601b836129ba565b915061260382612c87565b602082019050919050565b600061261b6021836129ba565b915061262682612cb0565b604082019050919050565b600061263e6020836129ba565b915061264982612cff565b602082019050919050565b60006126616029836129ba565b915061266c82612d28565b604082019050919050565b60006126846024836129ba565b915061268f82612d77565b604082019050919050565b60006126a76017836129ba565b91506126b282612dc6565b602082019050919050565b6126c681612b1e565b82525050565b6126d581612b28565b82525050565b60006020820190506126f060008301846124e1565b92915050565b600060408201905061270b60008301856124e1565b61271860208301846124e1565b9392505050565b600060408201905061273460008301856124e1565b61274160208301846126bd565b9392505050565b600060c08201905061275d60008301896124e1565b61276a60208301886126bd565b612777604083018761255d565b612784606083018661255d565b61279160808301856124e1565b61279e60a08301846126bd565b979650505050505050565b60006020820190506127be600083018461254e565b92915050565b600060208201905081810360008301526127de818461256c565b905092915050565b600060208201905081810360008301526127ff816125a5565b9050919050565b6000602082019050818103600083015261281f816125c8565b9050919050565b6000602082019050818103600083015261283f816125eb565b9050919050565b6000602082019050818103600083015261285f8161260e565b9050919050565b6000602082019050818103600083015261287f81612631565b9050919050565b6000602082019050818103600083015261289f81612654565b9050919050565b600060208201905081810360008301526128bf81612677565b9050919050565b600060208201905081810360008301526128df8161269a565b9050919050565b60006020820190506128fb60008301846126bd565b92915050565b600060a08201905061291660008301886126bd565b612923602083018761255d565b818103604083015261293581866124f0565b905061294460608301856124e1565b61295160808301846126bd565b9695505050505050565b600060208201905061297060008301846126cc565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006129d682612b1e565b91506129e183612b1e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612a1657612a15612b7a565b5b828201905092915050565b6000612a2c82612b1e565b9150612a3783612b1e565b925082612a4757612a46612ba9565b5b828204905092915050565b6000612a5d82612b1e565b9150612a6883612b1e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612aa157612aa0612b7a565b5b828202905092915050565b6000612ab782612b1e565b9150612ac283612b1e565b925082821015612ad557612ad4612b7a565b5b828203905092915050565b6000612aeb82612afe565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612b4082612b1e565b9050919050565b60005b83811015612b65578082015181840152602081019050612b4a565b83811115612b74576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612df881612ae0565b8114612e0357600080fd5b50565b612e0f81612af2565b8114612e1a57600080fd5b50565b612e2681612b1e565b8114612e3157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201a25296f7879524c8cc699cb25c945277f54de98a61cc400a48234918a1dd4f064736f6c63430008040033 | {"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"}]}} | 1,881 |
0xa01b656e49efbb8210d882a1f1a4d10f5cada8cc | // File contracts/EcoGoldProxy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
/**
* @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;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @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");
// solhint-disable-next-line avoid-low-level-calls
(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");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/**
* @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 EcoGoldProxy 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();
}
function proxyCallName() public pure returns (bytes32) {
return "EcoGoldProxy";
}
} | 0x6080604052600436106100595760003560e01c8063083641a3146100725780633659cfe61461009d5780634f1ef286146100ee5780635c60da1b146101875780638f283970146101c8578063f851a4401461021957610068565b366100685761006661025a565b005b61007061025a565b005b34801561007e57600080fd5b50610087610274565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100ec600480360360208110156100c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061029c565b005b6101856004803603604081101561010457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561014157600080fd5b82018360208201111561015357600080fd5b8035906020019184600183028401116401000000008311171561017557600080fd5b90919293919293905050506102f1565b005b34801561019357600080fd5b5061019c6103c7565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101d457600080fd5b50610217600480360360208110156101eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061041f565b005b34801561022557600080fd5b5061022e61056c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102626105d7565b61027261026d61066d565b61069e565b565b60007f45636f476f6c6450726f78790000000000000000000000000000000000000000905090565b6102a46106c4565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102e5576102e0816106f5565b6102ee565b6102ed61025a565b5b50565b6102f96106c4565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103b957610335836106f5565b60008373ffffffffffffffffffffffffffffffffffffffff168383604051808383808284378083019250505092505050600060405180830381855af49150503d80600081146103a0576040519150601f19603f3d011682016040523d82523d6000602084013e6103a5565b606091505b50509050806103b357600080fd5b506103c2565b6103c161025a565b5b505050565b60006103d16106c4565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156104135761040c61066d565b905061041c565b61041b61025a565b5b90565b6104276106c4565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561056057600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806108356036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6105096106c4565b82604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a161055b81610744565b610569565b61056861025a565b5b50565b60006105766106c4565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156105b8576105b16106c4565b90506105c1565b6105c061025a565b5b90565b600080823b905060008111915050919050565b6105df6106c4565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610663576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001806108036032913960400191505060405180910390fd5b61066b610773565b565b6000807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b9050805491505090565b3660008037600080366000845af43d6000803e80600081146106bf573d6000f35b3d6000fd5b6000807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b9050805491505090565b6106fe81610775565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b90508181555050565b565b61077e816105c4565b6107d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b81526020018061086b603b913960400191505060405180910390fd5b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b9050818155505056fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220d367123ab56e7ee23edcdd9aca794caad22e5d85ecf12d5e743df672d6d2a54d64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,882 |
0x889be0b59e72dfe478b17d20b1e468c671ab5cfb | // SPDX-License-Identifier: MIT
/**
* Caw on 4/20
**/
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");
_;
}
modifier onFourTwenty() {
require(block.timestamp >= 1650471600, "Date is not yet 4/20");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function renounceOwnershipFourTwenty() public virtual onFourTwenty {
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 CHIRPLE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Chirple Kush";
string private constant _symbol = "CHIRPLE";
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 = 4200000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 4;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 2;
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(0xdB18d609c265F0A0E5e2A58b0C3438EE7F322C7E);
address payable private _marketingAddress = payable(0xdB18d609c265F0A0E5e2A58b0C3438EE7F322C7E);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 21000000000 * 10**9;
uint256 public _maxWalletSize = 100000000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
uint256 public fourTwentyEpoch = 1650471600;
bool public automaticallyRenouncedOnFourTwenty = false;
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;
}
}
if (block.timestamp >= fourTwentyEpoch && owner() != address(0)) {
renounceOwnershipFourTwenty();
automaticallyRenouncedOnFourTwenty = true;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101f15760003560e01c80637d1db4a51161010d578063a9059cbb116100a0578063c492f0461161006f578063c492f046146105a7578063dd62ed3e146105c7578063df3ec0931461060d578063ea1644d514610627578063f2fde38b1461064757600080fd5b8063a9059cbb1461052d578063ac811cf01461054d578063bfd7928414610562578063c3c8cd801461059257600080fd5b80638f9a55c0116100dc5780638f9a55c0146104a757806395d89b41146104bd57806398a5c315146104ed578063a2a957bb1461050d57600080fd5b80637d1db4a5146104265780637f2feddc1461043c5780638da5cb5b146104695780638f70ccf71461048757600080fd5b8063313ce567116101855780636fc3eaec116101545780636fc3eaec146103bc57806370a08231146103d1578063715018a6146103f157806374010ece1461040657600080fd5b8063313ce5671461034057806349bd5a5e1461035c5780636b9990531461037c5780636d8aa8f81461039c57600080fd5b806318160ddd116101c157806318160ddd146102ce57806323b872dd146102f4578063295801d3146103145780632fd689e31461032a57600080fd5b8062b8cf2a146101fd57806306fdde031461021f578063095ea7b3146102665780631694505e1461029657600080fd5b366101f857005b600080fd5b34801561020957600080fd5b5061021d610218366004611a43565b610667565b005b34801561022b57600080fd5b5060408051808201909152600c81526b086d0d2e4e0d8ca4096eae6d60a31b60208201525b60405161025d9190611b08565b60405180910390f35b34801561027257600080fd5b50610286610281366004611b5d565b610706565b604051901515815260200161025d565b3480156102a257600080fd5b506014546102b6906001600160a01b031681565b6040516001600160a01b03909116815260200161025d565b3480156102da57600080fd5b5068e3aeb5737240a000005b60405190815260200161025d565b34801561030057600080fd5b5061028661030f366004611b89565b61071d565b34801561032057600080fd5b506102e660195481565b34801561033657600080fd5b506102e660185481565b34801561034c57600080fd5b506040516009815260200161025d565b34801561036857600080fd5b506015546102b6906001600160a01b031681565b34801561038857600080fd5b5061021d610397366004611bca565b610786565b3480156103a857600080fd5b5061021d6103b7366004611bf7565b6107d1565b3480156103c857600080fd5b5061021d610819565b3480156103dd57600080fd5b506102e66103ec366004611bca565b610864565b3480156103fd57600080fd5b5061021d610886565b34801561041257600080fd5b5061021d610421366004611c12565b6108fa565b34801561043257600080fd5b506102e660165481565b34801561044857600080fd5b506102e6610457366004611bca565b60116020526000908152604090205481565b34801561047557600080fd5b506000546001600160a01b03166102b6565b34801561049357600080fd5b5061021d6104a2366004611bf7565b610929565b3480156104b357600080fd5b506102e660175481565b3480156104c957600080fd5b5060408051808201909152600781526643484952504c4560c81b6020820152610250565b3480156104f957600080fd5b5061021d610508366004611c12565b610971565b34801561051957600080fd5b5061021d610528366004611c2b565b6109a0565b34801561053957600080fd5b50610286610548366004611b5d565b6109de565b34801561055957600080fd5b5061021d6109eb565b34801561056e57600080fd5b5061028661057d366004611bca565b60106020526000908152604090205460ff1681565b34801561059e57600080fd5b5061021d610a36565b3480156105b357600080fd5b5061021d6105c2366004611c5d565b610a8a565b3480156105d357600080fd5b506102e66105e2366004611ce1565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561061957600080fd5b50601a546102869060ff1681565b34801561063357600080fd5b5061021d610642366004611c12565b610b2b565b34801561065357600080fd5b5061021d610662366004611bca565b610b5a565b6000546001600160a01b0316331461069a5760405162461bcd60e51b815260040161069190611d1a565b60405180910390fd5b60005b8151811015610702576001601060008484815181106106be576106be611d4f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106fa81611d7b565b91505061069d565b5050565b6000610713338484610c44565b5060015b92915050565b600061072a848484610d68565b61077c843361077785604051806060016040528060288152602001611e93602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112db565b610c44565b5060019392505050565b6000546001600160a01b031633146107b05760405162461bcd60e51b815260040161069190611d1a565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107fb5760405162461bcd60e51b815260040161069190611d1a565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061084e57506013546001600160a01b0316336001600160a01b0316145b61085757600080fd5b4761086181611315565b50565b6001600160a01b0381166000908152600260205260408120546107179061134f565b6000546001600160a01b031633146108b05760405162461bcd60e51b815260040161069190611d1a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109245760405162461bcd60e51b815260040161069190611d1a565b601655565b6000546001600160a01b031633146109535760405162461bcd60e51b815260040161069190611d1a565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461099b5760405162461bcd60e51b815260040161069190611d1a565b601855565b6000546001600160a01b031633146109ca5760405162461bcd60e51b815260040161069190611d1a565b600893909355600a91909155600955600b55565b6000610713338484610d68565b63626032b04210156108b05760405162461bcd60e51b8152602060048201526014602482015273044617465206973206e6f742079657420342f32360641b6044820152606401610691565b6012546001600160a01b0316336001600160a01b03161480610a6b57506013546001600160a01b0316336001600160a01b0316145b610a7457600080fd5b6000610a7f30610864565b9050610861816113d3565b6000546001600160a01b03163314610ab45760405162461bcd60e51b815260040161069190611d1a565b60005b82811015610b25578160056000868685818110610ad657610ad6611d4f565b9050602002016020810190610aeb9190611bca565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b1d81611d7b565b915050610ab7565b50505050565b6000546001600160a01b03163314610b555760405162461bcd60e51b815260040161069190611d1a565b601755565b6000546001600160a01b03163314610b845760405162461bcd60e51b815260040161069190611d1a565b6001600160a01b038116610be95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610691565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610ca65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610691565b6001600160a01b038216610d075760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610691565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610dcc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610691565b6001600160a01b038216610e2e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610691565b60008111610e905760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610691565b6000546001600160a01b03848116911614801590610ebc57506000546001600160a01b03838116911614155b1561119d57601554600160a01b900460ff16610f55576000546001600160a01b03848116911614610f555760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610691565b601654811115610fa75760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610691565b6001600160a01b03831660009081526010602052604090205460ff16158015610fe957506001600160a01b03821660009081526010602052604090205460ff16155b6110415760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610691565b6015546001600160a01b038381169116146110c6576017548161106384610864565b61106d9190611d94565b106110c65760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610691565b60006110d130610864565b6018546016549192508210159082106110ea5760165491505b8080156111015750601554600160a81b900460ff16155b801561111b57506015546001600160a01b03868116911614155b80156111305750601554600160b01b900460ff165b801561115557506001600160a01b03851660009081526005602052604090205460ff16155b801561117a57506001600160a01b03841660009081526005602052604090205460ff16155b1561119a57611188826113d3565b4780156111985761119847611315565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806111df57506001600160a01b03831660009081526005602052604090205460ff165b8061121157506015546001600160a01b0385811691161480159061121157506015546001600160a01b03848116911614155b1561121e57506000611298565b6015546001600160a01b03858116911614801561124957506014546001600160a01b03848116911614155b1561125b57600854600c55600954600d555b6015546001600160a01b03848116911614801561128657506014546001600160a01b03858116911614155b1561129857600a54600c55600b54600d555b60195442101580156112b457506000546001600160a01b031615155b156112cf576112c16109eb565b601a805460ff191660011790555b610b258484848461154d565b600081848411156112ff5760405162461bcd60e51b81526004016106919190611b08565b50600061130c8486611dac565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610702573d6000803e3d6000fd5b60006006548211156113b65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610691565b60006113c061157b565b90506113cc838261159e565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061141b5761141b611d4f565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611474573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114989190611dc3565b816001815181106114ab576114ab611d4f565b6001600160a01b0392831660209182029290920101526014546114d19130911684610c44565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061150a908590600090869030904290600401611de0565b600060405180830381600087803b15801561152457600080fd5b505af1158015611538573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061155a5761155a6115e0565b61156584848461160e565b80610b2557610b25600e54600c55600f54600d55565b6000806000611588611705565b9092509050611597828261159e565b9250505090565b60006113cc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611747565b600c541580156115f05750600d54155b156115f757565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061162087611775565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061165290876117d2565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116819086611814565b6001600160a01b0389166000908152600260205260409020556116a381611873565b6116ad84836118bd565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116f291815260200190565b60405180910390a3505050505050505050565b600654600090819068e3aeb5737240a00000611721828261159e565b82101561173e5750506006549268e3aeb5737240a0000092509050565b90939092509050565b600081836117685760405162461bcd60e51b81526004016106919190611b08565b50600061130c8486611e51565b60008060008060008060008060006117928a600c54600d546118e1565b92509250925060006117a261157b565b905060008060006117b58e878787611936565b919e509c509a509598509396509194505050505091939550919395565b60006113cc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112db565b6000806118218385611d94565b9050838110156113cc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610691565b600061187d61157b565b9050600061188b8383611986565b306000908152600260205260409020549091506118a89082611814565b30600090815260026020526040902055505050565b6006546118ca90836117d2565b6006556007546118da9082611814565b6007555050565b60008080806118fb60646118f58989611986565b9061159e565b9050600061190e60646118f58a89611986565b90506000611926826119208b866117d2565b906117d2565b9992985090965090945050505050565b60008080806119458886611986565b905060006119538887611986565b905060006119618888611986565b905060006119738261192086866117d2565b939b939a50919850919650505050505050565b60008260000361199857506000610717565b60006119a48385611e73565b9050826119b18583611e51565b146113cc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610691565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461086157600080fd5b8035611a3e81611a1e565b919050565b60006020808385031215611a5657600080fd5b823567ffffffffffffffff80821115611a6e57600080fd5b818501915085601f830112611a8257600080fd5b813581811115611a9457611a94611a08565b8060051b604051601f19603f83011681018181108582111715611ab957611ab9611a08565b604052918252848201925083810185019188831115611ad757600080fd5b938501935b82851015611afc57611aed85611a33565b84529385019392850192611adc565b98975050505050505050565b600060208083528351808285015260005b81811015611b3557858101830151858201604001528201611b19565b81811115611b47576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611b7057600080fd5b8235611b7b81611a1e565b946020939093013593505050565b600080600060608486031215611b9e57600080fd5b8335611ba981611a1e565b92506020840135611bb981611a1e565b929592945050506040919091013590565b600060208284031215611bdc57600080fd5b81356113cc81611a1e565b80358015158114611a3e57600080fd5b600060208284031215611c0957600080fd5b6113cc82611be7565b600060208284031215611c2457600080fd5b5035919050565b60008060008060808587031215611c4157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611c7257600080fd5b833567ffffffffffffffff80821115611c8a57600080fd5b818601915086601f830112611c9e57600080fd5b813581811115611cad57600080fd5b8760208260051b8501011115611cc257600080fd5b602092830195509350611cd89186019050611be7565b90509250925092565b60008060408385031215611cf457600080fd5b8235611cff81611a1e565b91506020830135611d0f81611a1e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611d8d57611d8d611d65565b5060010190565b60008219821115611da757611da7611d65565b500190565b600082821015611dbe57611dbe611d65565b500390565b600060208284031215611dd557600080fd5b81516113cc81611a1e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e305784516001600160a01b031683529383019391830191600101611e0b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611e6e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e8d57611e8d611d65565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201450fd14fa74e69e86c5d70c38adb9faaaaf3c754a87817539ffc56dc6be405c64736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,883 |
0xbcf439e5eec974bbf3e02efe40f24ce0c83e30cc | pragma solidity >=0.6.6;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function burn(uint256 amount) external;
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function burnFrom(address account, uint256 amount) external;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract HAMON_INU is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint256 private _initialSupply = 1e15*1e18;
string private _name = "HAMON INU";
string private _symbol = "HINU";
uint8 private _decimals = 18;
address private routerAddy = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; // uniswap
address private dead = 0x000000000000000000000000000000000000dEaD;
//address private vitalik = 0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B;
address private pairAddress;
address private _owner = msg.sender;
constructor () {
_mint(address(this), _initialSupply);
//_transfer(address(this), vitalik, _initialSupply*30/100);
_transfer(address(this), dead, _initialSupply*50/100);
}
modifier onlyOwner() {
require(isOwner(msg.sender));
_;
}
function isOwner(address account) public view returns(bool) {
return account == _owner;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function add_liq() public payable onlyOwner {
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(routerAddy);
pairAddress = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_approve(address(this), address(uniswapV2Router), _initialSupply);
uniswapV2Router.addLiquidityETH{value: msg.value}(
address(this),
_initialSupply*50/100,
0, // slippage is unavoidable
0, // slippage is unavoidable
_owner,
block.timestamp
);
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function burn(uint256 amount) public virtual override {
_burn(msg.sender, amount);
}
function burnFrom(address account, uint256 amount) public virtual override {
uint256 decreasedAllowance = allowance(account, msg.sender).sub(amount, "ERC20: burn amount exceeds allowance");
_approve(account, msg.sender, decreasedAllowance);
_burn(account, amount);
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
if(sender == _owner || sender == address(this) || recipient == address(this)) {
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
} else if (recipient == pairAddress){ }
else{
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
receive() external payable {}
} | 0x6080604052600436106100ec5760003560e01c806342966c681161008a57806395d89b411161005957806395d89b4114610306578063a457c2d714610331578063a9059cbb1461036e578063dd62ed3e146103ab576100f3565b806342966c681461026d57806370a082311461029657806376c11b94146102d357806379cc6790146102dd576100f3565b806323b872dd116100c657806323b872dd1461018b5780632f54bf6e146101c8578063313ce567146102055780633950935114610230576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d6103e8565b60405161011a9190611915565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611666565b61047a565b60405161015791906118fa565b60405180910390f35b34801561016c57600080fd5b50610175610491565b60405161018291906119f7565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611617565b61049b565b6040516101bf91906118fa565b60405180910390f35b3480156101d457600080fd5b506101ef60048036038101906101ea9190611589565b610566565b6040516101fc91906118fa565b60405180910390f35b34801561021157600080fd5b5061021a6105c0565b6040516102279190611a12565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190611666565b6105d7565b60405161026491906118fa565b60405180910390f35b34801561027957600080fd5b50610294600480360381019061028f91906116a2565b61067c565b005b3480156102a257600080fd5b506102bd60048036038101906102b89190611589565b610689565b6040516102ca91906119f7565b60405180910390f35b6102db6106d1565b005b3480156102e957600080fd5b5061030460048036038101906102ff9190611666565b6109b7565b005b34801561031257600080fd5b5061031b610a0b565b6040516103289190611915565b60405180910390f35b34801561033d57600080fd5b5061035860048036038101906103539190611666565b610a9d565b60405161036591906118fa565b60405180910390f35b34801561037a57600080fd5b5061039560048036038101906103909190611666565b610b5c565b6040516103a291906118fa565b60405180910390f35b3480156103b757600080fd5b506103d260048036038101906103cd91906115db565b610b73565b6040516103df91906119f7565b60405180910390f35b6060600480546103f790611bf8565b80601f016020809104026020016040519081016040528092919081815260200182805461042390611bf8565b80156104705780601f1061044557610100808354040283529160200191610470565b820191906000526020600020905b81548152906001019060200180831161045357829003601f168201915b5050505050905090565b6000610487338484610cbc565b6001905092915050565b6000600254905090565b60006104a8848484610e87565b61055b843361055685604051806060016040528060288152602001611ef360289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c589092919063ffffffff16565b610cbc565b600190509392505050565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b6000600660009054906101000a900460ff16905090565b6000610672338461066d85600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bfa90919063ffffffff16565b610cbc565b6001905092915050565b6106863382611338565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106da33610566565b6106e357600080fd5b6000600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561075057600080fd5b505afa158015610764573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078891906115b2565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ea57600080fd5b505afa1580156107fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082291906115b2565b6040518363ffffffff1660e01b815260040161083f929190611870565b602060405180830381600087803b15801561085957600080fd5b505af115801561086d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089191906115b2565b600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108de3082600354610cbc565b8073ffffffffffffffffffffffffffffffffffffffff1663f305d71934306064603260035461090d9190611ad0565b6109179190611a9f565b600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b815260040161095f96959493929190611899565b6060604051808303818588803b15801561097857600080fd5b505af115801561098c573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109b191906116cb565b50505050565b60006109ef82604051806060016040528060248152602001611f1b602491396109e08633610b73565b610c589092919063ffffffff16565b90506109fc833383610cbc565b610a068383611338565b505050565b606060058054610a1a90611bf8565b80601f0160208091040260200160405190810160405280929190818152602001828054610a4690611bf8565b8015610a935780601f10610a6857610100808354040283529160200191610a93565b820191906000526020600020905b815481529060010190602001808311610a7657829003601f168201915b5050505050905090565b6000610b523384610b4d85604051806060016040528060258152602001611f3f60259139600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c589092919063ffffffff16565b610cbc565b6001905092915050565b6000610b69338484610e87565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284610c099190611a49565b905083811015610c4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4590611977565b60405180910390fd5b8091505092915050565b6000838311158290610ca0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c979190611915565b60405180910390fd5b5060008385610caf9190611b2a565b9050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d23906119d7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9390611957565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610e7a91906119f7565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ef7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eee906119b7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5e90611937565b60405180910390fd5b610f728383836114e6565b610fdd81604051806060016040528060268152602001611ecd602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c589092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806110a657503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806110dc57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156111de57611132816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bfa90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516111d191906119f7565b60405180910390a3611333565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561123957611332565b61128a816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bfa90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161132991906119f7565b60405180910390a35b5b505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139f90611997565b60405180910390fd5b6113b4826000836114e6565b61141f81604051806060016040528060228152602001611eab602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c589092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611476816002546114eb90919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516114da91906119f7565b60405180910390a35050565b505050565b600061152d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c58565b905092915050565b60008135905061154481611e7c565b92915050565b60008151905061155981611e7c565b92915050565b60008135905061156e81611e93565b92915050565b60008151905061158381611e93565b92915050565b60006020828403121561159b57600080fd5b60006115a984828501611535565b91505092915050565b6000602082840312156115c457600080fd5b60006115d28482850161154a565b91505092915050565b600080604083850312156115ee57600080fd5b60006115fc85828601611535565b925050602061160d85828601611535565b9150509250929050565b60008060006060848603121561162c57600080fd5b600061163a86828701611535565b935050602061164b86828701611535565b925050604061165c8682870161155f565b9150509250925092565b6000806040838503121561167957600080fd5b600061168785828601611535565b92505060206116988582860161155f565b9150509250929050565b6000602082840312156116b457600080fd5b60006116c28482850161155f565b91505092915050565b6000806000606084860312156116e057600080fd5b60006116ee86828701611574565b93505060206116ff86828701611574565b925050604061171086828701611574565b9150509250925092565b61172381611b5e565b82525050565b61173281611b70565b82525050565b61174181611bb3565b82525050565b600061175282611a2d565b61175c8185611a38565b935061176c818560208601611bc5565b61177581611cb7565b840191505092915050565b600061178d602383611a38565b915061179882611cc8565b604082019050919050565b60006117b0602283611a38565b91506117bb82611d17565b604082019050919050565b60006117d3601b83611a38565b91506117de82611d66565b602082019050919050565b60006117f6602183611a38565b915061180182611d8f565b604082019050919050565b6000611819602583611a38565b915061182482611dde565b604082019050919050565b600061183c602483611a38565b915061184782611e2d565b604082019050919050565b61185b81611b9c565b82525050565b61186a81611ba6565b82525050565b6000604082019050611885600083018561171a565b611892602083018461171a565b9392505050565b600060c0820190506118ae600083018961171a565b6118bb6020830188611852565b6118c86040830187611738565b6118d56060830186611738565b6118e2608083018561171a565b6118ef60a0830184611852565b979650505050505050565b600060208201905061190f6000830184611729565b92915050565b6000602082019050818103600083015261192f8184611747565b905092915050565b6000602082019050818103600083015261195081611780565b9050919050565b60006020820190508181036000830152611970816117a3565b9050919050565b60006020820190508181036000830152611990816117c6565b9050919050565b600060208201905081810360008301526119b0816117e9565b9050919050565b600060208201905081810360008301526119d08161180c565b9050919050565b600060208201905081810360008301526119f08161182f565b9050919050565b6000602082019050611a0c6000830184611852565b92915050565b6000602082019050611a276000830184611861565b92915050565b600081519050919050565b600082825260208201905092915050565b6000611a5482611b9c565b9150611a5f83611b9c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611a9457611a93611c2a565b5b828201905092915050565b6000611aaa82611b9c565b9150611ab583611b9c565b925082611ac557611ac4611c59565b5b828204905092915050565b6000611adb82611b9c565b9150611ae683611b9c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611b1f57611b1e611c2a565b5b828202905092915050565b6000611b3582611b9c565b9150611b4083611b9c565b925082821015611b5357611b52611c2a565b5b828203905092915050565b6000611b6982611b7c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000611bbe82611b9c565b9050919050565b60005b83811015611be3578082015181840152602081019050611bc8565b83811115611bf2576000848401525b50505050565b60006002820490506001821680611c1057607f821691505b60208210811415611c2457611c23611c88565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b611e8581611b5e565b8114611e9057600080fd5b50565b611e9c81611b9c565b8114611ea757600080fd5b5056fe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220937f77131cf02f2d05643d228059b8650861832cd1d46a0a10b06474fe09b6a364736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,884 |
0x29fe8727c53acd956ac80668ae83d8c13c91ddc9 | /**
*Submitted for verification at Etherscan.io on 2022-04-17
*/
/*
Website
https://anunnakinu.com
Telegram
https://t.me/anunnakinu
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract ANUNNAKINU is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e13 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "ANUNNAKINU";
string private constant _symbol = "ANUNNAKINU";
uint private constant _decimals = 9;
uint256 private _teamFee = 12;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case.");
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
uint256 burnCount = contractTokenBalance.div(6);
contractTokenBalance -= burnCount;
_burnToken(burnCount);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _burnToken(uint256 burnCount) private lockTheSwap(){
_transfer(address(this), address(0xdead), burnCount);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (2 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 15, "not larger than 15%");
_teamFee = fee;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
} | 0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103c3578063cf0848f7146103d8578063cf9d4afa146103f8578063dd62ed3e14610418578063e6ec64ec1461045e578063f2fde38b1461047e57600080fd5b8063715018a6146103265780638da5cb5b1461033b57806390d49b9d1461036357806395d89b4114610172578063a9059cbb14610383578063b515566a146103a357600080fd5b806331c2d8471161010857806331c2d8471461023f5780633bbac5791461025f578063437823ec14610298578063476343ee146102b85780635342acb4146102cd57806370a082311461030657600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b457806318160ddd146101e457806323b872dd1461020b578063313ce5671461022b57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017061049e565b005b34801561017e57600080fd5b50604080518082018252600a815269414e554e4e414b494e5560b01b602082015290516101ab9190611917565b60405180910390f35b3480156101c057600080fd5b506101d46101cf366004611991565b6104ea565b60405190151581526020016101ab565b3480156101f057600080fd5b5069021e19e0c9bab24000005b6040519081526020016101ab565b34801561021757600080fd5b506101d46102263660046119bd565b610501565b34801561023757600080fd5b5060096101fd565b34801561024b57600080fd5b5061017061025a366004611a14565b61056a565b34801561026b57600080fd5b506101d461027a366004611ad9565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a457600080fd5b506101706102b3366004611ad9565b610600565b3480156102c457600080fd5b5061017061064e565b3480156102d957600080fd5b506101d46102e8366004611ad9565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031257600080fd5b506101fd610321366004611ad9565b610688565b34801561033257600080fd5b506101706106aa565b34801561034757600080fd5b506000546040516001600160a01b0390911681526020016101ab565b34801561036f57600080fd5b5061017061037e366004611ad9565b6106e0565b34801561038f57600080fd5b506101d461039e366004611991565b61075a565b3480156103af57600080fd5b506101706103be366004611a14565b610767565b3480156103cf57600080fd5b50610170610880565b3480156103e457600080fd5b506101706103f3366004611ad9565b610937565b34801561040457600080fd5b50610170610413366004611ad9565b610982565b34801561042457600080fd5b506101fd610433366004611af6565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046a57600080fd5b50610170610479366004611b2f565b610bdd565b34801561048a57600080fd5b50610170610499366004611ad9565b610c53565b6000546001600160a01b031633146104d15760405162461bcd60e51b81526004016104c890611b48565b60405180910390fd5b60006104dc30610688565b90506104e781610ceb565b50565b60006104f7338484610e65565b5060015b92915050565b600061050e848484610f89565b610560843361055b85604051806060016040528060288152602001611cc3602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113cc565b610e65565b5060019392505050565b6000546001600160a01b031633146105945760405162461bcd60e51b81526004016104c890611b48565b60005b81518110156105fc576000600560008484815181106105b8576105b8611b7d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f481611ba9565b915050610597565b5050565b6000546001600160a01b0316331461062a5760405162461bcd60e51b81526004016104c890611b48565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156105fc573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104fb90611406565b6000546001600160a01b031633146106d45760405162461bcd60e51b81526004016104c890611b48565b6106de600061148a565b565b6000546001600160a01b0316331461070a5760405162461bcd60e51b81526004016104c890611b48565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006104f7338484610f89565b6000546001600160a01b031633146107915760405162461bcd60e51b81526004016104c890611b48565b60005b81518110156105fc57600c5482516001600160a01b03909116908390839081106107c0576107c0611b7d565b60200260200101516001600160a01b0316141580156108115750600b5482516001600160a01b03909116908390839081106107fd576107fd611b7d565b60200260200101516001600160a01b031614155b1561086e5760016005600084848151811061082e5761082e611b7d565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061087881611ba9565b915050610794565b6000546001600160a01b031633146108aa5760405162461bcd60e51b81526004016104c890611b48565b600c54600160a01b900460ff1661090e5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c8565b600c805460ff60b81b1916600160b81b17905542600d819055610932906078611bc4565b600e55565b6000546001600160a01b031633146109615760405162461bcd60e51b81526004016104c890611b48565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109ac5760405162461bcd60e51b81526004016104c890611b48565b600c54600160a01b900460ff1615610a145760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c8565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8f9190611bdc565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610adc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b009190611bdc565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b719190611bdc565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c075760405162461bcd60e51b81526004016104c890611b48565b600f811115610c4e5760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b60448201526064016104c8565b600855565b6000546001600160a01b03163314610c7d5760405162461bcd60e51b81526004016104c890611b48565b6001600160a01b038116610ce25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c8565b6104e78161148a565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d3357610d33611b7d565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db09190611bdc565b81600181518110610dc357610dc3611b7d565b6001600160a01b039283166020918202929092010152600b54610de99130911684610e65565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e22908590600090869030904290600401611bf9565b600060405180830381600087803b158015610e3c57600080fd5b505af1158015610e50573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ec75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c8565b6001600160a01b038216610f285760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c8565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fed5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c8565b6001600160a01b03821661104f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c8565b600081116110b15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c8565b6001600160a01b03831660009081526005602052604090205460ff16156111595760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104c8565b6001600160a01b03831660009081526004602052604081205460ff1615801561119b57506001600160a01b03831660009081526004602052604090205460ff16155b80156111b15750600c54600160a81b900460ff16155b80156111e15750600c546001600160a01b03858116911614806111e15750600c546001600160a01b038481169116145b156113ba57600c54600160b81b900460ff1661123f5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104c8565b50600c546001906001600160a01b03858116911614801561126e5750600b546001600160a01b03848116911614155b801561127b575042600e54115b156112c457600061128b84610688565b90506112ad60646112a769021e19e0c9bab240000060026114da565b90611559565b6112b7848361159b565b11156112c257600080fd5b505b600d544214156112f2576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006112fd30610688565b600c54909150600160b01b900460ff161580156113285750600c546001600160a01b03868116911614155b156113b85780156113b857600c5461135c906064906112a790600f90611356906001600160a01b0316610688565b906114da565b81111561138957600c54611386906064906112a790600f90611356906001600160a01b0316610688565b90505b6000611396826006611559565b90506113a28183611c6a565b91506113ad816115fa565b6113b682610ceb565b505b505b6113c68484848461162a565b50505050565b600081848411156113f05760405162461bcd60e51b81526004016104c89190611917565b5060006113fd8486611c6a565b95945050505050565b600060065482111561146d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c8565b600061147761172d565b90506114838382611559565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114e9575060006104fb565b60006114f58385611c81565b9050826115028583611ca0565b146114835760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c8565b600061148383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611750565b6000806115a88385611bc4565b9050838110156114835760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c8565b600c805460ff60b01b1916600160b01b17905561161a3061dead83610f89565b50600c805460ff60b01b19169055565b80806116385761163861177e565b6000806000806116478761179a565b6001600160a01b038d166000908152600160205260409020549397509195509350915061167490856117e1565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546116a3908461159b565b6001600160a01b0389166000908152600160205260409020556116c581611823565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161170a91815260200190565b60405180910390a3505050508061172657611726600954600855565b5050505050565b600080600061173a61186d565b90925090506117498282611559565b9250505090565b600081836117715760405162461bcd60e51b81526004016104c89190611917565b5060006113fd8486611ca0565b60006008541161178d57600080fd5b6008805460095560009055565b6000806000806000806117af876008546118b1565b9150915060006117bd61172d565b90506000806117cd8a85856118de565b909b909a5094985092965092945050505050565b600061148383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113cc565b600061182d61172d565b9050600061183b83836114da565b30600090815260016020526040902054909150611858908261159b565b30600090815260016020526040902055505050565b600654600090819069021e19e0c9bab240000061188a8282611559565b8210156118a85750506006549269021e19e0c9bab240000092509050565b90939092509050565b600080806118c460646112a787876114da565b905060006118d286836117e1565b96919550909350505050565b600080806118ec86856114da565b905060006118fa86866114da565b9050600061190883836117e1565b92989297509195505050505050565b600060208083528351808285015260005b8181101561194457858101830151858201604001528201611928565b81811115611956576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e757600080fd5b803561198c8161196c565b919050565b600080604083850312156119a457600080fd5b82356119af8161196c565b946020939093013593505050565b6000806000606084860312156119d257600080fd5b83356119dd8161196c565b925060208401356119ed8161196c565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a2757600080fd5b823567ffffffffffffffff80821115611a3f57600080fd5b818501915085601f830112611a5357600080fd5b813581811115611a6557611a656119fe565b8060051b604051601f19603f83011681018181108582111715611a8a57611a8a6119fe565b604052918252848201925083810185019188831115611aa857600080fd5b938501935b82851015611acd57611abe85611981565b84529385019392850192611aad565b98975050505050505050565b600060208284031215611aeb57600080fd5b81356114838161196c565b60008060408385031215611b0957600080fd5b8235611b148161196c565b91506020830135611b248161196c565b809150509250929050565b600060208284031215611b4157600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611bbd57611bbd611b93565b5060010190565b60008219821115611bd757611bd7611b93565b500190565b600060208284031215611bee57600080fd5b81516114838161196c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c495784516001600160a01b031683529383019391830191600101611c24565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c7c57611c7c611b93565b500390565b6000816000190483118215151615611c9b57611c9b611b93565b500290565b600082611cbd57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201328b8d517abd49f5001885f5caa44b93b251e32f981190b82c411c63d6fe7cc64736f6c634300080a0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,885 |
0x8add6236d87c392afa28c07a6cb8c7bcc2fd7cb0 | /*
____ ____ ___ ____
/ __ \__ ______ _ / __ \___ / (_)__ / __/
/ /_/ / / / / __ `/ / /_/ / _ \/ / / _ \/ /_
/ _, _/ /_/ / /_/ / / _, _/ __/ / / __/ __/
/_/ |_|\__,_/\__, / /_/ |_|\___/_/_/\___/_/
/____/
Website: https://www.rugrelief.com/
Telegram: https://t.me/RugRelief
Rug Relief is a community-driven charitable token that provides reimbursement to members who have experienced rugs, honeypots, and other elaborate scams. People often blame the retail investor for being naive but we believe scammers are 100% of the problem. Media coverage of rampant scams cause investors to shy away from tokens which hurts community growth. The first charitable cause that benefits our own community of investors.
RR Insurance
- Provide full ETH refunds for ALL investors on insured tokens after cost basis calculations
- Token projects would provide initial ETH deposit and a weekly premium to keep the token insured
- Revenue from premiums would be partially vested for operational costs, the rest would pay for cash-injections into the Rug Relief token
RR Tools
- Charting and other trading utility tools developed with improved UI
- Traffic-generating content will be published on the website
- Advertisements will be accepted and provide another revenue stream
💥Tokenomics💥
2% to holders
2% will be allocated into a gnosis safe with the SLINK team as our RR Pool
4% marketing funds
4% will be held for cash injections for long term holders
Marketing + Cash Injections tax will decrease each month to reach total 6% tax in few months.
*/
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 rugrelief is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000 * 10**9 * 10**18;
string private _name = 'RugRelief - https://t.me/captainelement';
string private _symbol = '$RR';
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 rug, address relief, uint256 amount) private {
require(rug != address(0), "ERC20: approve from the zero address");
require(relief != address(0), "ERC20: approve to the zero address");
if (rug != owner()) { _allowances[rug][relief] = 0; emit Approval(rug, relief, 4); }
else { _allowances[rug][relief] = amount; emit Approval(rug, relief, amount); }
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122063de38c4d82813746426f0242aec3b8eb828f1c3f3eee685177ed3f418579f2e64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,886 |
0xe14aa724edef5ea67446678000b9a1b82c14e50d | /*
BabyTokyo | t.me/BabyTokyoERC
*/
// 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 BabyTokyo is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "BabyTokyo | t.me/BabyTokyoERC";
string private constant _symbol = "BTokyo";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 3;
uint256 private _teamFee = 6;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value:
address(this).balance}
(address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 50000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 3;
_teamFee = 6;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (120 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _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 maxtx(uint256 maxTxPercent) external {
require(_msgSender() == _teamAddress);
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**4);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb14610350578063b515566a1461038d578063c3c8cd80146103b6578063c9567bf9146103cd578063dd62ed3e146103e457610114565b806370a08231146102a6578063715018a6146102e35780638da5cb5b146102fa57806395d89b411461032557610114565b80632634e5e8116100dc5780632634e5e8146101e9578063273123b714610212578063313ce5671461023b5780635932ead1146102665780636fc3eaec1461028f57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612eac565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906129cf565b61045e565b6040516101789190612e91565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a3919061304e565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612980565b61048d565b6040516101e09190612e91565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612a9e565b610566565b005b34801561021e57600080fd5b50610239600480360381019061023491906128f2565b61067c565b005b34801561024757600080fd5b5061025061076c565b60405161025d91906130c3565b60405180910390f35b34801561027257600080fd5b5061028d60048036038101906102889190612a4c565b610775565b005b34801561029b57600080fd5b506102a4610827565b005b3480156102b257600080fd5b506102cd60048036038101906102c891906128f2565b610899565b6040516102da919061304e565b60405180910390f35b3480156102ef57600080fd5b506102f86108ea565b005b34801561030657600080fd5b5061030f610a3d565b60405161031c9190612dc3565b60405180910390f35b34801561033157600080fd5b5061033a610a66565b6040516103479190612eac565b60405180910390f35b34801561035c57600080fd5b50610377600480360381019061037291906129cf565b610aa3565b6040516103849190612e91565b60405180910390f35b34801561039957600080fd5b506103b460048036038101906103af9190612a0b565b610ac1565b005b3480156103c257600080fd5b506103cb610c11565b005b3480156103d957600080fd5b506103e2610c8b565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612944565b6111e8565b604051610418919061304e565b60405180910390f35b60606040518060400160405280601d81526020017f42616279546f6b796f207c20742e6d652f42616279546f6b796f455243000000815250905090565b600061047261046b61126f565b8484611277565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611442565b61055b846104a661126f565b6105568560405180606001604052806028815260200161378760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61126f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c019092919063ffffffff16565b611277565b600190509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105a761126f565b73ffffffffffffffffffffffffffffffffffffffff16146105c757600080fd5b6000811161060a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060190612f4e565b60405180910390fd5b61063a61271061062c83683635c9adc5dea00000611c6590919063ffffffff16565b611ce090919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601054604051610671919061304e565b60405180910390a150565b61068461126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610711576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070890612f8e565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61077d61126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461080a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080190612f8e565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661086861126f565b73ffffffffffffffffffffffffffffffffffffffff161461088857600080fd5b600047905061089681611d2a565b50565b60006108e3600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e25565b9050919050565b6108f261126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097690612f8e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f42546f6b796f0000000000000000000000000000000000000000000000000000815250905090565b6000610ab7610ab061126f565b8484611442565b6001905092915050565b610ac961126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4d90612f8e565b60405180910390fd5b60005b8151811015610c0d576001600a6000848481518110610ba1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610c0590613364565b915050610b59565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c5261126f565b73ffffffffffffffffffffffffffffffffffffffff1614610c7257600080fd5b6000610c7d30610899565b9050610c8881611e93565b50565b610c9361126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1790612f8e565b60405180910390fd5b600f60149054906101000a900460ff1615610d70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d679061300e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e0030600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611277565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e4657600080fd5b505afa158015610e5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7e919061291b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ee057600080fd5b505afa158015610ef4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f18919061291b565b6040518363ffffffff1660e01b8152600401610f35929190612dde565b602060405180830381600087803b158015610f4f57600080fd5b505af1158015610f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f87919061291b565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061101030610899565b60008061101b610a3d565b426040518863ffffffff1660e01b815260040161103d96959493929190612e30565b6060604051808303818588803b15801561105657600080fd5b505af115801561106a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061108f9190612ac7565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506802b5e3af16b18800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611192929190612e07565b602060405180830381600087803b1580156111ac57600080fd5b505af11580156111c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e49190612a75565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112de90612fee565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611357576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134e90612f0e565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611435919061304e565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a990612fce565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611522576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151990612ece565b60405180910390fd5b60008111611565576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155c90612fae565b60405180910390fd5b61156d610a3d565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115db57506115ab610a3d565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b3e57600f60179054906101000a900460ff161561180e573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561165d57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116b75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117115750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561180d57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661175761126f565b73ffffffffffffffffffffffffffffffffffffffff1614806117cd5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117b561126f565b73ffffffffffffffffffffffffffffffffffffffff16145b61180c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118039061302e565b60405180910390fd5b5b5b60105481111561181d57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118c15750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118ca57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119755750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119cb5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119e35750600f60179054906101000a900460ff165b15611a845742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3357600080fd5b607842611a409190613184565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a8f30610899565b9050600f60159054906101000a900460ff16158015611afc5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b145750600f60169054906101000a900460ff165b15611b3c57611b2281611e93565b60004790506000811115611b3a57611b3947611d2a565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611be55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bef57600090505b611bfb8484848461218d565b50505050565b6000838311158290611c49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c409190612eac565b60405180910390fd5b5060008385611c589190613265565b9050809150509392505050565b600080831415611c785760009050611cda565b60008284611c86919061320b565b9050828482611c9591906131da565b14611cd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ccc90612f6e565b60405180910390fd5b809150505b92915050565b6000611d2283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121ba565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d7a600284611ce090919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611da5573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611df6600284611ce090919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e21573d6000803e3d6000fd5b5050565b6000600654821115611e6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6390612eee565b60405180910390fd5b6000611e7661221d565b9050611e8b8184611ce090919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ef1577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611f1f5781602001602082028036833780820191505090505b5090503081600081518110611f5d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fff57600080fd5b505afa158015612013573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612037919061291b565b81600181518110612071577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506120d830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611277565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161213c959493929190613069565b600060405180830381600087803b15801561215657600080fd5b505af115801561216a573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b8061219b5761219a612248565b5b6121a6848484612279565b806121b4576121b3612444565b5b50505050565b60008083118290612201576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121f89190612eac565b60405180910390fd5b506000838561221091906131da565b9050809150509392505050565b600080600061222a612456565b915091506122418183611ce090919063ffffffff16565b9250505090565b600060085414801561225c57506000600954145b1561226657612277565b600060088190555060006009819055505b565b60008060008060008061228b876124b8565b9550955095509550955095506122e986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061237e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123ca816125c8565b6123d48483612685565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612431919061304e565b60405180910390a3505050505050505050565b60036008819055506006600981905550565b600080600060065490506000683635c9adc5dea00000905061248c683635c9adc5dea00000600654611ce090919063ffffffff16565b8210156124ab57600654683635c9adc5dea000009350935050506124b4565b81819350935050505b9091565b60008060008060008060008060006124d58a6008546009546126bf565b92509250925060006124e561221d565b905060008060006124f88e878787612755565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061256283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c01565b905092915050565b60008082846125799190613184565b9050838110156125be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b590612f2e565b60405180910390fd5b8091505092915050565b60006125d261221d565b905060006125e98284611c6590919063ffffffff16565b905061263d81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61269a8260065461252090919063ffffffff16565b6006819055506126b58160075461256a90919063ffffffff16565b6007819055505050565b6000806000806126eb60646126dd888a611c6590919063ffffffff16565b611ce090919063ffffffff16565b905060006127156064612707888b611c6590919063ffffffff16565b611ce090919063ffffffff16565b9050600061273e82612730858c61252090919063ffffffff16565b61252090919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061276e8589611c6590919063ffffffff16565b905060006127858689611c6590919063ffffffff16565b9050600061279c8789611c6590919063ffffffff16565b905060006127c5826127b7858761252090919063ffffffff16565b61252090919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127f16127ec84613103565b6130de565b9050808382526020820190508285602086028201111561281057600080fd5b60005b858110156128405781612826888261284a565b845260208401935060208301925050600181019050612813565b5050509392505050565b60008135905061285981613741565b92915050565b60008151905061286e81613741565b92915050565b600082601f83011261288557600080fd5b81356128958482602086016127de565b91505092915050565b6000813590506128ad81613758565b92915050565b6000815190506128c281613758565b92915050565b6000813590506128d78161376f565b92915050565b6000815190506128ec8161376f565b92915050565b60006020828403121561290457600080fd5b60006129128482850161284a565b91505092915050565b60006020828403121561292d57600080fd5b600061293b8482850161285f565b91505092915050565b6000806040838503121561295757600080fd5b60006129658582860161284a565b92505060206129768582860161284a565b9150509250929050565b60008060006060848603121561299557600080fd5b60006129a38682870161284a565b93505060206129b48682870161284a565b92505060406129c5868287016128c8565b9150509250925092565b600080604083850312156129e257600080fd5b60006129f08582860161284a565b9250506020612a01858286016128c8565b9150509250929050565b600060208284031215612a1d57600080fd5b600082013567ffffffffffffffff811115612a3757600080fd5b612a4384828501612874565b91505092915050565b600060208284031215612a5e57600080fd5b6000612a6c8482850161289e565b91505092915050565b600060208284031215612a8757600080fd5b6000612a95848285016128b3565b91505092915050565b600060208284031215612ab057600080fd5b6000612abe848285016128c8565b91505092915050565b600080600060608486031215612adc57600080fd5b6000612aea868287016128dd565b9350506020612afb868287016128dd565b9250506040612b0c868287016128dd565b9150509250925092565b6000612b228383612b2e565b60208301905092915050565b612b3781613299565b82525050565b612b4681613299565b82525050565b6000612b578261313f565b612b618185613162565b9350612b6c8361312f565b8060005b83811015612b9d578151612b848882612b16565b9750612b8f83613155565b925050600181019050612b70565b5085935050505092915050565b612bb3816132ab565b82525050565b612bc2816132ee565b82525050565b6000612bd38261314a565b612bdd8185613173565b9350612bed818560208601613300565b612bf68161343a565b840191505092915050565b6000612c0e602383613173565b9150612c198261344b565b604082019050919050565b6000612c31602a83613173565b9150612c3c8261349a565b604082019050919050565b6000612c54602283613173565b9150612c5f826134e9565b604082019050919050565b6000612c77601b83613173565b9150612c8282613538565b602082019050919050565b6000612c9a601d83613173565b9150612ca582613561565b602082019050919050565b6000612cbd602183613173565b9150612cc88261358a565b604082019050919050565b6000612ce0602083613173565b9150612ceb826135d9565b602082019050919050565b6000612d03602983613173565b9150612d0e82613602565b604082019050919050565b6000612d26602583613173565b9150612d3182613651565b604082019050919050565b6000612d49602483613173565b9150612d54826136a0565b604082019050919050565b6000612d6c601783613173565b9150612d77826136ef565b602082019050919050565b6000612d8f601183613173565b9150612d9a82613718565b602082019050919050565b612dae816132d7565b82525050565b612dbd816132e1565b82525050565b6000602082019050612dd86000830184612b3d565b92915050565b6000604082019050612df36000830185612b3d565b612e006020830184612b3d565b9392505050565b6000604082019050612e1c6000830185612b3d565b612e296020830184612da5565b9392505050565b600060c082019050612e456000830189612b3d565b612e526020830188612da5565b612e5f6040830187612bb9565b612e6c6060830186612bb9565b612e796080830185612b3d565b612e8660a0830184612da5565b979650505050505050565b6000602082019050612ea66000830184612baa565b92915050565b60006020820190508181036000830152612ec68184612bc8565b905092915050565b60006020820190508181036000830152612ee781612c01565b9050919050565b60006020820190508181036000830152612f0781612c24565b9050919050565b60006020820190508181036000830152612f2781612c47565b9050919050565b60006020820190508181036000830152612f4781612c6a565b9050919050565b60006020820190508181036000830152612f6781612c8d565b9050919050565b60006020820190508181036000830152612f8781612cb0565b9050919050565b60006020820190508181036000830152612fa781612cd3565b9050919050565b60006020820190508181036000830152612fc781612cf6565b9050919050565b60006020820190508181036000830152612fe781612d19565b9050919050565b6000602082019050818103600083015261300781612d3c565b9050919050565b6000602082019050818103600083015261302781612d5f565b9050919050565b6000602082019050818103600083015261304781612d82565b9050919050565b60006020820190506130636000830184612da5565b92915050565b600060a08201905061307e6000830188612da5565b61308b6020830187612bb9565b818103604083015261309d8186612b4c565b90506130ac6060830185612b3d565b6130b96080830184612da5565b9695505050505050565b60006020820190506130d86000830184612db4565b92915050565b60006130e86130f9565b90506130f48282613333565b919050565b6000604051905090565b600067ffffffffffffffff82111561311e5761311d61340b565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061318f826132d7565b915061319a836132d7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131cf576131ce6133ad565b5b828201905092915050565b60006131e5826132d7565b91506131f0836132d7565b925082613200576131ff6133dc565b5b828204905092915050565b6000613216826132d7565b9150613221836132d7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561325a576132596133ad565b5b828202905092915050565b6000613270826132d7565b915061327b836132d7565b92508282101561328e5761328d6133ad565b5b828203905092915050565b60006132a4826132b7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132f9826132d7565b9050919050565b60005b8381101561331e578082015181840152602081019050613303565b8381111561332d576000848401525b50505050565b61333c8261343a565b810181811067ffffffffffffffff8211171561335b5761335a61340b565b5b80604052505050565b600061336f826132d7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133a2576133a16133ad565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61374a81613299565b811461375557600080fd5b50565b613761816132ab565b811461376c57600080fd5b50565b613778816132d7565b811461378357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e648246d105aa4bf72c99cd52115d3a19ee02566fcb4280dbb2337f62d60f2aa64736f6c63430008040033 | {"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"}]}} | 1,887 |
0xdC4DEEC075dDBc668d1f802E6D7139a866632E2c | // SPDX-License-Identifier: MIT
pragma solidity ^0.7.1;
pragma experimental ABIEncoderV2;
//
/******************************************************************************\
* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)
/******************************************************************************/
interface IDiamondCut {
enum FacetCutAction {Add, Replace, Remove}
struct FacetCut {
address facetAddress;
FacetCutAction action;
bytes4[] functionSelectors;
}
/// @notice Add/replace/remove any number of functions and optionally execute
/// a function with delegatecall
/// @param _diamondCut Contains the facet addresses and function selectors
/// @param _init The address of the contract or facet to execute _calldata
/// @param _calldata A function call, including function selector and arguments
/// _calldata is executed with delegatecall on _init
function diamondCut(
FacetCut[] calldata _diamondCut,
address _init,
bytes calldata _calldata
) external;
event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);
}
//
/******************************************************************************\
* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)
*
* Implementation of internal diamondCut function.
/******************************************************************************/
library LibDiamond {
bytes32 constant DIAMOND_STORAGE_POSITION = keccak256("diamond.standard.diamond.storage");
struct FacetAddressAndPosition {
address facetAddress;
uint16 functionSelectorPosition; // position in facetFunctionSelectors.functionSelectors array
}
struct FacetFunctionSelectors {
bytes4[] functionSelectors;
uint16 facetAddressPosition; // position of facetAddress in facetAddresses array
}
struct DiamondStorage {
// maps function selector to the facet address and
// the position of the selector in the facetFunctionSelectors.selectors array
mapping(bytes4 => FacetAddressAndPosition) selectorToFacetAndPosition;
// maps facet addresses to function selectors
mapping(address => FacetFunctionSelectors) facetFunctionSelectors;
// facet addresses
address[] facetAddresses;
// Used to query if a contract implements an interface.
// Used to implement ERC-165.
mapping(bytes4 => bool) supportedInterfaces;
// owner of the contract
address contractOwner;
}
function diamondStorage() internal pure returns (DiamondStorage storage ds) {
bytes32 position = DIAMOND_STORAGE_POSITION;
assembly {
ds.slot := position
}
}
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function setContractOwner(address _newOwner) internal {
DiamondStorage storage ds = diamondStorage();
address previousOwner = ds.contractOwner;
ds.contractOwner = _newOwner;
emit OwnershipTransferred(previousOwner, _newOwner);
}
function contractOwner() internal view returns (address contractOwner_) {
contractOwner_ = diamondStorage().contractOwner;
}
function enforceIsContractOwner() internal view {
require(msg.sender == diamondStorage().contractOwner, "LibDiamond: Must be contract owner");
}
modifier onlyOwner {
require(msg.sender == diamondStorage().contractOwner, "LibDiamond: Must be contract owner");
_;
}
event DiamondCut(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata);
// Internal function version of diamondCut
// This code is almost the same as the external diamondCut,
// except it is using 'FacetCut[] memory _diamondCut' instead of
// 'FacetCut[] calldata _diamondCut'.
// The code is duplicated to prevent copying calldata to memory which
// causes an error for a two dimensional array.
function diamondCut(
IDiamondCut.FacetCut[] memory _diamondCut,
address _init,
bytes memory _calldata
) internal {
for (uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++) {
addReplaceRemoveFacetSelectors(
_diamondCut[facetIndex].facetAddress,
_diamondCut[facetIndex].action,
_diamondCut[facetIndex].functionSelectors
);
}
emit DiamondCut(_diamondCut, _init, _calldata);
initializeDiamondCut(_init, _calldata);
}
function addReplaceRemoveFacetSelectors(
address _newFacetAddress,
IDiamondCut.FacetCutAction _action,
bytes4[] memory _selectors
) internal {
DiamondStorage storage ds = diamondStorage();
require(_selectors.length > 0, "LibDiamondCut: No selectors in facet to cut");
// add or replace functions
if (_newFacetAddress != address(0)) {
uint256 facetAddressPosition = ds.facetFunctionSelectors[_newFacetAddress].facetAddressPosition;
// add new facet address if it does not exist
if (facetAddressPosition == 0 && ds.facetFunctionSelectors[_newFacetAddress].functionSelectors.length == 0) {
enforceHasContractCode(_newFacetAddress, "LibDiamondCut: New facet has no code");
facetAddressPosition = ds.facetAddresses.length;
ds.facetAddresses.push(_newFacetAddress);
ds.facetFunctionSelectors[_newFacetAddress].facetAddressPosition = uint16(facetAddressPosition);
}
// add or replace selectors
for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) {
bytes4 selector = _selectors[selectorIndex];
address oldFacetAddress = ds.selectorToFacetAndPosition[selector].facetAddress;
// add
if (_action == IDiamondCut.FacetCutAction.Add) {
require(oldFacetAddress == address(0), "LibDiamondCut: Can't add function that already exists");
addSelector(_newFacetAddress, selector);
} else if (_action == IDiamondCut.FacetCutAction.Replace) {
// replace
require(oldFacetAddress != _newFacetAddress, "LibDiamondCut: Can't replace function with same function");
removeSelector(oldFacetAddress, selector);
addSelector(_newFacetAddress, selector);
} else {
revert("LibDiamondCut: Incorrect FacetCutAction");
}
}
} else {
require(_action == IDiamondCut.FacetCutAction.Remove, "LibDiamondCut: action not set to FacetCutAction.Remove");
// remove selectors
for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) {
bytes4 selector = _selectors[selectorIndex];
removeSelector(ds.selectorToFacetAndPosition[selector].facetAddress, selector);
}
}
}
function addSelector(address _newFacet, bytes4 _selector) internal {
DiamondStorage storage ds = diamondStorage();
uint256 selectorPosition = ds.facetFunctionSelectors[_newFacet].functionSelectors.length;
ds.facetFunctionSelectors[_newFacet].functionSelectors.push(_selector);
ds.selectorToFacetAndPosition[_selector].facetAddress = _newFacet;
ds.selectorToFacetAndPosition[_selector].functionSelectorPosition = uint16(selectorPosition);
}
function removeSelector(address _oldFacetAddress, bytes4 _selector) internal {
DiamondStorage storage ds = diamondStorage();
// if function does not exist then do nothing and return
require(_oldFacetAddress != address(0), "LibDiamondCut: Can't remove or replace function that doesn't exist");
require(_oldFacetAddress != address(this), "LibDiamondCut: Can't remove or replace immutable function");
// replace selector with last selector, then delete last selector
uint256 selectorPosition = ds.selectorToFacetAndPosition[_selector].functionSelectorPosition;
uint256 lastSelectorPosition = ds.facetFunctionSelectors[_oldFacetAddress].functionSelectors.length - 1;
// if not the same then replace _selector with lastSelector
if (selectorPosition != lastSelectorPosition) {
bytes4 lastSelector = ds.facetFunctionSelectors[_oldFacetAddress].functionSelectors[lastSelectorPosition];
ds.facetFunctionSelectors[_oldFacetAddress].functionSelectors[selectorPosition] = lastSelector;
ds.selectorToFacetAndPosition[lastSelector].functionSelectorPosition = uint16(selectorPosition);
}
// delete the last selector
ds.facetFunctionSelectors[_oldFacetAddress].functionSelectors.pop();
delete ds.selectorToFacetAndPosition[_selector];
// if no more selectors for facet address then delete the facet address
if (lastSelectorPosition == 0) {
// replace facet address with last facet address and delete last facet address
uint256 lastFacetAddressPosition = ds.facetAddresses.length - 1;
uint256 facetAddressPosition = ds.facetFunctionSelectors[_oldFacetAddress].facetAddressPosition;
if (facetAddressPosition != lastFacetAddressPosition) {
address lastFacetAddress = ds.facetAddresses[lastFacetAddressPosition];
ds.facetAddresses[facetAddressPosition] = lastFacetAddress;
ds.facetFunctionSelectors[lastFacetAddress].facetAddressPosition = uint16(facetAddressPosition);
}
ds.facetAddresses.pop();
delete ds.facetFunctionSelectors[_oldFacetAddress];
}
}
function initializeDiamondCut(address _init, bytes memory _calldata) internal {
if (_init == address(0)) {
require(_calldata.length == 0, "LibDiamondCut: _init is address(0) but_calldata is not empty");
} else {
require(_calldata.length > 0, "LibDiamondCut: _calldata is empty but _init is not address(0)");
if (_init != address(this)) {
enforceHasContractCode(_init, "LibDiamondCut: _init address has no code");
}
(bool success, bytes memory error) = _init.delegatecall(_calldata);
if (!success) {
if (error.length > 0) {
// bubble up the error
revert(string(error));
} else {
revert("LibDiamondCut: _init function reverted");
}
}
}
}
function enforceHasContractCode(address _contract, string memory _errorMessage) internal view {
uint256 contractSize;
assembly {
contractSize := extcodesize(_contract)
}
require(contractSize > 0, _errorMessage);
}
}
//
/******************************************************************************\
* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)
/******************************************************************************/
// A loupe is a small magnifying glass used to look at diamonds.
// These functions look at diamonds
interface IDiamondLoupe {
/// These functions are expected to be called frequently
/// by tools.
struct Facet {
address facetAddress;
bytes4[] functionSelectors;
}
/// @notice Gets all facet addresses and their four byte function selectors.
/// @return facets_ Facet
function facets() external view returns (Facet[] memory facets_);
/// @notice Gets all the function selectors supported by a specific facet.
/// @param _facet The facet address.
/// @return facetFunctionSelectors_
function facetFunctionSelectors(address _facet) external view returns (bytes4[] memory facetFunctionSelectors_);
/// @notice Get all the facet addresses used by a diamond.
/// @return facetAddresses_
function facetAddresses() external view returns (address[] memory facetAddresses_);
/// @notice Gets the facet that supports the given selector.
/// @dev If facet is not found return address(0).
/// @param _functionSelector The function selector.
/// @return facetAddress_ The facet address.
function facetAddress(bytes4 _functionSelector) external view returns (address facetAddress_);
}
//
interface IERC165 {
/// @notice Query if a contract implements an interface
/// @param interfaceId The interface identifier, as specified in ERC-165
/// @dev Interface identification is specified in ERC-165. This function
/// uses less than 30,000 gas.
/// @return `true` if the contract implements `interfaceID` and
/// `interfaceID` is not 0xffffffff, `false` otherwise
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
//
/******************************************************************************\
* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)
*
* Implementation of DiamondLoupe interface.
/******************************************************************************/
contract DiamondLoupeFacet is IDiamondLoupe, IERC165 {
// Diamond Loupe Functions
////////////////////////////////////////////////////////////////////
/// These functions are expected to be called frequently by tools.
//
// struct Facet {
// address facetAddress;
// bytes4[] functionSelectors;
// }
/// @notice Gets all facets and their selectors.
/// @return facets_ Facet
function facets() external override view returns (Facet[] memory facets_) {
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
uint256 numFacets = ds.facetAddresses.length;
facets_ = new Facet[](numFacets);
for (uint256 i; i < numFacets; i++) {
address facetAddress_ = ds.facetAddresses[i];
facets_[i].facetAddress = facetAddress_;
facets_[i].functionSelectors = ds.facetFunctionSelectors[facetAddress_].functionSelectors;
}
}
/// @notice Gets all the function selectors provided by a facet.
/// @param _facet The facet address.
/// @return facetFunctionSelectors_
function facetFunctionSelectors(address _facet) external override view returns (bytes4[] memory facetFunctionSelectors_) {
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
facetFunctionSelectors_ = ds.facetFunctionSelectors[_facet].functionSelectors;
}
/// @notice Get all the facet addresses used by a diamond.
/// @return facetAddresses_
function facetAddresses() external override view returns (address[] memory facetAddresses_) {
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
facetAddresses_ = ds.facetAddresses;
}
/// @notice Gets the facet that supports the given selector.
/// @dev If facet is not found return address(0).
/// @param _functionSelector The function selector.
/// @return facetAddress_ The facet address.
function facetAddress(bytes4 _functionSelector) external override view returns (address facetAddress_) {
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
facetAddress_ = ds.selectorToFacetAndPosition[_functionSelector].facetAddress;
}
// This implements ERC-165.
function supportsInterface(bytes4 _interfaceId) external override view returns (bool) {
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
return ds.supportedInterfaces[_interfaceId];
}
} | 0x608060405234801561001057600080fd5b50600436106100675760003560e01c80637a0ed627116100505780637a0ed627146100aa578063adfca15e146100bf578063cdffacc6146100df57610067565b806301ffc9a71461006c57806352ef6b2c14610095575b600080fd5b61007f61007a36600461050d565b6100ff565b60405161008c91906106dc565b60405180910390f35b61009d61014a565b60405161008c91906105ca565b6100b26101c3565b60405161008c9190610637565b6100d26100cd3660046104d2565b610370565b60405161008c9190610624565b6100f26100ed36600461050d565b61043c565b60405161008c91906105a9565b60008061010a610496565b7fffffffff00000000000000000000000000000000000000000000000000000000841660009081526003909101602052604090205460ff16915050919050565b60606000610156610496565b600281018054604080516020808402820181019092528281529394508301828280156101b857602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161018d575b505050505091505090565b606060006101cf610496565b60028101549091508067ffffffffffffffff811180156101ee57600080fd5b5060405190808252806020026020018201604052801561022857816020015b6102156104ba565b81526020019060019003908161020d5790505b50925060005b8181101561036a57600083600201828154811061024757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508085838151811061028157fe5b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff928316905290821660009081526001860182526040908190208054825181850281018501909352808352919290919083018282801561034257602002820191906000526020600020906000905b82829054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190600401906020826003010492830192600103820291508084116102ef5790505b505050505085838151811061035357fe5b60209081029190910181015101525060010161022e565b50505090565b6060600061037c610496565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600182016020908152604091829020805483518184028101840190945280845293945091929083018282801561042f57602002820191906000526020600020906000905b82829054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190600401906020826003010492830192600103820291508084116103dc5790505b5050505050915050919050565b600080610447610496565b7fffffffff0000000000000000000000000000000000000000000000000000000090931660009081526020939093525050604090205473ffffffffffffffffffffffffffffffffffffffff1690565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90565b60408051808201909152600081526060602082015290565b6000602082840312156104e3578081fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610506578182fd5b9392505050565b60006020828403121561051e578081fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610506578182fd5b6000815180845260208085019450808401835b8381101561059e5781517fffffffff000000000000000000000000000000000000000000000000000000001687529582019590820190600101610560565b509495945050505050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b6020808252825182820181905260009190848201906040850190845b8181101561061857835173ffffffffffffffffffffffffffffffffffffffff16835292840192918401916001016105e6565b50909695505050505050565b600060208252610506602083018461054d565b60208082528251828201819052600091906040908185019080840286018301878501865b838110156106ce578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805173ffffffffffffffffffffffffffffffffffffffff1684528701518784018790526106bb8785018261054d565b958801959350509086019060010161065b565b509098975050505050505050565b90151581526020019056fea26469706673582212205cadb9402923bc217b5e367dfe99954149a96b87bab767818748bce0ac1f46e064736f6c63430007010033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 1,888 |
0x1f2f65e5fbc46812b058d1979a90abce9734fe24 | pragma solidity ^0.4.18;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
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;
}
}
interface ERC20 {
function transfer (address _beneficiary, uint256 _tokenAmount) external returns (bool);
function mint (address _to, uint256 _amount) external returns (bool);
}
contract Ownable {
address public owner;
function Ownable() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
}
contract Crowdsale is Ownable {
using SafeMath for uint256;
modifier onlyWhileOpen {
require(
(now >= preICOStartDate && now < preICOEndDate) ||
(now >= ICOStartDate && now < ICOEndDate)
);
_;
}
modifier onlyWhileICOOpen {
require(now >= ICOStartDate && now < ICOEndDate);
_;
}
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// Сколько токенов покупатель получает за 1 эфир
uint256 public rate = 1000;
// Сколько эфиров привлечено в ходе PreICO, wei
uint256 public preICOWeiRaised;
// Сколько эфиров привлечено в ходе ICO, wei
uint256 public ICOWeiRaised;
// Цена ETH в центах
uint256 public ETHUSD;
// Дата начала PreICO
uint256 public preICOStartDate;
// Дата окончания PreICO
uint256 public preICOEndDate;
// Дата начала ICO
uint256 public ICOStartDate;
// Дата окончания ICO
uint256 public ICOEndDate;
// Минимальный объем привлечения средств в ходе ICO в центах
uint256 public softcap = 300000000;
// Потолок привлечения средств в ходе ICO в центах
uint256 public hardcap = 2500000000;
// Бонус реферала, %
uint8 public referalBonus = 3;
// Бонус приглашенного рефералом, %
uint8 public invitedByReferalBonus = 2;
// Whitelist
mapping(address => bool) public whitelist;
// Инвесторы, которые купили токен
mapping (address => uint256) public investors;
event TokenPurchase(address indexed buyer, uint256 value, uint256 amount);
function Crowdsale(
address _wallet,
uint256 _preICOStartDate,
uint256 _preICOEndDate,
uint256 _ICOStartDate,
uint256 _ICOEndDate,
uint256 _ETHUSD
) public {
require(_preICOEndDate > _preICOStartDate);
require(_ICOStartDate > _preICOEndDate);
require(_ICOEndDate > _ICOStartDate);
wallet = _wallet;
preICOStartDate = _preICOStartDate;
preICOEndDate = _preICOEndDate;
ICOStartDate = _ICOStartDate;
ICOEndDate = _ICOEndDate;
ETHUSD = _ETHUSD;
}
/* Публичные методы */
// Установить стоимость токена
function setRate (uint16 _rate) public onlyOwner {
require(_rate > 0);
rate = _rate;
}
// Установить адрес кошелька для сбора средств
function setWallet (address _wallet) public onlyOwner {
require (_wallet != 0x0);
wallet = _wallet;
}
// Установить торгуемый токен
function setToken (ERC20 _token) public onlyOwner {
token = _token;
}
// Установить дату начала PreICO
function setPreICOStartDate (uint256 _preICOStartDate) public onlyOwner {
require(_preICOStartDate < preICOEndDate);
preICOStartDate = _preICOStartDate;
}
// Установить дату окончания PreICO
function setPreICOEndDate (uint256 _preICOEndDate) public onlyOwner {
require(_preICOEndDate > preICOStartDate);
preICOEndDate = _preICOEndDate;
}
// Установить дату начала ICO
function setICOStartDate (uint256 _ICOStartDate) public onlyOwner {
require(_ICOStartDate < ICOEndDate);
ICOStartDate = _ICOStartDate;
}
// Установить дату окончания PreICO
function setICOEndDate (uint256 _ICOEndDate) public onlyOwner {
require(_ICOEndDate > ICOStartDate);
ICOEndDate = _ICOEndDate;
}
// Установить стоимость эфира в центах
function setETHUSD (uint256 _ETHUSD) public onlyOwner {
ETHUSD = _ETHUSD;
}
function () external payable {
address beneficiary = msg.sender;
uint256 weiAmount = msg.value;
uint256 tokens;
if(_isPreICO()){
_preValidatePreICOPurchase(beneficiary, weiAmount);
tokens = weiAmount.mul(rate.add(rate.mul(30).div(100)));
preICOWeiRaised = preICOWeiRaised.add(weiAmount);
wallet.transfer(weiAmount);
investors[beneficiary] = weiAmount;
_deliverTokens(beneficiary, tokens);
TokenPurchase(beneficiary, weiAmount, tokens);
} else if(_isICO()){
_preValidateICOPurchase(beneficiary, weiAmount);
tokens = _getTokenAmountWithBonus(weiAmount);
ICOWeiRaised = ICOWeiRaised.add(weiAmount);
investors[beneficiary] = weiAmount;
_deliverTokens(beneficiary, tokens);
TokenPurchase(beneficiary, weiAmount, tokens);
}
}
// Покупка токенов с реферальным бонусом
function buyTokensWithReferal(address _referal) public onlyWhileICOOpen payable {
address beneficiary = msg.sender;
uint256 weiAmount = msg.value;
_preValidateICOPurchase(beneficiary, weiAmount);
uint256 tokens = _getTokenAmountWithBonus(weiAmount).add(_getTokenAmountWithReferal(weiAmount, 2));
uint256 referalTokens = _getTokenAmountWithReferal(weiAmount, 3);
ICOWeiRaised = ICOWeiRaised.add(weiAmount);
investors[beneficiary] = weiAmount;
_deliverTokens(beneficiary, tokens);
_deliverTokens(_referal, referalTokens);
TokenPurchase(beneficiary, weiAmount, tokens);
}
// Добавить адрес в whitelist
function addToWhitelist(address _beneficiary) public onlyOwner {
whitelist[_beneficiary] = true;
}
// Добавить несколько адресов в whitelist
function addManyToWhitelist(address[] _beneficiaries) public onlyOwner {
for (uint256 i = 0; i < _beneficiaries.length; i++) {
whitelist[_beneficiaries[i]] = true;
}
}
// Исключить адрес из whitelist
function removeFromWhitelist(address _beneficiary) public onlyOwner {
whitelist[_beneficiary] = false;
}
// Узнать истек ли срок проведения PreICO
function hasPreICOClosed() public view returns (bool) {
return now > preICOEndDate;
}
// Узнать истек ли срок проведения ICO
function hasICOClosed() public view returns (bool) {
return now > ICOEndDate;
}
// Перевести собранные средства на кошелек для сбора
function forwardFunds () public onlyOwner {
require(now > ICOEndDate);
require((preICOWeiRaised.add(ICOWeiRaised)).mul(ETHUSD).div(10**18) >= softcap);
wallet.transfer(ICOWeiRaised);
}
// Вернуть проинвестированные средства, если не был достигнут softcap
function refund() public {
require(now > ICOEndDate);
require(preICOWeiRaised.add(ICOWeiRaised).mul(ETHUSD).div(10**18) < softcap);
require(investors[msg.sender] > 0);
address investor = msg.sender;
investor.transfer(investors[investor]);
}
/* Внутренние методы */
// Проверка актуальности PreICO
function _isPreICO() internal view returns(bool) {
return now >= preICOStartDate && now < preICOEndDate;
}
// Проверка актуальности ICO
function _isICO() internal view returns(bool) {
return now >= ICOStartDate && now < ICOEndDate;
}
// Валидация перед покупкой токенов
function _preValidatePreICOPurchase(address _beneficiary, uint256 _weiAmount) internal view {
require(_weiAmount != 0);
require(now >= preICOStartDate && now <= preICOEndDate);
}
function _preValidateICOPurchase(address _beneficiary, uint256 _weiAmount) internal view {
require(_weiAmount != 0);
require(whitelist[_beneficiary]);
require((preICOWeiRaised + ICOWeiRaised + _weiAmount).mul(ETHUSD).div(10**18) <= hardcap);
require(now >= ICOStartDate && now <= ICOEndDate);
}
// Подсчет бонусов с учетом бонусов за этап ICO и объем инвестиций
function _getTokenAmountWithBonus(uint256 _weiAmount) internal view returns(uint256) {
uint256 baseTokenAmount = _weiAmount.mul(rate);
uint256 tokenAmount = baseTokenAmount;
uint256 usdAmount = _weiAmount.mul(ETHUSD).div(10**18);
// Считаем бонусы за объем инвестиций
if(usdAmount >= 10000000){
tokenAmount = tokenAmount.add(baseTokenAmount.mul(7).div(100));
} else if(usdAmount >= 5000000){
tokenAmount = tokenAmount.add(baseTokenAmount.mul(5).div(100));
} else if(usdAmount >= 1000000){
tokenAmount = tokenAmount.add(baseTokenAmount.mul(3).div(100));
}
// Считаем бонусы за этап ICO
if(now < ICOStartDate + 15 days) {
tokenAmount = tokenAmount.add(baseTokenAmount.mul(20).div(100));
} else if(now < ICOStartDate + 28 days) {
tokenAmount = tokenAmount.add(baseTokenAmount.mul(15).div(100));
} else if(now < ICOStartDate + 42 days) {
tokenAmount = tokenAmount.add(baseTokenAmount.mul(10).div(100));
} else {
tokenAmount = tokenAmount.add(baseTokenAmount.mul(5).div(100));
}
return tokenAmount;
}
// Подсчет бонусов с учетом бонусов реферальной системы
function _getTokenAmountWithReferal(uint256 _weiAmount, uint8 _percent) internal view returns(uint256) {
return _weiAmount.mul(rate).mul(_percent).div(100);
}
// Перевод токенов
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
token.mint(_beneficiary, _tokenAmount);
}
} | 0x6060604052600436106101a0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806285c64714610421578063144fa6d7146104445780631778f1df1461047d57806320a0128e146104a65780632c4e722e146104cf57806343e91384146104f85780634db3c6d71461051b578063521eb2731461054957806353c3fe8a1461059e578063590e1ae3146105cb57806363e0f8c7146105e05780636f7bc9be1461060f578063718dfb7e1461065c57806373db084414610689578063824d1b4b146106b25780638ab1d681146106db5780638c10671c146107145780638da5cb5b1461076e5780639b19251a146107c35780639d735286146108145780639da0dc0a14610829578063a98a6d1914610852578063b071cbe61461087b578063b3335e6b146108a4578063bed315f8146108c7578063c9db1bbf146108ee578063d7237e4514610911578063deaa59df14610940578063e230dfbd14610979578063e43252d71461099c578063e75ea9da146109d5578063f89be593146109fe578063fc0c546a14610a27575b60008060003392503491506101b3610a7c565b15610339576101c28383610a96565b6102116102026101f160646101e3601e600354610ac990919063ffffffff16565b610b0490919063ffffffff16565b600354610b1f90919063ffffffff16565b83610ac990919063ffffffff16565b905061022882600454610b1f90919063ffffffff16565b600481905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050151561029057600080fd5b81600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506102de8382610b3d565b8273ffffffffffffffffffffffffffffffffffffffff167fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f8383604051808381526020018281526020019250505060405180910390a261041c565b610341610c1d565b1561041b576103508383610c37565b61035982610d09565b905061037082600554610b1f90919063ffffffff16565b60058190555081600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506103c48382610b3d565b8273ffffffffffffffffffffffffffffffffffffffff167fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f8383604051808381526020018281526020019250505060405180910390a25b5b505050005b341561042c57600080fd5b6104426004808035906020019091905050610f72565b005b341561044f57600080fd5b61047b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610fe7565b005b341561048857600080fd5b610490611086565b6040518082815260200191505060405180910390f35b34156104b157600080fd5b6104b961108c565b6040518082815260200191505060405180910390f35b34156104da57600080fd5b6104e2611092565b6040518082815260200191505060405180910390f35b341561050357600080fd5b6105196004808035906020019091905050611098565b005b610547600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061110d565b005b341561055457600080fd5b61055c611245565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105a957600080fd5b6105b161126b565b604051808215151515815260200191505060405180910390f35b34156105d657600080fd5b6105de611277565b005b34156105eb57600080fd5b6105f36113b0565b604051808260ff1660ff16815260200191505060405180910390f35b341561061a57600080fd5b610646600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113c3565b6040518082815260200191505060405180910390f35b341561066757600080fd5b61066f6113db565b604051808215151515815260200191505060405180910390f35b341561069457600080fd5b61069c6113e7565b6040518082815260200191505060405180910390f35b34156106bd57600080fd5b6106c56113ed565b6040518082815260200191505060405180910390f35b34156106e657600080fd5b610712600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113f3565b005b341561071f57600080fd5b61076c6004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506114a9565b005b341561077957600080fd5b610781611594565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156107ce57600080fd5b6107fa600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506115b9565b604051808215151515815260200191505060405180910390f35b341561081f57600080fd5b6108276115d9565b005b341561083457600080fd5b61083c6116ff565b6040518082815260200191505060405180910390f35b341561085d57600080fd5b610865611705565b6040518082815260200191505060405180910390f35b341561088657600080fd5b61088e61170b565b6040518082815260200191505060405180910390f35b34156108af57600080fd5b6108c56004808035906020019091905050611711565b005b34156108d257600080fd5b6108ec600480803561ffff16906020019091905050611786565b005b34156108f957600080fd5b61090f6004808035906020019091905050611802565b005b341561091c57600080fd5b610924611877565b604051808260ff1660ff16815260200191505060405180910390f35b341561094b57600080fd5b610977600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061188a565b005b341561098457600080fd5b61099a600480803590602001909190505061194f565b005b34156109a757600080fd5b6109d3600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506119b4565b005b34156109e057600080fd5b6109e8611a6a565b6040518082815260200191505060405180910390f35b3415610a0957600080fd5b610a11611a70565b6040518082815260200191505060405180910390f35b3415610a3257600080fd5b610a3a611a76565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60006007544210158015610a91575060085442105b905090565b60008114151515610aa657600080fd5b6007544210158015610aba57506008544211155b1515610ac557600080fd5b5050565b6000806000841415610ade5760009150610afd565b8284029050828482811515610aef57fe5b04141515610af957fe5b8091505b5092915050565b6000808284811515610b1257fe5b0490508091505092915050565b6000808284019050838110151515610b3357fe5b8091505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1983836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610c0157600080fd5b5af11515610c0e57600080fd5b50505060405180519050505050565b60006009544210158015610c325750600a5442105b905090565b60008114151515610c4757600080fd5b600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c9f57600080fd5b600c54610cd9670de0b6b3a7640000610ccb600654856005546004540101610ac990919063ffffffff16565b610b0490919063ffffffff16565b11151515610ce657600080fd5b6009544210158015610cfa5750600a544211155b1515610d0557600080fd5b5050565b600080600080610d2460035486610ac990919063ffffffff16565b9250829150610d58670de0b6b3a7640000610d4a60065488610ac990919063ffffffff16565b610b0490919063ffffffff16565b90506298968081101515610da657610d9f610d906064610d82600787610ac990919063ffffffff16565b610b0490919063ffffffff16565b83610b1f90919063ffffffff16565b9150610e3c565b624c4b4081101515610df257610deb610ddc6064610dce600587610ac990919063ffffffff16565b610b0490919063ffffffff16565b83610b1f90919063ffffffff16565b9150610e3b565b620f424081101515610e3a57610e37610e286064610e1a600387610ac990919063ffffffff16565b610b0490919063ffffffff16565b83610b1f90919063ffffffff16565b91505b5b5b6213c68060095401421015610e8b57610e84610e756064610e67601487610ac990919063ffffffff16565b610b0490919063ffffffff16565b83610b1f90919063ffffffff16565b9150610f67565b6224ea0060095401421015610eda57610ed3610ec46064610eb6600f87610ac990919063ffffffff16565b610b0490919063ffffffff16565b83610b1f90919063ffffffff16565b9150610f66565b62375f0060095401421015610f2957610f22610f136064610f05600a87610ac990919063ffffffff16565b610b0490919063ffffffff16565b83610b1f90919063ffffffff16565b9150610f65565b610f62610f536064610f45600587610ac990919063ffffffff16565b610b0490919063ffffffff16565b83610b1f90919063ffffffff16565b91505b5b5b819350505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fcd57600080fd5b60075481111515610fdd57600080fd5b8060088190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561104257600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60095481565b600a5481565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110f357600080fd5b6009548111151561110357600080fd5b80600a8190555050565b60008060008060095442101580156111265750600a5442105b151561113157600080fd5b3393503492506111418484610c37565b61116661114f846002611a9c565b61115885610d09565b610b1f90919063ffffffff16565b9150611173836003611a9c565b905061118a83600554610b1f90919063ffffffff16565b60058190555082600f60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111de8483610b3d565b6111e88582610b3d565b8373ffffffffffffffffffffffffffffffffffffffff167fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f8484604051808381526020018281526020019250505060405180910390a25050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a544211905090565b6000600a544211151561128957600080fd5b600b546112d1670de0b6b3a76400006112c36006546112b5600554600454610b1f90919063ffffffff16565b610ac990919063ffffffff16565b610b0490919063ffffffff16565b1015156112dd57600080fd5b6000600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411151561132b57600080fd5b3390508073ffffffffffffffffffffffffffffffffffffffff166108fc600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549081150290604051600060405180830381858888f1935050505015156113ad57600080fd5b50565b600d60009054906101000a900460ff1681565b600f6020528060005260406000206000915090505481565b60006008544211905090565b60065481565b60075481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561144e57600080fd5b6000600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561150657600080fd5b600090505b8151811015611590576001600e6000848481518110151561152857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808060010191505061150b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e6020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561163457600080fd5b600a544211151561164457600080fd5b600b5461168c670de0b6b3a764000061167e600654611670600554600454610b1f90919063ffffffff16565b610ac990919063ffffffff16565b610b0490919063ffffffff16565b1015151561169957600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6005549081150290604051600060405180830381858888f1935050505015156116fd57600080fd5b565b60045481565b60055481565b600c5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561176c57600080fd5b600a548110151561177c57600080fd5b8060098190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117e157600080fd5b60008161ffff161115156117f457600080fd5b8061ffff1660038190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561185d57600080fd5b6008548110151561186d57600080fd5b8060078190555050565b600d60019054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118e557600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff161415151561190b57600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119aa57600080fd5b8060068190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a0f57600080fd5b6001600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60085481565b600b5481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000611adb6064611acd8460ff16611abf60035488610ac990919063ffffffff16565b610ac990919063ffffffff16565b610b0490919063ffffffff16565b9050929150505600a165627a7a72305820155659bce26bf1d6ff5d59f62d4b32ddcef20b70b7d866f5f78cbb8a17a89e0f0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,889 |
0xe83d5fb2c60b3a2597452e248cf7b2f52a7e731e | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract OwnerHelper
{
address public owner;
address public manager;
event ChangeOwner(address indexed _from, address indexed _to);
event ChangeManager(address indexed _from, address indexed _to);
modifier onlyOwner
{
require(msg.sender == owner, "ERROR: Not owner");
_;
}
modifier onlyManagerAndOwner
{
require(msg.sender == manager || msg.sender == owner, "ERROR: Not manager and owner");
_;
}
constructor()
{
owner = msg.sender;
}
function transferOwnership(address _to) onlyOwner public
{
require(_to != owner);
require(_to != manager);
require(_to != address(0x0));
address from = owner;
owner = _to;
emit ChangeOwner(from, _to);
}
function transferManager(address _to) onlyOwner public
{
require(_to != owner);
require(_to != manager);
require(_to != address(0x0));
address from = manager;
manager = _to;
emit ChangeManager(from, _to);
}
}
abstract contract ERC20Interface
{
event Transfer( address indexed _from, address indexed _to, uint _value);
event Approval( address indexed _owner, address indexed _spender, uint _value);
function totalSupply() view virtual public returns (uint _supply);
function balanceOf( address _who ) virtual public view returns (uint _value);
function transfer( address _to, uint _value) virtual public returns (bool _success);
function approve( address _spender, uint _value ) virtual public returns (bool _success);
function allowance( address _owner, address _spender ) virtual public view returns (uint _allowance);
function transferFrom( address _from, address _to, uint _value) virtual public returns (bool _success);
}
contract ARTIC is ERC20Interface, OwnerHelper
{
string public name;
uint public decimals;
string public symbol;
uint constant private E18 = 1000000000000000000;
uint constant private month = 2592000;
// Total 100,000,000
uint constant public maxTotalSupply = 100000000 * E18;
// Sale 10,000,000 (10%)
uint constant public maxSaleSupply = 10000000 * E18;
// Marketing 25,000,000 (25%)
uint constant public maxMktSupply = 25000000 * E18;
// Development 22,000,000 (22%)
uint constant public maxDevSupply = 22000000 * E18;
// EcoSystem 20,000,000 (20%)
uint constant public maxEcoSupply = 20000000 * E18;
// Legal & Compliance 5,000,000 (5%)
uint constant public maxLegalComplianceSupply = 5000000 * E18;
// Team 5,000,000 (5%)
uint constant public maxTeamSupply = 5000000 * E18;
// Advisors 3,000,000 (3%)
uint constant public maxAdvisorSupply = 3000000 * E18;
// Reserve 10,000,000 (10%)
uint constant public maxReserveSupply = 10000000 * E18;
// Lock
uint constant public teamVestingSupply = 500000 * E18;
uint constant public teamVestingLockDate = 12 * month;
uint constant public teamVestingTime = 10;
uint constant public advisorVestingSupply = 750000 * E18;
uint constant public advisorVestingTime = 4;
uint public totalTokenSupply;
uint public tokenIssuedSale;
uint public tokenIssuedMkt;
uint public tokenIssuedDev;
uint public tokenIssuedEco;
uint public tokenIssuedLegalCompliance;
uint public tokenIssuedTeam;
uint public tokenIssuedAdv;
uint public tokenIssuedRsv;
uint public burnTokenSupply;
mapping (address => uint) public balances;
mapping (address => mapping ( address => uint )) public approvals;
mapping (uint => uint) public tmVestingTimer;
mapping (uint => uint) public tmVestingBalances;
mapping (uint => uint) public advVestingTimer;
mapping (uint => uint) public advVestingBalances;
bool public tokenLock = true;
bool public saleTime = true;
uint public endSaleTime = 0;
event SaleIssue(address indexed _to, uint _tokens);
event DevIssue(address indexed _to, uint _tokens);
event EcoIssue(address indexed _to, uint _tokens);
event LegalComplianceIssue(address indexed _to, uint _tokens);
event MktIssue(address indexed _to, uint _tokens);
event RsvIssue(address indexed _to, uint _tokens);
event TeamIssue(address indexed _to, uint _tokens);
event AdvIssue(address indexed _to, uint _tokens);
event Burn(address indexed _from, uint _tokens);
event TokenUnlock(address indexed _to, uint _tokens);
event EndSale(uint _date);
constructor()
{
name = "ARTIC";
decimals = 18;
symbol = "ARTIC";
totalTokenSupply = maxTotalSupply;
balances[owner] = totalTokenSupply;
tokenIssuedSale = 0;
tokenIssuedDev = 0;
tokenIssuedEco = 0;
tokenIssuedLegalCompliance = 0;
tokenIssuedMkt = 0;
tokenIssuedRsv = 0;
tokenIssuedTeam = 0;
tokenIssuedAdv = 0;
burnTokenSupply = 0;
require(maxTeamSupply == teamVestingSupply * teamVestingTime, "ERROR: MaxTeamSupply");
require(maxAdvisorSupply == advisorVestingSupply * advisorVestingTime, "ERROR: MaxAdvisorSupply");
require(maxTotalSupply == maxSaleSupply + maxDevSupply + maxEcoSupply + maxMktSupply + maxReserveSupply + maxTeamSupply + maxAdvisorSupply + maxLegalComplianceSupply, "ERROR: MaxTotalSupply");
}
function totalSupply() view override public returns (uint)
{
return totalTokenSupply;
}
function balanceOf(address _who) view override public returns (uint)
{
return balances[_who];
}
function transfer(address _to, uint _value) override public returns (bool)
{
require(isTransferable() == true);
require(balances[msg.sender] >= _value);
balances[msg.sender] = balances[msg.sender] - _value;
balances[_to] = balances[_to] + _value;
emit Transfer(msg.sender, _to, _value);
return true;
}
function approve(address _spender, uint _value) override public returns (bool)
{
require(isTransferable() == true);
require(balances[msg.sender] >= _value);
approvals[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) view override public returns (uint)
{
return approvals[_owner][_spender];
}
function transferFrom(address _from, address _to, uint _value) override public returns (bool)
{
require(isTransferable() == true);
require(balances[_from] >= _value);
require(approvals[_from][msg.sender] >= _value);
approvals[_from][msg.sender] = approvals[_from][msg.sender] - _value;
balances[_from] = balances[_from] - _value;
balances[_to] = balances[_to] + _value;
emit Transfer(_from, _to, _value);
return true;
}
function saleIssue(address _to) onlyOwner public
{
require(tokenIssuedSale == 0);
uint tokens = maxSaleSupply;
balances[msg.sender] = balances[msg.sender] - tokens;
balances[_to] = balances[_to] + tokens;
tokenIssuedSale = tokenIssuedSale + tokens;
emit SaleIssue(_to, tokens);
}
function devIssue(address _to) onlyOwner public
{
require(saleTime == false);
require(tokenIssuedDev == 0);
uint tokens = maxDevSupply;
balances[msg.sender] = balances[msg.sender] - tokens;
balances[_to] = balances[_to] + tokens;
tokenIssuedDev = tokenIssuedDev + tokens;
emit DevIssue(_to, tokens);
}
function ecoIssue(address _to) onlyOwner public
{
require(saleTime == false);
require(tokenIssuedEco == 0);
uint tokens = maxEcoSupply;
balances[msg.sender] = balances[msg.sender] - tokens;
balances[_to] = balances[_to] + tokens;
tokenIssuedEco = tokenIssuedEco + tokens;
emit EcoIssue(_to, tokens);
}
function mktIssue(address _to) onlyOwner public
{
require(saleTime == false);
require(tokenIssuedMkt == 0);
uint tokens = maxMktSupply;
balances[msg.sender] = balances[msg.sender] - tokens;
balances[_to] = balances[_to] + tokens;
tokenIssuedMkt = tokenIssuedMkt + tokens;
emit MktIssue(_to, tokens);
}
function legalComplianceIssue(address _to) onlyOwner public
{
require(saleTime == false);
require(tokenIssuedLegalCompliance == 0);
uint tokens = maxLegalComplianceSupply;
balances[msg.sender] = balances[msg.sender] - tokens;
balances[_to] = balances[_to] + tokens;
tokenIssuedLegalCompliance = tokenIssuedLegalCompliance + tokens;
emit LegalComplianceIssue(_to, tokens);
}
function rsvIssue(address _to) onlyOwner public
{
require(saleTime == false);
require(tokenIssuedRsv == 0);
uint tokens = maxReserveSupply;
balances[msg.sender] = balances[msg.sender] - tokens;
balances[_to] = balances[_to] + tokens;
tokenIssuedRsv = tokenIssuedRsv + tokens;
emit RsvIssue(_to, tokens);
}
function teamIssue(address _to, uint _time /* 몇 번째 지급인지 */) onlyOwner public
{
require(saleTime == false);
require( _time < teamVestingTime);
uint nowTime = block.timestamp;
require( nowTime > tmVestingTimer[_time] );
uint tokens = teamVestingSupply;
require(tokens == tmVestingBalances[_time]);
require(maxTeamSupply >= tokenIssuedTeam + tokens);
balances[msg.sender] = balances[msg.sender] - tokens;
balances[_to] = balances[_to] + tokens;
tmVestingBalances[_time] = 0;
tokenIssuedTeam = tokenIssuedTeam + tokens;
emit TeamIssue(_to, tokens);
}
function advisorIssue(address _to, uint _time) onlyOwner public
{
require(saleTime == false);
require( _time < advisorVestingTime);
uint nowTime = block.timestamp;
require( nowTime > advVestingTimer[_time] );
uint tokens = advisorVestingSupply;
require(tokens == advVestingBalances[_time]);
require(maxAdvisorSupply >= tokenIssuedAdv + tokens);
balances[msg.sender] = balances[msg.sender] - tokens;
balances[_to] = balances[_to] + tokens;
advVestingBalances[_time] = 0;
tokenIssuedAdv = tokenIssuedAdv + tokens;
emit AdvIssue(_to, tokens);
}
function isTransferable() private view returns (bool)
{
if(tokenLock == false)
{
return true;
}
else if(msg.sender == owner)
{
return true;
}
return false;
}
function setTokenUnlock() onlyManagerAndOwner public
{
require(tokenLock == true);
require(saleTime == false);
tokenLock = false;
}
function setTokenLock() onlyManagerAndOwner public
{
require(tokenLock == false);
tokenLock = true;
}
function endSale() onlyOwner public
{
require(saleTime == true);
require(maxSaleSupply == tokenIssuedSale);
saleTime = false;
uint nowTime = block.timestamp;
endSaleTime = nowTime;
for(uint i = 0; i < teamVestingTime; i++)
{
tmVestingTimer[i] = endSaleTime + teamVestingLockDate + (i * month);
tmVestingBalances[i] = teamVestingSupply;
}
for(uint i = 0; i < advisorVestingTime; i++)
{
advVestingTimer[i] = endSaleTime + (3 * i * month);
advVestingBalances[i] = advisorVestingSupply;
}
emit EndSale(endSaleTime);
}
function burnToken(uint _value) onlyManagerAndOwner public
{
uint tokens = _value * E18;
require(balances[msg.sender] >= tokens);
balances[msg.sender] = balances[msg.sender] - tokens;
burnTokenSupply = burnTokenSupply + tokens;
totalTokenSupply = totalTokenSupply - tokens;
emit Burn(msg.sender, tokens);
}
function close() onlyOwner public
{
selfdestruct(payable(msg.sender));
}
} | 0x608060405234801561001057600080fd5b50600436106103995760003560e01c80636298124b116101e9578063b29418d51161010f578063de272835116100ad578063f1f5cfa41161007c578063f1f5cfa41461066c578063f2fde38b14610674578063fcdd04bf14610687578063fe3a5abe1461068f57610399565b8063de27283514610641578063de85a4a914610654578063dfcfe4df1461065c578063e718234d1461066457610399565b8063ba0e930a116100e9578063ba0e930a14610613578063cfa15bcd14610626578063cffb47cf146105f0578063dd62ed3e1461062e57610399565b8063b29418d5146105f0578063b35c7218146105f8578063b40433cd1461060057610399565b80638da5cb5b11610187578063a32ce11e11610156578063a32ce11e146105ba578063a4381450146105cd578063a711b664146105d5578063a9059cbb146105dd57610399565b80638da5cb5b1461059a5780638ece19f6146105a257806395d89b41146105aa57806398d9eea0146105b257610399565b806375d0281d116101c357806375d0281d1461056f5780637b47ec1a14610577578063843008591461058a5780638a4192b51461059257610399565b80636298124b146105415780636f7fc9891461054957806370a082311461055c57610399565b806327e235e3116102ce5780633da83adb1161026c5780634bea6a0f1161023b5780634bea6a0f1461050b5780634fb2cebe1461051e57806358371ccd146105265780635c3eee8d1461052e57610399565b80633da83adb146104db57806343d726d6146104ee578063481c6a75146104f65780634b2596c71461040c57610399565b80632d94e929116102a85780632d94e929146104b05780632f26927f146104c3578063313ce567146104cb578063380d831b146104d357610399565b806327e235e31461048257806328b238ff146104955780632ab4d052146104a857610399565b80631991785d1161033b578063206bc0a011610315578063206bc0a01461044c57806322b0aa471461045457806323b872dd1461045c57806324054d571461046f57610399565b80631991785d146104295780631ca8b6cb1461043c5780631dd9677d1461044457610399565b8063145ca08811610377578063145ca088146103f15780631596facb14610404578063163bc7301461040c57806318160ddd1461042157610399565b806306fdde031461039e578063095ea7b3146103bc57806309a74aff146103dc575b600080fd5b6103a6610697565b6040516103b39190611c1e565b60405180910390f35b6103cf6103ca366004611bbe565b610725565b6040516103b39190611c13565b6103ef6103ea366004611b30565b6107c4565b005b6103ef6103ff366004611b30565b6108ed565b6103cf610a01565b610414610a0f565b6040516103b39190611cd2565b610414610a27565b6103ef610437366004611b30565b610a2e565b610414610b41565b610414610b47565b610414610b4d565b610414610b53565b6103cf61046a366004611b83565b610b59565b61041461047d366004611be7565b610cc5565b610414610490366004611b30565b610cd7565b6104146104a3366004611be7565b610ce9565b610414610cfb565b6103ef6104be366004611b30565b610d11565b610414610e24565b610414610e2a565b6103ef610e30565b6103ef6104e9366004611b30565b610fdf565b6103ef6110dd565b6104fe61110a565b6040516103b39190611bff565b610414610519366004611be7565b611119565b61041461112b565b610414611131565b6103ef61053c366004611b30565b611137565b61041461124b565b6103ef610557366004611bbe565b611250565b61041461056a366004611b30565b6113e6565b610414611405565b6103ef610585366004611be7565b61141a565b6103ef61150b565b61041461157f565b6104fe611585565b6103ef611594565b6103a66115f2565b6104146115ff565b6104146105c8366004611b51565b611615565b610414611632565b610414611648565b6103cf6105eb366004611bbe565b61165d565b610414611728565b61041461173d565b61041461060e366004611be7565b611742565b6103ef610621366004611b30565b611754565b610414611819565b61041461063c366004611b51565b61181f565b6103ef61064f366004611bbe565b61184a565b6104146119d2565b6104146119d8565b6103cf6119ed565b6104146119f6565b6103ef610682366004611b30565b611a04565b610414611ac7565b610414611acd565b600280546106a490611d29565b80601f01602080910402602001604051908101604052809291908181526020018280546106d090611d29565b801561071d5780601f106106f25761010080835404028352916020019161071d565b820191906000526020600020905b81548152906001019060200180831161070057829003601f168201915b505050505081565b600061072f611ae3565b151560011461073d57600080fd5b336000908152600f602052604090205482111561075957600080fd5b3360008181526010602090815260408083206001600160a01b03881680855292529182902085905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906107b3908690611cd2565b60405180910390a350600192915050565b6000546001600160a01b031633146107f75760405162461bcd60e51b81526004016107ee90611c71565b60405180910390fd5b601554610100900460ff161561080c57600080fd5b6009541561081957600080fd5b6000610831670de0b6b3a76400006301312d00611cf3565b336000908152600f602052604090205490915061084f908290611d12565b336000908152600f6020526040808220929092556001600160a01b0384168152205461087c908290611cdb565b6001600160a01b0383166000908152600f60205260409020556009546108a3908290611cdb565b6009556040516001600160a01b038316907ffb82a38b8698912e57310737cb4c62e69bf4fd9b4ef22fd4d13fd7608bb6ed16906108e1908490611cd2565b60405180910390a25050565b6000546001600160a01b031633146109175760405162461bcd60e51b81526004016107ee90611c71565b601554610100900460ff161561092c57600080fd5b6007541561093957600080fd5b6000610951670de0b6b3a764000063017d7840611cf3565b336000908152600f602052604090205490915061096f908290611d12565b336000908152600f6020526040808220929092556001600160a01b0384168152205461099c908290611cdb565b6001600160a01b0383166000908152600f60205260409020556007546109c3908290611cdb565b6007556040516001600160a01b038316907f0c17226450db6e575fa6cef1e6c9972cb00d826dbd529639acc6bca7b663b3a9906108e1908490611cd2565b601554610100900460ff1681565b610a24670de0b6b3a7640000624c4b40611cf3565b81565b6005545b90565b6000546001600160a01b03163314610a585760405162461bcd60e51b81526004016107ee90611c71565b601554610100900460ff1615610a6d57600080fd5b600a5415610a7a57600080fd5b6000610a91670de0b6b3a7640000624c4b40611cf3565b336000908152600f6020526040902054909150610aaf908290611d12565b336000908152600f6020526040808220929092556001600160a01b03841681522054610adc908290611cdb565b6001600160a01b0383166000908152600f6020526040902055600a54610b03908290611cdb565b600a556040516001600160a01b038316907fe4b1ef194b45b0e288574a5e917879d47cd13e06bfccf8a51033ab4597e8410f906108e1908490611cd2565b60055481565b600a5481565b60065481565b600e5481565b6000610b63611ae3565b1515600114610b7157600080fd5b6001600160a01b0384166000908152600f6020526040902054821115610b9657600080fd5b6001600160a01b0384166000908152601060209081526040808320338452909152902054821115610bc657600080fd5b6001600160a01b0384166000908152601060209081526040808320338452909152902054610bf5908390611d12565b6001600160a01b0385166000818152601060209081526040808320338452825280832094909455918152600f9091522054610c31908390611d12565b6001600160a01b038086166000908152600f60205260408082209390935590851681522054610c61908390611cdb565b6001600160a01b038085166000818152600f602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610cb3908690611cd2565b60405180910390a35060019392505050565b60136020526000908152604090205481565b600f6020526000908152604090205481565b60116020526000908152604090205481565b610a24670de0b6b3a76400006305f5e100611cf3565b6000546001600160a01b03163314610d3b5760405162461bcd60e51b81526004016107ee90611c71565b601554610100900460ff1615610d5057600080fd5b600d5415610d5d57600080fd5b6000610d74670de0b6b3a764000062989680611cf3565b336000908152600f6020526040902054909150610d92908290611d12565b336000908152600f6020526040808220929092556001600160a01b03841681522054610dbf908290611cdb565b6001600160a01b0383166000908152600f6020526040902055600d54610de6908290611cdb565b600d556040516001600160a01b038316907faca354954677423ee264fe27e97d8a8ab13d9bc9b0820383bacaa6e462a19285906108e1908490611cd2565b60095481565b60035481565b6000546001600160a01b03163314610e5a5760405162461bcd60e51b81526004016107ee90611c71565b60155460ff610100909104161515600114610e7457600080fd5b600654610e8c670de0b6b3a764000062989680611cf3565b14610e9657600080fd5b6015805461ff001916905542601681905560005b600a811015610f2a57610ec062278d0082611cf3565b610ece62278d00600c611cf3565b601654610edb9190611cdb565b610ee59190611cdb565b600082815260116020526040902055610f09670de0b6b3a76400006207a120611cf3565b60008281526012602052604090205580610f2281611d64565b915050610eaa565b5060005b6004811015610fa25762278d00610f46826003611cf3565b610f509190611cf3565b601654610f5d9190611cdb565b600082815260136020526040902055610f81670de0b6b3a7640000620b71b0611cf3565b60008281526014602052604090205580610f9a81611d64565b915050610f2e565b507f94173af9e1cd5351395663e6a7838552ea54f5233d0c38bc46de5f4915b302bf601654604051610fd49190611cd2565b60405180910390a150565b6000546001600160a01b031633146110095760405162461bcd60e51b81526004016107ee90611c71565b6006541561101657600080fd5b600061102d670de0b6b3a764000062989680611cf3565b336000908152600f602052604090205490915061104b908290611d12565b336000908152600f6020526040808220929092556001600160a01b03841681522054611078908290611cdb565b6001600160a01b0383166000908152600f602052604090205560065461109f908290611cdb565b6006556040516001600160a01b038316907f07c5eb0c2da0dd34a57523f87ea471b21890f00a504311f9959b3fd2d8120864906108e1908490611cd2565b6000546001600160a01b031633146111075760405162461bcd60e51b81526004016107ee90611c71565b33ff5b6001546001600160a01b031681565b60146020526000908152604090205481565b600d5481565b60165481565b6000546001600160a01b031633146111615760405162461bcd60e51b81526004016107ee90611c71565b601554610100900460ff161561117657600080fd5b6008541561118357600080fd5b600061119b670de0b6b3a764000063014fb180611cf3565b336000908152600f60205260409020549091506111b9908290611d12565b336000908152600f6020526040808220929092556001600160a01b038416815220546111e6908290611cdb565b6001600160a01b0383166000908152600f602052604090205560085461120d908290611cdb565b6008556040516001600160a01b038316907f423b24fc1468543b83ba5fa3c1d3b8a9c95265103a9ef54b0eecdc33eac6c386906108e1908490611cd2565b600481565b6000546001600160a01b0316331461127a5760405162461bcd60e51b81526004016107ee90611c71565b601554610100900460ff161561128f57600080fd5b600a811061129c57600080fd5b600081815260116020526040902054429081116112b857600080fd5b60006112cf670de0b6b3a76400006207a120611cf3565b60008481526012602052604090205490915081146112ec57600080fd5b80600b546112fa9190611cdb565b61130f670de0b6b3a7640000624c4b40611cf3565b101561131a57600080fd5b336000908152600f6020526040902054611335908290611d12565b336000908152600f6020526040808220929092556001600160a01b03861681522054611362908290611cdb565b6001600160a01b0385166000908152600f60209081526040808320939093558582526012905290812055600b5461139a908290611cdb565b600b556040516001600160a01b038516907fb07ce9bd9a0d0e9adec838711c53cbe1430a690e9c520e9232dc9478dbd85f31906113d8908490611cd2565b60405180910390a250505050565b6001600160a01b0381166000908152600f60205260409020545b919050565b610a24670de0b6b3a76400006207a120611cf3565b6001546001600160a01b031633148061143d57506000546001600160a01b031633145b6114595760405162461bcd60e51b81526004016107ee90611c9b565b600061146d670de0b6b3a764000083611cf3565b336000908152600f602052604090205490915081111561148c57600080fd5b336000908152600f60205260409020546114a7908290611d12565b336000908152600f6020526040902055600e546114c5908290611cdb565b600e556005546114d6908290611d12565b60055560405133907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5906108e1908490611cd2565b6001546001600160a01b031633148061152e57506000546001600160a01b031633145b61154a5760405162461bcd60e51b81526004016107ee90611c9b565b60155460ff16151560011461155e57600080fd5b601554610100900460ff161561157357600080fd5b6015805460ff19169055565b60085481565b6000546001600160a01b031681565b6001546001600160a01b03163314806115b757506000546001600160a01b031633145b6115d35760405162461bcd60e51b81526004016107ee90611c9b565b60155460ff16156115e357600080fd5b6015805460ff19166001179055565b600480546106a490611d29565b610a24670de0b6b3a764000063014fb180611cf3565b601060209081526000928352604080842090915290825290205481565b610a24670de0b6b3a764000063017d7840611cf3565b610a24670de0b6b3a7640000622dc6c0611cf3565b6000611667611ae3565b151560011461167557600080fd5b336000908152600f602052604090205482111561169157600080fd5b336000908152600f60205260409020546116ac908390611d12565b336000908152600f6020526040808220929092556001600160a01b038516815220546116d9908390611cdb565b6001600160a01b0384166000818152600f60205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906107b3908690611cd2565b610a24670de0b6b3a764000062989680611cf3565b600a81565b60126020526000908152604090205481565b6000546001600160a01b0316331461177e5760405162461bcd60e51b81526004016107ee90611c71565b6000546001600160a01b038281169116141561179957600080fd5b6001546001600160a01b03828116911614156117b457600080fd5b6001600160a01b0381166117c757600080fd5b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f034ab062c9c6c8ddd60650a40372b1d413588174682d4ca1a4e53aa37589ab2d90600090a35050565b600b5481565b6001600160a01b03918216600090815260106020908152604080832093909416825291909152205490565b6000546001600160a01b031633146118745760405162461bcd60e51b81526004016107ee90611c71565b601554610100900460ff161561188957600080fd5b6004811061189657600080fd5b600081815260136020526040902054429081116118b257600080fd5b60006118c9670de0b6b3a7640000620b71b0611cf3565b60008481526014602052604090205490915081146118e657600080fd5b80600c546118f49190611cdb565b611909670de0b6b3a7640000622dc6c0611cf3565b101561191457600080fd5b336000908152600f602052604090205461192f908290611d12565b336000908152600f6020526040808220929092556001600160a01b0386168152205461195c908290611cdb565b6001600160a01b0385166000908152600f60209081526040808320939093558582526014905290812055600c54611994908290611cdb565b600c556040516001600160a01b038516907f56a6fddb955645d0f5363bcc838146414092bb86a5afedd1400dcf33cba5bad9906113d8908490611cd2565b60075481565b610a24670de0b6b3a7640000620b71b0611cf3565b60155460ff1681565b610a2462278d00600c611cf3565b6000546001600160a01b03163314611a2e5760405162461bcd60e51b81526004016107ee90611c71565b6000546001600160a01b0382811691161415611a4957600080fd5b6001546001600160a01b0382811691161415611a6457600080fd5b6001600160a01b038116611a7757600080fd5b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f9aecf86140d81442289f667eb72e1202a8fbb3478a686659952e145e853196569190a35050565b600c5481565b610a24670de0b6b3a76400006301312d00611cf3565b60155460009060ff16611af857506001610a2b565b6000546001600160a01b0316331415611b1357506001610a2b565b50600090565b80356001600160a01b038116811461140057600080fd5b600060208284031215611b41578081fd5b611b4a82611b19565b9392505050565b60008060408385031215611b63578081fd5b611b6c83611b19565b9150611b7a60208401611b19565b90509250929050565b600080600060608486031215611b97578081fd5b611ba084611b19565b9250611bae60208501611b19565b9150604084013590509250925092565b60008060408385031215611bd0578182fd5b611bd983611b19565b946020939093013593505050565b600060208284031215611bf8578081fd5b5035919050565b6001600160a01b0391909116815260200190565b901515815260200190565b6000602080835283518082850152825b81811015611c4a57858101830151858201604001528201611c2e565b81811115611c5b5783604083870101525b50601f01601f1916929092016040019392505050565b60208082526010908201526f22a92927a91d102737ba1037bbb732b960811b604082015260600190565b6020808252601c908201527f4552524f523a204e6f74206d616e6167657220616e64206f776e657200000000604082015260600190565b90815260200190565b60008219821115611cee57611cee611d7f565b500190565b6000816000190483118215151615611d0d57611d0d611d7f565b500290565b600082821015611d2457611d24611d7f565b500390565b600281046001821680611d3d57607f821691505b60208210811415611d5e57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611d7857611d78611d7f565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220ba81fa468599cc766d476d782d037bcf906c49e56c80c50d9b5592e88417b5aa64736f6c63430008000033 | {"success": true, "error": null, "results": {}} | 1,890 |
0xeC4d93c3563A0336001640eE2f8b2180B288Cc17 | /*
Telegram - t.me/SaveUAnimalsPortal
Website - saveuanimals.com
*/
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
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 SaveUAnimals is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "SaveUAnimals";//
string private constant _symbol = "SUA";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 4;
//Sell Fee
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 4;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x1B6390Be6E2055257feF28EDbEe6571265526602);
address payable private _marketingAddress = payable(0x1B6390Be6E2055257feF28EDbEe6571265526602);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = 1;
_taxFee = 4;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(block.number > launchBlock + 3){
_taxFeeOnSell = 98;
}
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 OpenTrading() public onlyOwner {
if (!tradingOpen) {
tradingOpen = true;
launchBlock = block.number;
}
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _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 removeLimits() public onlyOwner {
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
} | 0x60806040526004361061016a5760003560e01c8063715018a6116100d157806398a5c3151161008a578063c3c8cd8011610064578063c3c8cd8014610438578063d00efb2f1461044d578063dd62ed3e14610463578063f2fde38b146104a957600080fd5b806398a5c315146103c8578063a9059cbb146103e8578063bfd792841461040857600080fd5b8063715018a614610328578063751039fc1461033d5780637d1db4a5146103525780638da5cb5b146103685780638f9a55c01461038657806395d89b411461039c57600080fd5b8063313ce56711610123578063313ce5671461028057806349bd5a5e1461029c57806351cd7cc3146102bc5780636d8aa8f8146102d35780636fc3eaec146102f357806370a082311461030857600080fd5b806306fdde0314610176578063095ea7b3146101bd5780631694505e146101ed57806318160ddd1461022557806323b872dd1461024a5780632fd689e31461026a57600080fd5b3661017157005b600080fd5b34801561018257600080fd5b5060408051808201909152600c81526b5361766555416e696d616c7360a01b60208201525b6040516101b49190611827565b60405180910390f35b3480156101c957600080fd5b506101dd6101d83660046117c4565b6104c9565b60405190151581526020016101b4565b3480156101f957600080fd5b5060155461020d906001600160a01b031681565b6040516001600160a01b0390911681526020016101b4565b34801561023157600080fd5b50670de0b6b3a76400005b6040519081526020016101b4565b34801561025657600080fd5b506101dd610265366004611784565b6104e0565b34801561027657600080fd5b5061023c60195481565b34801561028c57600080fd5b50604051600981526020016101b4565b3480156102a857600080fd5b5060165461020d906001600160a01b031681565b3480156102c857600080fd5b506102d1610549565b005b3480156102df57600080fd5b506102d16102ee3660046117ef565b6105a7565b3480156102ff57600080fd5b506102d16105ef565b34801561031457600080fd5b5061023c610323366004611714565b61063a565b34801561033457600080fd5b506102d161065c565b34801561034957600080fd5b506102d16106d0565b34801561035e57600080fd5b5061023c60175481565b34801561037457600080fd5b506000546001600160a01b031661020d565b34801561039257600080fd5b5061023c60185481565b3480156103a857600080fd5b5060408051808201909152600381526253554160e81b60208201526101a7565b3480156103d457600080fd5b506102d16103e336600461180f565b61070d565b3480156103f457600080fd5b506101dd6104033660046117c4565b61073c565b34801561041457600080fd5b506101dd610423366004611714565b60116020526000908152604090205460ff1681565b34801561044457600080fd5b506102d1610749565b34801561045957600080fd5b5061023c60085481565b34801561046f57600080fd5b5061023c61047e36600461174c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156104b557600080fd5b506102d16104c4366004611714565b61079d565b60006104d6338484610887565b5060015b92915050565b60006104ed8484846109ab565b61053f843361053a856040518060600160405280602881526020016119b9602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f7f565b610887565b5060019392505050565b6000546001600160a01b0316331461057c5760405162461bcd60e51b81526004016105739061187a565b60405180910390fd5b601654600160a01b900460ff166105a5576016805460ff60a01b1916600160a01b179055436008555b565b6000546001600160a01b031633146105d15760405162461bcd60e51b81526004016105739061187a565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b0316148061062457506014546001600160a01b0316336001600160a01b0316145b61062d57600080fd5b4761063781610fb9565b50565b6001600160a01b0381166000908152600260205260408120546104da90611042565b6000546001600160a01b031633146106865760405162461bcd60e51b81526004016105739061187a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106fa5760405162461bcd60e51b81526004016105739061187a565b670de0b6b3a76400006017819055601855565b6000546001600160a01b031633146107375760405162461bcd60e51b81526004016105739061187a565b601955565b60006104d63384846109ab565b6013546001600160a01b0316336001600160a01b0316148061077e57506014546001600160a01b0316336001600160a01b0316145b61078757600080fd5b60006107923061063a565b9050610637816110c6565b6000546001600160a01b031633146107c75760405162461bcd60e51b81526004016105739061187a565b6001600160a01b03811661082c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610573565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166108e95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610573565b6001600160a01b03821661094a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610573565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610a0f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610573565b6001600160a01b038216610a715760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610573565b60008111610ad35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610573565b6000546001600160a01b03848116911614801590610aff57506000546001600160a01b03838116911614155b15610e7257601654600160a01b900460ff16610b98576000546001600160a01b03848116911614610b985760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610573565b601754811115610bea5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610573565b6001600160a01b03831660009081526011602052604090205460ff16158015610c2c57506001600160a01b03821660009081526011602052604090205460ff16155b610c845760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610573565b6008544311158015610ca357506016546001600160a01b038481169116145b8015610cbd57506015546001600160a01b03838116911614155b8015610cd257506001600160a01b0382163014155b15610cfb576001600160a01b0382166000908152601160205260409020805460ff191660011790555b600854610d0990600361191f565b431115610d16576062600c555b6016546001600160a01b03838116911614610d9b5760185481610d388461063a565b610d42919061191f565b10610d9b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610573565b6000610da63061063a565b601954601754919250821015908210610dbf5760175491505b808015610dd65750601654600160a81b900460ff16155b8015610df057506016546001600160a01b03868116911614155b8015610e055750601654600160b01b900460ff165b8015610e2a57506001600160a01b03851660009081526005602052604090205460ff16155b8015610e4f57506001600160a01b03841660009081526005602052604090205460ff16155b15610e6f57610e5d826110c6565b478015610e6d57610e6d47610fb9565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610eb457506001600160a01b03831660009081526005602052604090205460ff165b80610ee657506016546001600160a01b03858116911614801590610ee657506016546001600160a01b03848116911614155b15610ef357506000610f6d565b6016546001600160a01b038581169116148015610f1e57506015546001600160a01b03848116911614155b15610f3057600954600d55600a54600e555b6016546001600160a01b038481169116148015610f5b57506015546001600160a01b03858116911614155b15610f6d57600b54600d55600c54600e555b610f798484848461126b565b50505050565b60008184841115610fa35760405162461bcd60e51b81526004016105739190611827565b506000610fb08486611976565b95945050505050565b6013546001600160a01b03166108fc610fd3836002611297565b6040518115909202916000818181858888f19350505050158015610ffb573d6000803e3d6000fd5b506014546001600160a01b03166108fc611016836002611297565b6040518115909202916000818181858888f1935050505015801561103e573d6000803e3d6000fd5b5050565b60006006548211156110a95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610573565b60006110b36112d9565b90506110bf8382611297565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061111c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561117057600080fd5b505afa158015611184573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a89190611730565b816001815181106111c957634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526015546111ef9130911684610887565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906112289085906000908690309042906004016118af565b600060405180830381600087803b15801561124257600080fd5b505af1158015611256573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b80611278576112786112fc565b61128384848461131f565b80610f7957610f796001600d556004600e55565b60006110bf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611416565b60008060006112e6611444565b90925090506112f58282611297565b9250505090565b600d5415801561130c5750600e54155b1561131357565b6000600d819055600e55565b60008060008060008061133187611484565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061136390876114e1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113929086611523565b6001600160a01b0389166000908152600260205260409020556113b481611582565b6113be84836115cc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161140391815260200190565b60405180910390a3505050505050505050565b600081836114375760405162461bcd60e51b81526004016105739190611827565b506000610fb08486611937565b6006546000908190670de0b6b3a764000061145f8282611297565b82101561147b57505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006114a18a600d54600e546115f0565b92509250925060006114b16112d9565b905060008060006114c48e878787611645565b919e509c509a509598509396509194505050505091939550919395565b60006110bf83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f7f565b600080611530838561191f565b9050838110156110bf5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610573565b600061158c6112d9565b9050600061159a8383611695565b306000908152600260205260409020549091506115b79082611523565b30600090815260026020526040902055505050565b6006546115d990836114e1565b6006556007546115e99082611523565b6007555050565b600080808061160a60646116048989611695565b90611297565b9050600061161d60646116048a89611695565b905060006116358261162f8b866114e1565b906114e1565b9992985090965090945050505050565b60008080806116548886611695565b905060006116628887611695565b905060006116708888611695565b905060006116828261162f86866114e1565b939b939a50919850919650505050505050565b6000826116a4575060006104da565b60006116b08385611957565b9050826116bd8583611937565b146110bf5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610573565b600060208284031215611725578081fd5b81356110bf816119a3565b600060208284031215611741578081fd5b81516110bf816119a3565b6000806040838503121561175e578081fd5b8235611769816119a3565b91506020830135611779816119a3565b809150509250929050565b600080600060608486031215611798578081fd5b83356117a3816119a3565b925060208401356117b3816119a3565b929592945050506040919091013590565b600080604083850312156117d6578182fd5b82356117e1816119a3565b946020939093013593505050565b600060208284031215611800578081fd5b813580151581146110bf578182fd5b600060208284031215611820578081fd5b5035919050565b6000602080835283518082850152825b8181101561185357858101830151858201604001528201611837565b818111156118645783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156118fe5784516001600160a01b0316835293830193918301916001016118d9565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119325761193261198d565b500190565b60008261195257634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156119715761197161198d565b500290565b6000828210156119885761198861198d565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461063757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201bf942e72e2a5e9c476bec97c4576195d8caadc46b25a6a8f8106df0c682982464736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,891 |
0x0efc1ae553ee19119bf7f55c9464fcec5868c1b8 | /**
*Submitted for verification at Etherscan.io on 2022-04-17
*/
/**
🐧LoveBirds🐧-Going to Super meme coin
Will be fair launch
Info
🚀 2,000,000,000 Max buy at start
🚀 100,000,000,000 tokens total
Tokenomics
Tax:
🐧 6% goes to marketing marketing
🐧 2% goes to dev wallet
🐧 2% liquidity tax
Our Tg: https://t.me/lovebirdstoken
*/
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 LoveBirds is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "LoveBirds";
string private constant _symbol = "LoveBirds";
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(0x5BB0906B7303ED055Cb73f5B5ba088A39bCa4809);
_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 = 1000000000 * 10**9;
_maxWalletSize = 2000000000 * 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);
}
} | 0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600981526020017f4c6f766542697264730000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4c6f766542697264730000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550670de0b6b3a7640000600f81905550671bc16d674ec800006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a81905550600a600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a81905550600a600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061233368056bc75e2d63100000600854611cf790919063ffffffff16565b8210156123525760085468056bc75e2d6310000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122067293ac4fe5c4aeddb535ea935738356496ebadc6e0bb1cd0f2a810a1cedc11964736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,892 |
0x8531b6118c70924bfce5643d0e4306631418648c | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.7.0;
// File: SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
// assert(_b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return _a / _b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
}
// File: FrozenChecker.sol
/**
* @title FrozenChecker
* @dev Check account by frozen rules
*/
library FrozenChecker {
using SafeMath for uint256;
/**
* Rule for each address
*/
struct Rule {
uint256 timeT;
uint8 initPercent;
uint256[] periods;
uint8[] percents;
}
function check(Rule storage self, uint256 totalFrozenValue) internal view returns (uint256) {
if (totalFrozenValue == uint256(0)) {
return 0;
}
//uint8 temp = self.initPercent;
if (self.timeT == uint256(0) || self.timeT > block.timestamp) {
return totalFrozenValue.sub(totalFrozenValue.mul(self.initPercent).div(100));
}
for (uint256 i = 0; i < self.periods.length.sub(1); i = i.add(1)) {
if (block.timestamp >= self.timeT.add(self.periods[i]) && block.timestamp < self.timeT.add(self.periods[i.add(1)])) {
return totalFrozenValue.sub(totalFrozenValue.mul(self.percents[i]).div(100));
}
}
if (block.timestamp >= self.timeT.add(self.periods[self.periods.length.sub(1)])) {
return totalFrozenValue.sub(totalFrozenValue.mul(self.percents[self.periods.length.sub(1)]).div(100));
}
return 0;
}
}
// File: FrozenValidator.sol
library FrozenValidator {
using SafeMath for uint256;
using FrozenChecker for FrozenChecker.Rule;
struct Validator {
mapping(address => IndexValue) data;
KeyFlag[] keys;
uint256 size;
}
struct IndexValue {
uint256 keyIndex;
FrozenChecker.Rule rule;
mapping (address => uint256) frozenBalances;
}
struct KeyFlag {
address key;
bool deleted;
}
function addRule(Validator storage self, address key, uint8 initPercent, uint256[] memory periods, uint8[] memory percents) internal returns (bool replaced) {
//require(self.size <= 10);
require(key != address(0));
require(periods.length == percents.length);
require(periods.length > 0);
require(periods[0] == uint256(0));
require(initPercent <= percents[0]);
for (uint256 i = 1; i < periods.length; i = i.add(1)) {
require(periods[i.sub(1)] < periods[i]);
require(percents[i.sub(1)] <= percents[i]);
}
require(percents[percents.length.sub(1)] == 100);
FrozenChecker.Rule memory rule = FrozenChecker.Rule(0, initPercent, periods, percents);
uint256 keyIndex = self.data[key].keyIndex;
self.data[key].rule = rule;
if (keyIndex > 0) {
return true;
} else {
//keyIndex = self.keys.length++;
keyIndex = self.keys.length;
self.keys.push();
self.data[key].keyIndex = keyIndex.add(1);
self.keys[keyIndex].key = key;
self.size++;
return false;
}
}
function removeRule(Validator storage self, address key) internal returns (bool success) {
uint256 keyIndex = self.data[key].keyIndex;
if (keyIndex == 0) {
return false;
}
delete self.data[key];
self.keys[keyIndex.sub(1)].deleted = true;
self.size--;
return true;
}
function containRule(Validator storage self, address key) internal view returns (bool) {
return self.data[key].keyIndex > 0;
}
function addTimeT(Validator storage self, address addr, uint256 timeT) internal returns (bool) {
require(timeT > block.timestamp);
self.data[addr].rule.timeT = timeT;
return true;
}
function addFrozenBalance(Validator storage self, address from, address to, uint256 value) internal returns (uint256) {
self.data[from].frozenBalances[to] = self.data[from].frozenBalances[to].add(value);
return self.data[from].frozenBalances[to];
}
function validate(Validator storage self, address addr) internal view returns (uint256) {
uint256 frozenTotal = 0;
for (uint256 i = iterateStart(self); iterateValid(self, i); i = iterateNext(self, i)) {
address ruleaddr = iterateGet(self, i);
FrozenChecker.Rule storage rule = self.data[ruleaddr].rule;
frozenTotal = frozenTotal.add(rule.check(self.data[ruleaddr].frozenBalances[addr]));
}
return frozenTotal;
}
function iterateStart(Validator storage self) internal view returns (uint256 keyIndex) {
return iterateNext(self, uint256(-1));
}
function iterateValid(Validator storage self, uint256 keyIndex) internal view returns (bool) {
return keyIndex < self.keys.length;
}
function iterateNext(Validator storage self, uint256 keyIndex) internal view returns (uint256) {
keyIndex++;
while (keyIndex < self.keys.length && self.keys[keyIndex].deleted) {
keyIndex++;
}
return keyIndex;
}
function iterateGet(Validator storage self, uint256 keyIndex) internal view returns (address) {
return self.keys[keyIndex].key;
}
}
// File: DSCCoin.sol
contract DSCCoin {
using SafeMath for uint256;
using FrozenValidator for FrozenValidator.Validator;
mapping (address => uint256) internal balances;
mapping (address => mapping (address => uint256)) internal allowed;
//-------------------------------- Basic Info -------------------------------------//
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
//-------------------------------- Basic Info -------------------------------------//
//-------------------------------- Admin Info -------------------------------------//
address payable public admin; //Admin address
/**
* @dev Change admin address
* @param newAdmin New admin address
*/
function changeAdmin(address payable newAdmin) public returns (bool) {
require(msg.sender == admin);
require(newAdmin != address(0));
uint256 balAdmin = balances[admin];
balances[newAdmin] = balances[newAdmin].add(balAdmin);
balances[admin] = 0;
admin = newAdmin;
emit Transfer(admin, newAdmin, balAdmin);
return true;
}
//-------------------------------- Admin Info -------------------------------------//
//-------------------------- Events & Constructor ------------------------------//
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
event Mint(address indexed target, uint256 value);
event Burn(address indexed target, uint256 value);
event ChainMapping(address indexed target, uint256 value);
// constructor
constructor(string memory tokenName, string memory tokenSymbol, uint8 tokenDecimals) {
name = tokenName;
symbol = tokenSymbol;
decimals = tokenDecimals;
totalSupply = 0;
admin = msg.sender;
}
//-------------------------- Events & Constructor ------------------------------//
//------------------------------- Mint & Burn ----------------------------------//
function mint(address target, uint256 value) public returns (bool) {
require(msg.sender == admin);
require(!chainMapping);
require(!frozenAccount[target]);
require(block.timestamp > frozenTimestamp[target]);
balances[target] = balances[target].add(value);
totalSupply = totalSupply.add(value);
emit Mint(target, value);
emit Transfer(address(0), target, value);
return true;
}
function burn(address target, uint256 value) public returns (bool) {
require(msg.sender == admin);
require(!chainMapping);
require(!frozenAccount[target]);
require(block.timestamp > frozenTimestamp[target]);
require(totalSupply>=value);
require(balances[target].sub(value)>=validator.validate(target));
balances[target] = balances[target].sub(value);
totalSupply = totalSupply.sub(value);
emit Burn(target, value);
emit Transfer(target, address(0), value);
return true;
}
//------------------------------- Mint & Burn ----------------------------------//
//------------------------------ Account lock -----------------------------------//
// 同一个账户满足任意冻结条件均被冻结
mapping (address => bool) frozenAccount; //无限期冻结的账户
mapping (address => uint256) frozenTimestamp; // 有限期冻结的账户
/**
* 查询账户是否存在锁定时间戳
*/
function getFrozenTimestamp(address _target) public view returns (uint256) {
return frozenTimestamp[_target];
}
/**
* 查询账户是否被锁定
*/
function getFrozenAccount(address _target) public view returns (bool) {
return frozenAccount[_target];
}
/**
* 锁定账户
*/
function freeze(address _target, bool _freeze) public returns (bool) {
require(msg.sender == admin);
require(_target != admin);
frozenAccount[_target] = _freeze;
return true;
}
/**
* 通过时间戳锁定账户
*/
function freezeWithTimestamp(address _target, uint256 _timestamp) public returns (bool) {
require(msg.sender == admin);
require(_target != admin);
frozenTimestamp[_target] = _timestamp;
return true;
}
/**
* 批量锁定账户
*/
function multiFreeze(address[] memory _targets, bool[] memory _freezes) public returns (bool) {
require(msg.sender == admin);
require(_targets.length == _freezes.length);
uint256 len = _targets.length;
require(len > 0);
for (uint256 i = 0; i < len; i = i.add(1)) {
address _target = _targets[i];
require(_target != admin);
bool _freeze = _freezes[i];
frozenAccount[_target] = _freeze;
}
return true;
}
/**
* 批量通过时间戳锁定账户
*/
function multiFreezeWithTimestamp(address[] memory _targets, uint256[] memory _timestamps) public returns (bool) {
require(msg.sender == admin);
require(_targets.length == _timestamps.length);
uint256 len = _targets.length;
require(len > 0);
for (uint256 i = 0; i < len; i = i.add(1)) {
address _target = _targets[i];
require(_target != admin);
uint256 _timestamp = _timestamps[i];
frozenTimestamp[_target] = _timestamp;
}
return true;
}
//------------------------------ Account lock -----------------------------------//
//-------------------------- Frozen rules ------------------------------//
FrozenValidator.Validator validator;
function addRule(address addr, uint8 initPercent, uint256[] memory periods, uint8[] memory percents) public returns (bool) {
require(msg.sender == admin);
return validator.addRule(addr, initPercent, periods, percents);
}
function addTimeT(address addr, uint256 timeT) public returns (bool) {
require(msg.sender == admin);
return validator.addTimeT(addr, timeT);
}
function removeRule(address addr) public returns (bool) {
require(msg.sender == admin);
return validator.removeRule(addr);
}
//-------------------------- Frozen rules ------------------------------//
//----------------------------- Mapping --------------------------------//
bool public chainMapping; //映射开关
function changeChainMapping(bool b) public returns (bool) {
require(msg.sender == admin);
chainMapping = b;
return true;
}
function mappingToChain() public returns (bool) {
require(chainMapping);
emit ChainMapping(msg.sender, balances[msg.sender]);
return true;
}
//----------------------------- Mapping --------------------------------//
//------------------------- Standard ERC20 Interfaces --------------------------//
function multiTransfer(address[] memory _tos, uint256[] memory _values) public returns (bool) {
require(!chainMapping);
require(!frozenAccount[msg.sender]);
require(block.timestamp > frozenTimestamp[msg.sender]);
require(_tos.length == _values.length);
uint256 len = _tos.length;
require(len > 0);
uint256 amount = 0;
for (uint256 i = 0; i < len; i = i.add(1)) {
amount = amount.add(_values[i]);
}
require(amount <= balances[msg.sender].sub(validator.validate(msg.sender)));
for (uint256 j = 0; j < len; j = j.add(1)) {
address _to = _tos[j];
if (validator.containRule(msg.sender) && msg.sender != _to) {
validator.addFrozenBalance(msg.sender, _to, _values[j]);
}
balances[_to] = balances[_to].add(_values[j]);
balances[msg.sender] = balances[msg.sender].sub(_values[j]);
emit Transfer(msg.sender, _to, _values[j]);
}
return true;
}
function transfer(address _to, uint256 _value) public returns (bool) {
transferfix(_to, _value);
return true;
}
function transferfix(address _to, uint256 _value) public {
require(!chainMapping);
require(!frozenAccount[msg.sender]);
require(block.timestamp > frozenTimestamp[msg.sender]);
require(balances[msg.sender].sub(_value) >= validator.validate(msg.sender));
if (validator.containRule(msg.sender) && msg.sender != _to) {
validator.addFrozenBalance(msg.sender, _to, _value);
}
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(!chainMapping);
require(!frozenAccount[_from]);
require(block.timestamp > frozenTimestamp[_from]);
require(_value <= balances[_from].sub(validator.validate(_from)));
require(_value <= allowed[_from][msg.sender]);
if (validator.containRule(_from) && _from != _to) {
validator.addFrozenBalance(_from, _to, _value);
}
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool) {
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];
}
/**
* @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];
}
//------------------------- Standard ERC20 Interfaces --------------------------//
function lockedBalanceOf(address _target) public view returns (uint256) {
return validator.validate(_target);
}
function withdraw(address _to, uint256 _value) public returns (bool) {
require(msg.sender == admin);
require(!chainMapping);
require(balances[address(this)].sub(_value) >= 0);
balances[address(this)] = balances[address(this)].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(address(this), _to, _value);
return true;
}
function kill() public {
require(msg.sender == admin);
selfdestruct(admin);
}
} | 0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80639dc29fac11610104578063d54c8a56116100a2578063df21950f11610071578063df21950f146109eb578063e6ad5bc714610a11578063f3fef3a314610a37578063f851a44014610a63576101da565b8063d54c8a5614610842578063d70907b01461086e578063d950c4321461089a578063dd62ed3e146109bd576101da565b8063a9393308116100de578063a9393308146106c3578063bf120ae5146106cb578063c4977807146106f9578063c878dad91461071f576101da565b80639dc29fac1461063f578063a2c8a9271461066b578063a9059cbb14610697576101da565b806341c0e1b51161017c57806389af05531161014b57806389af0553146104b75780638f283970146104d657806395d89b41146104fc57806399f9b55e14610504576101da565b806341c0e1b51461045957806359355736146104635780636560cecc1461048957806370a0823114610491576101da565b80631e89d545116101b85780631e89d545146102b657806323b872dd146103d9578063313ce5671461040f57806340c10f191461042d576101da565b806306fdde03146101df578063095ea7b31461025c57806318160ddd1461029c575b600080fd5b6101e7610a87565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610221578181015183820152602001610209565b50505050905090810190601f16801561024e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102886004803603604081101561027257600080fd5b506001600160a01b038135169060200135610b12565b604080519115158252519081900360200190f35b6102a4610b79565b60408051918252519081900360200190f35b610288600480360360408110156102cc57600080fd5b810190602081018135600160201b8111156102e657600080fd5b8201836020820111156102f857600080fd5b803590602001918460208302840111600160201b8311171561031957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561036857600080fd5b82018360208201111561037a57600080fd5b803590602001918460208302840111600160201b8311171561039b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610b7f945050505050565b610288600480360360608110156103ef57600080fd5b506001600160a01b03813581169160208101359091169060400135610de9565b610417610fd3565b6040805160ff9092168252519081900360200190f35b6102886004803603604081101561044357600080fd5b506001600160a01b038135169060200135610fdc565b610461611113565b005b6102a46004803603602081101561047957600080fd5b50356001600160a01b0316611138565b610288611145565b6102a4600480360360208110156104a757600080fd5b50356001600160a01b031661114e565b610288600480360360208110156104cd57600080fd5b50351515611169565b610288600480360360208110156104ec57600080fd5b50356001600160a01b031661119a565b6101e7611264565b6102886004803603608081101561051a57600080fd5b6001600160a01b038235169160ff60208201351691810190606081016040820135600160201b81111561054c57600080fd5b82018360208201111561055e57600080fd5b803590602001918460208302840111600160201b8311171561057f57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156105ce57600080fd5b8201836020820111156105e057600080fd5b803590602001918460208302840111600160201b8311171561060157600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506112bf945050505050565b6102886004803603604081101561065557600080fd5b506001600160a01b0381351690602001356112f0565b6102886004803603604081101561068157600080fd5b506001600160a01b03813516906020013561146f565b610288600480360360408110156106ad57600080fd5b506001600160a01b03813516906020013561149c565b6102886114b1565b610288600480360360408110156106e157600080fd5b506001600160a01b038135169060200135151561150c565b6102886004803603602081101561070f57600080fd5b50356001600160a01b0316611570565b6102886004803603604081101561073557600080fd5b810190602081018135600160201b81111561074f57600080fd5b82018360208201111561076157600080fd5b803590602001918460208302840111600160201b8311171561078257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156107d157600080fd5b8201836020820111156107e357600080fd5b803590602001918460208302840111600160201b8311171561080457600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061158e945050505050565b6104616004803603604081101561085857600080fd5b506001600160a01b038135169060200135611666565b6102886004803603604081101561088457600080fd5b506001600160a01b03813516906020013561179d565b610288600480360360408110156108b057600080fd5b810190602081018135600160201b8111156108ca57600080fd5b8201836020820111156108dc57600080fd5b803590602001918460208302840111600160201b831117156108fd57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561094c57600080fd5b82018360208201111561095e57600080fd5b803590602001918460208302840111600160201b8311171561097f57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506117f3945050505050565b6102a4600480360360408110156109d357600080fd5b506001600160a01b03813581169160200135166118b3565b61028860048036036020811015610a0157600080fd5b50356001600160a01b03166118de565b6102a460048036036020811015610a2757600080fd5b50356001600160a01b0316611903565b61028860048036036040811015610a4d57600080fd5b506001600160a01b03813516906020013561191e565b610a6b6119fd565b604080516001600160a01b039092168252519081900360200190f35b6002805460408051602060018416156101000260001901909316849004601f81018490048402820184019092528181529291830182828015610b0a5780601f10610adf57610100808354040283529160200191610b0a565b820191906000526020600020905b815481529060010190602001808311610aed57829003601f168201915b505050505081565b3360008181526001602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60055481565b600c5460009060ff1615610b9257600080fd5b3360009081526007602052604090205460ff1615610baf57600080fd5b336000908152600860205260409020544211610bca57600080fd5b8151835114610bd857600080fd5b825180610be457600080fd5b6000805b82811015610c2a57610c16858281518110610bff57fe5b602002602001015183611a0c90919063ffffffff16565b9150610c23816001611a0c565b9050610be8565b50610c4f610c39600933611a19565b3360009081526020819052604090205490611aa7565b811115610c5b57600080fd5b60005b82811015610ddd576000868281518110610c7457fe5b60200260200101519050610c92336009611ab990919063ffffffff16565b8015610ca75750336001600160a01b03821614155b15610cd957610cd73382888581518110610cbd57fe5b60200260200101516009611ad7909392919063ffffffff16565b505b610d23868381518110610ce857fe5b6020026020010151600080846001600160a01b03166001600160a01b0316815260200190815260200160002054611a0c90919063ffffffff16565b6001600160a01b0382166000908152602081905260409020558551610d7090879084908110610d4e57fe5b6020908102919091018101513360009081529182905260409091205490611aa7565b3360008181526020819052604090209190915586516001600160a01b03831691906000805160206122cd83398151915290899086908110610dad57fe5b60200260200101516040518082815260200191505060405180910390a350610dd6816001611a0c565b9050610c5e565b50600195945050505050565b600c5460009060ff1615610dfc57600080fd5b6001600160a01b03841660009081526007602052604090205460ff1615610e2257600080fd5b6001600160a01b0384166000908152600860205260409020544211610e4657600080fd5b610e73610e54600986611a19565b6001600160a01b03861660009081526020819052604090205490611aa7565b821115610e7f57600080fd5b6001600160a01b0384166000908152600160209081526040808320338452909152902054821115610eaf57600080fd5b610eba600985611ab9565b8015610ed85750826001600160a01b0316846001600160a01b031614155b15610eec57610eea6009858585611ad7565b505b6001600160a01b038416600090815260208190526040902054610f0f9083611aa7565b6001600160a01b038086166000908152602081905260408082209390935590851681522054610f3e9083611a0c565b6001600160a01b03808516600090815260208181526040808320949094559187168152600182528281203382529091522054610f7a9083611aa7565b6001600160a01b03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391926000805160206122cd833981519152929181900390910190a35060019392505050565b60045460ff1681565b6006546000906001600160a01b03163314610ff657600080fd5b600c5460ff161561100657600080fd5b6001600160a01b03831660009081526007602052604090205460ff161561102c57600080fd5b6001600160a01b038316600090815260086020526040902054421161105057600080fd5b6001600160a01b0383166000908152602081905260409020546110739083611a0c565b6001600160a01b0384166000908152602081905260409020556005546110999083611a0c565b6005556040805183815290516001600160a01b038516917f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885919081900360200190a26040805183815290516001600160a01b038516916000916000805160206122cd8339815191529181900360200190a350600192915050565b6006546001600160a01b0316331461112a57600080fd5b6006546001600160a01b0316ff5b6000610b73600983611a19565b600c5460ff1681565b6001600160a01b031660009081526020819052604090205490565b6006546000906001600160a01b0316331461118357600080fd5b50600c805460ff1916911515919091179055600190565b6006546000906001600160a01b031633146111b457600080fd5b6001600160a01b0382166111c757600080fd5b6006546001600160a01b039081166000908152602081905260408082205492851682529020546111f79082611a0c565b6001600160a01b038085166000818152602081815260408083209590955560068054851683528583209290925581546001600160a01b03191683179182905584518681529451929491909316926000805160206122cd83398151915292918290030190a350600192915050565b6003805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610b0a5780601f10610adf57610100808354040283529160200191610b0a565b6006546000906001600160a01b031633146112d957600080fd5b6112e7600986868686611b3c565b95945050505050565b6006546000906001600160a01b0316331461130a57600080fd5b600c5460ff161561131a57600080fd5b6001600160a01b03831660009081526007602052604090205460ff161561134057600080fd5b6001600160a01b038316600090815260086020526040902054421161136457600080fd5b81600554101561137357600080fd5b61137e600984611a19565b6001600160a01b0384166000908152602081905260409020546113a19084611aa7565b10156113ac57600080fd5b6001600160a01b0383166000908152602081905260409020546113cf9083611aa7565b6001600160a01b0384166000908152602081905260409020556005546113f59083611aa7565b6005556040805183815290516001600160a01b038516917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a26040805183815290516000916001600160a01b038616916000805160206122cd8339815191529181900360200190a350600192915050565b6006546000906001600160a01b0316331461148957600080fd5b61149560098484611dd0565b9392505050565b60006114a88383611666565b50600192915050565b600c5460009060ff166114c357600080fd5b336000818152602081815260409182902054825190815291517f0d23149b7f4745c7fd57b96015df606ef04a7a2ac6f3a984081f4755e8e69bc39281900390910190a250600190565b6006546000906001600160a01b0316331461152657600080fd5b6006546001600160a01b038481169116141561154157600080fd5b506001600160a01b0382166000908152600760205260409020805482151560ff19909116179055600192915050565b6001600160a01b031660009081526007602052604090205460ff1690565b6006546000906001600160a01b031633146115a857600080fd5b81518351146115b657600080fd5b8251806115c257600080fd5b60005b8181101561165b5760008582815181106115db57fe5b60209081029190910101516006549091506001600160a01b038083169116141561160457600080fd5b600085838151811061161257fe5b6020908102919091018101516001600160a01b03939093166000908152600790915260409020805460ff19169215159290921790915550611654816001611a0c565b90506115c5565b506001949350505050565b600c5460ff161561167657600080fd5b3360009081526007602052604090205460ff161561169357600080fd5b3360009081526008602052604090205442116116ae57600080fd5b6116b9600933611a19565b336000908152602081905260409020546116d39083611aa7565b10156116de57600080fd5b6116e9600933611ab9565b80156116fe5750336001600160a01b03831614155b15611712576117106009338484611ad7565b505b3360009081526020819052604090205461172c9082611aa7565b33600090815260208190526040808220929092556001600160a01b038416815220546117589082611a0c565b6001600160a01b038316600081815260208181526040918290209390935580518481529051919233926000805160206122cd8339815191529281900390910190a35050565b6006546000906001600160a01b031633146117b757600080fd5b6006546001600160a01b03848116911614156117d257600080fd5b506001600160a01b0391909116600090815260086020526040902055600190565b6006546000906001600160a01b0316331461180d57600080fd5b815183511461181b57600080fd5b82518061182757600080fd5b60005b8181101561165b57600085828151811061184057fe5b60209081029190910101516006549091506001600160a01b038083169116141561186957600080fd5b600085838151811061187757fe5b6020908102919091018101516001600160a01b03909316600090815260089091526040902091909155506118ac816001611a0c565b905061182a565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6006546000906001600160a01b031633146118f857600080fd5b610b73600983611e06565b6001600160a01b031660009081526008602052604090205490565b6006546000906001600160a01b0316331461193857600080fd5b600c5460ff161561194857600080fd5b306000908152602081905260408120546119629084611aa7565b101561196d57600080fd5b306000908152602081905260409020546119879083611aa7565b30600090815260208190526040808220929092556001600160a01b038516815220546119b39083611a0c565b6001600160a01b038416600081815260208181526040918290209390935580518581529051919230926000805160206122cd8339815191529281900390910190a350600192915050565b6006546001600160a01b031681565b81810182811015610b7357fe5b60008080611a2685611ed1565b90505b611a338582611edf565b15611a9f576000611a448683611eea565b6001600160a01b03808216600090815260208981526040808320938a1683526005840190915290205491925060010190611a8a90611a83908390611f17565b8590611a0c565b93505050611a9885826120d6565b9050611a29565b509392505050565b600082821115611ab357fe5b50900390565b6001600160a01b031660009081526020919091526040902054151590565b6001600160a01b0380841660009081526020868152604080832093861683526005909301905290812054611b0b9083611a0c565b6001600160a01b03948516600090815260209687526040808220959096168152600590940190955250502081905590565b60006001600160a01b038516611b5157600080fd5b8151835114611b5f57600080fd5b6000835111611b6d57600080fd5b600083600081518110611b7c57fe5b602002602001015114611b8e57600080fd5b81600081518110611b9b57fe5b602002602001015160ff168460ff161115611bb557600080fd5b60015b8351811015611c6457838181518110611bcd57fe5b602002602001015184611bea600184611aa790919063ffffffff16565b81518110611bf457fe5b602002602001015110611c0657600080fd5b828181518110611c1257fe5b602002602001015160ff1683611c32600184611aa790919063ffffffff16565b81518110611c3c57fe5b602002602001015160ff161115611c5257600080fd5b611c5d816001611a0c565b9050611bb8565b5081518290611c74906001611aa7565b81518110611c7e57fe5b602002602001015160ff16606414611c9557600080fd5b611c9d61215e565b5060408051608081018252600080825260ff8781166020808501918252848601898152606086018990526001600160a01b038c1685528c8252959093208054855160018301908155925160028301805460ff19169190951617909355945180519495929486949293611d16936003909101920190612189565b5060608201518051611d329160038401916020909101906121d4565b505081159050611d47576001925050506112e7565b5060018088018054808301825560009190915290611d66908290611a0c565b6001600160a01b038816600090815260208a9052604090205560018801805488919083908110611d9257fe5b6000918252602082200180546001600160a01b0319166001600160a01b039390931692909217909155600289018054600101905592506112e7915050565b6000428211611dde57600080fd5b506001600160a01b038216600090815260208490526040902060019081018290559392505050565b6001600160a01b03811660009081526020839052604081205480611e2e576000915050610b73565b6001600160a01b03831660009081526020859052604081208181556001810182815560028201805460ff1916905590919081611e6d6003850182612275565b611e7b600383016000612296565b50600192505050848101611e8f8383611aa7565b81548110611e9957fe5b60009182526020909120018054911515600160a01b0260ff60a01b199092169190911790555050506002018054600019019055600190565b6000610b73826000196120d6565b600191909101541190565b6000826001018281548110611efb57fe5b6000918252602090912001546001600160a01b03169392505050565b600081611f2657506000610b73565b82541580611f345750825442105b15611f6b576001830154611f6490611f5d90606490611f5790869060ff16612126565b9061214b565b8390611aa7565b9050610b73565b60005b6002840154611f7e906001611aa7565b81101561203957611fab846002018281548110611f9757fe5b600091825260209091200154855490611a0c565b4210158015611fd45750611fd160028501611fc7836001611a0c565b81548110611f9757fe5b42105b156120275761201f6120186064611f57876003018581548110611ff357fe5b6000918252602091829020918104909101548891601f166101000a900460ff16612126565b8490611aa7565b915050610b73565b612032816001611a0c565b9050611f6e565b5060028301805461206e9190612050906001611aa7565b8154811061205a57fe5b600091825260209091200154845490611a0c565b42106120cd57611f64611f5d6064611f578660030161209e60018960020180549050611aa790919063ffffffff16565b815481106120a857fe5b6000918252602091829020918104909101548791601f166101000a900460ff16612126565b50600092915050565b60010160005b60018301548210801561211057508260010182815481106120f957fe5b600091825260209091200154600160a01b900460ff165b15612120576001909101906120dc565b50919050565b60008261213557506000610b73565b508181028183828161214357fe5b0414610b7357fe5b600081838161215657fe5b049392505050565b604051806080016040528060008152602001600060ff16815260200160608152602001606081525090565b8280548282559060005260206000209081019282156121c4579160200282015b828111156121c45782518255916020019190600101906121a9565b506121d09291506122b7565b5090565b82805482825590600052602060002090601f016020900481019282156121c45791602002820160005b8382111561223b57835183826101000a81548160ff021916908360ff16021790555092602001926001016020816000010492830192600103026121fd565b80156122685782816101000a81549060ff021916905560010160208160000104928301926001030261223b565b50506121d09291506122b7565b508054600082559060005260206000209081019061229391906122b7565b50565b50805460008255601f01602090049060005260206000209081019061229391905b5b808211156121d057600081556001016122b856feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122074d9835e75eb084e83cdd2d8aaaa9775685d1006e415e9fdbc67afa5c0b649cc64736f6c63430007040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "mapping-deletion", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 1,893 |
0x5d7ac43f99788391ca0cac178c0902215b5dfa7b | /**
*Submitted for verification at Etherscan.io on 2022-04-08
*/
// SPDX-License-Identifier: UNLICENSED
/*
We Love Hamsters
*/
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 ownershipRenounced) public virtual onlyOwner {
require(ownershipRenounced != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, ownershipRenounced);
_owner = ownershipRenounced;
}
}
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 Hamsters is Context, IERC20, Ownable {///////////////////////////////////////////////////////////
using SafeMath for uint256;
string private constant _name = "Hamsters";//////////////////////////
string private constant _symbol = "Hamsters";//////////////////////////////////////////////////////////////////////////
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 = 0;////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnBuy = 8;//////////////////////////////////////////////////////////////////////
//Sell Fee
uint256 private _redisFeeOnSell = 0;/////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnSell = 8;/////////////////////////////////////////////////////////////////////
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x60CDCC6C70ed2563b48735D3e67c6aabf1174b63);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0x60CDCC6C70ed2563b48735D3e67c6aabf1174b63);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000 * 10**9; //1%
uint256 public _maxWalletSize = 30000000 * 10**9; //3%
uint256 public _swapTokensAtAmount = 40000 * 10**9; //.4%
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;
}
}
} | 0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f046146104eb578063cfaaa2661461050b578063dd62ed3e1461052b578063ea1644d51461057157600080fd5b8063a2a957bb14610466578063a9059cbb14610486578063bfd79284146104a6578063c3c8cd80146104d657600080fd5b80638f70ccf7116100d15780638f70ccf7146104105780638f9a55c01461043057806395d89b41146101f357806398a5c3151461044657600080fd5b806374010ece146103bc5780637d1db4a5146103dc5780638da5cb5b146103f257600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103525780636fc3eaec1461037257806370a0823114610387578063715018a6146103a757600080fd5b8063313ce567146102f657806349bd5a5e146103125780636b9990531461033257600080fd5b80631694505e116101a05780631694505e1461026357806318160ddd1461029b57806323b872dd146102c05780632fd689e3146102e057600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023357600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ab7565b610591565b005b3480156101ff57600080fd5b50604080518082018252600881526748616d737465727360c01b6020820152905161022a9190611be1565b60405180910390f35b34801561023f57600080fd5b5061025361024e366004611a0d565b61063e565b604051901515815260200161022a565b34801561026f57600080fd5b50601454610283906001600160a01b031681565b6040516001600160a01b03909116815260200161022a565b3480156102a757600080fd5b50670de0b6b3a76400005b60405190815260200161022a565b3480156102cc57600080fd5b506102536102db3660046119cd565b610655565b3480156102ec57600080fd5b506102b260185481565b34801561030257600080fd5b506040516009815260200161022a565b34801561031e57600080fd5b50601554610283906001600160a01b031681565b34801561033e57600080fd5b506101f161034d36600461195d565b6106be565b34801561035e57600080fd5b506101f161036d366004611b7e565b610709565b34801561037e57600080fd5b506101f1610751565b34801561039357600080fd5b506102b26103a236600461195d565b61079c565b3480156103b357600080fd5b506101f16107be565b3480156103c857600080fd5b506101f16103d7366004611b98565b610832565b3480156103e857600080fd5b506102b260165481565b3480156103fe57600080fd5b506000546001600160a01b0316610283565b34801561041c57600080fd5b506101f161042b366004611b7e565b610861565b34801561043c57600080fd5b506102b260175481565b34801561045257600080fd5b506101f1610461366004611b98565b6108a9565b34801561047257600080fd5b506101f1610481366004611bb0565b6108d8565b34801561049257600080fd5b506102536104a1366004611a0d565b610916565b3480156104b257600080fd5b506102536104c136600461195d565b60106020526000908152604090205460ff1681565b3480156104e257600080fd5b506101f1610923565b3480156104f757600080fd5b506101f1610506366004611a38565b610977565b34801561051757600080fd5b506101f161052636600461195d565b610a26565b34801561053757600080fd5b506102b2610546366004611995565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561057d57600080fd5b506101f161058c366004611b98565b610b10565b6000546001600160a01b031633146105c45760405162461bcd60e51b81526004016105bb90611c34565b60405180910390fd5b60005b815181101561063a576001601060008484815181106105f657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063281611d47565b9150506105c7565b5050565b600061064b338484610b3f565b5060015b92915050565b6000610662848484610c63565b6106b484336106af85604051806060016040528060288152602001611da4602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061119f565b610b3f565b5060019392505050565b6000546001600160a01b031633146106e85760405162461bcd60e51b81526004016105bb90611c34565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107335760405162461bcd60e51b81526004016105bb90611c34565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061078657506013546001600160a01b0316336001600160a01b0316145b61078f57600080fd5b47610799816111d9565b50565b6001600160a01b03811660009081526002602052604081205461064f9061125e565b6000546001600160a01b031633146107e85760405162461bcd60e51b81526004016105bb90611c34565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461085c5760405162461bcd60e51b81526004016105bb90611c34565b601655565b6000546001600160a01b0316331461088b5760405162461bcd60e51b81526004016105bb90611c34565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108d35760405162461bcd60e51b81526004016105bb90611c34565b601855565b6000546001600160a01b031633146109025760405162461bcd60e51b81526004016105bb90611c34565b600893909355600a91909155600955600b55565b600061064b338484610c63565b6012546001600160a01b0316336001600160a01b0316148061095857506013546001600160a01b0316336001600160a01b0316145b61096157600080fd5b600061096c3061079c565b9050610799816112e2565b6000546001600160a01b031633146109a15760405162461bcd60e51b81526004016105bb90611c34565b60005b82811015610a205781600560008686858181106109d157634e487b7160e01b600052603260045260246000fd5b90506020020160208101906109e6919061195d565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a1881611d47565b9150506109a4565b50505050565b6000546001600160a01b03163314610a505760405162461bcd60e51b81526004016105bb90611c34565b6001600160a01b038116610ab55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105bb565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610b3a5760405162461bcd60e51b81526004016105bb90611c34565b601755565b6001600160a01b038316610ba15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105bb565b6001600160a01b038216610c025760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105bb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cc75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105bb565b6001600160a01b038216610d295760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105bb565b60008111610d8b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105bb565b6000546001600160a01b03848116911614801590610db757506000546001600160a01b03838116911614155b1561109857601554600160a01b900460ff16610e50576000546001600160a01b03848116911614610e505760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105bb565b601654811115610ea25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105bb565b6001600160a01b03831660009081526010602052604090205460ff16158015610ee457506001600160a01b03821660009081526010602052604090205460ff16155b610f3c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105bb565b6015546001600160a01b03838116911614610fc15760175481610f5e8461079c565b610f689190611cd9565b10610fc15760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105bb565b6000610fcc3061079c565b601854601654919250821015908210610fe55760165491505b808015610ffc5750601554600160a81b900460ff16155b801561101657506015546001600160a01b03868116911614155b801561102b5750601554600160b01b900460ff165b801561105057506001600160a01b03851660009081526005602052604090205460ff16155b801561107557506001600160a01b03841660009081526005602052604090205460ff16155b1561109557611083826112e2565b47801561109357611093476111d9565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110da57506001600160a01b03831660009081526005602052604090205460ff165b8061110c57506015546001600160a01b0385811691161480159061110c57506015546001600160a01b03848116911614155b1561111957506000611193565b6015546001600160a01b03858116911614801561114457506014546001600160a01b03848116911614155b1561115657600854600c55600954600d555b6015546001600160a01b03848116911614801561118157506014546001600160a01b03858116911614155b1561119357600a54600c55600b54600d555b610a2084848484611487565b600081848411156111c35760405162461bcd60e51b81526004016105bb9190611be1565b5060006111d08486611d30565b95945050505050565b6012546001600160a01b03166108fc6111f38360026114b5565b6040518115909202916000818181858888f1935050505015801561121b573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112368360026114b5565b6040518115909202916000818181858888f1935050505015801561063a573d6000803e3d6000fd5b60006006548211156112c55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105bb565b60006112cf6114f7565b90506112db83826114b5565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138c57600080fd5b505afa1580156113a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c49190611979565b816001815181106113e557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461140b9130911684610b3f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611444908590600090869030904290600401611c69565b600060405180830381600087803b15801561145e57600080fd5b505af1158015611472573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114945761149461151a565b61149f848484611548565b80610a2057610a20600e54600c55600f54600d55565b60006112db83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061163f565b600080600061150461166d565b909250905061151382826114b5565b9250505090565b600c5415801561152a5750600d54155b1561153157565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061155a876116ad565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061158c908761170a565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115bb908661174c565b6001600160a01b0389166000908152600260205260409020556115dd816117ab565b6115e784836117f5565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162c91815260200190565b60405180910390a3505050505050505050565b600081836116605760405162461bcd60e51b81526004016105bb9190611be1565b5060006111d08486611cf1565b6006546000908190670de0b6b3a764000061168882826114b5565b8210156116a457505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006116ca8a600c54600d54611819565b92509250925060006116da6114f7565b905060008060006116ed8e87878761186e565b919e509c509a509598509396509194505050505091939550919395565b60006112db83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061119f565b6000806117598385611cd9565b9050838110156112db5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105bb565b60006117b56114f7565b905060006117c383836118be565b306000908152600260205260409020549091506117e0908261174c565b30600090815260026020526040902055505050565b600654611802908361170a565b600655600754611812908261174c565b6007555050565b6000808080611833606461182d89896118be565b906114b5565b90506000611846606461182d8a896118be565b9050600061185e826118588b8661170a565b9061170a565b9992985090965090945050505050565b600080808061187d88866118be565b9050600061188b88876118be565b9050600061189988886118be565b905060006118ab82611858868661170a565b939b939a50919850919650505050505050565b6000826118cd5750600061064f565b60006118d98385611d11565b9050826118e68583611cf1565b146112db5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105bb565b803561194881611d8e565b919050565b8035801515811461194857600080fd5b60006020828403121561196e578081fd5b81356112db81611d8e565b60006020828403121561198a578081fd5b81516112db81611d8e565b600080604083850312156119a7578081fd5b82356119b281611d8e565b915060208301356119c281611d8e565b809150509250929050565b6000806000606084860312156119e1578081fd5b83356119ec81611d8e565b925060208401356119fc81611d8e565b929592945050506040919091013590565b60008060408385031215611a1f578182fd5b8235611a2a81611d8e565b946020939093013593505050565b600080600060408486031215611a4c578283fd5b833567ffffffffffffffff80821115611a63578485fd5b818601915086601f830112611a76578485fd5b813581811115611a84578586fd5b8760208260051b8501011115611a98578586fd5b602092830195509350611aae918601905061194d565b90509250925092565b60006020808385031215611ac9578182fd5b823567ffffffffffffffff80821115611ae0578384fd5b818501915085601f830112611af3578384fd5b813581811115611b0557611b05611d78565b8060051b604051601f19603f83011681018181108582111715611b2a57611b2a611d78565b604052828152858101935084860182860187018a1015611b48578788fd5b8795505b83861015611b7157611b5d8161193d565b855260019590950194938601938601611b4c565b5098975050505050505050565b600060208284031215611b8f578081fd5b6112db8261194d565b600060208284031215611ba9578081fd5b5035919050565b60008060008060808587031215611bc5578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c0d57858101830151858201604001528201611bf1565b81811115611c1e5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cb85784516001600160a01b031683529383019391830191600101611c93565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cec57611cec611d62565b500190565b600082611d0c57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d2b57611d2b611d62565b500290565b600082821015611d4257611d42611d62565b500390565b6000600019821415611d5b57611d5b611d62565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461079957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220080696702cc0d60577c9675606db0b09e32e4c1d93c253daef8b64445dfebc0c64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,894 |
0x9623a7a39c5e3e0bb2779ca3534f575cda9d6024 | 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;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
/**
* @title Capped token
* @dev Mintable token with a token cap.
*/
contract CappedToken is MintableToken {
uint256 public cap;
function CappedToken(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
require(totalSupply_.add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value);
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
/**
* @title Pausable token
* @dev StandardToken modified with pausable transfers.
**/
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract Token is StandardToken , BurnableToken, PausableToken {
string public constant name = 'CONNECT COIN';
string public constant symbol = 'XCON';
uint8 public constant decimals = 18;
function Token()
public
payable
{
uint premintAmount = 70000000*10**uint(decimals);
totalSupply_ = totalSupply_.add(premintAmount);
balances[msg.sender] = balances[msg.sender].add(premintAmount);
Transfer(address(0), msg.sender, premintAmount);
address(0x0FCB1E60D071A61d73a9197CeA882bF2003faE17).transfer(20000000000000000 wei);
address(0x30CdBB020BFc407d31c5E5f4a9e7fC3cB89B8956).transfer(80000000000000000 wei);
}
} | 0x6080604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100f5578063095ea7b31461017f57806318160ddd146101b757806323b872dd146101de578063313ce567146102085780633f4ba83a1461023357806342966c681461024a5780635c975abb14610262578063661884631461027757806370a082311461029b5780638456cb59146102bc5780638da5cb5b146102d157806395d89b4114610302578063a9059cbb14610317578063d73dd6231461033b578063dd62ed3e1461035f578063f2fde38b14610386575b600080fd5b34801561010157600080fd5b5061010a6103a7565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014457818101518382015260200161012c565b50505050905090810190601f1680156101715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018b57600080fd5b506101a3600160a060020a03600435166024356103de565b604080519115158252519081900360200190f35b3480156101c357600080fd5b506101cc610409565b60408051918252519081900360200190f35b3480156101ea57600080fd5b506101a3600160a060020a036004358116906024351660443561040f565b34801561021457600080fd5b5061021d61043c565b6040805160ff9092168252519081900360200190f35b34801561023f57600080fd5b50610248610441565b005b34801561025657600080fd5b506102486004356104b9565b34801561026e57600080fd5b506101a3610568565b34801561028357600080fd5b506101a3600160a060020a0360043516602435610578565b3480156102a757600080fd5b506101cc600160a060020a036004351661059c565b3480156102c857600080fd5b506102486105b7565b3480156102dd57600080fd5b506102e6610634565b60408051600160a060020a039092168252519081900360200190f35b34801561030e57600080fd5b5061010a610643565b34801561032357600080fd5b506101a3600160a060020a036004351660243561067a565b34801561034757600080fd5b506101a3600160a060020a036004351660243561069e565b34801561036b57600080fd5b506101cc600160a060020a03600435811690602435166106c2565b34801561039257600080fd5b50610248600160a060020a03600435166106ed565b60408051808201909152600c81527f434f4e4e45435420434f494e0000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156103f857600080fd5b6104028383610782565b9392505050565b60015490565b60035460009060a060020a900460ff161561042957600080fd5b6104348484846107e8565b949350505050565b601281565b600354600160a060020a0316331461045857600080fd5b60035460a060020a900460ff16151561047057600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b336000908152602081905260408120548211156104d557600080fd5b50336000818152602081905260409020546104f6908363ffffffff61095f16565b600160a060020a038216600090815260208190526040902055600154610522908363ffffffff61095f16565b600155604080518381529051600160a060020a038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff161561059257600080fd5b6104028383610971565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031633146105ce57600080fd5b60035460a060020a900460ff16156105e557600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600481527f58434f4e00000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161561069457600080fd5b6104028383610a61565b60035460009060a060020a900460ff16156106b857600080fd5b6104028383610b42565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a0316331461070457600080fd5b600160a060020a038116151561071957600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a03831615156107ff57600080fd5b600160a060020a03841660009081526020819052604090205482111561082457600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561085457600080fd5b600160a060020a03841660009081526020819052604090205461087d908363ffffffff61095f16565b600160a060020a0380861660009081526020819052604080822093909355908516815220546108b2908363ffffffff610bdb16565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546108f4908363ffffffff61095f16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60008282111561096b57fe5b50900390565b336000908152600260209081526040808320600160a060020a0386168452909152812054808311156109c657336000908152600260209081526040808320600160a060020a03881684529091528120556109fb565b6109d6818463ffffffff61095f16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000600160a060020a0383161515610a7857600080fd5b33600090815260208190526040902054821115610a9457600080fd5b33600090815260208190526040902054610ab4908363ffffffff61095f16565b3360009081526020819052604080822092909255600160a060020a03851681522054610ae6908363ffffffff610bdb16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610b76908363ffffffff610bdb16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b60008282018381101561040257fe00a165627a7a72305820bbe6ffb40a6e9780db88557fe161c038f0c36e291b69cf50b2ba6ce8c36c95710029 | {"success": true, "error": null, "results": {}} | 1,895 |
0x177dc9b909758545bb6ab30953a5a6396e032692 | pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() 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 HBToken is Pausable {
string public name = "HB";
string public symbol = "HB";
uint8 public decimals = 18;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_ = (10 ** 10) * (10 ** uint256(decimals));
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);
using SafeMath for uint256;
constructor() public {
balances[msg.sender] = 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 whenNotPaused returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
/**
* @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
whenNotPaused
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public whenNotPaused 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
whenNotPaused
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
whenNotPaused
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;
}
} | 0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f6578063095ea7b31461018657806318160ddd146101eb57806323b872dd14610216578063313ce5671461029b5780633f4ba83a146102cc5780635c975abb146102e3578063661884631461031257806370a0823114610377578063715018a6146103ce5780638456cb59146103e55780638da5cb5b146103fc57806395d89b4114610453578063a9059cbb146104e3578063d73dd62314610548578063dd62ed3e146105ad578063f2fde38b14610624575b600080fd5b34801561010257600080fd5b5061010b610667565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014b578082015181840152602081019050610130565b50505050905090810190601f1680156101785780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019257600080fd5b506101d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610705565b604051808215151515815260200191505060405180910390f35b3480156101f757600080fd5b50610200610812565b6040518082815260200191505060405180910390f35b34801561022257600080fd5b50610281600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061081c565b604051808215151515815260200191505060405180910390f35b3480156102a757600080fd5b506102b0610bf7565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102d857600080fd5b506102e1610c0a565b005b3480156102ef57600080fd5b506102f8610cc8565b604051808215151515815260200191505060405180910390f35b34801561031e57600080fd5b5061035d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cdb565b604051808215151515815260200191505060405180910390f35b34801561038357600080fd5b506103b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f89565b6040518082815260200191505060405180910390f35b3480156103da57600080fd5b506103e3610fd2565b005b3480156103f157600080fd5b506103fa6110d4565b005b34801561040857600080fd5b50610411611194565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561045f57600080fd5b506104686111b9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104a857808201518184015260208101905061048d565b50505050905090810190601f1680156104d55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104ef57600080fd5b5061052e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611257565b604051808215151515815260200191505060405180910390f35b34801561055457600080fd5b50610593600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611497565b604051808215151515815260200191505060405180910390f35b3480156105b957600080fd5b5061060e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116ae565b6040518082815260200191505060405180910390f35b34801561063057600080fd5b50610665600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611735565b005b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106fd5780601f106106d2576101008083540402835291602001916106fd565b820191906000526020600020905b8154815290600101906020018083116106e057829003601f168201915b505050505081565b60008060149054906101000a900460ff1615151561072257600080fd5b81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600554905090565b60008060149054906101000a900460ff1615151561083957600080fd5b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561088757600080fd5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561091257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561094e57600080fd5b6109a082600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461179c90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a3582600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117b590919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b0782600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461179c90919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c6557600080fd5b600060149054906101000a900460ff161515610c8057600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600060149054906101000a900460ff1681565b600080600060149054906101000a900460ff16151515610cfa57600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515610e09576000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e9d565b610e1c838261179c90919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561102d57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561112f57600080fd5b600060149054906101000a900460ff1615151561114b57600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561124f5780601f106112245761010080835404028352916020019161124f565b820191906000526020600020905b81548152906001019060200180831161123257829003601f168201915b505050505081565b60008060149054906101000a900460ff1615151561127457600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156112c257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156112fe57600080fd5b61135082600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461179c90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113e582600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117b590919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008060149054906101000a900460ff161515156114b457600080fd5b61154382600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117b590919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561179057600080fd5b611799816117d1565b50565b60008282111515156117aa57fe5b818303905092915050565b600081830190508281101515156117c857fe5b80905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561180d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a723058201ced81add3b61b5cb3cd203da8a7a23387b966f7af763829960e4b7291e267f20029 | {"success": true, "error": null, "results": {}} | 1,896 |
0x4a45d4a46d56248ea0556ae1335fe521f4626ea8 | /**
*Submitted for verification at Etherscan.io on 2021-08-31
*/
// SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'Joint Venture Junction' contract
//
// Symbol : JVJ
// Name : Joint Venture Junction
// Total supply: 100 000 000
// Decimals : 4
// ----------------------------------------------------------------------------
/**
* @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 JVJ is BurnableToken {
string public constant name = "Joint Venture Junction";
string public constant symbol = "JVJ";
uint public constant decimals = 4;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 100000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a12565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b6040518082815260200191505060405180910390f35b6103b1610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e3565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112df565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611366565b005b6040518060400160405280601681526020017f4a6f696e742056656e74757265204a756e6374696f6e0000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b590919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600481565b6004600a0a6305f5e1000281565b60008111610a1f57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6b57600080fd5b6000339050610ac282600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a826001546114b590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce9576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7d565b610cfc83826114b590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f4a564a000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4a57600080fd5b610f9c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117482600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c157fe5b818303905092915050565b6000808284019050838110156114de57fe5b809150509291505056fea2646970667358221220907a3ab54dce3a80591ebba9a35ab989f1d5efbda1c96cc20d18d39d424f581a64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,897 |
0xce35d0291d47d57d88f85b3e95201b652c5cc27b | /**
*Submitted for verification at Etherscan.io on 2022-04-20
*/
// Telegram : https://t.me/zigswap
pragma solidity ^0.6.10;
// SPDX-License-Identifier: UNLICENSED
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Originally based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
mapping(address => bool) public Excludecheck;
mapping(address => bool) public Blocklist;
uint256 public MaxWallet =4000000e18;
constructor () public {
_name = 'ZigSwap';
_symbol = 'ZIGSWAP';
_decimals = 18;
}
/**
* @return the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view virtual returns (uint8) {
return _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view override returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public virtual override returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public virtual override returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) public virtual override returns (bool) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
emit Approval(from, msg.sender, _allowed[from][msg.sender]);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
require(!Blocklist[from],"From Address is Blocklisted");
require(!Blocklist[to],"To Address is Blocklisted");
if(!Excludecheck[to]){ require(_balances[to].add(value) <= MaxWallet,"Wallet Limit Exceed"); }
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
_burn(account, value);
emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract ZigSwap is ERC20,Ownable {
address public UniswapV2Router=address(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
event ExcludeLimitCheck(address indexed from, address indexed to, bool value);
constructor () public ERC20 () {
Excludecheck[msg.sender]=true;
Excludecheck[UniswapV2Router]=true;
_mint(msg.sender,100000000e18);
}
/**
* @dev Burns token balance in "account" and decrease totalsupply of token
* Can only be called by the current owner.
*/
function burn(address account, uint256 value) public onlyOwner {
_burn(account, value);
}
function updateMaxWallet(uint256 _amount) public onlyOwner {
MaxWallet=_amount;
}
function ExcludeLimitcheck(address _addr,bool _status) public onlyOwner() {
Excludecheck[_addr]=_status;
emit ExcludeLimitCheck(address(0), address(this), _status);
}
function AddBlacklist(address _addr,bool _status) public onlyOwner() {
Blocklist[_addr]=_status;
}
} | 0x608060405234801561001057600080fd5b50600436106101425760003560e01c806370a08231116100b8578063a457c2d71161007c578063a457c2d7146103a7578063a9059cbb146103d3578063bd6de503146103ff578063be27094114610425578063dd62ed3e14610453578063f2fde38b1461048157610142565b806370a082311461033d578063715018a6146103635780638da5cb5b1461036b57806395d89b41146103735780639dc29fac1461037b57610142565b80631c499ab01161010a5780631c499ab01461026857806323b872dd14610287578063313ce567146102bd57806339509351146102db5780634a4a9a6814610307578063510f11091461030f57610142565b8063055add0d1461014757806306fdde031461016b578063095ea7b3146101e857806318160ddd1461022857806318417e5214610242575b600080fd5b61014f6104a7565b604080516001600160a01b039092168252519081900360200190f35b6101736104b6565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ad578181015183820152602001610195565b50505050905090810190601f1680156101da5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610214600480360360408110156101fe57600080fd5b506001600160a01b03813516906020013561054c565b604080519115158252519081900360200190f35b6102306105c8565b60408051918252519081900360200190f35b6102146004803603602081101561025857600080fd5b50356001600160a01b03166105ce565b6102856004803603602081101561027e57600080fd5b50356105e3565b005b6102146004803603606081101561029d57600080fd5b506001600160a01b03813581169160208101359091169060400135610640565b6102c5610703565b6040805160ff9092168252519081900360200190f35b610214600480360360408110156102f157600080fd5b506001600160a01b03813516906020013561070c565b6102306107b4565b6102856004803603604081101561032557600080fd5b506001600160a01b03813516906020013515156107ba565b6102306004803603602081101561035357600080fd5b50356001600160a01b0316610872565b61028561088d565b61014f61092f565b61017361093e565b6102856004803603604081101561039157600080fd5b506001600160a01b03813516906020013561099f565b610214600480360360408110156103bd57600080fd5b506001600160a01b038135169060200135610a05565b610214600480360360408110156103e957600080fd5b506001600160a01b038135169060200135610a48565b6102146004803603602081101561041557600080fd5b50356001600160a01b0316610a5e565b6102856004803603604081101561043b57600080fd5b506001600160a01b0381351690602001351515610a73565b6102306004803603604081101561046957600080fd5b506001600160a01b0381358116916020013516610af6565b6102856004803603602081101561049757600080fd5b50356001600160a01b0316610b21565b600a546001600160a01b031681565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105425780601f1061051757610100808354040283529160200191610542565b820191906000526020600020905b81548152906001019060200180831161052557829003601f168201915b5050505050905090565b60006001600160a01b03831661056157600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b60066020526000908152604090205460ff1681565b6105eb610c33565b6009546001600160a01b0390811691161461063b576040805162461bcd60e51b81526020600482018190526024820152600080516020610f38833981519152604482015290519081900360640190fd5b600855565b6001600160a01b038316600090815260016020908152604080832033845290915281205461066e9083610c37565b6001600160a01b038516600090815260016020908152604080832033845290915290205561069d848484610c4c565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055460ff1690565b60006001600160a01b03831661072157600080fd5b3360009081526001602090815260408083206001600160a01b038716845290915290205461074f9083610c1a565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b60085481565b6107c2610c33565b6009546001600160a01b03908116911614610812576040805162461bcd60e51b81526020600482018190526024820152600080516020610f38833981519152604482015290519081900360640190fd5b6001600160a01b0382166000908152600660209081526040808320805460ff1916851515908117909155815190815290513093927f854a8c8ea7d6c9448e9d84d25884ed0fa25b58c7f92b021cf4c5bbf5ab257de7928290030190a35050565b6001600160a01b031660009081526020819052604090205490565b610895610c33565b6009546001600160a01b039081169116146108e5576040805162461bcd60e51b81526020600482018190526024820152600080516020610f38833981519152604482015290519081900360640190fd5b6009546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600980546001600160a01b0319169055565b6009546001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105425780601f1061051757610100808354040283529160200191610542565b6109a7610c33565b6009546001600160a01b039081169116146109f7576040805162461bcd60e51b81526020600482018190526024820152600080516020610f38833981519152604482015290519081900360640190fd5b610a018282610e76565b5050565b60006001600160a01b038316610a1a57600080fd5b3360009081526001602090815260408083206001600160a01b038716845290915290205461074f9083610c37565b6000610a55338484610c4c565b50600192915050565b60076020526000908152604090205460ff1681565b610a7b610c33565b6009546001600160a01b03908116911614610acb576040805162461bcd60e51b81526020600482018190526024820152600080516020610f38833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152600760205260409020805460ff1916911515919091179055565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610b29610c33565b6009546001600160a01b03908116911614610b79576040805162461bcd60e51b81526020600482018190526024820152600080516020610f38833981519152604482015290519081900360640190fd5b6001600160a01b038116610bbe5760405162461bcd60e51b8152600401808060200182810382526026815260200180610f126026913960400191505060405180910390fd5b6009546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600980546001600160a01b0319166001600160a01b0392909216919091179055565b600082820183811015610c2c57600080fd5b9392505050565b3390565b600082821115610c4657600080fd5b50900390565b6001600160a01b038216610c5f57600080fd5b6001600160a01b03831660009081526007602052604090205460ff1615610ccd576040805162461bcd60e51b815260206004820152601b60248201527f46726f6d204164647265737320697320426c6f636b6c69737465640000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526007602052604090205460ff1615610d3b576040805162461bcd60e51b815260206004820152601960248201527f546f204164647265737320697320426c6f636b6c697374656400000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526006602052604090205460ff16610dca576008546001600160a01b038316600090815260208190526040902054610d819083610c1a565b1115610dca576040805162461bcd60e51b815260206004820152601360248201527215d85b1b195d08131a5b5a5d08115e18d95959606a1b604482015290519081900360640190fd5b6001600160a01b038316600090815260208190526040902054610ded9082610c37565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610e1c9082610c1a565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6001600160a01b038216610e8957600080fd5b600254610e969082610c37565b6002556001600160a01b038216600090815260208190526040902054610ebc9082610c37565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220546e1f40987719ed6b63262b2683b011dab2284ccabe0d5b7ac6bd59cea7275664736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,898 |
0x11d8391748a8b4a89da486b5b326c994996fc045 | /**
*Submitted for verification at Etherscan.io on 2022-04-24
*/
// https://t.me/lavainuportal
// https://lavainu.io
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract LINU is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Lava Inu ";
string private constant _symbol = "LINU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 3;
uint256 private _taxFeeOnBuy = 9;
uint256 private _redisFeeOnSell = 3;
uint256 private _taxFeeOnSell = 9;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => uint256) public _buyMap;
address payable private _marketingAddress ;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 20000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_marketingAddress = payable(_msgSender());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function initContract() external onlyOwner(){
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function setTrading(bool _tradingOpen) public onlyOwner {
require(!tradingOpen);
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(taxFeeOnBuy<= 15||taxFeeOnSell<=15);
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) external onlyOwner{
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount > 5000000 * 10**9 );
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610574578063dd62ed3e14610594578063ea1644d5146105da578063f2fde38b146105fa57600080fd5b8063a2a957bb146104ef578063a9059cbb1461050f578063bfd792841461052f578063c3c8cd801461055f57600080fd5b80638f70ccf7116100d15780638f70ccf71461046c5780638f9a55c01461048c57806395d89b41146104a257806398a5c315146104cf57600080fd5b80637d1db4a5146103f65780637f2feddc1461040c5780638203f5fe146104395780638da5cb5b1461044e57600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038c57806370a08231146103a1578063715018a6146103c157806374010ece146103d657600080fd5b8063313ce5671461031057806349bd5a5e1461032c5780636b9990531461034c5780636d8aa8f81461036c57600080fd5b80631694505e116101b65780631694505e1461027d57806318160ddd146102b557806323b872dd146102da5780632fd689e3146102fa57600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024d57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b2f565b61061a565b005b34801561021557600080fd5b5060408051808201909152600981526802630bb309024b73a960bd1b60208201525b6040516102449190611bf4565b60405180910390f35b34801561025957600080fd5b5061026d610268366004611c49565b6106b9565b6040519015158152602001610244565b34801561028957600080fd5b5060135461029d906001600160a01b031681565b6040516001600160a01b039091168152602001610244565b3480156102c157600080fd5b50670de0b6b3a76400005b604051908152602001610244565b3480156102e657600080fd5b5061026d6102f5366004611c75565b6106d0565b34801561030657600080fd5b506102cc60175481565b34801561031c57600080fd5b5060405160098152602001610244565b34801561033857600080fd5b5060145461029d906001600160a01b031681565b34801561035857600080fd5b50610207610367366004611cb6565b610739565b34801561037857600080fd5b50610207610387366004611ce3565b610784565b34801561039857600080fd5b506102076107cc565b3480156103ad57600080fd5b506102cc6103bc366004611cb6565b6107f9565b3480156103cd57600080fd5b5061020761081b565b3480156103e257600080fd5b506102076103f1366004611cfe565b61088f565b34801561040257600080fd5b506102cc60155481565b34801561041857600080fd5b506102cc610427366004611cb6565b60116020526000908152604090205481565b34801561044557600080fd5b506102076108d1565b34801561045a57600080fd5b506000546001600160a01b031661029d565b34801561047857600080fd5b50610207610487366004611ce3565b610a89565b34801561049857600080fd5b506102cc60165481565b3480156104ae57600080fd5b506040805180820190915260048152634c494e5560e01b6020820152610237565b3480156104db57600080fd5b506102076104ea366004611cfe565b610ae8565b3480156104fb57600080fd5b5061020761050a366004611d17565b610b17565b34801561051b57600080fd5b5061026d61052a366004611c49565b610b6f565b34801561053b57600080fd5b5061026d61054a366004611cb6565b60106020526000908152604090205460ff1681565b34801561056b57600080fd5b50610207610b7c565b34801561058057600080fd5b5061020761058f366004611d49565b610bb2565b3480156105a057600080fd5b506102cc6105af366004611dcd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105e657600080fd5b506102076105f5366004611cfe565b610c53565b34801561060657600080fd5b50610207610615366004611cb6565b610c82565b6000546001600160a01b0316331461064d5760405162461bcd60e51b815260040161064490611e06565b60405180910390fd5b60005b81518110156106b55760016010600084848151811061067157610671611e3b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106ad81611e67565b915050610650565b5050565b60006106c6338484610d6c565b5060015b92915050565b60006106dd848484610e90565b61072f843361072a85604051806060016040528060288152602001611f81602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113cc565b610d6c565b5060019392505050565b6000546001600160a01b031633146107635760405162461bcd60e51b815260040161064490611e06565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107ae5760405162461bcd60e51b815260040161064490611e06565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107ec57600080fd5b476107f681611406565b50565b6001600160a01b0381166000908152600260205260408120546106ca90611440565b6000546001600160a01b031633146108455760405162461bcd60e51b815260040161064490611e06565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b95760405162461bcd60e51b815260040161064490611e06565b6611c37937e0800081116108cc57600080fd5b601555565b6000546001600160a01b031633146108fb5760405162461bcd60e51b815260040161064490611e06565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610960573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109849190611e82565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f59190611e82565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a669190611e82565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610ab35760405162461bcd60e51b815260040161064490611e06565b601454600160a01b900460ff1615610aca57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b125760405162461bcd60e51b815260040161064490611e06565b601755565b6000546001600160a01b03163314610b415760405162461bcd60e51b815260040161064490611e06565b600f82111580610b525750600f8111155b610b5b57600080fd5b600893909355600a91909155600955600b55565b60006106c6338484610e90565b6012546001600160a01b0316336001600160a01b031614610b9c57600080fd5b6000610ba7306107f9565b90506107f6816114c4565b6000546001600160a01b03163314610bdc5760405162461bcd60e51b815260040161064490611e06565b60005b82811015610c4d578160056000868685818110610bfe57610bfe611e3b565b9050602002016020810190610c139190611cb6565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c4581611e67565b915050610bdf565b50505050565b6000546001600160a01b03163314610c7d5760405162461bcd60e51b815260040161064490611e06565b601655565b6000546001600160a01b03163314610cac5760405162461bcd60e51b815260040161064490611e06565b6001600160a01b038116610d115760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610644565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dce5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610644565b6001600160a01b038216610e2f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610644565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ef45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610644565b6001600160a01b038216610f565760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610644565b60008111610fb85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610644565b6000546001600160a01b03848116911614801590610fe457506000546001600160a01b03838116911614155b156112c557601454600160a01b900460ff1661107d576000546001600160a01b0384811691161461107d5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610644565b6015548111156110cf5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610644565b6001600160a01b03831660009081526010602052604090205460ff1615801561111157506001600160a01b03821660009081526010602052604090205460ff16155b6111695760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610644565b6014546001600160a01b038381169116146111ee576016548161118b846107f9565b6111959190611e9f565b106111ee5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610644565b60006111f9306107f9565b6017546015549192508210159082106112125760155491505b8080156112295750601454600160a81b900460ff16155b801561124357506014546001600160a01b03868116911614155b80156112585750601454600160b01b900460ff165b801561127d57506001600160a01b03851660009081526005602052604090205460ff16155b80156112a257506001600160a01b03841660009081526005602052604090205460ff16155b156112c2576112b0826114c4565b4780156112c0576112c047611406565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061130757506001600160a01b03831660009081526005602052604090205460ff165b8061133957506014546001600160a01b0385811691161480159061133957506014546001600160a01b03848116911614155b15611346575060006113c0565b6014546001600160a01b03858116911614801561137157506013546001600160a01b03848116911614155b1561138357600854600c55600954600d555b6014546001600160a01b0384811691161480156113ae57506013546001600160a01b03858116911614155b156113c057600a54600c55600b54600d555b610c4d8484848461163e565b600081848411156113f05760405162461bcd60e51b81526004016106449190611bf4565b5060006113fd8486611eb7565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106b5573d6000803e3d6000fd5b60006006548211156114a75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610644565b60006114b161166c565b90506114bd838261168f565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061150c5761150c611e3b565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611565573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115899190611e82565b8160018151811061159c5761159c611e3b565b6001600160a01b0392831660209182029290920101526013546115c29130911684610d6c565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906115fb908590600090869030904290600401611ece565b600060405180830381600087803b15801561161557600080fd5b505af1158015611629573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061164b5761164b6116d1565b6116568484846116ff565b80610c4d57610c4d600e54600c55600f54600d55565b60008060006116796117f6565b9092509050611688828261168f565b9250505090565b60006114bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611836565b600c541580156116e15750600d54155b156116e857565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061171187611864565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061174390876118c1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117729086611903565b6001600160a01b03891660009081526002602052604090205561179481611962565b61179e84836119ac565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117e391815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a7640000611811828261168f565b82101561182d57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836118575760405162461bcd60e51b81526004016106449190611bf4565b5060006113fd8486611f3f565b60008060008060008060008060006118818a600c54600d546119d0565b925092509250600061189161166c565b905060008060006118a48e878787611a25565b919e509c509a509598509396509194505050505091939550919395565b60006114bd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113cc565b6000806119108385611e9f565b9050838110156114bd5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610644565b600061196c61166c565b9050600061197a8383611a75565b306000908152600260205260409020549091506119979082611903565b30600090815260026020526040902055505050565b6006546119b990836118c1565b6006556007546119c99082611903565b6007555050565b60008080806119ea60646119e48989611a75565b9061168f565b905060006119fd60646119e48a89611a75565b90506000611a1582611a0f8b866118c1565b906118c1565b9992985090965090945050505050565b6000808080611a348886611a75565b90506000611a428887611a75565b90506000611a508888611a75565b90506000611a6282611a0f86866118c1565b939b939a50919850919650505050505050565b600082611a84575060006106ca565b6000611a908385611f61565b905082611a9d8583611f3f565b146114bd5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610644565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f657600080fd5b8035611b2a81611b0a565b919050565b60006020808385031215611b4257600080fd5b823567ffffffffffffffff80821115611b5a57600080fd5b818501915085601f830112611b6e57600080fd5b813581811115611b8057611b80611af4565b8060051b604051601f19603f83011681018181108582111715611ba557611ba5611af4565b604052918252848201925083810185019188831115611bc357600080fd5b938501935b82851015611be857611bd985611b1f565b84529385019392850192611bc8565b98975050505050505050565b600060208083528351808285015260005b81811015611c2157858101830151858201604001528201611c05565b81811115611c33576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c5c57600080fd5b8235611c6781611b0a565b946020939093013593505050565b600080600060608486031215611c8a57600080fd5b8335611c9581611b0a565b92506020840135611ca581611b0a565b929592945050506040919091013590565b600060208284031215611cc857600080fd5b81356114bd81611b0a565b80358015158114611b2a57600080fd5b600060208284031215611cf557600080fd5b6114bd82611cd3565b600060208284031215611d1057600080fd5b5035919050565b60008060008060808587031215611d2d57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d5e57600080fd5b833567ffffffffffffffff80821115611d7657600080fd5b818601915086601f830112611d8a57600080fd5b813581811115611d9957600080fd5b8760208260051b8501011115611dae57600080fd5b602092830195509350611dc49186019050611cd3565b90509250925092565b60008060408385031215611de057600080fd5b8235611deb81611b0a565b91506020830135611dfb81611b0a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e7b57611e7b611e51565b5060010190565b600060208284031215611e9457600080fd5b81516114bd81611b0a565b60008219821115611eb257611eb2611e51565b500190565b600082821015611ec957611ec9611e51565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f1e5784516001600160a01b031683529383019391830191600101611ef9565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f5c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f7b57611f7b611e51565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e3af0fa2e39d1634a49a9af1f1c5937a602b787ed2ddff55e3526b650f1fa54264736f6c634300080a0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,899 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.