Source Code
Overview
ETH Balance
0 ETH
Token Holdings
More Info
ContractCreator
Multichain Info
N/A
Latest 12 from a total of 12 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
Amount
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Buy ETH | 6532787 | 603 days ago | IN | 0.2 ETH | 0.0000001 | ||||
| Buy ETH | 6531078 | 603 days ago | IN | 29 ETH | 0.00000003 | ||||
| Buy ETH | 6530437 | 603 days ago | IN | 20 ETH | 0.00000005 | ||||
| Buy ETH | 6507208 | 603 days ago | IN | 0.005 ETH | 0.00000008 | ||||
| Buy ETH | 6507111 | 603 days ago | IN | 0.1 ETH | 0.00000009 | ||||
| Buy ETH | 6507108 | 603 days ago | IN | 0.5 ETH | 0.00000009 | ||||
| Buy ETH | 6507104 | 603 days ago | IN | 0.3 ETH | 0.00000009 | ||||
| Buy ETH | 6507098 | 603 days ago | IN | 0.1 ETH | 0.00000009 | ||||
| Buy ETH | 6506668 | 603 days ago | IN | 0.5 ETH | 0.0000001 | ||||
| Buy ETH | 6506546 | 603 days ago | IN | 0.2 ETH | 0.00000011 | ||||
| Buy ETH | 6503814 | 603 days ago | IN | 0.1 ETH | 0.00000011 | ||||
| Set Force Claima... | 6503598 | 603 days ago | IN | 0 ETH | 0.00000011 |
Latest 11 internal transactions
| Parent Transaction Hash | Block | From | To | Amount | ||
|---|---|---|---|---|---|---|
| 6532787 | 603 days ago | 0.2 ETH | ||||
| 6531078 | 603 days ago | 29 ETH | ||||
| 6530437 | 603 days ago | 20 ETH | ||||
| 6507208 | 603 days ago | 0.005 ETH | ||||
| 6507111 | 603 days ago | 0.1 ETH | ||||
| 6507108 | 603 days ago | 0.5 ETH | ||||
| 6507104 | 603 days ago | 0.3 ETH | ||||
| 6507098 | 603 days ago | 0.1 ETH | ||||
| 6506668 | 603 days ago | 0.5 ETH | ||||
| 6506546 | 603 days ago | 0.2 ETH | ||||
| 6503814 | 603 days ago | 0.1 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x90af9D6B...71D0C2849 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
FairAuction
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 1 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "../interface/IWETH.sol";
contract FairAuction is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
struct UserInfo {
uint256 allocation; // amount taken into account to obtain TOKEN (amount spent + discount)
uint256 contribution; // amount spent to buy TOKEN
uint256 discount; // discount % for this user
uint256 discountEligibleAmount; // max contribution amount eligible for a discount
address ref; // referral for this account
uint256 refEarnings; // referral earnings made by this account
uint256 refCount; // number of referrals made by this account
uint256 claimedRefEarnings; // amount of claimed referral earnings
bool hasClaimed; // has already claimed its allocation
}
uint256 public constant PROJECT_TOKEN_RATIO = 2;
uint256 public constant X_PROJECT_TOKEN_RATIO = 1;
IERC20 public immutable PROJECT_TOKEN; // Project token contract
IERC20 public immutable X_PROJECT_TOKEN; // X Project token contract
IERC20 public immutable SALE_TOKEN; // token used to participate
IERC20 public immutable LP_TOKEN; // Project LP address
uint256 public immutable START_TIME; // sale start time
uint256 public immutable END_TIME; // sale end time
uint256 public constant REFERRAL_SHARE = 3; // 3%
mapping(address => UserInfo) public userInfo; // buyers and referrers info
uint256 public totalRaised; // raised amount, does not take into account referral shares
uint256 public totalAllocation; // takes into account discounts
uint256 public immutable MAX_PROJECT_TOKENS_TO_DISTRIBUTE; // max PROJECT_TOKEN amount to distribute during the sale
uint256 public immutable MIN_TOTAL_RAISED_FOR_MAX_PROJECT_TOKEN; // amount to reach to distribute max PROJECT_TOKEN amount
uint256 public immutable MAX_RAISE_AMOUNT;
uint256 public immutable CAP_PER_WALLET;
address public immutable treasury; // treasury multisig, will receive raised amount
bool public unsoldTokensBurnt;
bool public forceClaimable; // safety measure to ensure that we can force claimable to true in case awaited LP token address plan change during the sale
address public weth;
constructor(
IERC20 projectToken,
IERC20 xProjectToken,
IERC20 saleToken,
IERC20 lpToken,
uint256 startTime,
uint256 endTime,
address treasury_,
uint256 maxToDistribute,
uint256 minToRaise,
uint256 maxToRaise,
uint256 capPerWallet,
address _weth
) Ownable(msg.sender) {
require(startTime < endTime, "invalid dates");
require(treasury_ != address(0), "invalid treasury");
PROJECT_TOKEN = projectToken;
X_PROJECT_TOKEN = xProjectToken;
SALE_TOKEN = saleToken;
LP_TOKEN = lpToken;
START_TIME = startTime;
END_TIME = endTime;
treasury = treasury_;
MAX_PROJECT_TOKENS_TO_DISTRIBUTE = maxToDistribute;
MIN_TOTAL_RAISED_FOR_MAX_PROJECT_TOKEN = minToRaise;
if (maxToRaise == 0) {
maxToRaise = type(uint256).max;
}
MAX_RAISE_AMOUNT = maxToRaise;
if (capPerWallet == 0) {
capPerWallet = type(uint256).max;
}
CAP_PER_WALLET = capPerWallet;
weth = _weth;
}
/********************************************/
/****************** EVENTS ******************/
/********************************************/
event Buy(address indexed user, uint256 amount);
event ClaimRefEarnings(address indexed user, uint256 amount);
event Claim(address indexed user, uint256 amount);
event NewRefEarning(address referrer, uint256 amount);
event DiscountUpdated();
event EmergencyWithdraw(address token, uint256 amount);
/***********************************************/
/****************** MODIFIERS ******************/
/***********************************************/
// receive() external payable() {
// require(address(saleToken) == weth, "non ETH sale");
// }
/**
* @dev Check whether the sale is currently active
*
* Will be marked as inactive if PROJECT_TOKEN has not been deposited into the contract
*/
modifier isSaleActive() {
require(
hasStarted() &&
!hasEnded() &&
PROJECT_TOKEN.balanceOf(address(this)) >=
(MAX_PROJECT_TOKENS_TO_DISTRIBUTE * PROJECT_TOKEN_RATIO) /
(PROJECT_TOKEN_RATIO + X_PROJECT_TOKEN_RATIO) &&
X_PROJECT_TOKEN.balanceOf(address(this)) >=
(MAX_PROJECT_TOKENS_TO_DISTRIBUTE * X_PROJECT_TOKEN_RATIO) /
(PROJECT_TOKEN_RATIO + X_PROJECT_TOKEN_RATIO),
"isActive: sale is not active"
);
_;
}
/**
* @dev Check whether users can claim their purchased PROJECT_TOKEN
*
* Sale must have ended, and LP tokens must have been formed
*/
modifier isClaimable() {
require(hasEnded(), "isClaimable: sale has not ended");
if (LP_TOKEN == IERC20(address(0))) {
require(forceClaimable, "isClaimable: LP token not set");
} else {
require(
LP_TOKEN.totalSupply() > 0 || forceClaimable,
"isClaimable: no LP tokens"
);
}
_;
}
/**************************************************/
/****************** PUBLIC VIEWS ******************/
/**************************************************/
/**
* @dev Get remaining duration before the end of the sale
*/
function getRemainingTime() external view returns (uint256) {
if (hasEnded()) return 0;
return END_TIME - _currentBlockTimestamp();
}
/**
* @dev Returns whether the sale has already started
*/
function hasStarted() public view returns (bool) {
return _currentBlockTimestamp() >= START_TIME;
}
/**
* @dev Returns whether the sale has already ended
*/
function hasEnded() public view returns (bool) {
return END_TIME <= _currentBlockTimestamp();
}
/**
* @dev Returns the amount of PROJECT_TOKEN to be distributed based on the current total raised
*/
function tokensToDistribute() public view returns (uint256) {
if (MIN_TOTAL_RAISED_FOR_MAX_PROJECT_TOKEN > totalRaised) {
return
(MAX_PROJECT_TOKENS_TO_DISTRIBUTE * totalRaised) /
MIN_TOTAL_RAISED_FOR_MAX_PROJECT_TOKEN;
}
return MAX_PROJECT_TOKENS_TO_DISTRIBUTE;
}
/**
* @dev Get user share times 1e5
*/
function getExpectedClaimAmount(
address account
) public view returns (uint256) {
if (totalAllocation == 0) return 0;
UserInfo memory user = userInfo[account];
return (user.allocation * tokensToDistribute()) / totalAllocation;
}
/****************************************************************/
/****************** EXTERNAL PUBLIC FUNCTIONS ******************/
/****************************************************************/
function buyETH(
address referralAddress
) external payable isSaleActive nonReentrant {
require(address(SALE_TOKEN) == weth, "non ETH sale");
uint256 amount = msg.value;
IWETH(weth).deposit{value: amount}();
_buy(amount, referralAddress);
}
/**
* @dev Purchase an allocation for the sale for a value of "amount" SALE_TOKEN, referred by "referralAddress"
*/
function buy(
uint256 amount,
address referralAddress
) external isSaleActive nonReentrant {
SALE_TOKEN.safeTransferFrom(msg.sender, address(this), amount);
_buy(amount, referralAddress);
}
function _buy(uint256 amount, address referralAddress) internal {
require(amount > 0, "buy: zero amount");
require(
totalRaised + amount <= MAX_RAISE_AMOUNT,
"buy: hardcap reached"
);
require(msg.sender == tx.origin, "FORBIDDEN");
uint256 participationAmount = amount;
UserInfo storage user = userInfo[msg.sender];
require(
user.contribution + amount <= CAP_PER_WALLET,
"buy: wallet cap reached"
);
// handle user's referral
if (
user.allocation == 0 &&
user.ref == address(0) &&
referralAddress != address(0) &&
referralAddress != msg.sender
) {
// If first buy, and does not have any ref already set
user.ref = referralAddress;
}
referralAddress = user.ref;
if (referralAddress != address(0)) {
UserInfo storage referrer = userInfo[referralAddress];
// compute and send referrer share
uint256 refShareAmount = (REFERRAL_SHARE * amount) / 100;
referrer.refEarnings = referrer.refEarnings + refShareAmount;
referrer.refCount = referrer.refCount + 1;
participationAmount = participationAmount - refShareAmount;
emit NewRefEarning(referralAddress, refShareAmount);
}
uint256 allocation = amount;
if (
user.discount > 0 && user.contribution < user.discountEligibleAmount
) {
// Get eligible amount for the active user's discount
uint256 discountEligibleAmount = user.discountEligibleAmount -
user.contribution;
if (discountEligibleAmount > amount) {
discountEligibleAmount = amount;
}
// Readjust user new allocation
allocation =
allocation +
(discountEligibleAmount * user.discount) /
100;
}
// update raised amounts
user.contribution = user.contribution + amount;
totalRaised = totalRaised + amount;
// update allocations
user.allocation = user.allocation + allocation;
totalAllocation = totalAllocation + allocation;
emit Buy(msg.sender, amount);
// transfer contribution to treasury
SALE_TOKEN.safeTransfer(treasury, participationAmount);
}
/**
* @dev Claim referral earnings
*/
function claimRefEarnings() public {
UserInfo storage user = userInfo[msg.sender];
uint256 toClaim = user.refEarnings - user.claimedRefEarnings;
if (toClaim > 0) {
user.claimedRefEarnings = user.claimedRefEarnings + toClaim;
emit ClaimRefEarnings(msg.sender, toClaim);
SALE_TOKEN.safeTransfer(msg.sender, toClaim);
}
}
/**
* @dev Claim purchased PROJECT_TOKEN during the sale
*/
function claim() external isClaimable {
UserInfo storage user = userInfo[msg.sender];
require(
totalAllocation > 0 && user.allocation > 0,
"claim: zero allocation"
);
require(!user.hasClaimed, "claim: already claimed");
user.hasClaimed = true;
uint256 amount = getExpectedClaimAmount(msg.sender);
emit Claim(msg.sender, amount);
// send PROJECT_TOKEN allocation
_safeClaimTransfer(msg.sender, amount);
}
/****************************************************************/
/********************** OWNABLE FUNCTIONS **********************/
/****************************************************************/
struct DiscountSettings {
address account;
uint256 discount;
uint256 eligibleAmount;
}
/**
* @dev Assign custom discounts, used for v1 users
*
* Based on saved v1 tokens amounts in our snapshot
*/
function setUsersDiscount(
DiscountSettings[] calldata users
) public onlyOwner {
for (uint256 i = 0; i < users.length; ++i) {
DiscountSettings memory userDiscount = users[i];
UserInfo storage user = userInfo[userDiscount.account];
require(userDiscount.discount <= 35, "discount too high");
user.discount = userDiscount.discount;
user.discountEligibleAmount = userDiscount.eligibleAmount;
}
emit DiscountUpdated();
}
/********************************************************/
/****************** /!\ EMERGENCY ONLY ******************/
/********************************************************/
/**
* @dev Failsafe
*/
function emergencyWithdrawFunds(
address token,
uint256 amount
) external onlyOwner {
IERC20(token).safeTransfer(msg.sender, amount);
emit EmergencyWithdraw(token, amount);
}
function setForceClaimable(bool _forceClaimable) external onlyOwner {
forceClaimable = _forceClaimable;
}
/**
* @dev Burn unsold PROJECT_TOKEN if MIN_TOTAL_RAISED_FOR_MAX_PROJECT_TOKEN has not been reached
*
* Must only be called by the owner
*/
function burnUnsoldTokens() external onlyOwner {
require(hasEnded(), "burnUnsoldTokens: presale has not ended");
require(!unsoldTokensBurnt, "burnUnsoldTokens: already burnt");
uint256 totalSold = tokensToDistribute();
require(
totalSold < MAX_PROJECT_TOKENS_TO_DISTRIBUTE,
"burnUnsoldTokens: no token to burn"
);
unsoldTokensBurnt = true;
PROJECT_TOKEN.transfer(
0x000000000000000000000000000000000000dEaD,
MAX_PROJECT_TOKENS_TO_DISTRIBUTE - totalSold
);
}
/********************************************************/
/****************** INTERNAL FUNCTIONS ******************/
/********************************************************/
/**
* @dev Safe token transfer function, in case rounding error causes contract to not have enough tokens
*/
function _safeClaimTransfer(address to, uint256 amount) internal {
uint256 balance = PROJECT_TOKEN.balanceOf(address(this));
uint256 xBalance = X_PROJECT_TOKEN.balanceOf(address(this));
bool transferSuccess = false;
uint256 xAmount = (amount * X_PROJECT_TOKEN_RATIO) /
(PROJECT_TOKEN_RATIO + X_PROJECT_TOKEN_RATIO);
uint256 projectAmount = amount - xAmount;
if (projectAmount > balance) {
transferSuccess = PROJECT_TOKEN.transfer(to, balance);
} else {
transferSuccess = PROJECT_TOKEN.transfer(to, projectAmount);
}
if (xAmount > xBalance) {
transferSuccess = X_PROJECT_TOKEN.transfer(to, xBalance);
} else {
transferSuccess = X_PROJECT_TOKEN.transfer(to, xAmount);
}
require(transferSuccess, "safeClaimTransfer: Transfer failed");
}
/**
* @dev Utility function to get the current block timestamp
*/
function _currentBlockTimestamp() internal view virtual returns (uint256) {
return block.timestamp;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. 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;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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 Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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, uint256 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
/**
* @dev An operation with an ERC20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @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);
if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @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).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// 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 cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @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 or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* 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.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @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`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function withdraw(uint) external;
}{
"optimizer": {
"enabled": true,
"runs": 1
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract ABI
API[{"inputs":[{"internalType":"contract IERC20","name":"projectToken","type":"address"},{"internalType":"contract IERC20","name":"xProjectToken","type":"address"},{"internalType":"contract IERC20","name":"saleToken","type":"address"},{"internalType":"contract IERC20","name":"lpToken","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"address","name":"treasury_","type":"address"},{"internalType":"uint256","name":"maxToDistribute","type":"uint256"},{"internalType":"uint256","name":"minToRaise","type":"uint256"},{"internalType":"uint256","name":"maxToRaise","type":"uint256"},{"internalType":"uint256","name":"capPerWallet","type":"uint256"},{"internalType":"address","name":"_weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Buy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ClaimRefEarnings","type":"event"},{"anonymous":false,"inputs":[],"name":"DiscountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"referrer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"NewRefEarning","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"CAP_PER_WALLET","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"END_TIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LP_TOKEN","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PROJECT_TOKENS_TO_DISTRIBUTE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_RAISE_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_TOTAL_RAISED_FOR_MAX_PROJECT_TOKEN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROJECT_TOKEN","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROJECT_TOKEN_RATIO","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REFERRAL_SHARE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SALE_TOKEN","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"START_TIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"X_PROJECT_TOKEN","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"X_PROJECT_TOKEN_RATIO","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"burnUnsoldTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"referralAddress","type":"address"}],"name":"buy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"referralAddress","type":"address"}],"name":"buyETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimRefEarnings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"emergencyWithdrawFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"forceClaimable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getExpectedClaimAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRemainingTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasEnded","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasStarted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_forceClaimable","type":"bool"}],"name":"setForceClaimable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"discount","type":"uint256"},{"internalType":"uint256","name":"eligibleAmount","type":"uint256"}],"internalType":"struct FairAuction.DiscountSettings[]","name":"users","type":"tuple[]"}],"name":"setUsersDiscount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokensToDistribute","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRaised","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unsoldTokensBurnt","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"allocation","type":"uint256"},{"internalType":"uint256","name":"contribution","type":"uint256"},{"internalType":"uint256","name":"discount","type":"uint256"},{"internalType":"uint256","name":"discountEligibleAmount","type":"uint256"},{"internalType":"address","name":"ref","type":"address"},{"internalType":"uint256","name":"refEarnings","type":"uint256"},{"internalType":"uint256","name":"refCount","type":"uint256"},{"internalType":"uint256","name":"claimedRefEarnings","type":"uint256"},{"internalType":"bool","name":"hasClaimed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
0x6101e06040523480156200001257600080fd5b50604051620027fd380380620027fd833981016040819052620000359162000206565b33806200005d57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b62000068816200019d565b5060018055868810620000ae5760405162461bcd60e51b815260206004820152600d60248201526c696e76616c696420646174657360981b604482015260640162000054565b6001600160a01b038616620000f95760405162461bcd60e51b815260206004820152601060248201526f696e76616c696420747265617375727960801b604482015260640162000054565b6001600160a01b03808d166080528b811660a0528a811660c05289811660e05261010089905261012088905286166101c0526101408590526101608490526000839003620001475760001992505b61018083905260008290036200015d5760001991505b6101a091909152600580546001600160a01b03909216620100000262010000600160b01b031990921691909117905550620002da98505050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200020357600080fd5b50565b6000806000806000806000806000806000806101808d8f0312156200022a57600080fd5b8c516200023781620001ed565b60208e0151909c506200024a81620001ed565b60408e0151909b506200025d81620001ed565b60608e0151909a506200027081620001ed565b8099505060808d0151975060a08d0151965060c08d01516200029281620001ed565b8096505060e08d015194506101008d015193506101208d015192506101408d015191506101608d0151620002c681620001ed565b809150509295989b509295989b509295989b565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516123b562000448600039600081816103620152611e3401526000818161070b0152611b8901526000818161050f0152611ac30152600081816106d701528181610afe0152610b250152600081816104bb01528181610b4901528181610b8401528181610bd901528181610cb101528181610fcb015281816110a3015281816112a9015261136601526000818161029e01528181611507015261154601526000818161060b015261075101526000818161058c015281816107d1015261085d01526000818161055801528181610ad001528181610d98015281816111920152611e120152600081816103df01528181610cf6015281816110e80152818161166d01528181611881015261191901526000818161068301528181610c1e0152818161101001528181611338015281816115f10152818161174d01526117e501526123b56000f3fe60806040526004361061019f5760003560e01c80631959a002146101a457806325c909d61461026a57806337ba682d1461028c5780633fc8cef3146102ce578063428640441461030157806344691f7e146103165780634e71d92d1461033b57806361d027b314610350578063641ddc2e14610384578063664ef3621461039957806367a80efd146103b8578063684006e5146103cd5780636ee56f3314610401578063715018a614610414578063742145461461042957806379203dc4146104495780637deb60251461045f5780638da5cb5b1461047f578063940bb34414610494578063a1f5f6e7146104a9578063a2fddd6f146104dd578063a8284463146104fd578063b21b5a2114610531578063b8ac77a414610546578063bfd9041b1461057a578063c2f5e463146105ae578063c5c4744c146105c3578063d1aa4974146105d9578063ddaa26ad146105f9578063e165f5c11461062d578063ecb70fb714610647578063efb98bcf1461065c578063f0686c8014610671578063f2fde38b146106a5578063fbed31e0146106c5578063fc617791146106f9575b600080fd5b3480156101b057600080fd5b506102176101bf366004612095565b6002602081905260009182526040909120805460018201549282015460038301546004840154600585015460068601546007870154600890970154959796949593946001600160a01b03909316939192909160ff1689565b60408051998a5260208a01989098529688019590955260608701939093526001600160a01b03909116608086015260a085015260c084015260e08301521515610100820152610120015b60405180910390f35b34801561027657600080fd5b5061028a6102853660046120be565b61072d565b005b34801561029857600080fd5b506102c07f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610261565b3480156102da57600080fd5b506005546102f4906201000090046001600160a01b031681565b60405161026191906120db565b34801561030d57600080fd5b506102c0600181565b34801561032257600080fd5b5061032b61074f565b6040519015158152602001610261565b34801561034757600080fd5b5061028a610776565b34801561035c57600080fd5b506102f47f000000000000000000000000000000000000000000000000000000000000000081565b34801561039057600080fd5b5061028a610a4b565b3480156103a557600080fd5b5060055461032b90610100900460ff1681565b3480156103c457600080fd5b506102c0610af7565b3480156103d957600080fd5b506102f47f000000000000000000000000000000000000000000000000000000000000000081565b61028a61040f366004612095565b610ba6565b34801561042057600080fd5b5061028a610e8b565b34801561043557600080fd5b5061028a6104443660046120ef565b610e9f565b34801561045557600080fd5b506102c060045481565b34801561046b57600080fd5b5061028a61047a366004612163565b610f98565b34801561048b57600080fd5b506102f46111cd565b3480156104a057600080fd5b5061028a6111dc565b3480156104b557600080fd5b506102c07f000000000000000000000000000000000000000000000000000000000000000081565b3480156104e957600080fd5b5061028a6104f836600461218f565b6113ea565b34801561050957600080fd5b506102c07f000000000000000000000000000000000000000000000000000000000000000081565b34801561053d57600080fd5b506102c0600381565b34801561055257600080fd5b506102f47f000000000000000000000000000000000000000000000000000000000000000081565b34801561058657600080fd5b506102f47f000000000000000000000000000000000000000000000000000000000000000081565b3480156105ba57600080fd5b506102c0600281565b3480156105cf57600080fd5b506102c060035481565b3480156105e557600080fd5b506102c06105f4366004612095565b611443565b34801561060557600080fd5b506102c07f000000000000000000000000000000000000000000000000000000000000000081565b34801561063957600080fd5b5060055461032b9060ff1681565b34801561065357600080fd5b5061032b611504565b34801561066857600080fd5b506102c061152b565b34801561067d57600080fd5b506102f47f000000000000000000000000000000000000000000000000000000000000000081565b3480156106b157600080fd5b5061028a6106c0366004612095565b61156a565b3480156106d157600080fd5b506102c07f000000000000000000000000000000000000000000000000000000000000000081565b34801561070557600080fd5b506102c07f000000000000000000000000000000000000000000000000000000000000000081565b6107356115a5565b600580549115156101000261ff0019909216919091179055565b7f000000000000000000000000000000000000000000000000000000000000000042101590565b61077e611504565b6107cf5760405162461bcd60e51b815260206004820152601f60248201527f6973436c61696d61626c653a2073616c6520686173206e6f7420656e6465640060448201526064015b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661085957600554610100900460ff166108545760405162461bcd60e51b815260206004820152601d60248201527f6973436c61696d61626c653a204c5020746f6b656e206e6f742073657400000060448201526064016107c6565b610938565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dd91906121b9565b11806108f05750600554610100900460ff165b6109385760405162461bcd60e51b81526020600482015260196024820152786973436c61696d61626c653a206e6f204c5020746f6b656e7360381b60448201526064016107c6565b336000908152600260205260409020600454158015906109585750805415155b61099d5760405162461bcd60e51b815260206004820152601660248201527531b630b4b69d103d32b9379030b63637b1b0ba34b7b760511b60448201526064016107c6565b600881015460ff16156109eb5760405162461bcd60e51b815260206004820152601660248201527518db185a5b4e88185b1c9958591e4818db185a5b595960521b60448201526064016107c6565b60088101805460ff191660011790556000610a0533611443565b60405181815290915033907f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d49060200160405180910390a2610a4733826115d7565b5050565b33600090815260026020526040812060078101546005820154919291610a7191906121e8565b90508015610a4757808260070154610a8991906121fb565b600783015560405181815233907fe0b46c91649485ec4f8a85100cc80f5edd3778bee364d122bfaf0065205df56a9060200160405180910390a2610a476001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633836119f7565b60006003547f00000000000000000000000000000000000000000000000000000000000000001115610b81577f00000000000000000000000000000000000000000000000000000000000000006003547f0000000000000000000000000000000000000000000000000000000000000000610b72919061220e565b610b7c9190612225565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b610bae61074f565b8015610bbf5750610bbd611504565b155b8015610c975750610bd2600160026121fb565b610bfd60027f000000000000000000000000000000000000000000000000000000000000000061220e565b610c079190612225565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190610c539030906004016120db565b602060405180830381865afa158015610c70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9491906121b9565b10155b8015610d6f5750610caa600160026121fb565b610cd560017f000000000000000000000000000000000000000000000000000000000000000061220e565b610cdf9190612225565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190610d2b9030906004016120db565b602060405180830381865afa158015610d48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6c91906121b9565b10155b610d8b5760405162461bcd60e51b81526004016107c690612247565b610d93611a54565b6005547f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03908116620100009092041614610e065760405162461bcd60e51b815260206004820152600c60248201526b6e6f6e204554482073616c6560a01b60448201526064016107c6565b6000349050600560029054906101000a90046001600160a01b03166001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015610e5b57600080fd5b505af1158015610e6f573d6000803e3d6000fd5b5050505050610e7e8183611a7e565b50610e8860018055565b50565b610e936115a5565b610e9d6000611e60565b565b610ea76115a5565b60005b81811015610f6a576000838383818110610ec657610ec661227d565b905060600201803603810190610edc9190612293565b80516001600160a01b03166000908152600260209081526040909120908201519192509060231015610f445760405162461bcd60e51b81526020600482015260116024820152700c8d2e6c6deeadce840e8dede40d0d2ced607b1b60448201526064016107c6565b60208201516002820155604090910151600390910155610f6381612301565b9050610eaa565b506040517fe6e7add12c2bec7372a9746b87dc5ef9b4473697bfe869dafad06298fccd087a90600090a15050565b610fa061074f565b8015610fb15750610faf611504565b155b80156110895750610fc4600160026121fb565b610fef60027f000000000000000000000000000000000000000000000000000000000000000061220e565b610ff99190612225565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a08231906110459030906004016120db565b602060405180830381865afa158015611062573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108691906121b9565b10155b8015611161575061109c600160026121fb565b6110c760017f000000000000000000000000000000000000000000000000000000000000000061220e565b6110d19190612225565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a082319061111d9030906004016120db565b602060405180830381865afa15801561113a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115e91906121b9565b10155b61117d5760405162461bcd60e51b81526004016107c690612247565b611185611a54565b6111ba6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333085611eb0565b6111c48282611a7e565b610a4760018055565b6000546001600160a01b031690565b6111e46115a5565b6111ec611504565b6112485760405162461bcd60e51b815260206004820152602760248201527f6275726e556e736f6c64546f6b656e733a2070726573616c6520686173206e6f6044820152661d08195b99195960ca1b60648201526084016107c6565b60055460ff161561129b5760405162461bcd60e51b815260206004820152601f60248201527f6275726e556e736f6c64546f6b656e733a20616c7265616479206275726e740060448201526064016107c6565b60006112a5610af7565b90507f000000000000000000000000000000000000000000000000000000000000000081106113215760405162461bcd60e51b815260206004820152602260248201527f6275726e556e736f6c64546f6b656e733a206e6f20746f6b656e20746f206275604482015261393760f11b60648201526084016107c6565b6005805460ff191660011790556001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663a9059cbb61dead61138a847f00000000000000000000000000000000000000000000000000000000000000006121e8565b6040518363ffffffff1660e01b81526004016113a792919061231a565b6020604051808303816000875af11580156113c6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a479190612333565b6113f26115a5565b6114066001600160a01b03831633836119f7565b7f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd9695828260405161143792919061231a565b60405180910390a15050565b600060045460000361145757506000919050565b6001600160a01b03808316600090815260026020818152604092839020835161012081018552815481526001820154928101929092529182015492810192909252600381015460608301526004808201549093166080830152600581015460a0830152600681015460c0830152600781015460e08301526008015460ff16151561010082015290546114e7610af7565b82516114f3919061220e565b6114fd9190612225565b9392505050565b427f0000000000000000000000000000000000000000000000000000000000000000111590565b6000611535611504565b156115405750600090565b610b7c427f00000000000000000000000000000000000000000000000000000000000000006121e8565b6115726115a5565b6001600160a01b03811661159c576000604051631e4fbdf760e01b81526004016107c691906120db565b610e8881611e60565b336115ae6111cd565b6001600160a01b031614610e9d573360405163118cdaa760e01b81526004016107c691906120db565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a08231906116269030906004016120db565b602060405180830381865afa158015611643573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166791906121b9565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016116b791906120db565b602060405180830381865afa1580156116d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f891906121b9565b9050600080611709600160026121fb565b61171460018761220e565b61171e9190612225565b9050600061172c82876121e8565b9050848111156117ce5760405163a9059cbb60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb90611784908a90899060040161231a565b6020604051808303816000875af11580156117a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c79190612333565b9250611862565b60405163a9059cbb60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb9061181c908a90859060040161231a565b6020604051808303816000875af115801561183b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185f9190612333565b92505b838211156119025760405163a9059cbb60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906118b8908a90889060040161231a565b6020604051808303816000875af11580156118d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118fb9190612333565b9250611996565b60405163a9059cbb60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb90611950908a90869060040161231a565b6020604051808303816000875af115801561196f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119939190612333565b92505b826119ee5760405162461bcd60e51b815260206004820152602260248201527f73616665436c61696d5472616e736665723a205472616e73666572206661696c604482015261195960f21b60648201526084016107c6565b50505050505050565b611a4f83846001600160a01b031663a9059cbb8585604051602401611a1d92919061231a565b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050611eef565b505050565b600260015403611a7757604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b60008211611ac15760405162461bcd60e51b815260206004820152601060248201526f189d5e4e881e995c9bc8185b5bdd5b9d60821b60448201526064016107c6565b7f000000000000000000000000000000000000000000000000000000000000000082600354611af091906121fb565b1115611b355760405162461bcd60e51b8152602060048201526014602482015273189d5e4e881a185c9918d85c081c995858da195960621b60448201526064016107c6565b333214611b705760405162461bcd60e51b81526020600482015260096024820152682327a92124a22222a760b91b60448201526064016107c6565b33600090815260026020526040902060018101548391907f000000000000000000000000000000000000000000000000000000000000000090611bb49084906121fb565b1115611bfc5760405162461bcd60e51b8152602060048201526017602482015276189d5e4e881dd85b1b195d0818d85c081c995858da1959604a1b60448201526064016107c6565b8054158015611c16575060048101546001600160a01b0316155b8015611c2a57506001600160a01b03831615155b8015611c3f57506001600160a01b0383163314155b15611c62576004810180546001600160a01b0319166001600160a01b0385161790555b60048101546001600160a01b031692508215611d1c576001600160a01b0383166000908152600260205260408120906064611c9e87600361220e565b611ca89190612225565b9050808260050154611cba91906121fb565b60058301556006820154611ccf9060016121fb565b6006830155611cde81856121e8565b93507fed705b591bdaba923b0ab0afaedaeefc22fd650b2a9f507b21758f2e7e397af98582604051611d1192919061231a565b60405180910390a150505b6002810154849015801590611d38575081600301548260010154105b15611d8a57600082600101548360030154611d5391906121e8565b905085811115611d605750845b6064836002015482611d72919061220e565b611d7c9190612225565b611d8690836121fb565b9150505b848260010154611d9a91906121fb565b6001830155600354611dad9086906121fb565b6003558154611dbd9082906121fb565b8255600454611dcd9082906121fb565b60045560405185815233907fe3d4187f6ca4248660cc0ac8b8056515bac4a8132be2eca31d6d0cc170722a7e9060200160405180910390a2611e596001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f0000000000000000000000000000000000000000000000000000000000000000856119f7565b5050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b038481166024830152838116604483015260648201839052611ee99186918216906323b872dd90608401611a1d565b50505050565b6000611f046001600160a01b03841683611f49565b90508051600014158015611f29575080806020019051810190611f279190612333565b155b15611a4f5782604051635274afe760e01b81526004016107c691906120db565b6060611f5783836000611f60565b90505b92915050565b606081471015611f85573060405163cd78605960e01b81526004016107c691906120db565b600080856001600160a01b03168486604051611fa19190612350565b60006040518083038185875af1925050503d8060008114611fde576040519150601f19603f3d011682016040523d82523d6000602084013e611fe3565b606091505b5091509150611ff3868383611ffd565b9695505050505050565b6060826120125761200d82612050565b6114fd565b815115801561202957506001600160a01b0384163b155b156120495783604051639996b31560e01b81526004016107c691906120db565b50806114fd565b8051156120605780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b038116811461209057600080fd5b919050565b6000602082840312156120a757600080fd5b611f5782612079565b8015158114610e8857600080fd5b6000602082840312156120d057600080fd5b81356114fd816120b0565b6001600160a01b0391909116815260200190565b6000806020838503121561210257600080fd5b82356001600160401b038082111561211957600080fd5b818501915085601f83011261212d57600080fd5b81358181111561213c57600080fd5b86602060608302850101111561215157600080fd5b60209290920196919550909350505050565b6000806040838503121561217657600080fd5b8235915061218660208401612079565b90509250929050565b600080604083850312156121a257600080fd5b6121ab83612079565b946020939093013593505050565b6000602082840312156121cb57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115611f5a57611f5a6121d2565b80820180821115611f5a57611f5a6121d2565b8082028115828204841417611f5a57611f5a6121d2565b60008261224257634e487b7160e01b600052601260045260246000fd5b500490565b6020808252601c908201527b69734163746976653a2073616c65206973206e6f742061637469766560201b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000606082840312156122a557600080fd5b604051606081016001600160401b03811182821017156122d557634e487b7160e01b600052604160045260246000fd5b6040526122e183612079565b815260208301356020820152604083013560408201528091505092915050565b600060018201612313576123136121d2565b5060010190565b6001600160a01b03929092168252602082015260400190565b60006020828403121561234557600080fd5b81516114fd816120b0565b6000825160005b818110156123715760208186018101518583015201612357565b50600092019182525091905056fea2646970667358221220ccf8a19d0ce83e1a3bfcc7b5c425c5e4aa6911e87cb7a0967fef613cc2c85c8d64736f6c63430008140033000000000000000000000000a07ac8cde2a98b189477b8e41f0c2ea6cddbc0550000000000000000000000001b71b460e914fef538c2ae177a954e0ce5fce31400000000000000000000000042000000000000000000000000000000000000230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006661eedc000000000000000000000000000000000000000000000000000000006663405c000000000000000000000000ca640e70e1822096aa42a79a363d7849cd34664c00000000000000000000000000000000000000000000152d02c7e14af6800000000000000000000000000000000000000000000000000001158e460913d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004200000000000000000000000000000000000023
Deployed Bytecode
0x60806040526004361061019f5760003560e01c80631959a002146101a457806325c909d61461026a57806337ba682d1461028c5780633fc8cef3146102ce578063428640441461030157806344691f7e146103165780634e71d92d1461033b57806361d027b314610350578063641ddc2e14610384578063664ef3621461039957806367a80efd146103b8578063684006e5146103cd5780636ee56f3314610401578063715018a614610414578063742145461461042957806379203dc4146104495780637deb60251461045f5780638da5cb5b1461047f578063940bb34414610494578063a1f5f6e7146104a9578063a2fddd6f146104dd578063a8284463146104fd578063b21b5a2114610531578063b8ac77a414610546578063bfd9041b1461057a578063c2f5e463146105ae578063c5c4744c146105c3578063d1aa4974146105d9578063ddaa26ad146105f9578063e165f5c11461062d578063ecb70fb714610647578063efb98bcf1461065c578063f0686c8014610671578063f2fde38b146106a5578063fbed31e0146106c5578063fc617791146106f9575b600080fd5b3480156101b057600080fd5b506102176101bf366004612095565b6002602081905260009182526040909120805460018201549282015460038301546004840154600585015460068601546007870154600890970154959796949593946001600160a01b03909316939192909160ff1689565b60408051998a5260208a01989098529688019590955260608701939093526001600160a01b03909116608086015260a085015260c084015260e08301521515610100820152610120015b60405180910390f35b34801561027657600080fd5b5061028a6102853660046120be565b61072d565b005b34801561029857600080fd5b506102c07f000000000000000000000000000000000000000000000000000000006663405c81565b604051908152602001610261565b3480156102da57600080fd5b506005546102f4906201000090046001600160a01b031681565b60405161026191906120db565b34801561030d57600080fd5b506102c0600181565b34801561032257600080fd5b5061032b61074f565b6040519015158152602001610261565b34801561034757600080fd5b5061028a610776565b34801561035c57600080fd5b506102f47f000000000000000000000000ca640e70e1822096aa42a79a363d7849cd34664c81565b34801561039057600080fd5b5061028a610a4b565b3480156103a557600080fd5b5060055461032b90610100900460ff1681565b3480156103c457600080fd5b506102c0610af7565b3480156103d957600080fd5b506102f47f0000000000000000000000001b71b460e914fef538c2ae177a954e0ce5fce31481565b61028a61040f366004612095565b610ba6565b34801561042057600080fd5b5061028a610e8b565b34801561043557600080fd5b5061028a6104443660046120ef565b610e9f565b34801561045557600080fd5b506102c060045481565b34801561046b57600080fd5b5061028a61047a366004612163565b610f98565b34801561048b57600080fd5b506102f46111cd565b3480156104a057600080fd5b5061028a6111dc565b3480156104b557600080fd5b506102c07f00000000000000000000000000000000000000000000152d02c7e14af680000081565b3480156104e957600080fd5b5061028a6104f836600461218f565b6113ea565b34801561050957600080fd5b506102c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b34801561053d57600080fd5b506102c0600381565b34801561055257600080fd5b506102f47f000000000000000000000000420000000000000000000000000000000000002381565b34801561058657600080fd5b506102f47f000000000000000000000000000000000000000000000000000000000000000081565b3480156105ba57600080fd5b506102c0600281565b3480156105cf57600080fd5b506102c060035481565b3480156105e557600080fd5b506102c06105f4366004612095565b611443565b34801561060557600080fd5b506102c07f000000000000000000000000000000000000000000000000000000006661eedc81565b34801561063957600080fd5b5060055461032b9060ff1681565b34801561065357600080fd5b5061032b611504565b34801561066857600080fd5b506102c061152b565b34801561067d57600080fd5b506102f47f000000000000000000000000a07ac8cde2a98b189477b8e41f0c2ea6cddbc05581565b3480156106b157600080fd5b5061028a6106c0366004612095565b61156a565b3480156106d157600080fd5b506102c07f000000000000000000000000000000000000000000000001158e460913d0000081565b34801561070557600080fd5b506102c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b6107356115a5565b600580549115156101000261ff0019909216919091179055565b7f000000000000000000000000000000000000000000000000000000006661eedc42101590565b61077e611504565b6107cf5760405162461bcd60e51b815260206004820152601f60248201527f6973436c61696d61626c653a2073616c6520686173206e6f7420656e6465640060448201526064015b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661085957600554610100900460ff166108545760405162461bcd60e51b815260206004820152601d60248201527f6973436c61696d61626c653a204c5020746f6b656e206e6f742073657400000060448201526064016107c6565b610938565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dd91906121b9565b11806108f05750600554610100900460ff165b6109385760405162461bcd60e51b81526020600482015260196024820152786973436c61696d61626c653a206e6f204c5020746f6b656e7360381b60448201526064016107c6565b336000908152600260205260409020600454158015906109585750805415155b61099d5760405162461bcd60e51b815260206004820152601660248201527531b630b4b69d103d32b9379030b63637b1b0ba34b7b760511b60448201526064016107c6565b600881015460ff16156109eb5760405162461bcd60e51b815260206004820152601660248201527518db185a5b4e88185b1c9958591e4818db185a5b595960521b60448201526064016107c6565b60088101805460ff191660011790556000610a0533611443565b60405181815290915033907f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d49060200160405180910390a2610a4733826115d7565b5050565b33600090815260026020526040812060078101546005820154919291610a7191906121e8565b90508015610a4757808260070154610a8991906121fb565b600783015560405181815233907fe0b46c91649485ec4f8a85100cc80f5edd3778bee364d122bfaf0065205df56a9060200160405180910390a2610a476001600160a01b037f00000000000000000000000042000000000000000000000000000000000000231633836119f7565b60006003547f000000000000000000000000000000000000000000000001158e460913d000001115610b81577f000000000000000000000000000000000000000000000001158e460913d000006003547f00000000000000000000000000000000000000000000152d02c7e14af6800000610b72919061220e565b610b7c9190612225565b905090565b507f00000000000000000000000000000000000000000000152d02c7e14af680000090565b610bae61074f565b8015610bbf5750610bbd611504565b155b8015610c975750610bd2600160026121fb565b610bfd60027f00000000000000000000000000000000000000000000152d02c7e14af680000061220e565b610c079190612225565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000a07ac8cde2a98b189477b8e41f0c2ea6cddbc05516906370a0823190610c539030906004016120db565b602060405180830381865afa158015610c70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9491906121b9565b10155b8015610d6f5750610caa600160026121fb565b610cd560017f00000000000000000000000000000000000000000000152d02c7e14af680000061220e565b610cdf9190612225565b6040516370a0823160e01b81526001600160a01b037f0000000000000000000000001b71b460e914fef538c2ae177a954e0ce5fce31416906370a0823190610d2b9030906004016120db565b602060405180830381865afa158015610d48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6c91906121b9565b10155b610d8b5760405162461bcd60e51b81526004016107c690612247565b610d93611a54565b6005547f00000000000000000000000042000000000000000000000000000000000000236001600160a01b03908116620100009092041614610e065760405162461bcd60e51b815260206004820152600c60248201526b6e6f6e204554482073616c6560a01b60448201526064016107c6565b6000349050600560029054906101000a90046001600160a01b03166001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015610e5b57600080fd5b505af1158015610e6f573d6000803e3d6000fd5b5050505050610e7e8183611a7e565b50610e8860018055565b50565b610e936115a5565b610e9d6000611e60565b565b610ea76115a5565b60005b81811015610f6a576000838383818110610ec657610ec661227d565b905060600201803603810190610edc9190612293565b80516001600160a01b03166000908152600260209081526040909120908201519192509060231015610f445760405162461bcd60e51b81526020600482015260116024820152700c8d2e6c6deeadce840e8dede40d0d2ced607b1b60448201526064016107c6565b60208201516002820155604090910151600390910155610f6381612301565b9050610eaa565b506040517fe6e7add12c2bec7372a9746b87dc5ef9b4473697bfe869dafad06298fccd087a90600090a15050565b610fa061074f565b8015610fb15750610faf611504565b155b80156110895750610fc4600160026121fb565b610fef60027f00000000000000000000000000000000000000000000152d02c7e14af680000061220e565b610ff99190612225565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000a07ac8cde2a98b189477b8e41f0c2ea6cddbc05516906370a08231906110459030906004016120db565b602060405180830381865afa158015611062573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108691906121b9565b10155b8015611161575061109c600160026121fb565b6110c760017f00000000000000000000000000000000000000000000152d02c7e14af680000061220e565b6110d19190612225565b6040516370a0823160e01b81526001600160a01b037f0000000000000000000000001b71b460e914fef538c2ae177a954e0ce5fce31416906370a082319061111d9030906004016120db565b602060405180830381865afa15801561113a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115e91906121b9565b10155b61117d5760405162461bcd60e51b81526004016107c690612247565b611185611a54565b6111ba6001600160a01b037f000000000000000000000000420000000000000000000000000000000000002316333085611eb0565b6111c48282611a7e565b610a4760018055565b6000546001600160a01b031690565b6111e46115a5565b6111ec611504565b6112485760405162461bcd60e51b815260206004820152602760248201527f6275726e556e736f6c64546f6b656e733a2070726573616c6520686173206e6f6044820152661d08195b99195960ca1b60648201526084016107c6565b60055460ff161561129b5760405162461bcd60e51b815260206004820152601f60248201527f6275726e556e736f6c64546f6b656e733a20616c7265616479206275726e740060448201526064016107c6565b60006112a5610af7565b90507f00000000000000000000000000000000000000000000152d02c7e14af680000081106113215760405162461bcd60e51b815260206004820152602260248201527f6275726e556e736f6c64546f6b656e733a206e6f20746f6b656e20746f206275604482015261393760f11b60648201526084016107c6565b6005805460ff191660011790556001600160a01b037f000000000000000000000000a07ac8cde2a98b189477b8e41f0c2ea6cddbc0551663a9059cbb61dead61138a847f00000000000000000000000000000000000000000000152d02c7e14af68000006121e8565b6040518363ffffffff1660e01b81526004016113a792919061231a565b6020604051808303816000875af11580156113c6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a479190612333565b6113f26115a5565b6114066001600160a01b03831633836119f7565b7f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd9695828260405161143792919061231a565b60405180910390a15050565b600060045460000361145757506000919050565b6001600160a01b03808316600090815260026020818152604092839020835161012081018552815481526001820154928101929092529182015492810192909252600381015460608301526004808201549093166080830152600581015460a0830152600681015460c0830152600781015460e08301526008015460ff16151561010082015290546114e7610af7565b82516114f3919061220e565b6114fd9190612225565b9392505050565b427f000000000000000000000000000000000000000000000000000000006663405c111590565b6000611535611504565b156115405750600090565b610b7c427f000000000000000000000000000000000000000000000000000000006663405c6121e8565b6115726115a5565b6001600160a01b03811661159c576000604051631e4fbdf760e01b81526004016107c691906120db565b610e8881611e60565b336115ae6111cd565b6001600160a01b031614610e9d573360405163118cdaa760e01b81526004016107c691906120db565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000a07ac8cde2a98b189477b8e41f0c2ea6cddbc05516906370a08231906116269030906004016120db565b602060405180830381865afa158015611643573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166791906121b9565b905060007f0000000000000000000000001b71b460e914fef538c2ae177a954e0ce5fce3146001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016116b791906120db565b602060405180830381865afa1580156116d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f891906121b9565b9050600080611709600160026121fb565b61171460018761220e565b61171e9190612225565b9050600061172c82876121e8565b9050848111156117ce5760405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000a07ac8cde2a98b189477b8e41f0c2ea6cddbc055169063a9059cbb90611784908a90899060040161231a565b6020604051808303816000875af11580156117a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c79190612333565b9250611862565b60405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000a07ac8cde2a98b189477b8e41f0c2ea6cddbc055169063a9059cbb9061181c908a90859060040161231a565b6020604051808303816000875af115801561183b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185f9190612333565b92505b838211156119025760405163a9059cbb60e01b81526001600160a01b037f0000000000000000000000001b71b460e914fef538c2ae177a954e0ce5fce314169063a9059cbb906118b8908a90889060040161231a565b6020604051808303816000875af11580156118d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118fb9190612333565b9250611996565b60405163a9059cbb60e01b81526001600160a01b037f0000000000000000000000001b71b460e914fef538c2ae177a954e0ce5fce314169063a9059cbb90611950908a90869060040161231a565b6020604051808303816000875af115801561196f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119939190612333565b92505b826119ee5760405162461bcd60e51b815260206004820152602260248201527f73616665436c61696d5472616e736665723a205472616e73666572206661696c604482015261195960f21b60648201526084016107c6565b50505050505050565b611a4f83846001600160a01b031663a9059cbb8585604051602401611a1d92919061231a565b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050611eef565b505050565b600260015403611a7757604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b60008211611ac15760405162461bcd60e51b815260206004820152601060248201526f189d5e4e881e995c9bc8185b5bdd5b9d60821b60448201526064016107c6565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82600354611af091906121fb565b1115611b355760405162461bcd60e51b8152602060048201526014602482015273189d5e4e881a185c9918d85c081c995858da195960621b60448201526064016107c6565b333214611b705760405162461bcd60e51b81526020600482015260096024820152682327a92124a22222a760b91b60448201526064016107c6565b33600090815260026020526040902060018101548391907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90611bb49084906121fb565b1115611bfc5760405162461bcd60e51b8152602060048201526017602482015276189d5e4e881dd85b1b195d0818d85c081c995858da1959604a1b60448201526064016107c6565b8054158015611c16575060048101546001600160a01b0316155b8015611c2a57506001600160a01b03831615155b8015611c3f57506001600160a01b0383163314155b15611c62576004810180546001600160a01b0319166001600160a01b0385161790555b60048101546001600160a01b031692508215611d1c576001600160a01b0383166000908152600260205260408120906064611c9e87600361220e565b611ca89190612225565b9050808260050154611cba91906121fb565b60058301556006820154611ccf9060016121fb565b6006830155611cde81856121e8565b93507fed705b591bdaba923b0ab0afaedaeefc22fd650b2a9f507b21758f2e7e397af98582604051611d1192919061231a565b60405180910390a150505b6002810154849015801590611d38575081600301548260010154105b15611d8a57600082600101548360030154611d5391906121e8565b905085811115611d605750845b6064836002015482611d72919061220e565b611d7c9190612225565b611d8690836121fb565b9150505b848260010154611d9a91906121fb565b6001830155600354611dad9086906121fb565b6003558154611dbd9082906121fb565b8255600454611dcd9082906121fb565b60045560405185815233907fe3d4187f6ca4248660cc0ac8b8056515bac4a8132be2eca31d6d0cc170722a7e9060200160405180910390a2611e596001600160a01b037f0000000000000000000000004200000000000000000000000000000000000023167f000000000000000000000000ca640e70e1822096aa42a79a363d7849cd34664c856119f7565b5050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b038481166024830152838116604483015260648201839052611ee99186918216906323b872dd90608401611a1d565b50505050565b6000611f046001600160a01b03841683611f49565b90508051600014158015611f29575080806020019051810190611f279190612333565b155b15611a4f5782604051635274afe760e01b81526004016107c691906120db565b6060611f5783836000611f60565b90505b92915050565b606081471015611f85573060405163cd78605960e01b81526004016107c691906120db565b600080856001600160a01b03168486604051611fa19190612350565b60006040518083038185875af1925050503d8060008114611fde576040519150601f19603f3d011682016040523d82523d6000602084013e611fe3565b606091505b5091509150611ff3868383611ffd565b9695505050505050565b6060826120125761200d82612050565b6114fd565b815115801561202957506001600160a01b0384163b155b156120495783604051639996b31560e01b81526004016107c691906120db565b50806114fd565b8051156120605780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b038116811461209057600080fd5b919050565b6000602082840312156120a757600080fd5b611f5782612079565b8015158114610e8857600080fd5b6000602082840312156120d057600080fd5b81356114fd816120b0565b6001600160a01b0391909116815260200190565b6000806020838503121561210257600080fd5b82356001600160401b038082111561211957600080fd5b818501915085601f83011261212d57600080fd5b81358181111561213c57600080fd5b86602060608302850101111561215157600080fd5b60209290920196919550909350505050565b6000806040838503121561217657600080fd5b8235915061218660208401612079565b90509250929050565b600080604083850312156121a257600080fd5b6121ab83612079565b946020939093013593505050565b6000602082840312156121cb57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115611f5a57611f5a6121d2565b80820180821115611f5a57611f5a6121d2565b8082028115828204841417611f5a57611f5a6121d2565b60008261224257634e487b7160e01b600052601260045260246000fd5b500490565b6020808252601c908201527b69734163746976653a2073616c65206973206e6f742061637469766560201b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000606082840312156122a557600080fd5b604051606081016001600160401b03811182821017156122d557634e487b7160e01b600052604160045260246000fd5b6040526122e183612079565b815260208301356020820152604083013560408201528091505092915050565b600060018201612313576123136121d2565b5060010190565b6001600160a01b03929092168252602082015260400190565b60006020828403121561234557600080fd5b81516114fd816120b0565b6000825160005b818110156123715760208186018101518583015201612357565b50600092019182525091905056fea2646970667358221220ccf8a19d0ce83e1a3bfcc7b5c425c5e4aa6911e87cb7a0967fef613cc2c85c8d64736f6c63430008140033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.