Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 467 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim Rewards | 19107587 | 360 days ago | IN | 0 ETH | 0.00096879 | ||||
Create Distribut... | 19107584 | 360 days ago | IN | 0 ETH | 0.00051726 | ||||
Claim Rewards | 19107571 | 360 days ago | IN | 0 ETH | 0.0017602 | ||||
Create Distribut... | 19107564 | 360 days ago | IN | 0 ETH | 0.00052964 | ||||
Top Up | 19107039 | 360 days ago | IN | 0 ETH | 0.00089679 | ||||
Top Up | 19106719 | 360 days ago | IN | 0 ETH | 0.00099466 | ||||
Create Mission | 19106639 | 360 days ago | IN | 0.05 ETH | 0.0026821 | ||||
Create Mission | 19106634 | 360 days ago | IN | 0.015 ETH | 0.00234884 | ||||
Create Mission | 19106377 | 361 days ago | IN | 0.015 ETH | 0.00236313 | ||||
Claim Rewards | 19106121 | 361 days ago | IN | 0 ETH | 0.0023286 | ||||
Create Mission | 19106121 | 361 days ago | IN | 0.015 ETH | 0.00257117 | ||||
Create Mission | 19105853 | 361 days ago | IN | 0.015 ETH | 0.00244371 | ||||
Create Mission | 19105351 | 361 days ago | IN | 0.05 ETH | 0.00199337 | ||||
Top Up | 19105337 | 361 days ago | IN | 0 ETH | 0.00091466 | ||||
Create Mission | 19104359 | 361 days ago | IN | 0.015 ETH | 0.00237662 | ||||
Create Mission | 19104272 | 361 days ago | IN | 0.015 ETH | 0.00271061 | ||||
Create Mission | 19103854 | 361 days ago | IN | 0.015 ETH | 0.00218235 | ||||
Create Mission | 19101305 | 361 days ago | IN | 0.05 ETH | 0.00153337 | ||||
Top Up | 19100840 | 361 days ago | IN | 0 ETH | 0.00082304 | ||||
Create Mission | 19100714 | 361 days ago | IN | 0.015 ETH | 0.00174183 | ||||
Claim Rewards | 19099301 | 362 days ago | IN | 0 ETH | 0.00198267 | ||||
Create Mission | 19098646 | 362 days ago | IN | 0.05 ETH | 0.00252336 | ||||
Create Mission | 19098603 | 362 days ago | IN | 0.015 ETH | 0.00286149 | ||||
Create Mission | 19098032 | 362 days ago | IN | 0.015 ETH | 0.00208091 | ||||
Create Mission | 19096815 | 362 days ago | IN | 0.015 ETH | 0.00199496 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
19107571 | 360 days ago | 0.1465 ETH | ||||
19106639 | 360 days ago | 0.04 ETH | ||||
19106634 | 360 days ago | 0.012 ETH | ||||
19106377 | 361 days ago | 0.012 ETH | ||||
19106121 | 361 days ago | 0.0117 ETH | ||||
19106121 | 361 days ago | 0.012 ETH | ||||
19105853 | 361 days ago | 0.012 ETH | ||||
19105351 | 361 days ago | 0.04 ETH | ||||
19104359 | 361 days ago | 0.012 ETH | ||||
19104272 | 361 days ago | 0.012 ETH | ||||
19103854 | 361 days ago | 0.012 ETH | ||||
19101305 | 361 days ago | 0.04 ETH | ||||
19100714 | 361 days ago | 0.012 ETH | ||||
19098646 | 362 days ago | 0.04 ETH | ||||
19098603 | 362 days ago | 0.012 ETH | ||||
19098032 | 362 days ago | 0.012 ETH | ||||
19096815 | 362 days ago | 0.012 ETH | ||||
19096470 | 362 days ago | 0.0054 ETH | ||||
19095961 | 362 days ago | 0.04 ETH | ||||
19095716 | 362 days ago | 0.0218 ETH | ||||
19095312 | 362 days ago | 0.012 ETH | ||||
19095216 | 362 days ago | 0.0166 ETH | ||||
19093504 | 362 days ago | 0.16 ETH | ||||
19093497 | 362 days ago | 0.04 ETH | ||||
19092946 | 362 days ago | 0.04 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
ReachMainDistribution
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: unlicensed pragma solidity 0.8.19; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol"; import "./interfaces/IDex.sol"; error InvalidSignature(); error InvalidMerkleProof(); error ClaimingPaused(); error UnsufficientEthAllocation(); error AlreadyClaimed(); error InvalidMerkleRoot(); error UnsufficientEthBalance(); error UnsufficientReachBalance(); error InvalidTokenAddress(); error InvalidPrice(); /** * @title ReachDistribution * @dev This contract manages the distribution of Reach tokens and Ether based on Merkle proofs. */ contract ReachMainDistribution is Ownable2Step, ReentrancyGuard { using SafeERC20 for IERC20; // Events event Received(address indexed sender, uint256 amount); event RewardsClaimed( address indexed account, uint256 ethAmount, uint256 reachAmount, uint256 indexed version, uint256 timestamp ); event TopUp(address indexed user, uint256 balance, uint256 timestamp); event DistributionSet( bytes32 indexed merkleRoot, uint256 ethAmount, uint256 reachAmount ); event MissionCreated(string missionId, uint256 amount); // State variables struct Claims { uint256 eth; uint256 reach; } struct Config { uint256 swapPercentage; uint256 leaderboardPercentage; uint256 rsPercentage; } IRouter public router = IRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); mapping(address => Claims) public claims; uint256 public currentVersion; mapping(address => uint256) public lastClaimedVersion; address public reachToken; bool public paused; bytes32 public merkleRoot; uint256 public creditPrice = 25 ether; uint256 public feesCollected; uint256 public leaderboardPool; uint256 public rsPool; Config public config; /** * @dev Constructor for ReachDistribution contract. * @param _reachToken Address of the reach token. */ constructor(address _reachToken) { reachToken = _reachToken; config = Config({ swapPercentage: 800, leaderboardPercentage: 875, rsPercentage: 125 }); } // External functions /* * @notice Creates a new mission * @param _missionId The ID of the new mission * @param _amount The amount allocated to the new mission */ function createMission( string memory _missionId, uint256 _amount ) external payable { require(_amount > 0, "Amount must be greater than 0."); require(_amount == msg.value, "Incorrect amount sent."); uint256 amountToSwap = (_amount * config.swapPercentage) / 1000; swapEth(amountToSwap); emit MissionCreated(_missionId, _amount); } /** * @dev Allows users to top up their credit balance. * @param _amount The amount of credits to add. */ function topUp(uint256 _amount) external { uint256 price = _amount * creditPrice; IERC20(reachToken).safeTransferFrom(msg.sender, address(this), price); feesCollected += price; emit TopUp(msg.sender, _amount, block.timestamp); } /** * @dev sets the percentages for the contract * @param _swapPercentage The percentage of the swap * @param _leaderboardPercentage The percentage of the leaderboard * @param _rsPercentage The percentage of the rs */ function setPercentages( uint256 _swapPercentage, uint256 _leaderboardPercentage, uint256 _rsPercentage ) external onlyOwner { config = Config({ swapPercentage: _swapPercentage, leaderboardPercentage: _leaderboardPercentage, rsPercentage: _rsPercentage }); } /** * @dev Toggles the pausing state of the contract. */ function toggleClaiming() external onlyOwner { paused = !paused; } /** * @dev Withdraws all Reach tokens to the owner's address. */ function withdrawFees() external onlyOwner { uint256 balance = IERC20(reachToken).balanceOf(address(this)); require(balance > feesCollected, "No fees to withdraw."); IERC20(reachToken).safeTransfer(owner(), feesCollected); } /** * @dev Allows users to claim their rewards. * @param _merkleProof The merkle proof for the claim. * @param _ethAmount The ETH amount to claim. * @param _reachAmount The Reach token amount to claim. */ function claimRewards( bytes32[] calldata _merkleProof, uint256 _ethAmount, uint256 _reachAmount ) external nonReentrant { if (paused) revert ClaimingPaused(); if (lastClaimedVersion[msg.sender] == currentVersion) revert AlreadyClaimed(); if (!verifyProof(_merkleProof, _ethAmount, _reachAmount)) revert InvalidMerkleProof(); lastClaimedVersion[msg.sender] = currentVersion; claims[msg.sender] = Claims({eth: _ethAmount, reach: _reachAmount}); if (_ethAmount > 0) payable(msg.sender).transfer(_ethAmount); if (_reachAmount > 0) IERC20(reachToken).safeTransfer(msg.sender, _reachAmount); emit RewardsClaimed( msg.sender, _ethAmount, _reachAmount, currentVersion, block.timestamp ); } // Public functions /** * @dev Sets the price for purchasing credits. * @param _price The new price for credits. */ function setCreditPrice(uint256 _price) public onlyOwner { if (_price == 0) { revert InvalidPrice(); } creditPrice = _price; } /** * @dev Creates a new distribution of rewards. * @param _merkleRoot The merkle root of the distribution. * @param _ethAmount The total ETH amount for the distribution. * @param _reachAmount The total Reach token amount for the distribution. */ function createDistribution( bytes32 _merkleRoot, uint256 _ethAmount, uint256 _reachAmount ) public onlyOwner { if (_merkleRoot == bytes32(0)) revert InvalidMerkleRoot(); if (address(this).balance < _ethAmount) revert UnsufficientEthBalance(); if (IERC20(reachToken).balanceOf(address(this)) < _reachAmount) revert UnsufficientReachBalance(); currentVersion++; merkleRoot = _merkleRoot; emit DistributionSet(_merkleRoot, _ethAmount, _reachAmount); } /** * @dev Sets the Reach token address. * @param _token The new Reach token address. */ function setReachAddress(address _token) public onlyOwner { if (_token == address(0) || IERC20(_token).totalSupply() == 0) { revert InvalidTokenAddress(); } reachToken = _token; } // Fallback function /** * @dev Fallback function to receive Ether. */ receive() external payable { emit Received(msg.sender, msg.value); } // Internal functions /** * @dev Verifies the Merkle proof for a claim. * @param _merkleProof The Merkle proof. * @param _ethAmount The ETH amount in the claim. * @param _reachAmount The Reach token amount in the claim. * @return bool True if the proof is valid, false otherwise. */ function verifyProof( bytes32[] calldata _merkleProof, uint256 _ethAmount, uint256 _reachAmount ) internal view returns (bool) { bytes32 leaf = keccak256( abi.encodePacked(msg.sender, _ethAmount, _reachAmount) ); return MerkleProof.verifyCalldata(_merkleProof, merkleRoot, leaf); } // Override functions /** * @dev Prevents renouncing ownership. */ function renounceOwnership() public virtual override onlyOwner { revert("Can't renounce ownership"); } function swapEth(uint _ethAmount) public payable { address[] memory path = new address[](2); path[0] = router.WETH(); path[1] = reachToken; uint256 balanceBefore = IERC20(reachToken).balanceOf(address(this)); // make the swap router.swapExactETHForTokensSupportingFeeOnTransferTokens{ value: _ethAmount }(0, path, address(this), block.timestamp + 5); uint256 balanceAfter = IERC20(reachToken).balanceOf(address(this)); uint256 outputAmount = balanceAfter - balanceBefore; // output the amount of tokens received //if swap is called within this contract leaderboardPool += (outputAmount * config.leaderboardPercentage) / 1000; rsPool += (outputAmount * config.rsPercentage) / 1000; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../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. * * 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() { _transferOwnership(_msgSender()); } /** * @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 { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @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 { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol) pragma solidity ^0.8.0; import "./Ownable.sol"; /** * @dev Contract module which provides 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} and {acceptOwnership}. * * This module is used through inheritance. It will make available all functions * from parent (Ownable). */ abstract contract Ownable2Step is Ownable { address private _pendingOwner; event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); /** * @dev Returns the address of the pending owner. */ function pendingOwner() public view virtual returns (address) { return _pendingOwner; } /** * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual override onlyOwner { _pendingOwner = newOwner; emit OwnershipTransferStarted(owner(), newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner. * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual override { delete _pendingOwner; super._transferOwnership(newOwner); } /** * @dev The new owner accepts the ownership transfer. */ function acceptOwnership() public virtual { address sender = _msgSender(); require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner"); _transferOwnership(sender); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @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; 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 require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // 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 // OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @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 v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @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 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 `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, 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 `from` to `to` 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, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/IERC20Permit.sol"; import "../../../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 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.encodeWithSelector(token.transfer.selector, 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.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @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); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @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.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @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"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @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.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://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.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or 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 { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) 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(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol) 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) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates merkle trees that are safe * against this attack out of the box. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} * * _Available since v4.7._ */ function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} * * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { require(proofPos == proofLen, "MerkleProof: invalid multiproof"); unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { require(proofPos == proofLen, "MerkleProof: invalid multiproof"); unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.0; /** * @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. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ 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; if (lastIndex != toDeleteIndex) { 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] = valueIndex; // Replace lastValue's index to valueIndex } // 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) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { 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(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, 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(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set 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(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // 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(uint160(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(uint160(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(uint160(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(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // 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 in 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)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; interface IPair { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function token0() external view returns (address); } interface IFactory { function createPair( address tokenA, address tokenB ) external returns (address pair); function getPair( address tokenA, address tokenB ) external view returns (address pair); } interface IRouter { 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 swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable returns (uint[] memory amounts); function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; }
{ "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_reachToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyClaimed","type":"error"},{"inputs":[],"name":"ClaimingPaused","type":"error"},{"inputs":[],"name":"InvalidMerkleProof","type":"error"},{"inputs":[],"name":"InvalidMerkleRoot","type":"error"},{"inputs":[],"name":"InvalidPrice","type":"error"},{"inputs":[],"name":"InvalidTokenAddress","type":"error"},{"inputs":[],"name":"UnsufficientEthBalance","type":"error"},{"inputs":[],"name":"UnsufficientReachBalance","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reachAmount","type":"uint256"}],"name":"DistributionSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"missionId","type":"string"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MissionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Received","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reachAmount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"version","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"balance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"TopUp","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"},{"internalType":"uint256","name":"_ethAmount","type":"uint256"},{"internalType":"uint256","name":"_reachAmount","type":"uint256"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claims","outputs":[{"internalType":"uint256","name":"eth","type":"uint256"},{"internalType":"uint256","name":"reach","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"config","outputs":[{"internalType":"uint256","name":"swapPercentage","type":"uint256"},{"internalType":"uint256","name":"leaderboardPercentage","type":"uint256"},{"internalType":"uint256","name":"rsPercentage","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"_ethAmount","type":"uint256"},{"internalType":"uint256","name":"_reachAmount","type":"uint256"}],"name":"createDistribution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_missionId","type":"string"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"createMission","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"creditPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentVersion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feesCollected","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastClaimedVersion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"leaderboardPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reachToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"contract IRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rsPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setCreditPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_swapPercentage","type":"uint256"},{"internalType":"uint256","name":"_leaderboardPercentage","type":"uint256"},{"internalType":"uint256","name":"_rsPercentage","type":"uint256"}],"name":"setPercentages","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"setReachAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ethAmount","type":"uint256"}],"name":"swapEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"toggleClaiming","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"topUp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
6080604052737a250d5630b4cf539739df2c5dacb4c659f2488d600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555068015af1d78b58c400006009553480156200007357600080fd5b506040516200307e3803806200307e8339818101604052810190620000999190620002bb565b620000b9620000ad6200014c60201b60201c565b6200015460201b60201c565b600160028190555080600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040518060600160405280610320815260200161036b8152602001607d815250600d60008201518160000155602082015181600101556040820151816002015590505050620002ed565b600033905090565b600160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556200018a816200018d60201b60201c565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620002838262000256565b9050919050565b620002958162000276565b8114620002a157600080fd5b50565b600081519050620002b5816200028a565b92915050565b600060208284031215620002d457620002d362000251565b5b6000620002e484828501620002a4565b91505092915050565b612d8180620002fd6000396000f3fe6080604052600436106101a05760003560e01c806398cf9d51116100ec578063deafb0381161008a578063f071db5a11610064578063f071db5a14610584578063f0976aa9146105af578063f2fde38b146105da578063f887ea4014610603576101f5565b8063deafb03814610512578063e30c39781461053d578063ee86318014610568576101f5565b8063a9d3ce99116100c6578063a9d3ce9914610457578063ad17a0b314610480578063c6788bdd146104a9578063ca6358cd146104e7576101f5565b806398cf9d51146103e75780639d888e86146104035780639dac6bd21461042e576101f5565b80635c975abb1161015957806379ba50971161013357806379ba5097146103635780638010fc451461037a5780638da5cb5b14610391578063916b82ae146103bc576101f5565b80635c975abb146102f4578063715018a61461031f57806379502c5514610336576101f5565b80630b062140146101fa57806325342ecc146102235780632eb4a7ab1461024c5780633e1ec42814610277578063476343ee146102b457806350017f3e146102cb576101f5565b366101f5573373ffffffffffffffffffffffffffffffffffffffff167f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f88525874346040516101eb9190611cd1565b60405180910390a2005b600080fd5b34801561020657600080fd5b50610221600480360381019061021c9190611d62565b61062e565b005b34801561022f57600080fd5b5061024a60048036038101906102459190611e1a565b6107df565b005b34801561025857600080fd5b50610261610aa6565b60405161026e9190611e9d565b60405180910390f35b34801561028357600080fd5b5061029e60048036038101906102999190611f16565b610aac565b6040516102ab9190611cd1565b60405180910390f35b3480156102c057600080fd5b506102c9610ac4565b005b3480156102d757600080fd5b506102f260048036038101906102ed9190611f43565b610c09565b005b34801561030057600080fd5b50610309610cd7565b6040516103169190611f8b565b60405180910390f35b34801561032b57600080fd5b50610334610cea565b005b34801561034257600080fd5b5061034b610d2d565b60405161035a93929190611fa6565b60405180910390f35b34801561036f57600080fd5b50610378610d45565b005b34801561038657600080fd5b5061038f610dd2565b005b34801561039d57600080fd5b506103a6610e06565b6040516103b39190611fec565b60405180910390f35b3480156103c857600080fd5b506103d1610e2f565b6040516103de9190611cd1565b60405180910390f35b61040160048036038101906103fc9190611f43565b610e35565b005b34801561040f57600080fd5b50610418611237565b6040516104259190611cd1565b60405180910390f35b34801561043a57600080fd5b5061045560048036038101906104509190611f16565b61123d565b005b34801561046357600080fd5b5061047e60048036038101906104799190612007565b611369565b005b34801561048c57600080fd5b506104a760048036038101906104a29190611f43565b6113b4565b005b3480156104b557600080fd5b506104d060048036038101906104cb9190611f16565b6113ff565b6040516104de92919061205a565b60405180910390f35b3480156104f357600080fd5b506104fc611423565b6040516105099190611cd1565b60405180910390f35b34801561051e57600080fd5b50610527611429565b6040516105349190611fec565b60405180910390f35b34801561054957600080fd5b5061055261144f565b60405161055f9190611fec565b60405180910390f35b610582600480360381019061057d91906121c4565b611479565b005b34801561059057600080fd5b50610599611567565b6040516105a69190611cd1565b60405180910390f35b3480156105bb57600080fd5b506105c461156d565b6040516105d19190611cd1565b60405180910390f35b3480156105e657600080fd5b5061060160048036038101906105fc9190611f16565b611573565b005b34801561060f57600080fd5b50610618611620565b604051610625919061227f565b60405180910390f35b610636611646565b6000801b8303610672576040517f9dd854d300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b814710156106ac576040517fb0e0a91f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016107089190611fec565b602060405180830381865afa158015610725573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074991906122af565b1015610781576040517ff5bdd33400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600560008154809291906107949061230b565b919050555082600881905550827f9d700ed7d64303281d0221273ac003349bc5143ccd917e1789630ca22eba1bc783836040516107d292919061205a565b60405180910390a2505050565b6107e76116c4565b600760149054906101000a900460ff161561082e576040517fcfbf738900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600554600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054036108a8576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108b484848484611711565b6108ea576040517fb05e92fa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600554600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550604051806040016040528083815260200182815250600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015590505060008211156109ec573373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156109ea573d6000803e3d6000fd5b505b6000811115610a4357610a423382600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661175a9092919063ffffffff16565b5b6005543373ffffffffffffffffffffffffffffffffffffffff167f5619b8583bbbb0760d27ac9ff844cec866b333bf7ad0262c2d809ff42f22e5fc848442604051610a9093929190611fa6565b60405180910390a3610aa06117e0565b50505050565b60085481565b60066020528060005260406000206000915090505481565b610acc611646565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610b299190611fec565b602060405180830381865afa158015610b46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6a91906122af565b9050600a548111610bb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba7906123b0565b60405180910390fd5b610c06610bbb610e06565b600a54600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661175a9092919063ffffffff16565b50565b600060095482610c1991906123d0565b9050610c6a333083600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117ea909392919063ffffffff16565b80600a6000828254610c7c9190612412565b925050819055503373ffffffffffffffffffffffffffffffffffffffff167ff0f5a6096b2a43fc10bc314148e9ac3851fd8455384682f3c3cd9d2f0bc71b178342604051610ccb92919061205a565b60405180910390a25050565b600760149054906101000a900460ff1681565b610cf2611646565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2490612492565b60405180910390fd5b600d8060000154908060010154908060020154905083565b6000610d4f611873565b90508073ffffffffffffffffffffffffffffffffffffffff16610d7061144f565b73ffffffffffffffffffffffffffffffffffffffff1614610dc6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dbd90612524565b60405180910390fd5b610dcf8161187b565b50565b610dda611646565b600760149054906101000a900460ff1615600760146101000a81548160ff021916908315150217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600b5481565b6000600267ffffffffffffffff811115610e5257610e51612099565b5b604051908082528060200260200182016040528015610e805781602001602082028036833780820191505090505b509050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ef0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f149190612559565b81600081518110610f2857610f27612586565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110610f9957610f98612586565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016110309190611fec565b602060405180830381865afa15801561104d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107191906122af565b9050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b6f9de9584600085306005426110c39190612412565b6040518663ffffffff1660e01b81526004016110e294939291906126ae565b6000604051808303818588803b1580156110fb57600080fd5b505af115801561110f573d6000803e3d6000fd5b50505050506000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016111719190611fec565b602060405180830381865afa15801561118e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b291906122af565b9050600082826111c291906126fa565b90506103e8600d60010154826111d891906123d0565b6111e2919061275d565b600b60008282546111f39190612412565b925050819055506103e8600d600201548261120e91906123d0565b611218919061275d565b600c60008282546112299190612412565b925050819055505050505050565b60055481565b611245611646565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614806112ee575060008173ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ec91906122af565b145b15611325576040517f1eb00b0600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611371611646565b604051806060016040528084815260200183815260200182815250600d600082015181600001556020820151816001015560408201518160020155905050505050565b6113bc611646565b600081036113f5576040517ebfc92100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060098190555050565b60046020528060005260406000206000915090508060000154908060010154905082565b60095481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600081116114bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b3906127da565b60405180910390fd5b3481146114fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114f590612846565b60405180910390fd5b60006103e8600d600001548361151491906123d0565b61151e919061275d565b905061152981610e35565b7f7a9a0839d82bd76df4e7e95befca46c7a54d34aadcc54bf0f86da048f39e043b838360405161155a9291906128d4565b60405180910390a1505050565b600a5481565b600c5481565b61157b611646565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff166115db610e06565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61164e611873565b73ffffffffffffffffffffffffffffffffffffffff1661166c610e06565b73ffffffffffffffffffffffffffffffffffffffff16146116c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b990612950565b60405180910390fd5b565b6002805403611708576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ff906129bc565b60405180910390fd5b60028081905550565b60008033848460405160200161172993929190612a45565b60405160208183030381529060405280519060200120905061174f8686600854846118ac565b915050949350505050565b6117db8363a9059cbb60e01b8484604051602401611779929190612a82565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506118c5565b505050565b6001600281905550565b61186d846323b872dd60e01b85858560405160240161180b93929190612aab565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506118c5565b50505050565b600033905090565b600160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556118a98161198d565b50565b6000826118ba868685611a51565b149050949350505050565b6000611927826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611aa99092919063ffffffff16565b90506000815114806119495750808060200190518101906119489190612b0e565b5b611988576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197f90612bad565b60405180910390fd5b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008082905060005b85859050811015611a9d57611a8882878784818110611a7c57611a7b612586565b5b90506020020135611ac1565b91508080611a959061230b565b915050611a5a565b50809150509392505050565b6060611ab88484600085611aec565b90509392505050565b6000818310611ad957611ad48284611bb9565b611ae4565b611ae38383611bb9565b5b905092915050565b606082471015611b31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2890612c3f565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611b5a9190612ca6565b60006040518083038185875af1925050503d8060008114611b97576040519150601f19603f3d011682016040523d82523d6000602084013e611b9c565b606091505b5091509150611bad87838387611bd0565b92505050949350505050565b600082600052816020526040600020905092915050565b60608315611c32576000835103611c2a57611bea85611c45565b611c29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2090612d09565b60405180910390fd5b5b829050611c3d565b611c3c8383611c68565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600082511115611c7b5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611caf9190612d29565b60405180910390fd5b6000819050919050565b611ccb81611cb8565b82525050565b6000602082019050611ce66000830184611cc2565b92915050565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b611d1381611d00565b8114611d1e57600080fd5b50565b600081359050611d3081611d0a565b92915050565b611d3f81611cb8565b8114611d4a57600080fd5b50565b600081359050611d5c81611d36565b92915050565b600080600060608486031215611d7b57611d7a611cf6565b5b6000611d8986828701611d21565b9350506020611d9a86828701611d4d565b9250506040611dab86828701611d4d565b9150509250925092565b600080fd5b600080fd5b600080fd5b60008083601f840112611dda57611dd9611db5565b5b8235905067ffffffffffffffff811115611df757611df6611dba565b5b602083019150836020820283011115611e1357611e12611dbf565b5b9250929050565b60008060008060608587031215611e3457611e33611cf6565b5b600085013567ffffffffffffffff811115611e5257611e51611cfb565b5b611e5e87828801611dc4565b94509450506020611e7187828801611d4d565b9250506040611e8287828801611d4d565b91505092959194509250565b611e9781611d00565b82525050565b6000602082019050611eb26000830184611e8e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611ee382611eb8565b9050919050565b611ef381611ed8565b8114611efe57600080fd5b50565b600081359050611f1081611eea565b92915050565b600060208284031215611f2c57611f2b611cf6565b5b6000611f3a84828501611f01565b91505092915050565b600060208284031215611f5957611f58611cf6565b5b6000611f6784828501611d4d565b91505092915050565b60008115159050919050565b611f8581611f70565b82525050565b6000602082019050611fa06000830184611f7c565b92915050565b6000606082019050611fbb6000830186611cc2565b611fc86020830185611cc2565b611fd56040830184611cc2565b949350505050565b611fe681611ed8565b82525050565b60006020820190506120016000830184611fdd565b92915050565b6000806000606084860312156120205761201f611cf6565b5b600061202e86828701611d4d565b935050602061203f86828701611d4d565b925050604061205086828701611d4d565b9150509250925092565b600060408201905061206f6000830185611cc2565b61207c6020830184611cc2565b9392505050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6120d182612088565b810181811067ffffffffffffffff821117156120f0576120ef612099565b5b80604052505050565b6000612103611cec565b905061210f82826120c8565b919050565b600067ffffffffffffffff82111561212f5761212e612099565b5b61213882612088565b9050602081019050919050565b82818337600083830152505050565b600061216761216284612114565b6120f9565b90508281526020810184848401111561218357612182612083565b5b61218e848285612145565b509392505050565b600082601f8301126121ab576121aa611db5565b5b81356121bb848260208601612154565b91505092915050565b600080604083850312156121db576121da611cf6565b5b600083013567ffffffffffffffff8111156121f9576121f8611cfb565b5b61220585828601612196565b925050602061221685828601611d4d565b9150509250929050565b6000819050919050565b600061224561224061223b84611eb8565b612220565b611eb8565b9050919050565b60006122578261222a565b9050919050565b60006122698261224c565b9050919050565b6122798161225e565b82525050565b60006020820190506122946000830184612270565b92915050565b6000815190506122a981611d36565b92915050565b6000602082840312156122c5576122c4611cf6565b5b60006122d38482850161229a565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061231682611cb8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612348576123476122dc565b5b600182019050919050565b600082825260208201905092915050565b7f4e6f206665657320746f2077697468647261772e000000000000000000000000600082015250565b600061239a601483612353565b91506123a582612364565b602082019050919050565b600060208201905081810360008301526123c98161238d565b9050919050565b60006123db82611cb8565b91506123e683611cb8565b92508282026123f481611cb8565b9150828204841483151761240b5761240a6122dc565b5b5092915050565b600061241d82611cb8565b915061242883611cb8565b92508282019050808211156124405761243f6122dc565b5b92915050565b7f43616e27742072656e6f756e6365206f776e6572736869700000000000000000600082015250565b600061247c601883612353565b915061248782612446565b602082019050919050565b600060208201905081810360008301526124ab8161246f565b9050919050565b7f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060008201527f6e6577206f776e65720000000000000000000000000000000000000000000000602082015250565b600061250e602983612353565b9150612519826124b2565b604082019050919050565b6000602082019050818103600083015261253d81612501565b9050919050565b60008151905061255381611eea565b92915050565b60006020828403121561256f5761256e611cf6565b5b600061257d84828501612544565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000819050919050565b60006125da6125d56125d0846125b5565b612220565b611cb8565b9050919050565b6125ea816125bf565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61262581611ed8565b82525050565b6000612637838361261c565b60208301905092915050565b6000602082019050919050565b600061265b826125f0565b61266581856125fb565b93506126708361260c565b8060005b838110156126a1578151612688888261262b565b975061269383612643565b925050600181019050612674565b5085935050505092915050565b60006080820190506126c360008301876125e1565b81810360208301526126d58186612650565b90506126e46040830185611fdd565b6126f16060830184611cc2565b95945050505050565b600061270582611cb8565b915061271083611cb8565b9250828203905081811115612728576127276122dc565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061276882611cb8565b915061277383611cb8565b9250826127835761278261272e565b5b828204905092915050565b7f416d6f756e74206d7573742062652067726561746572207468616e20302e0000600082015250565b60006127c4601e83612353565b91506127cf8261278e565b602082019050919050565b600060208201905081810360008301526127f3816127b7565b9050919050565b7f496e636f727265637420616d6f756e742073656e742e00000000000000000000600082015250565b6000612830601683612353565b915061283b826127fa565b602082019050919050565b6000602082019050818103600083015261285f81612823565b9050919050565b600081519050919050565b60005b8381101561288f578082015181840152602081019050612874565b60008484015250505050565b60006128a682612866565b6128b08185612353565b93506128c0818560208601612871565b6128c981612088565b840191505092915050565b600060408201905081810360008301526128ee818561289b565b90506128fd6020830184611cc2565b9392505050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061293a602083612353565b915061294582612904565b602082019050919050565b600060208201905081810360008301526129698161292d565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b60006129a6601f83612353565b91506129b182612970565b602082019050919050565b600060208201905081810360008301526129d581612999565b9050919050565b60008160601b9050919050565b60006129f4826129dc565b9050919050565b6000612a06826129e9565b9050919050565b612a1e612a1982611ed8565b6129fb565b82525050565b6000819050919050565b612a3f612a3a82611cb8565b612a24565b82525050565b6000612a518286612a0d565b601482019150612a618285612a2e565b602082019150612a718284612a2e565b602082019150819050949350505050565b6000604082019050612a976000830185611fdd565b612aa46020830184611cc2565b9392505050565b6000606082019050612ac06000830186611fdd565b612acd6020830185611fdd565b612ada6040830184611cc2565b949350505050565b612aeb81611f70565b8114612af657600080fd5b50565b600081519050612b0881612ae2565b92915050565b600060208284031215612b2457612b23611cf6565b5b6000612b3284828501612af9565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000612b97602a83612353565b9150612ba282612b3b565b604082019050919050565b60006020820190508181036000830152612bc681612b8a565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000612c29602683612353565b9150612c3482612bcd565b604082019050919050565b60006020820190508181036000830152612c5881612c1c565b9050919050565b600081519050919050565b600081905092915050565b6000612c8082612c5f565b612c8a8185612c6a565b9350612c9a818560208601612871565b80840191505092915050565b6000612cb28284612c75565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000612cf3601d83612353565b9150612cfe82612cbd565b602082019050919050565b60006020820190508181036000830152612d2281612ce6565b9050919050565b60006020820190508181036000830152612d43818461289b565b90509291505056fea264697066735822122095f046a59abbe48db217c4d8906061de798051fbe37b876e13fc6b906346209164736f6c634300081300330000000000000000000000008b12bd54ca9b2311960057c8f3c88013e79316e3
Deployed Bytecode
0x6080604052600436106101a05760003560e01c806398cf9d51116100ec578063deafb0381161008a578063f071db5a11610064578063f071db5a14610584578063f0976aa9146105af578063f2fde38b146105da578063f887ea4014610603576101f5565b8063deafb03814610512578063e30c39781461053d578063ee86318014610568576101f5565b8063a9d3ce99116100c6578063a9d3ce9914610457578063ad17a0b314610480578063c6788bdd146104a9578063ca6358cd146104e7576101f5565b806398cf9d51146103e75780639d888e86146104035780639dac6bd21461042e576101f5565b80635c975abb1161015957806379ba50971161013357806379ba5097146103635780638010fc451461037a5780638da5cb5b14610391578063916b82ae146103bc576101f5565b80635c975abb146102f4578063715018a61461031f57806379502c5514610336576101f5565b80630b062140146101fa57806325342ecc146102235780632eb4a7ab1461024c5780633e1ec42814610277578063476343ee146102b457806350017f3e146102cb576101f5565b366101f5573373ffffffffffffffffffffffffffffffffffffffff167f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f88525874346040516101eb9190611cd1565b60405180910390a2005b600080fd5b34801561020657600080fd5b50610221600480360381019061021c9190611d62565b61062e565b005b34801561022f57600080fd5b5061024a60048036038101906102459190611e1a565b6107df565b005b34801561025857600080fd5b50610261610aa6565b60405161026e9190611e9d565b60405180910390f35b34801561028357600080fd5b5061029e60048036038101906102999190611f16565b610aac565b6040516102ab9190611cd1565b60405180910390f35b3480156102c057600080fd5b506102c9610ac4565b005b3480156102d757600080fd5b506102f260048036038101906102ed9190611f43565b610c09565b005b34801561030057600080fd5b50610309610cd7565b6040516103169190611f8b565b60405180910390f35b34801561032b57600080fd5b50610334610cea565b005b34801561034257600080fd5b5061034b610d2d565b60405161035a93929190611fa6565b60405180910390f35b34801561036f57600080fd5b50610378610d45565b005b34801561038657600080fd5b5061038f610dd2565b005b34801561039d57600080fd5b506103a6610e06565b6040516103b39190611fec565b60405180910390f35b3480156103c857600080fd5b506103d1610e2f565b6040516103de9190611cd1565b60405180910390f35b61040160048036038101906103fc9190611f43565b610e35565b005b34801561040f57600080fd5b50610418611237565b6040516104259190611cd1565b60405180910390f35b34801561043a57600080fd5b5061045560048036038101906104509190611f16565b61123d565b005b34801561046357600080fd5b5061047e60048036038101906104799190612007565b611369565b005b34801561048c57600080fd5b506104a760048036038101906104a29190611f43565b6113b4565b005b3480156104b557600080fd5b506104d060048036038101906104cb9190611f16565b6113ff565b6040516104de92919061205a565b60405180910390f35b3480156104f357600080fd5b506104fc611423565b6040516105099190611cd1565b60405180910390f35b34801561051e57600080fd5b50610527611429565b6040516105349190611fec565b60405180910390f35b34801561054957600080fd5b5061055261144f565b60405161055f9190611fec565b60405180910390f35b610582600480360381019061057d91906121c4565b611479565b005b34801561059057600080fd5b50610599611567565b6040516105a69190611cd1565b60405180910390f35b3480156105bb57600080fd5b506105c461156d565b6040516105d19190611cd1565b60405180910390f35b3480156105e657600080fd5b5061060160048036038101906105fc9190611f16565b611573565b005b34801561060f57600080fd5b50610618611620565b604051610625919061227f565b60405180910390f35b610636611646565b6000801b8303610672576040517f9dd854d300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b814710156106ac576040517fb0e0a91f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016107089190611fec565b602060405180830381865afa158015610725573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074991906122af565b1015610781576040517ff5bdd33400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600560008154809291906107949061230b565b919050555082600881905550827f9d700ed7d64303281d0221273ac003349bc5143ccd917e1789630ca22eba1bc783836040516107d292919061205a565b60405180910390a2505050565b6107e76116c4565b600760149054906101000a900460ff161561082e576040517fcfbf738900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600554600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054036108a8576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108b484848484611711565b6108ea576040517fb05e92fa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600554600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550604051806040016040528083815260200182815250600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015590505060008211156109ec573373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156109ea573d6000803e3d6000fd5b505b6000811115610a4357610a423382600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661175a9092919063ffffffff16565b5b6005543373ffffffffffffffffffffffffffffffffffffffff167f5619b8583bbbb0760d27ac9ff844cec866b333bf7ad0262c2d809ff42f22e5fc848442604051610a9093929190611fa6565b60405180910390a3610aa06117e0565b50505050565b60085481565b60066020528060005260406000206000915090505481565b610acc611646565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610b299190611fec565b602060405180830381865afa158015610b46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6a91906122af565b9050600a548111610bb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba7906123b0565b60405180910390fd5b610c06610bbb610e06565b600a54600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661175a9092919063ffffffff16565b50565b600060095482610c1991906123d0565b9050610c6a333083600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117ea909392919063ffffffff16565b80600a6000828254610c7c9190612412565b925050819055503373ffffffffffffffffffffffffffffffffffffffff167ff0f5a6096b2a43fc10bc314148e9ac3851fd8455384682f3c3cd9d2f0bc71b178342604051610ccb92919061205a565b60405180910390a25050565b600760149054906101000a900460ff1681565b610cf2611646565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2490612492565b60405180910390fd5b600d8060000154908060010154908060020154905083565b6000610d4f611873565b90508073ffffffffffffffffffffffffffffffffffffffff16610d7061144f565b73ffffffffffffffffffffffffffffffffffffffff1614610dc6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dbd90612524565b60405180910390fd5b610dcf8161187b565b50565b610dda611646565b600760149054906101000a900460ff1615600760146101000a81548160ff021916908315150217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600b5481565b6000600267ffffffffffffffff811115610e5257610e51612099565b5b604051908082528060200260200182016040528015610e805781602001602082028036833780820191505090505b509050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ef0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f149190612559565b81600081518110610f2857610f27612586565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110610f9957610f98612586565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016110309190611fec565b602060405180830381865afa15801561104d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107191906122af565b9050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b6f9de9584600085306005426110c39190612412565b6040518663ffffffff1660e01b81526004016110e294939291906126ae565b6000604051808303818588803b1580156110fb57600080fd5b505af115801561110f573d6000803e3d6000fd5b50505050506000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016111719190611fec565b602060405180830381865afa15801561118e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b291906122af565b9050600082826111c291906126fa565b90506103e8600d60010154826111d891906123d0565b6111e2919061275d565b600b60008282546111f39190612412565b925050819055506103e8600d600201548261120e91906123d0565b611218919061275d565b600c60008282546112299190612412565b925050819055505050505050565b60055481565b611245611646565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614806112ee575060008173ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ec91906122af565b145b15611325576040517f1eb00b0600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611371611646565b604051806060016040528084815260200183815260200182815250600d600082015181600001556020820151816001015560408201518160020155905050505050565b6113bc611646565b600081036113f5576040517ebfc92100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060098190555050565b60046020528060005260406000206000915090508060000154908060010154905082565b60095481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600081116114bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b3906127da565b60405180910390fd5b3481146114fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114f590612846565b60405180910390fd5b60006103e8600d600001548361151491906123d0565b61151e919061275d565b905061152981610e35565b7f7a9a0839d82bd76df4e7e95befca46c7a54d34aadcc54bf0f86da048f39e043b838360405161155a9291906128d4565b60405180910390a1505050565b600a5481565b600c5481565b61157b611646565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff166115db610e06565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61164e611873565b73ffffffffffffffffffffffffffffffffffffffff1661166c610e06565b73ffffffffffffffffffffffffffffffffffffffff16146116c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b990612950565b60405180910390fd5b565b6002805403611708576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ff906129bc565b60405180910390fd5b60028081905550565b60008033848460405160200161172993929190612a45565b60405160208183030381529060405280519060200120905061174f8686600854846118ac565b915050949350505050565b6117db8363a9059cbb60e01b8484604051602401611779929190612a82565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506118c5565b505050565b6001600281905550565b61186d846323b872dd60e01b85858560405160240161180b93929190612aab565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506118c5565b50505050565b600033905090565b600160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556118a98161198d565b50565b6000826118ba868685611a51565b149050949350505050565b6000611927826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611aa99092919063ffffffff16565b90506000815114806119495750808060200190518101906119489190612b0e565b5b611988576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197f90612bad565b60405180910390fd5b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008082905060005b85859050811015611a9d57611a8882878784818110611a7c57611a7b612586565b5b90506020020135611ac1565b91508080611a959061230b565b915050611a5a565b50809150509392505050565b6060611ab88484600085611aec565b90509392505050565b6000818310611ad957611ad48284611bb9565b611ae4565b611ae38383611bb9565b5b905092915050565b606082471015611b31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2890612c3f565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611b5a9190612ca6565b60006040518083038185875af1925050503d8060008114611b97576040519150601f19603f3d011682016040523d82523d6000602084013e611b9c565b606091505b5091509150611bad87838387611bd0565b92505050949350505050565b600082600052816020526040600020905092915050565b60608315611c32576000835103611c2a57611bea85611c45565b611c29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2090612d09565b60405180910390fd5b5b829050611c3d565b611c3c8383611c68565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600082511115611c7b5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611caf9190612d29565b60405180910390fd5b6000819050919050565b611ccb81611cb8565b82525050565b6000602082019050611ce66000830184611cc2565b92915050565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b611d1381611d00565b8114611d1e57600080fd5b50565b600081359050611d3081611d0a565b92915050565b611d3f81611cb8565b8114611d4a57600080fd5b50565b600081359050611d5c81611d36565b92915050565b600080600060608486031215611d7b57611d7a611cf6565b5b6000611d8986828701611d21565b9350506020611d9a86828701611d4d565b9250506040611dab86828701611d4d565b9150509250925092565b600080fd5b600080fd5b600080fd5b60008083601f840112611dda57611dd9611db5565b5b8235905067ffffffffffffffff811115611df757611df6611dba565b5b602083019150836020820283011115611e1357611e12611dbf565b5b9250929050565b60008060008060608587031215611e3457611e33611cf6565b5b600085013567ffffffffffffffff811115611e5257611e51611cfb565b5b611e5e87828801611dc4565b94509450506020611e7187828801611d4d565b9250506040611e8287828801611d4d565b91505092959194509250565b611e9781611d00565b82525050565b6000602082019050611eb26000830184611e8e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611ee382611eb8565b9050919050565b611ef381611ed8565b8114611efe57600080fd5b50565b600081359050611f1081611eea565b92915050565b600060208284031215611f2c57611f2b611cf6565b5b6000611f3a84828501611f01565b91505092915050565b600060208284031215611f5957611f58611cf6565b5b6000611f6784828501611d4d565b91505092915050565b60008115159050919050565b611f8581611f70565b82525050565b6000602082019050611fa06000830184611f7c565b92915050565b6000606082019050611fbb6000830186611cc2565b611fc86020830185611cc2565b611fd56040830184611cc2565b949350505050565b611fe681611ed8565b82525050565b60006020820190506120016000830184611fdd565b92915050565b6000806000606084860312156120205761201f611cf6565b5b600061202e86828701611d4d565b935050602061203f86828701611d4d565b925050604061205086828701611d4d565b9150509250925092565b600060408201905061206f6000830185611cc2565b61207c6020830184611cc2565b9392505050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6120d182612088565b810181811067ffffffffffffffff821117156120f0576120ef612099565b5b80604052505050565b6000612103611cec565b905061210f82826120c8565b919050565b600067ffffffffffffffff82111561212f5761212e612099565b5b61213882612088565b9050602081019050919050565b82818337600083830152505050565b600061216761216284612114565b6120f9565b90508281526020810184848401111561218357612182612083565b5b61218e848285612145565b509392505050565b600082601f8301126121ab576121aa611db5565b5b81356121bb848260208601612154565b91505092915050565b600080604083850312156121db576121da611cf6565b5b600083013567ffffffffffffffff8111156121f9576121f8611cfb565b5b61220585828601612196565b925050602061221685828601611d4d565b9150509250929050565b6000819050919050565b600061224561224061223b84611eb8565b612220565b611eb8565b9050919050565b60006122578261222a565b9050919050565b60006122698261224c565b9050919050565b6122798161225e565b82525050565b60006020820190506122946000830184612270565b92915050565b6000815190506122a981611d36565b92915050565b6000602082840312156122c5576122c4611cf6565b5b60006122d38482850161229a565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061231682611cb8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612348576123476122dc565b5b600182019050919050565b600082825260208201905092915050565b7f4e6f206665657320746f2077697468647261772e000000000000000000000000600082015250565b600061239a601483612353565b91506123a582612364565b602082019050919050565b600060208201905081810360008301526123c98161238d565b9050919050565b60006123db82611cb8565b91506123e683611cb8565b92508282026123f481611cb8565b9150828204841483151761240b5761240a6122dc565b5b5092915050565b600061241d82611cb8565b915061242883611cb8565b92508282019050808211156124405761243f6122dc565b5b92915050565b7f43616e27742072656e6f756e6365206f776e6572736869700000000000000000600082015250565b600061247c601883612353565b915061248782612446565b602082019050919050565b600060208201905081810360008301526124ab8161246f565b9050919050565b7f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060008201527f6e6577206f776e65720000000000000000000000000000000000000000000000602082015250565b600061250e602983612353565b9150612519826124b2565b604082019050919050565b6000602082019050818103600083015261253d81612501565b9050919050565b60008151905061255381611eea565b92915050565b60006020828403121561256f5761256e611cf6565b5b600061257d84828501612544565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000819050919050565b60006125da6125d56125d0846125b5565b612220565b611cb8565b9050919050565b6125ea816125bf565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61262581611ed8565b82525050565b6000612637838361261c565b60208301905092915050565b6000602082019050919050565b600061265b826125f0565b61266581856125fb565b93506126708361260c565b8060005b838110156126a1578151612688888261262b565b975061269383612643565b925050600181019050612674565b5085935050505092915050565b60006080820190506126c360008301876125e1565b81810360208301526126d58186612650565b90506126e46040830185611fdd565b6126f16060830184611cc2565b95945050505050565b600061270582611cb8565b915061271083611cb8565b9250828203905081811115612728576127276122dc565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061276882611cb8565b915061277383611cb8565b9250826127835761278261272e565b5b828204905092915050565b7f416d6f756e74206d7573742062652067726561746572207468616e20302e0000600082015250565b60006127c4601e83612353565b91506127cf8261278e565b602082019050919050565b600060208201905081810360008301526127f3816127b7565b9050919050565b7f496e636f727265637420616d6f756e742073656e742e00000000000000000000600082015250565b6000612830601683612353565b915061283b826127fa565b602082019050919050565b6000602082019050818103600083015261285f81612823565b9050919050565b600081519050919050565b60005b8381101561288f578082015181840152602081019050612874565b60008484015250505050565b60006128a682612866565b6128b08185612353565b93506128c0818560208601612871565b6128c981612088565b840191505092915050565b600060408201905081810360008301526128ee818561289b565b90506128fd6020830184611cc2565b9392505050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061293a602083612353565b915061294582612904565b602082019050919050565b600060208201905081810360008301526129698161292d565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b60006129a6601f83612353565b91506129b182612970565b602082019050919050565b600060208201905081810360008301526129d581612999565b9050919050565b60008160601b9050919050565b60006129f4826129dc565b9050919050565b6000612a06826129e9565b9050919050565b612a1e612a1982611ed8565b6129fb565b82525050565b6000819050919050565b612a3f612a3a82611cb8565b612a24565b82525050565b6000612a518286612a0d565b601482019150612a618285612a2e565b602082019150612a718284612a2e565b602082019150819050949350505050565b6000604082019050612a976000830185611fdd565b612aa46020830184611cc2565b9392505050565b6000606082019050612ac06000830186611fdd565b612acd6020830185611fdd565b612ada6040830184611cc2565b949350505050565b612aeb81611f70565b8114612af657600080fd5b50565b600081519050612b0881612ae2565b92915050565b600060208284031215612b2457612b23611cf6565b5b6000612b3284828501612af9565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000612b97602a83612353565b9150612ba282612b3b565b604082019050919050565b60006020820190508181036000830152612bc681612b8a565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000612c29602683612353565b9150612c3482612bcd565b604082019050919050565b60006020820190508181036000830152612c5881612c1c565b9050919050565b600081519050919050565b600081905092915050565b6000612c8082612c5f565b612c8a8185612c6a565b9350612c9a818560208601612871565b80840191505092915050565b6000612cb28284612c75565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000612cf3601d83612353565b9150612cfe82612cbd565b602082019050919050565b60006020820190508181036000830152612d2281612ce6565b9050919050565b60006020820190508181036000830152612d43818461289b565b90509291505056fea264697066735822122095f046a59abbe48db217c4d8906061de798051fbe37b876e13fc6b906346209164736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000008b12bd54ca9b2311960057c8f3c88013e79316e3
-----Decoded View---------------
Arg [0] : _reachToken (address): 0x8B12BD54CA9B2311960057C8F3C88013e79316E3
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000008b12bd54ca9b2311960057c8f3c88013e79316e3
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.