Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
PrizePool
Compiler Version
v0.8.17+commit.8df45f5f
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "IERC20.sol";
import "SafeERC20.sol";
import "SafeMath.sol";
import "Context.sol";
import "ReentrancyGuard.sol";
import "Initializable.sol";
contract PrizePool is Context, Initializable, ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for IERC20;
address private constant _ZERO_ADDRESS = 0x0000000000000000000000000000000000000000;
address public owner;
address public rewardToken;
// Total Point: 1e6
uint256 public bqlPoint; // BQL Weights
uint256 public feePoint; // Fee Weights
uint256 public randomPoint; // Random Weights
uint256 public randomPool;
uint256 public totalReward;
uint256 public totalRandomPool;
mapping(address => uint256) public userBqlPool;
mapping(address => uint256) public userFeePool;
mapping(uint256 => uint256) public epochBqlPool;
mapping(uint256 => uint256) public epochFeePool;
event ClaimReward(
address indexed _receiver,
uint256 _amount,
string _type
);
event ClaimRandomPool(
address indexed _receiver,
uint256 _amount,
string _network,
string _txid
);
/* solium-disable-next-line */
receive () external payable {}
modifier onlyAdmin() {
require(msg.sender == owner, "only admin is allowed");
_;
}
function initialize(address _owner, address _rewardToken, uint256[] calldata _points) external initializer {
owner = _owner;
rewardToken = _rewardToken;
require(_points[0] + _points[1] + _points[2] <= 1e6, "Point error");
bqlPoint = _points[0];
feePoint = _points[1];
randomPoint = _points[2];
}
function setPoolPoint(uint256[] calldata _points) external onlyAdmin {
require(_points[0] + _points[1] + _points[2] <= 1e6, "Point error");
bqlPoint = _points[0];
feePoint = _points[1];
randomPoint = _points[2];
}
function setOwner(address _owner) external onlyAdmin {
require(_owner != address(0), "Owner can't be zero address");
owner = _owner;
}
function setRewardToken(address _rewardToken) external onlyAdmin {
require(totalReward == 0, "Reward tokens are fixed");
rewardToken = _rewardToken;
}
function setRewardBalance(address[] calldata _users, uint256[] calldata _amounts, uint8 _type) external onlyAdmin {
if (_type == 0) {
for (uint256 i = 0; i < _users.length; i++) {
userFeePool[_users[i]] = userFeePool[_users[i]].add(_amounts[i]);
}
} else if (_type == 1) {
for (uint256 i = 0; i < _users.length; i++) {
userBqlPool[_users[i]] = userBqlPool[_users[i]].add(_amounts[i]);
}
} else if (_type == 2) {
for (uint256 i = 0; i < _users.length; i++) {
userFeePool[_users[i]] = userFeePool[_users[i]].sub(_amounts[i]);
}
} else if (_type == 3) {
for (uint256 i = 0; i < _users.length; i++) {
userBqlPool[_users[i]] = userBqlPool[_users[i]].sub(_amounts[i]);
}
}
}
function poolDistribute(uint256 epoch, uint256 amount) external payable {
require(amount > 0, "Reward token amount can't be zero");
if (rewardToken == _ZERO_ADDRESS) {
require(msg.value == amount, "Amount is wrong");
} else {
require(IERC20(rewardToken).balanceOf(msg.sender) >= amount, "Amount is wrong");
IERC20(rewardToken).safeTransferFrom(msg.sender, address(this), amount);
}
randomPool = randomPool.add(amount.mul(randomPoint).div(1e6));
totalReward = totalReward.add(amount);
totalRandomPool = totalRandomPool.add(amount.mul(randomPoint).div(1e6));
epochBqlPool[epoch] = epochBqlPool[epoch].add(amount.mul(bqlPoint).div(1e6));
epochFeePool[epoch] = epochFeePool[epoch].add(amount.mul(feePoint).div(1e6));
}
function claimRandomPool(address receiver, string calldata network, string calldata txid) external onlyAdmin returns(uint256 amount) {
require(randomPool > 0, "Random pool is empty");
amount = randomPool;
randomPool = 0;
if (rewardToken == _ZERO_ADDRESS) {
payable(receiver).transfer(amount);
} else {
IERC20(rewardToken).safeTransfer(receiver, amount);
}
emit ClaimReward(receiver, amount, "random");
emit ClaimRandomPool(receiver, amount, network, txid);
}
function claimFeeReward() external returns(uint256 amount) {
uint256 amount = userFeePool[msg.sender];
require(amount > 0, "No reward for current address");
userFeePool[msg.sender] = 0;
if (rewardToken == _ZERO_ADDRESS) {
require(payable(this).balance >= amount, "Insufficient balance by pool");
payable(msg.sender).transfer(amount);
} else {
require(IERC20(rewardToken).balanceOf(address(this)) >= amount, "Insufficient balance by pool");
IERC20(rewardToken).safeTransfer(msg.sender, amount);
}
emit ClaimReward(msg.sender, amount, "fee");
}
function claimBqlReward() external returns(uint256 amount) {
uint256 amount = userBqlPool[msg.sender];
require(amount > 0, "No reward for current address");
userBqlPool[msg.sender] = 0;
if (rewardToken == _ZERO_ADDRESS) {
require(payable(this).balance >= amount, "Insufficient balance by pool");
payable(msg.sender).transfer(amount);
} else {
require(IERC20(rewardToken).balanceOf(address(this)) >= amount, "Insufficient balance by pool");
IERC20(rewardToken).safeTransfer(msg.sender, amount);
}
emit ClaimReward(msg.sender, amount, "bql");
}
function GetInitializeData(address _owner, address _rewardToken, uint256[] calldata _points) public pure returns(bytes memory){
return abi.encodeWithSignature("initialize(address,address,uint256[])", _owner, _rewardToken, _points);
}
}// SPDX-License-Identifier: MIT
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
pragma solidity ^0.8.0;
import "IDaiLikePermit.sol";
import "RevertReasonForwarder.sol";
import "IERC20.sol";
import "IERC20Permit.sol";
library SafeERC20 {
error SafeTransferFailed();
error SafeTransferFromFailed();
error ForceApproveFailed();
error SafeIncreaseAllowanceFailed();
error SafeDecreaseAllowanceFailed();
error SafePermitBadLength();
// Ensures method do not revert or return boolean `true`, admits call to non-smart-contract
function safeTransferFrom(IERC20 token, address from, address to, uint256 amount) internal {
bytes4 selector = token.transferFrom.selector;
bool success;
// @solidity memory-safe-assembly
assembly { // solhint-disable-line no-inline-assembly
let data := mload(0x40)
mstore(data, selector)
mstore(add(data, 0x04), from)
mstore(add(data, 0x24), to)
mstore(add(data, 0x44), amount)
success := call(gas(), token, 0, data, 100, 0x0, 0x20)
if success {
switch returndatasize()
case 0 { success := gt(extcodesize(token), 0) }
default { success := and(gt(returndatasize(), 31), eq(mload(0), 1)) }
}
}
if (!success) revert SafeTransferFromFailed();
}
// Ensures method do not revert or return boolean `true`, admits call to non-smart-contract
function safeTransfer(IERC20 token, address to, uint256 value) internal {
if (!_makeCall(token, token.transfer.selector, to, value)) {
revert SafeTransferFailed();
}
}
// If `approve(from, to, amount)` fails, try to `approve(from, to, 0)` before retry
function forceApprove(IERC20 token, address spender, uint256 value) internal {
if (!_makeCall(token, token.approve.selector, spender, value)) {
if (!_makeCall(token, token.approve.selector, spender, 0) ||
!_makeCall(token, token.approve.selector, spender, value))
{
revert ForceApproveFailed();
}
}
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 allowance = token.allowance(address(this), spender);
if (value > type(uint256).max - allowance) revert SafeIncreaseAllowanceFailed();
forceApprove(token, spender, allowance + value);
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 allowance = token.allowance(address(this), spender);
if (value > allowance) revert SafeDecreaseAllowanceFailed();
forceApprove(token, spender, allowance - value);
}
function safePermit(IERC20 token, bytes calldata permit) internal {
bool success;
if (permit.length == 32 * 7) {
success = _makeCalldataCall(token, IERC20Permit.permit.selector, permit);
} else if (permit.length == 32 * 8) {
success = _makeCalldataCall(token, IDaiLikePermit.permit.selector, permit);
} else {
revert SafePermitBadLength();
}
if (!success) RevertReasonForwarder.reRevert();
}
function _makeCall(IERC20 token, bytes4 selector, address to, uint256 amount) private returns(bool success) {
// @solidity memory-safe-assembly
assembly { // solhint-disable-line no-inline-assembly
let data := mload(0x40)
mstore(data, selector)
mstore(add(data, 0x04), to)
mstore(add(data, 0x24), amount)
success := call(gas(), token, 0, data, 0x44, 0x0, 0x20)
if success {
switch returndatasize()
case 0 { success := gt(extcodesize(token), 0) }
default { success := and(gt(returndatasize(), 31), eq(mload(0), 1)) }
}
}
}
function _makeCalldataCall(IERC20 token, bytes4 selector, bytes calldata args) private returns(bool success) {
// @solidity memory-safe-assembly
assembly { // solhint-disable-line no-inline-assembly
let len := add(4, args.length)
let data := mload(0x40)
mstore(data, selector)
calldatacopy(add(data, 0x04), args.offset, args.length)
success := call(gas(), token, 0, data, len, 0x0, 0x20)
if success {
switch returndatasize()
case 0 { success := gt(extcodesize(token), 0) }
default { success := and(gt(returndatasize(), 31), eq(mload(0), 1)) }
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IDaiLikePermit {
function permit(address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library RevertReasonForwarder {
function reRevert() internal pure {
// bubble up revert reason from latest external call
// @solidity memory-safe-assembly
assembly { // solhint-disable-line no-inline-assembly
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
}
}// SPDX-License-Identifier: MIT
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.
*/
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].
*/
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
pragma solidity ^0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
return (true, a - b);
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a / b);
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a % b);
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: modulo by zero");
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
function min(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = x < y ? x : y;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
// SPDX-License-Identifier: MIT
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
// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;
import "Address.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Modifier to protect an initializer function from being invoked twice.
*/
modifier initializer() {
require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized");
bool isTopLevelCall = !_initializing;
if (isTopLevelCall) {
_initializing = true;
_initialized = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
}
}
/// @dev Returns true if and only if the function is running in the constructor
function _isConstructor() private view returns (bool) {
return !Address.isContract(address(this));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}{
"evmVersion": "istanbul",
"optimizer": {
"enabled": true,
"runs": 200
},
"libraries": {
"PrizePool.sol": {}
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"name":"SafeTransferFailed","type":"error"},{"inputs":[],"name":"SafeTransferFromFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"_network","type":"string"},{"indexed":false,"internalType":"string","name":"_txid","type":"string"}],"name":"ClaimRandomPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"_type","type":"string"}],"name":"ClaimReward","type":"event"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_rewardToken","type":"address"},{"internalType":"uint256[]","name":"_points","type":"uint256[]"}],"name":"GetInitializeData","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"bqlPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimBqlReward","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimFeeReward","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"string","name":"network","type":"string"},{"internalType":"string","name":"txid","type":"string"}],"name":"claimRandomPool","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"epochBqlPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"epochFeePool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feePoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_rewardToken","type":"address"},{"internalType":"uint256[]","name":"_points","type":"uint256[]"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"poolDistribute","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"randomPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_points","type":"uint256[]"}],"name":"setPoolPoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_users","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"uint8","name":"_type","type":"uint8"}],"name":"setRewardBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardToken","type":"address"}],"name":"setRewardToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalRandomPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userBqlPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userFeePool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
608060405234801561001057600080fd5b5060018055611b1d806100246000396000f3fe6080604052600436106101395760003560e01c8063853b2a5d116100ab578063a570a4741161006f578063a570a4741461035c578063c7edf1321461037c578063d4da61f214610391578063e337fb5c146103be578063f1d9787a146103de578063f7c618c1146103f457600080fd5b8063853b2a5d146102b85780638aee8127146102d85780638da5cb5b146102f85780639adcb63614610330578063a4c595d51461034657600080fd5b8063325f40e4116100fd578063325f40e4146101e657806336803e541461021357806337db6cbb1461023357806350a153ef1461026057806366af3d771461028d578063750142e6146102a257600080fd5b806304d1ed3e14610145578063050d083e1461016e5780630a069dd61461019b57806313af4035146101b057806315018126146101d057600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5061015b60095481565b6040519081526020015b60405180910390f35b34801561017a57600080fd5b5061018e61018936600461167b565b610414565b60405161016591906116dc565b6101ae6101a936600461172a565b610462565b005b3480156101bc57600080fd5b506101ae6101cb36600461174c565b6106c8565b3480156101dc57600080fd5b5061015b60055481565b3480156101f257600080fd5b5061015b61020136600461174c565b600b6020526000908152604090205481565b34801561021f57600080fd5b506101ae61022e366004611767565b61076a565b34801561023f57600080fd5b5061015b61024e3660046117a9565b600d6020526000908152604090205481565b34801561026c57600080fd5b5061015b61027b36600461174c565b600a6020526000908152604090205481565b34801561029957600080fd5b5061015b610897565b3480156102ae57600080fd5b5061015b60085481565b3480156102c457600080fd5b5061015b6102d3366004611804565b610a6a565b3480156102e457600080fd5b506101ae6102f336600461174c565b610c00565b34801561030457600080fd5b50600254610318906001600160a01b031681565b6040516001600160a01b039091168152602001610165565b34801561033c57600080fd5b5061015b60075481565b34801561035257600080fd5b5061015b60065481565b34801561036857600080fd5b506101ae610377366004611885565b610c9c565b34801561038857600080fd5b5061015b610fbb565b34801561039d57600080fd5b5061015b6103ac3660046117a9565b600c6020526000908152604090205481565b3480156103ca57600080fd5b506101ae6103d936600461167b565b611182565b3480156103ea57600080fd5b5061015b60045481565b34801561040057600080fd5b50600354610318906001600160a01b031681565b60608484848460405160240161042d949392919061190f565b60408051601f198184030181529190526020810180516001600160e01b03166338cdfed760e21b17905290505b949350505050565b600081116104c15760405162461bcd60e51b815260206004820152602160248201527f52657761726420746f6b656e20616d6f756e742063616e2774206265207a65726044820152606f60f81b60648201526084015b60405180910390fd5b6003546001600160a01b0316610517578034146105125760405162461bcd60e51b815260206004820152600f60248201526e416d6f756e742069732077726f6e6760881b60448201526064016104b8565b6105db565b6003546040516370a0823160e01b815233600482015282916001600160a01b0316906370a0823190602401602060405180830381865afa15801561055f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105839190611962565b10156105c35760405162461bcd60e51b815260206004820152600f60248201526e416d6f756e742069732077726f6e6760881b60448201526064016104b8565b6003546105db906001600160a01b031633308461136e565b610609610600620f42406105fa600654856113ea90919063ffffffff16565b90611475565b600754906114d0565b60075560085461061990826114d0565b6008556006546106409061063790620f4240906105fa9085906113ea565b600954906114d0565b6009556004546106739061065e90620f4240906105fa9085906113ea565b6000848152600c6020526040902054906114d0565b6000838152600c60205260409020556005546106b29061069d90620f4240906105fa9085906113ea565b6000848152600d6020526040902054906114d0565b6000928352600d60205260409092209190915550565b6002546001600160a01b031633146106f25760405162461bcd60e51b81526004016104b89061197b565b6001600160a01b0381166107485760405162461bcd60e51b815260206004820152601b60248201527f4f776e65722063616e2774206265207a65726f2061646472657373000000000060448201526064016104b8565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146107945760405162461bcd60e51b81526004016104b89061197b565b620f4240828260028181106107ab576107ab6119aa565b90506020020135838360018181106107c5576107c56119aa565b90506020020135848460008181106107df576107df6119aa565b905060200201356107f091906119d6565b6107fa91906119d6565b11156108365760405162461bcd60e51b815260206004820152600b60248201526a2837b4b73a1032b93937b960a91b60448201526064016104b8565b81816000818110610849576108496119aa565b60200291909101356004555081816001818110610868576108686119aa565b60200291909101356005555081816002818110610887576108876119aa565b6020029190910135600655505050565b336000908152600a6020526040812054806108f45760405162461bcd60e51b815260206004820152601d60248201527f4e6f2072657761726420666f722063757272656e74206164647265737300000060448201526064016104b8565b336000908152600a60205260408120556003546001600160a01b031661096757804710156109345760405162461bcd60e51b81526004016104b8906119e9565b604051339082156108fc029083906000818181858888f19350505050158015610961573d6000803e3d6000fd5b50610a08565b6003546040516370a0823160e01b815230600482015282916001600160a01b0316906370a0823190602401602060405180830381865afa1580156109af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d39190611962565b10156109f15760405162461bcd60e51b81526004016104b8906119e9565b600354610a08906001600160a01b0316338361152f565b336001600160a01b03167fd2301a68d6cb5a0838ce40003dbb09e5eb2659920c05aba729b36ded7249fca482604051610a5e91815260406020820181905260039082015262189c5b60ea1b606082015260800190565b60405180910390a25090565b6002546000906001600160a01b03163314610a975760405162461bcd60e51b81526004016104b89061197b565b600060075411610ae05760405162461bcd60e51b815260206004820152601460248201527352616e646f6d20706f6f6c20697320656d70747960601b60448201526064016104b8565b506007805460009091556003546001600160a01b0316610b36576040516001600160a01b0387169082156108fc029083906000818181858888f19350505050158015610b30573d6000803e3d6000fd5b50610b4d565b600354610b4d906001600160a01b0316878361152f565b856001600160a01b03167fd2301a68d6cb5a0838ce40003dbb09e5eb2659920c05aba729b36ded7249fca482604051610ba69181526040602082018190526006908201526572616e646f6d60d01b606082015260800190565b60405180910390a2856001600160a01b03167f2367de18946d7ed7778bc3edf72c275a3771b70a3245a69fc251a4768acecbfb8287878787604051610bef959493929190611a49565b60405180910390a295945050505050565b6002546001600160a01b03163314610c2a5760405162461bcd60e51b81526004016104b89061197b565b60085415610c7a5760405162461bcd60e51b815260206004820152601760248201527f52657761726420746f6b656e732061726520666978656400000000000000000060448201526064016104b8565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b03163314610cc65760405162461bcd60e51b81526004016104b89061197b565b8060ff16600003610da05760005b84811015610d9a57610d43848483818110610cf157610cf16119aa565b90506020020135600b6000898986818110610d0e57610d0e6119aa565b9050602002016020810190610d23919061174c565b6001600160a01b03168152602081019190915260400160002054906114d0565b600b6000888885818110610d5957610d596119aa565b9050602002016020810190610d6e919061174c565b6001600160a01b0316815260208101919091526040016000205580610d9281611a82565b915050610cd4565b50610fb4565b8060ff16600103610e3f5760005b84811015610d9a57610de8848483818110610dcb57610dcb6119aa565b90506020020135600a6000898986818110610d0e57610d0e6119aa565b600a6000888885818110610dfe57610dfe6119aa565b9050602002016020810190610e13919061174c565b6001600160a01b0316815260208101919091526040016000205580610e3781611a82565b915050610dae565b8060ff16600203610f135760005b84811015610d9a57610ebc848483818110610e6a57610e6a6119aa565b90506020020135600b6000898986818110610e8757610e876119aa565b9050602002016020810190610e9c919061174c565b6001600160a01b0316815260208101919091526040016000205490611564565b600b6000888885818110610ed257610ed26119aa565b9050602002016020810190610ee7919061174c565b6001600160a01b0316815260208101919091526040016000205580610f0b81611a82565b915050610e4d565b8060ff16600303610fb45760005b84811015610fb257610f5b848483818110610f3e57610f3e6119aa565b90506020020135600a6000898986818110610e8757610e876119aa565b600a6000888885818110610f7157610f716119aa565b9050602002016020810190610f86919061174c565b6001600160a01b0316815260208101919091526040016000205580610faa81611a82565b915050610f21565b505b5050505050565b336000908152600b6020526040812054806110185760405162461bcd60e51b815260206004820152601d60248201527f4e6f2072657761726420666f722063757272656e74206164647265737300000060448201526064016104b8565b336000908152600b60205260408120556003546001600160a01b031661108b57804710156110585760405162461bcd60e51b81526004016104b8906119e9565b604051339082156108fc029083906000818181858888f19350505050158015611085573d6000803e3d6000fd5b5061112c565b6003546040516370a0823160e01b815230600482015282916001600160a01b0316906370a0823190602401602060405180830381865afa1580156110d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f79190611962565b10156111155760405162461bcd60e51b81526004016104b8906119e9565b60035461112c906001600160a01b0316338361152f565b336001600160a01b03167fd2301a68d6cb5a0838ce40003dbb09e5eb2659920c05aba729b36ded7249fca482604051610a5e9181526040602082018190526003908201526266656560e81b606082015260800190565b600054610100900460ff16806111975750303b155b806111a5575060005460ff16155b6112085760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104b8565b600054610100900460ff1615801561122a576000805461ffff19166101011790555b600280546001600160a01b038088166001600160a01b03199283161783556003805491881691909216179055620f4240908490849081811061126e5761126e6119aa565b9050602002013584846001818110611288576112886119aa565b90506020020135858560008181106112a2576112a26119aa565b905060200201356112b391906119d6565b6112bd91906119d6565b11156112f95760405162461bcd60e51b815260206004820152600b60248201526a2837b4b73a1032b93937b960a91b60448201526064016104b8565b8282600081811061130c5761130c6119aa565b6020029190910135600455508282600181811061132b5761132b6119aa565b6020029190910135600555508282600281811061134a5761134a6119aa565b6020029190910135600655508015610fb4576000805461ff00191690555050505050565b60006323b872dd60e01b905060006040518281528560048201528460248201528360448201526020600060648360008b5af191505080156113cc573d80156113c257600160005114601f3d111691506113ca565b6000873b1191505b505b80610fb25760405163f405907160e01b815260040160405180910390fd5b6000826000036113fc5750600061146f565b60006114088385611a9b565b9050826114158583611ab2565b1461146c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104b8565b90505b92915050565b60008082116114c65760405162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f00000000000060448201526064016104b8565b61146c8284611ab2565b6000806114dd83856119d6565b90508381101561146c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104b8565b6115428363a9059cbb60e01b84846115c0565b61155f5760405163fb7f507960e01b815260040160405180910390fd5b505050565b6000828211156115b65760405162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f77000060448201526064016104b8565b61146c8284611ad4565b60006040518481528360048201528260248201526020600060448360008a5af1915050801561045a573d801561160257600160005114601f3d1116915061160a565b6000863b1191505b50949350505050565b80356001600160a01b038116811461162a57600080fd5b919050565b60008083601f84011261164157600080fd5b50813567ffffffffffffffff81111561165957600080fd5b6020830191508360208260051b850101111561167457600080fd5b9250929050565b6000806000806060858703121561169157600080fd5b61169a85611613565b93506116a860208601611613565b9250604085013567ffffffffffffffff8111156116c457600080fd5b6116d08782880161162f565b95989497509550505050565b600060208083528351808285015260005b81811015611709578581018301518582016040015282016116ed565b506000604082860101526040601f19601f8301168501019250505092915050565b6000806040838503121561173d57600080fd5b50508035926020909101359150565b60006020828403121561175e57600080fd5b61146c82611613565b6000806020838503121561177a57600080fd5b823567ffffffffffffffff81111561179157600080fd5b61179d8582860161162f565b90969095509350505050565b6000602082840312156117bb57600080fd5b5035919050565b60008083601f8401126117d457600080fd5b50813567ffffffffffffffff8111156117ec57600080fd5b60208301915083602082850101111561167457600080fd5b60008060008060006060868803121561181c57600080fd5b61182586611613565b9450602086013567ffffffffffffffff8082111561184257600080fd5b61184e89838a016117c2565b9096509450604088013591508082111561186757600080fd5b50611874888289016117c2565b969995985093965092949392505050565b60008060008060006060868803121561189d57600080fd5b853567ffffffffffffffff808211156118b557600080fd5b6118c189838a0161162f565b909750955060208801359150808211156118da57600080fd5b506118e78882890161162f565b909450925050604086013560ff8116811461190157600080fd5b809150509295509295909350565b6001600160a01b03858116825284166020820152606060408201819052810182905260006001600160fb1b0383111561194757600080fd5b8260051b808560808501379190910160800195945050505050565b60006020828403121561197457600080fd5b5051919050565b6020808252601590820152741bdb9b1e4818591b5a5b881a5cc8185b1b1bddd959605a1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561146f5761146f6119c0565b6020808252601c908201527f496e73756666696369656e742062616c616e636520627920706f6f6c00000000604082015260600190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b858152606060208201526000611a63606083018688611a20565b8281036040840152611a76818587611a20565b98975050505050505050565b600060018201611a9457611a946119c0565b5060010190565b808202811582820484141761146f5761146f6119c0565b600082611acf57634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561146f5761146f6119c056fea2646970667358221220b4e49a2c60075f8c7f56dafceef45dd2d930209069e8afc0cdc56c0434291bd564736f6c63430008110033
Deployed Bytecode
0x6080604052600436106101395760003560e01c8063853b2a5d116100ab578063a570a4741161006f578063a570a4741461035c578063c7edf1321461037c578063d4da61f214610391578063e337fb5c146103be578063f1d9787a146103de578063f7c618c1146103f457600080fd5b8063853b2a5d146102b85780638aee8127146102d85780638da5cb5b146102f85780639adcb63614610330578063a4c595d51461034657600080fd5b8063325f40e4116100fd578063325f40e4146101e657806336803e541461021357806337db6cbb1461023357806350a153ef1461026057806366af3d771461028d578063750142e6146102a257600080fd5b806304d1ed3e14610145578063050d083e1461016e5780630a069dd61461019b57806313af4035146101b057806315018126146101d057600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5061015b60095481565b6040519081526020015b60405180910390f35b34801561017a57600080fd5b5061018e61018936600461167b565b610414565b60405161016591906116dc565b6101ae6101a936600461172a565b610462565b005b3480156101bc57600080fd5b506101ae6101cb36600461174c565b6106c8565b3480156101dc57600080fd5b5061015b60055481565b3480156101f257600080fd5b5061015b61020136600461174c565b600b6020526000908152604090205481565b34801561021f57600080fd5b506101ae61022e366004611767565b61076a565b34801561023f57600080fd5b5061015b61024e3660046117a9565b600d6020526000908152604090205481565b34801561026c57600080fd5b5061015b61027b36600461174c565b600a6020526000908152604090205481565b34801561029957600080fd5b5061015b610897565b3480156102ae57600080fd5b5061015b60085481565b3480156102c457600080fd5b5061015b6102d3366004611804565b610a6a565b3480156102e457600080fd5b506101ae6102f336600461174c565b610c00565b34801561030457600080fd5b50600254610318906001600160a01b031681565b6040516001600160a01b039091168152602001610165565b34801561033c57600080fd5b5061015b60075481565b34801561035257600080fd5b5061015b60065481565b34801561036857600080fd5b506101ae610377366004611885565b610c9c565b34801561038857600080fd5b5061015b610fbb565b34801561039d57600080fd5b5061015b6103ac3660046117a9565b600c6020526000908152604090205481565b3480156103ca57600080fd5b506101ae6103d936600461167b565b611182565b3480156103ea57600080fd5b5061015b60045481565b34801561040057600080fd5b50600354610318906001600160a01b031681565b60608484848460405160240161042d949392919061190f565b60408051601f198184030181529190526020810180516001600160e01b03166338cdfed760e21b17905290505b949350505050565b600081116104c15760405162461bcd60e51b815260206004820152602160248201527f52657761726420746f6b656e20616d6f756e742063616e2774206265207a65726044820152606f60f81b60648201526084015b60405180910390fd5b6003546001600160a01b0316610517578034146105125760405162461bcd60e51b815260206004820152600f60248201526e416d6f756e742069732077726f6e6760881b60448201526064016104b8565b6105db565b6003546040516370a0823160e01b815233600482015282916001600160a01b0316906370a0823190602401602060405180830381865afa15801561055f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105839190611962565b10156105c35760405162461bcd60e51b815260206004820152600f60248201526e416d6f756e742069732077726f6e6760881b60448201526064016104b8565b6003546105db906001600160a01b031633308461136e565b610609610600620f42406105fa600654856113ea90919063ffffffff16565b90611475565b600754906114d0565b60075560085461061990826114d0565b6008556006546106409061063790620f4240906105fa9085906113ea565b600954906114d0565b6009556004546106739061065e90620f4240906105fa9085906113ea565b6000848152600c6020526040902054906114d0565b6000838152600c60205260409020556005546106b29061069d90620f4240906105fa9085906113ea565b6000848152600d6020526040902054906114d0565b6000928352600d60205260409092209190915550565b6002546001600160a01b031633146106f25760405162461bcd60e51b81526004016104b89061197b565b6001600160a01b0381166107485760405162461bcd60e51b815260206004820152601b60248201527f4f776e65722063616e2774206265207a65726f2061646472657373000000000060448201526064016104b8565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146107945760405162461bcd60e51b81526004016104b89061197b565b620f4240828260028181106107ab576107ab6119aa565b90506020020135838360018181106107c5576107c56119aa565b90506020020135848460008181106107df576107df6119aa565b905060200201356107f091906119d6565b6107fa91906119d6565b11156108365760405162461bcd60e51b815260206004820152600b60248201526a2837b4b73a1032b93937b960a91b60448201526064016104b8565b81816000818110610849576108496119aa565b60200291909101356004555081816001818110610868576108686119aa565b60200291909101356005555081816002818110610887576108876119aa565b6020029190910135600655505050565b336000908152600a6020526040812054806108f45760405162461bcd60e51b815260206004820152601d60248201527f4e6f2072657761726420666f722063757272656e74206164647265737300000060448201526064016104b8565b336000908152600a60205260408120556003546001600160a01b031661096757804710156109345760405162461bcd60e51b81526004016104b8906119e9565b604051339082156108fc029083906000818181858888f19350505050158015610961573d6000803e3d6000fd5b50610a08565b6003546040516370a0823160e01b815230600482015282916001600160a01b0316906370a0823190602401602060405180830381865afa1580156109af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d39190611962565b10156109f15760405162461bcd60e51b81526004016104b8906119e9565b600354610a08906001600160a01b0316338361152f565b336001600160a01b03167fd2301a68d6cb5a0838ce40003dbb09e5eb2659920c05aba729b36ded7249fca482604051610a5e91815260406020820181905260039082015262189c5b60ea1b606082015260800190565b60405180910390a25090565b6002546000906001600160a01b03163314610a975760405162461bcd60e51b81526004016104b89061197b565b600060075411610ae05760405162461bcd60e51b815260206004820152601460248201527352616e646f6d20706f6f6c20697320656d70747960601b60448201526064016104b8565b506007805460009091556003546001600160a01b0316610b36576040516001600160a01b0387169082156108fc029083906000818181858888f19350505050158015610b30573d6000803e3d6000fd5b50610b4d565b600354610b4d906001600160a01b0316878361152f565b856001600160a01b03167fd2301a68d6cb5a0838ce40003dbb09e5eb2659920c05aba729b36ded7249fca482604051610ba69181526040602082018190526006908201526572616e646f6d60d01b606082015260800190565b60405180910390a2856001600160a01b03167f2367de18946d7ed7778bc3edf72c275a3771b70a3245a69fc251a4768acecbfb8287878787604051610bef959493929190611a49565b60405180910390a295945050505050565b6002546001600160a01b03163314610c2a5760405162461bcd60e51b81526004016104b89061197b565b60085415610c7a5760405162461bcd60e51b815260206004820152601760248201527f52657761726420746f6b656e732061726520666978656400000000000000000060448201526064016104b8565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b03163314610cc65760405162461bcd60e51b81526004016104b89061197b565b8060ff16600003610da05760005b84811015610d9a57610d43848483818110610cf157610cf16119aa565b90506020020135600b6000898986818110610d0e57610d0e6119aa565b9050602002016020810190610d23919061174c565b6001600160a01b03168152602081019190915260400160002054906114d0565b600b6000888885818110610d5957610d596119aa565b9050602002016020810190610d6e919061174c565b6001600160a01b0316815260208101919091526040016000205580610d9281611a82565b915050610cd4565b50610fb4565b8060ff16600103610e3f5760005b84811015610d9a57610de8848483818110610dcb57610dcb6119aa565b90506020020135600a6000898986818110610d0e57610d0e6119aa565b600a6000888885818110610dfe57610dfe6119aa565b9050602002016020810190610e13919061174c565b6001600160a01b0316815260208101919091526040016000205580610e3781611a82565b915050610dae565b8060ff16600203610f135760005b84811015610d9a57610ebc848483818110610e6a57610e6a6119aa565b90506020020135600b6000898986818110610e8757610e876119aa565b9050602002016020810190610e9c919061174c565b6001600160a01b0316815260208101919091526040016000205490611564565b600b6000888885818110610ed257610ed26119aa565b9050602002016020810190610ee7919061174c565b6001600160a01b0316815260208101919091526040016000205580610f0b81611a82565b915050610e4d565b8060ff16600303610fb45760005b84811015610fb257610f5b848483818110610f3e57610f3e6119aa565b90506020020135600a6000898986818110610e8757610e876119aa565b600a6000888885818110610f7157610f716119aa565b9050602002016020810190610f86919061174c565b6001600160a01b0316815260208101919091526040016000205580610faa81611a82565b915050610f21565b505b5050505050565b336000908152600b6020526040812054806110185760405162461bcd60e51b815260206004820152601d60248201527f4e6f2072657761726420666f722063757272656e74206164647265737300000060448201526064016104b8565b336000908152600b60205260408120556003546001600160a01b031661108b57804710156110585760405162461bcd60e51b81526004016104b8906119e9565b604051339082156108fc029083906000818181858888f19350505050158015611085573d6000803e3d6000fd5b5061112c565b6003546040516370a0823160e01b815230600482015282916001600160a01b0316906370a0823190602401602060405180830381865afa1580156110d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f79190611962565b10156111155760405162461bcd60e51b81526004016104b8906119e9565b60035461112c906001600160a01b0316338361152f565b336001600160a01b03167fd2301a68d6cb5a0838ce40003dbb09e5eb2659920c05aba729b36ded7249fca482604051610a5e9181526040602082018190526003908201526266656560e81b606082015260800190565b600054610100900460ff16806111975750303b155b806111a5575060005460ff16155b6112085760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104b8565b600054610100900460ff1615801561122a576000805461ffff19166101011790555b600280546001600160a01b038088166001600160a01b03199283161783556003805491881691909216179055620f4240908490849081811061126e5761126e6119aa565b9050602002013584846001818110611288576112886119aa565b90506020020135858560008181106112a2576112a26119aa565b905060200201356112b391906119d6565b6112bd91906119d6565b11156112f95760405162461bcd60e51b815260206004820152600b60248201526a2837b4b73a1032b93937b960a91b60448201526064016104b8565b8282600081811061130c5761130c6119aa565b6020029190910135600455508282600181811061132b5761132b6119aa565b6020029190910135600555508282600281811061134a5761134a6119aa565b6020029190910135600655508015610fb4576000805461ff00191690555050505050565b60006323b872dd60e01b905060006040518281528560048201528460248201528360448201526020600060648360008b5af191505080156113cc573d80156113c257600160005114601f3d111691506113ca565b6000873b1191505b505b80610fb25760405163f405907160e01b815260040160405180910390fd5b6000826000036113fc5750600061146f565b60006114088385611a9b565b9050826114158583611ab2565b1461146c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104b8565b90505b92915050565b60008082116114c65760405162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f00000000000060448201526064016104b8565b61146c8284611ab2565b6000806114dd83856119d6565b90508381101561146c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104b8565b6115428363a9059cbb60e01b84846115c0565b61155f5760405163fb7f507960e01b815260040160405180910390fd5b505050565b6000828211156115b65760405162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f77000060448201526064016104b8565b61146c8284611ad4565b60006040518481528360048201528260248201526020600060448360008a5af1915050801561045a573d801561160257600160005114601f3d1116915061160a565b6000863b1191505b50949350505050565b80356001600160a01b038116811461162a57600080fd5b919050565b60008083601f84011261164157600080fd5b50813567ffffffffffffffff81111561165957600080fd5b6020830191508360208260051b850101111561167457600080fd5b9250929050565b6000806000806060858703121561169157600080fd5b61169a85611613565b93506116a860208601611613565b9250604085013567ffffffffffffffff8111156116c457600080fd5b6116d08782880161162f565b95989497509550505050565b600060208083528351808285015260005b81811015611709578581018301518582016040015282016116ed565b506000604082860101526040601f19601f8301168501019250505092915050565b6000806040838503121561173d57600080fd5b50508035926020909101359150565b60006020828403121561175e57600080fd5b61146c82611613565b6000806020838503121561177a57600080fd5b823567ffffffffffffffff81111561179157600080fd5b61179d8582860161162f565b90969095509350505050565b6000602082840312156117bb57600080fd5b5035919050565b60008083601f8401126117d457600080fd5b50813567ffffffffffffffff8111156117ec57600080fd5b60208301915083602082850101111561167457600080fd5b60008060008060006060868803121561181c57600080fd5b61182586611613565b9450602086013567ffffffffffffffff8082111561184257600080fd5b61184e89838a016117c2565b9096509450604088013591508082111561186757600080fd5b50611874888289016117c2565b969995985093965092949392505050565b60008060008060006060868803121561189d57600080fd5b853567ffffffffffffffff808211156118b557600080fd5b6118c189838a0161162f565b909750955060208801359150808211156118da57600080fd5b506118e78882890161162f565b909450925050604086013560ff8116811461190157600080fd5b809150509295509295909350565b6001600160a01b03858116825284166020820152606060408201819052810182905260006001600160fb1b0383111561194757600080fd5b8260051b808560808501379190910160800195945050505050565b60006020828403121561197457600080fd5b5051919050565b6020808252601590820152741bdb9b1e4818591b5a5b881a5cc8185b1b1bddd959605a1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561146f5761146f6119c0565b6020808252601c908201527f496e73756666696369656e742062616c616e636520627920706f6f6c00000000604082015260600190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b858152606060208201526000611a63606083018688611a20565b8281036040840152611a76818587611a20565b98975050505050505050565b600060018201611a9457611a946119c0565b5060010190565b808202811582820484141761146f5761146f6119c0565b600082611acf57634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561146f5761146f6119c056fea2646970667358221220b4e49a2c60075f8c7f56dafceef45dd2d930209069e8afc0cdc56c0434291bd564736f6c63430008110033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.