Source Code
Overview
S Balance
S Value
$12.35 (@ $0.07/S)Latest 25 from a total of 1,272 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Enter Space Swee... | 58158229 | 40 days ago | IN | 9.8 S | 0.00921497 | ||||
| Enter Space Swee... | 49162722 | 116 days ago | IN | 5.912 S | 0.0089754 | ||||
| Enter Space Swee... | 49160784 | 116 days ago | IN | 10.912 S | 0.0108213 | ||||
| Claim Winnings | 49160759 | 116 days ago | IN | 0 S | 0.00211854 | ||||
| Enter Space Swee... | 49160729 | 116 days ago | IN | 5.912 S | 0.01316507 | ||||
| Claim Winnings | 42569498 | 168 days ago | IN | 0 S | 0.00222447 | ||||
| Claim Winnings | 42569465 | 168 days ago | IN | 0 S | 0.00231114 | ||||
| Claim Winnings | 42569442 | 168 days ago | IN | 0 S | 0.00211931 | ||||
| Claim Winnings | 42551840 | 168 days ago | IN | 0 S | 0.00211893 | ||||
| _entropy Callbac... | 42167538 | 171 days ago | IN | 0 S | 0.02406497 | ||||
| Perform Upkeep | 42167523 | 171 days ago | IN | 0.0456 S | 0.0067454 | ||||
| Enter Space Swee... | 41727698 | 174 days ago | IN | 0.84 S | 0.01109991 | ||||
| Enter Space Swee... | 41533176 | 176 days ago | IN | 0.83620658 S | 0.03884782 | ||||
| Enter Space Swee... | 41533154 | 176 days ago | IN | 0.83620658 S | 0.04274433 | ||||
| Enter Space Swee... | 41533139 | 176 days ago | IN | 0.83620658 S | 0.0421965 | ||||
| Enter Space Swee... | 41533115 | 176 days ago | IN | 0.83620658 S | 0.04203672 | ||||
| Enter Space Swee... | 41533093 | 176 days ago | IN | 0.83620658 S | 0.04186032 | ||||
| Enter Space Swee... | 41087916 | 179 days ago | IN | 0.82917646 S | 0.01156456 | ||||
| Transfer Dead Fu... | 41087300 | 179 days ago | IN | 0 S | 0.00229699 | ||||
| Transfer Treasur... | 41087285 | 179 days ago | IN | 0 S | 0.00207382 | ||||
| Enter Space Swee... | 41049900 | 179 days ago | IN | 0.82917646 S | 0.0421965 | ||||
| Enter Space Swee... | 41049867 | 179 days ago | IN | 0.82917646 S | 0.03972014 | ||||
| Enter Space Swee... | 41049838 | 179 days ago | IN | 0.82917646 S | 0.03838591 | ||||
| Enter Space Swee... | 40900540 | 180 days ago | IN | 0.82402643 S | 0.04850327 | ||||
| Enter Space Swee... | 40900157 | 180 days ago | IN | 0.82402643 S | 0.04423284 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 49160759 | 116 days ago | 6.74595904 S | ||||
| 42569498 | 168 days ago | 29.601096 S | ||||
| 42569465 | 168 days ago | 8.457456 S | ||||
| 42569442 | 168 days ago | 12.686184 S | ||||
| 42551840 | 168 days ago | 4.228728 S | ||||
| 42167538 | 171 days ago | 21.14364 S | ||||
| 42167523 | 171 days ago | 0.0456 S | ||||
| 41087300 | 179 days ago | 7.74758226 S | ||||
| 41087285 | 179 days ago | 0.0378 S | ||||
| 40210483 | 185 days ago | 26.3480384 S | ||||
| 40209112 | 185 days ago | 33.72979522 S | ||||
| 40209059 | 185 days ago | 16.86489761 S | ||||
| 40208363 | 185 days ago | 25.29734641 S | ||||
| 40208339 | 185 days ago | 59.02714164 S | ||||
| 40208311 | 185 days ago | 3.37297952 S | ||||
| 40208286 | 185 days ago | 8.4324488 S | ||||
| 40208265 | 185 days ago | 6.74595904 S | ||||
| 40208240 | 185 days ago | 5.05946928 S | ||||
| 40205044 | 185 days ago | 42.20493983 S | ||||
| 40205032 | 185 days ago | 0.04522352 S | ||||
| 39743480 | 188 days ago | 74.21672499 S | ||||
| 38250304 | 198 days ago | 48.11292175 S | ||||
| 38228433 | 198 days ago | 42.40955713 S | ||||
| 38084015 | 199 days ago | 6.36143357 S | ||||
| 38083091 | 199 days ago | 8.48191142 S |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
SpaceSweepDay
Compiler Version
v0.8.16+commit.07a7930e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@pythnetwork/entropy-sdk-solidity/IEntropy.sol";
import "@pythnetwork/entropy-sdk-solidity/IEntropyConsumer.sol";
import { SafeERC20, IERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
error SpaceSweepDay__NotEnoughSToken();
error SpaceSweepDay__TransferFailed();
error SpaceSweepDay__NotOpen();
error SpaceSweepDay__UpkeepNotNeeded(
uint256 currentBalance,
uint256 numPlayers,
uint256 SpaceSweepDayState
);
contract SpaceSweepDay is Ownable, ReentrancyGuard {
// contract SpaceSweepDay is IEntropyConsumer, Ownable, ReentrancyGuard {
// Entropy
IEntropy entropy;
address entropyProvider;
/* state variables */
uint256 public i_entranceFee;
address payable[] public s_players;
uint256[] public playerContributions;
address payable public treasuryWallet;
address[] public specialWallets;
uint256 public treasuryFund;
address payable[] public s_recentWinners;
uint256 public totalWinnings;
mapping(address => uint256) public winnings;
mapping(address => uint256) contributions;
uint256 public currentPool = 0;
mapping(uint256 => mapping(address => bool)) public roundWinners;
uint256 public currentRound = 1;
address public caller;
bool public feeEnabled = true;
/** Lottey Variables */
enum SpaceSweepDayState {
OPEN,
CALCULATING
}
SpaceSweepDayState private s_SpaceSweepDayState;
/* events */
event SpaceSweepDayEnterRequest(uint64 sequenceNumber);
event RequestedSpaceSweepWinner(uint256 indexed requestId);
event SpaceSweepDayEnterResult(uint64 sequenceNumber);
event SpaceSweepDayEnter(address indexed player, uint256 allo);
event WinnerPicked(
address indexed winner,
uint256 prize,
uint256 position,
uint256 p_length
);
event TreasuryChanged(address indexed newTreasury);
// Events for tracking refund status
event RefundIssued(address to, uint256 amount);
event RefundFailed(address to, uint256 amount);
constructor(
uint256 entranceFee,
address payable _treasuryWallet,
address _entropy,
address _entropyProvider,
address _caller
) {
i_entranceFee = entranceFee;
s_SpaceSweepDayState = SpaceSweepDayState.OPEN;
treasuryWallet = _treasuryWallet;
entropy = IEntropy(_entropy);
entropyProvider = _entropyProvider;
caller = _caller;
}
modifier onlyCaller() {
require(
msg.sender == caller || msg.sender == owner(),
"Only the caller or owner can call this function"
);
_;
}
function setUpkeepCaller(address _newCaller) external onlyOwner {
require(_newCaller != address(0), "New caller cannot be zero address");
caller = _newCaller;
}
// This method is required by the IEntropyConsumer interface
// function getEntropy() internal view override returns (address) {
// return address(entropy);
// }
function getFlipFee() public view returns (uint256 fee) {
fee = entropy.getFee(entropyProvider);
}
function toggleFee(bool _enabled) public onlyOwner {
feeEnabled = _enabled;
}
function enterSpaceSweepDaySpecial() public payable {
require(
s_SpaceSweepDayState == SpaceSweepDayState.OPEN,
"SpaceSweepDay__NotOpen"
);
// Initialize a flag to check if the sender is a special wallet
bool isSpecialWallet = false;
// Search for the sender's address in the specialWallets array
for (uint256 i = 0; i < specialWallets.length; i++) {
if (msg.sender == specialWallets[i]) {
isSpecialWallet = true;
specialWallets[i] = specialWallets[specialWallets.length - 1];
specialWallets.pop();
break;
}
}
// Require that the sender must be a special wallet
require(isSpecialWallet, "SpaceSweepDay__NotSpecialWallet");
s_players.push(payable(msg.sender));
playerContributions.push(msg.value);
contributions[msg.sender] += msg.value;
emit SpaceSweepDayEnter(msg.sender, contributions[msg.sender]);
}
function enterSpaceSweepDay(uint256 entries) public payable {
require(
s_SpaceSweepDayState == SpaceSweepDayState.OPEN,
"SpaceSweepDay__NotOpen"
);
uint256 flipFee = feeEnabled ? entropy.getFee(entropyProvider) : 0;
treasuryFund += flipFee;
uint256 totalEntryFee = i_entranceFee * entries;
require(msg.value >= totalEntryFee, "SpaceSweepDay__NotEnoughSToken");
contributions[msg.sender] += msg.value - flipFee;
currentPool += msg.value - flipFee;
// Track each entry separately
for (uint256 i = 0; i < entries; i++) {
playerContributions.push(i_entranceFee);
s_players.push(payable(msg.sender));
}
emit SpaceSweepDayEnter(msg.sender, contributions[msg.sender]);
}
function performUpkeep(bytes32 userRandomNumber) external payable onlyCaller {
bool isOpen = SpaceSweepDayState.OPEN == s_SpaceSweepDayState;
bool hasBalance = currentPool > 0;
bool hasPlayers = s_players.length >= 10;
bool upKeepNeeded = (isOpen && hasBalance && hasPlayers);
if (!upKeepNeeded) {
revert SpaceSweepDay__UpkeepNotNeeded(
currentPool,
s_players.length,
uint256(s_SpaceSweepDayState)
);
}
s_SpaceSweepDayState = SpaceSweepDayState.CALCULATING;
uint256 fee = entropy.getFee(entropyProvider);
uint64 sequenceNumber = entropy.requestWithCallback{ value: fee }(
entropyProvider,
userRandomNumber
);
emit RequestedSpaceSweepWinner(sequenceNumber);
emit SpaceSweepDayEnterRequest(sequenceNumber);
}
function _entropyCallback(
uint64 sequenceNumber,
address _entropyProvider,
bytes32 randomNumber
) external onlyCaller {
entropyProvider = _entropyProvider;
delete s_recentWinners;
uint256 totalPool = currentPool;
uint256 treasuryAmount = (totalPool * 20) / 100;
treasuryFund += treasuryAmount;
uint256 availablePool = totalPool - ((totalPool * 20) / 100);
uint256[10] memory prizePercentages = [
uint256(35),
uint256(20),
uint256(15),
uint256(10),
uint256(5),
uint256(4),
uint256(4),
uint256(3),
uint256(2),
uint256(2)
];
// Convert randomNumber to uint256 for more entropy
uint256 randomValue = uint256(randomNumber);
uint256 counter = 0;
uint256 nonce = 0;
for (uint256 i = 0; i < prizePercentages.length && counter < s_players.length; ) {
// Use keccak256 to get a new random value for each iteration
bytes32 randomHash = keccak256(abi.encodePacked(randomValue, nonce, i));
// Use full 256 bits of entropy for index calculation
uint256 index = uint256(randomHash) % s_players.length;
address payable winner = s_players[index];
if (!roundWinners[currentRound][winner]) {
uint256 prize = (availablePool * prizePercentages[i]) / 100;
winnings[winner] += prize;
totalWinnings += prize;
roundWinners[currentRound][winner] = true;
s_recentWinners.push(winner);
emit WinnerPicked(winner, prize, i + 1, s_players.length);
emit SpaceSweepDayEnterResult(sequenceNumber);
i++;
counter = 0;
} else {
counter++;
nonce++; // Increment nonce for new random hash
}
}
(bool successTreasury, ) = treasuryWallet.call{ value: treasuryFund }("");
require(successTreasury, "Transfer failed.");
treasuryFund = 0;
// Reset for next SpaceSweepDay
s_SpaceSweepDayState = SpaceSweepDayState.OPEN;
currentPool = 0;
for (uint256 i = 0; i < s_players.length; i++) {
contributions[s_players[i]] = 0;
}
delete s_players;
delete playerContributions;
currentRound++;
}
function claimWinnings() external nonReentrant {
uint256 winningAmount = winnings[msg.sender];
require(winningAmount > 0, "No winnings to claim");
winnings[msg.sender] = 0;
totalWinnings -= winningAmount;
// Transfer winnings
(bool success, ) = msg.sender.call{ value: winningAmount }("");
require(success, "Failed to send winnings to user wallet");
}
function getAllRecentWinnersWinnings()
public
view
returns (address[] memory, uint256[] memory)
{
uint256 winnersCount = s_recentWinners.length;
address[] memory winnerAddresses = new address[](winnersCount);
uint256[] memory winnerWinnings = new uint256[](winnersCount);
for (uint256 i = 0; i < winnersCount; i++) {
winnerAddresses[i] = s_recentWinners[i];
winnerWinnings[i] = winnings[s_recentWinners[i]];
}
return (winnerAddresses, winnerWinnings);
}
function getContractBalance() public view returns (uint256) {
return address(this).balance;
}
function addToPool() external payable {
require(msg.value > 0, "Must send S to add to the pool");
currentPool += msg.value;
}
function getSpaceSweepDayState() public view returns (SpaceSweepDayState) {
return s_SpaceSweepDayState;
}
function getSpecialWallets() public view returns (address[] memory) {
return specialWallets;
}
function getEntranceFee() public view returns (uint256) {
return i_entranceFee;
}
function getPlayer(uint256 index) public view returns (address) {
return s_players[index];
}
function getAllPlayers() public view returns (address payable[] memory) {
return s_players;
}
function getAllContributions() public view returns (uint256[] memory) {
return playerContributions;
}
function getCurrentPool() public view returns (uint256) {
return currentPool;
}
function getNumberOfPlayers() public view returns (uint256) {
return s_players.length;
}
function addSpecialWallets(address[] calldata _wallets) external onlyOwner {
for (uint i = 0; i < _wallets.length; i++) {
specialWallets.push(_wallets[i]);
}
}
function getTotalWinnings() public view returns (uint256) {
return totalWinnings;
}
function removeSpecialWallet(address _wallet) external onlyOwner {
for (uint256 i = 0; i < specialWallets.length; i++) {
if (specialWallets[i] == _wallet) {
specialWallets[i] = specialWallets[specialWallets.length - 1];
specialWallets.pop();
break;
}
}
}
// Function to update the entrance fee
function setEntranceFee(uint256 _newEntranceFee) external onlyOwner {
i_entranceFee = _newEntranceFee;
}
function setTreasury(address payable _newTreasury) public onlyOwner {
require(_newTreasury != address(0), "New treasury cannot be the zero address");
treasuryWallet = _newTreasury;
emit TreasuryChanged(_newTreasury);
}
function transferTreasuryFunds() public onlyOwner {
require(treasuryFund > 0, "No treasury to transfer");
uint256 amountToTransfer = treasuryFund;
treasuryFund = 0; // Reset remains before transfer to prevent re-entrancy attack
(bool success, ) = treasuryWallet.call{ value: amountToTransfer }("");
require(success, "Transfer failed");
}
function refundAllParticipants() external onlyOwner nonReentrant {
uint256 playerCount = s_players.length;
for (uint256 i = 0; i < playerCount; i++) {
address payable player = s_players[i];
// Attempt to refund each player individually
(bool success, ) = player.call{ value: i_entranceFee }("");
if (success) {
emit RefundIssued(player, i_entranceFee);
} else {
emit RefundFailed(player, i_entranceFee);
}
}
s_SpaceSweepDayState = SpaceSweepDayState.OPEN;
delete s_players;
currentPool = 0;
delete playerContributions;
}
function transferDeadFunds() public onlyOwner {
uint256 calculatedFunds = address(this).balance - (totalWinnings + currentPool);
require(calculatedFunds > 0, "No dead funds available for transfer");
(bool success, ) = treasuryWallet.call{ value: calculatedFunds }("");
require(success, "Transfer failed");
}
receive() external payable {}
}// 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) (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: Apache-2.0
pragma solidity ^0.8.0;
import "./EntropyStructs.sol";
interface EntropyEvents {
event Registered(EntropyStructs.ProviderInfo provider);
event Requested(EntropyStructs.Request request);
event RequestedWithCallback(
address indexed provider,
address indexed requestor,
uint64 indexed sequenceNumber,
bytes32 userRandomNumber,
EntropyStructs.Request request
);
event Revealed(
EntropyStructs.Request request,
bytes32 userRevelation,
bytes32 providerRevelation,
bytes32 blockHash,
bytes32 randomNumber
);
event RevealedWithCallback(
EntropyStructs.Request request,
bytes32 userRandomNumber,
bytes32 providerRevelation,
bytes32 randomNumber
);
event ProviderFeeUpdated(address provider, uint128 oldFee, uint128 newFee);
event ProviderUriUpdated(address provider, bytes oldUri, bytes newUri);
event ProviderFeeManagerUpdated(
address provider,
address oldFeeManager,
address newFeeManager
);
event Withdrawal(
address provider,
address recipient,
uint128 withdrawnAmount
);
}// SPDX-License-Identifier: Apache 2
pragma solidity ^0.8.0;
contract EntropyStructs {
struct ProviderInfo {
uint128 feeInWei;
uint128 accruedFeesInWei;
// The commitment that the provider posted to the blockchain, and the sequence number
// where they committed to this. This value is not advanced after the provider commits,
// and instead is stored to help providers track where they are in the hash chain.
bytes32 originalCommitment;
uint64 originalCommitmentSequenceNumber;
// Metadata for the current commitment. Providers may optionally use this field to help
// manage rotations (i.e., to pick the sequence number from the correct hash chain).
bytes commitmentMetadata;
// Optional URI where clients can retrieve revelations for the provider.
// Client SDKs can use this field to automatically determine how to retrieve random values for each provider.
// TODO: specify the API that must be implemented at this URI
bytes uri;
// The first sequence number that is *not* included in the current commitment (i.e., an exclusive end index).
// The contract maintains the invariant that sequenceNumber <= endSequenceNumber.
// If sequenceNumber == endSequenceNumber, the provider must rotate their commitment to add additional random values.
uint64 endSequenceNumber;
// The sequence number that will be assigned to the next inbound user request.
uint64 sequenceNumber;
// The current commitment represents an index/value in the provider's hash chain.
// These values are used to verify requests for future sequence numbers. Note that
// currentCommitmentSequenceNumber < sequenceNumber.
//
// The currentCommitment advances forward through the provider's hash chain as values
// are revealed on-chain.
bytes32 currentCommitment;
uint64 currentCommitmentSequenceNumber;
// An address that is authorized to set / withdraw fees on behalf of this provider.
address feeManager;
}
struct Request {
// Storage slot 1 //
address provider;
uint64 sequenceNumber;
// The number of hashes required to verify the provider revelation.
uint32 numHashes;
// Storage slot 2 //
// The commitment is keccak256(userCommitment, providerCommitment). Storing the hash instead of both saves 20k gas by
// eliminating 1 store.
bytes32 commitment;
// Storage slot 3 //
// The number of the block where this request was created.
// Note that we're using a uint64 such that we have an additional space for an address and other fields in
// this storage slot. Although block.number returns a uint256, 64 bits should be plenty to index all of the
// blocks ever generated.
uint64 blockNumber;
// The address that requested this random number.
address requester;
// If true, incorporate the blockhash of blockNumber into the generated random value.
bool useBlockhash;
// If true, the requester will be called back with the generated random value.
bool isRequestWithCallback;
// There are 2 remaining bytes of free space in this slot.
}
}// SPDX-License-Identifier: Apache 2
pragma solidity ^0.8.0;
import "./EntropyEvents.sol";
interface IEntropy is EntropyEvents {
// Register msg.sender as a randomness provider. The arguments are the provider's configuration parameters
// and initial commitment. Re-registering the same provider rotates the provider's commitment (and updates
// the feeInWei).
//
// chainLength is the number of values in the hash chain *including* the commitment, that is, chainLength >= 1.
function register(
uint128 feeInWei,
bytes32 commitment,
bytes calldata commitmentMetadata,
uint64 chainLength,
bytes calldata uri
) external;
// Withdraw a portion of the accumulated fees for the provider msg.sender.
// Calling this function will transfer `amount` wei to the caller (provided that they have accrued a sufficient
// balance of fees in the contract).
function withdraw(uint128 amount) external;
// Withdraw a portion of the accumulated fees for provider. The msg.sender must be the fee manager for this provider.
// Calling this function will transfer `amount` wei to the caller (provided that they have accrued a sufficient
// balance of fees in the contract).
function withdrawAsFeeManager(address provider, uint128 amount) external;
// As a user, request a random number from `provider`. Prior to calling this method, the user should
// generate a random number x and keep it secret. The user should then compute hash(x) and pass that
// as the userCommitment argument. (You may call the constructUserCommitment method to compute the hash.)
//
// This method returns a sequence number. The user should pass this sequence number to
// their chosen provider (the exact method for doing so will depend on the provider) to retrieve the provider's
// number. The user should then call fulfillRequest to construct the final random number.
//
// This method will revert unless the caller provides a sufficient fee (at least getFee(provider)) as msg.value.
// Note that excess value is *not* refunded to the caller.
function request(
address provider,
bytes32 userCommitment,
bool useBlockHash
) external payable returns (uint64 assignedSequenceNumber);
// Request a random number. The method expects the provider address and a secret random number
// in the arguments. It returns a sequence number.
//
// The address calling this function should be a contract that inherits from the IEntropyConsumer interface.
// The `entropyCallback` method on that interface will receive a callback with the generated random number.
//
// This method will revert unless the caller provides a sufficient fee (at least getFee(provider)) as msg.value.
// Note that excess value is *not* refunded to the caller.
function requestWithCallback(
address provider,
bytes32 userRandomNumber
) external payable returns (uint64 assignedSequenceNumber);
// Fulfill a request for a random number. This method validates the provided userRandomness and provider's proof
// against the corresponding commitments in the in-flight request. If both values are validated, this function returns
// the corresponding random number.
//
// Note that this function can only be called once per in-flight request. Calling this function deletes the stored
// request information (so that the contract doesn't use a linear amount of storage in the number of requests).
// If you need to use the returned random number more than once, you are responsible for storing it.
function reveal(
address provider,
uint64 sequenceNumber,
bytes32 userRevelation,
bytes32 providerRevelation
) external returns (bytes32 randomNumber);
// Fulfill a request for a random number. This method validates the provided userRandomness
// and provider's revelation against the corresponding commitment in the in-flight request. If both values are validated
// and the requestor address is a contract address, this function calls the requester's entropyCallback method with the
// sequence number, provider address and the random number as arguments. Else if the requestor is an EOA, it won't call it.
//
// Note that this function can only be called once per in-flight request. Calling this function deletes the stored
// request information (so that the contract doesn't use a linear amount of storage in the number of requests).
// If you need to use the returned random number more than once, you are responsible for storing it.
//
// Anyone can call this method to fulfill a request, but the callback will only be made to the original requester.
function revealWithCallback(
address provider,
uint64 sequenceNumber,
bytes32 userRandomNumber,
bytes32 providerRevelation
) external;
function getProviderInfo(
address provider
) external view returns (EntropyStructs.ProviderInfo memory info);
function getDefaultProvider() external view returns (address provider);
function getRequest(
address provider,
uint64 sequenceNumber
) external view returns (EntropyStructs.Request memory req);
function getFee(address provider) external view returns (uint128 feeAmount);
function getAccruedPythFees()
external
view
returns (uint128 accruedPythFeesInWei);
function setProviderFee(uint128 newFeeInWei) external;
function setProviderFeeAsFeeManager(
address provider,
uint128 newFeeInWei
) external;
function setProviderUri(bytes calldata newUri) external;
// Set manager as the fee manager for the provider msg.sender.
// After calling this function, manager will be able to set the provider's fees and withdraw them.
// Only one address can be the fee manager for a provider at a time -- calling this function again with a new value
// will override the previous value. Call this function with the all-zero address to disable the fee manager role.
function setFeeManager(address manager) external;
function constructUserCommitment(
bytes32 userRandomness
) external pure returns (bytes32 userCommitment);
function combineRandomValues(
bytes32 userRandomness,
bytes32 providerRandomness,
bytes32 blockHash
) external pure returns (bytes32 combinedRandomness);
}// SPDX-License-Identifier: Apache 2
pragma solidity ^0.8.0;
abstract contract IEntropyConsumer {
// This method is called by Entropy to provide the random number to the consumer.
// It asserts that the msg.sender is the Entropy contract. It is not meant to be
// override by the consumer.
function _entropyCallback(
uint64 sequence,
address provider,
bytes32 randomNumber
) external {
address entropy = getEntropy();
require(entropy != address(0), "Entropy address not set");
require(msg.sender == entropy, "Only Entropy can call this function");
entropyCallback(sequence, provider, randomNumber);
}
// getEntropy returns Entropy contract address. The method is being used to check that the
// callback is indeed from Entropy contract. The consumer is expected to implement this method.
// Entropy address can be found here - https://docs.pyth.network/entropy/contract-addresses
function getEntropy() internal view virtual returns (address);
// This method is expected to be implemented by the consumer to handle the random number.
// It will be called by _entropyCallback after _entropyCallback ensures that the call is
// indeed from Entropy contract.
function entropyCallback(
uint64 sequence,
address provider,
bytes32 randomNumber
) internal virtual;
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"uint256","name":"entranceFee","type":"uint256"},{"internalType":"address payable","name":"_treasuryWallet","type":"address"},{"internalType":"address","name":"_entropy","type":"address"},{"internalType":"address","name":"_entropyProvider","type":"address"},{"internalType":"address","name":"_caller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"currentBalance","type":"uint256"},{"internalType":"uint256","name":"numPlayers","type":"uint256"},{"internalType":"uint256","name":"SpaceSweepDayState","type":"uint256"}],"name":"SpaceSweepDay__UpkeepNotNeeded","type":"error"},{"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":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RefundFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RefundIssued","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"requestId","type":"uint256"}],"name":"RequestedSpaceSweepWinner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"allo","type":"uint256"}],"name":"SpaceSweepDayEnter","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"sequenceNumber","type":"uint64"}],"name":"SpaceSweepDayEnterRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"sequenceNumber","type":"uint64"}],"name":"SpaceSweepDayEnterResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newTreasury","type":"address"}],"name":"TreasuryChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":false,"internalType":"uint256","name":"prize","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"position","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"p_length","type":"uint256"}],"name":"WinnerPicked","type":"event"},{"inputs":[{"internalType":"uint64","name":"sequenceNumber","type":"uint64"},{"internalType":"address","name":"_entropyProvider","type":"address"},{"internalType":"bytes32","name":"randomNumber","type":"bytes32"}],"name":"_entropyCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_wallets","type":"address[]"}],"name":"addSpecialWallets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"addToPool","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"caller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimWinnings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"entries","type":"uint256"}],"name":"enterSpaceSweepDay","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"enterSpaceSweepDaySpecial","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"feeEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllContributions","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllPlayers","outputs":[{"internalType":"address payable[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllRecentWinnersWinnings","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getContractBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getEntranceFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFlipFee","outputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNumberOfPlayers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getPlayer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSpaceSweepDayState","outputs":[{"internalType":"enum SpaceSweepDay.SpaceSweepDayState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSpecialWallets","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalWinnings","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"i_entranceFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"userRandomNumber","type":"bytes32"}],"name":"performUpkeep","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"playerContributions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"refundAllParticipants","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"}],"name":"removeSpecialWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"roundWinners","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"s_players","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"s_recentWinners","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newEntranceFee","type":"uint256"}],"name":"setEntranceFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_newTreasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newCaller","type":"address"}],"name":"setUpkeepCaller","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"specialWallets","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_enabled","type":"bool"}],"name":"toggleFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalWinnings","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"transferDeadFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"transferTreasuryFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasuryFund","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasuryWallet","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"winnings","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60806040526000600e5560016010556011805460ff60a01b1916600160a01b1790553480156200002e57600080fd5b50604051620027523803806200275283398101604081905262000051916200012e565b6200005c33620000c5565b6001805560049490945560118054600780546001600160a01b03199081166001600160a01b0397881617909155600280548216958716959095179094556003805490941692851692909217909255600161ff0160a01b03191692909116919091179055620001a2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200012b57600080fd5b50565b600080600080600060a086880312156200014757600080fd5b8551945060208601516200015b8162000115565b60408701519094506200016e8162000115565b6060870151909350620001818162000115565b6080870151909250620001948162000115565b809150509295509295909350565b6125a080620001b26000396000f3fe60806040526004361061026b5760003560e01c8063a1e9b51111610144578063e0c4f12d116100b6578063f0f442601161007a578063f0f44260146106c6578063f2fde38b146106e6578063fc9c8d3914610706578063fd6673f514610726578063fda76a9b1461073b578063fe56f5a01461075057600080fd5b8063e0c4f12d1461062c578063e55ae4e814610642578063ea3a149914610662578063ee7863551461068f578063efa1c482146106a457600080fd5b8063b401faf111610108578063b401faf1146105a2578063b72481f8146105b7578063b8c5bfb9146105cd578063c07401f0146105e2578063ddc382d2146105ea578063e044e9c31461060a57600080fd5b8063a1e9b5111461050b578063a771ebc71461051e578063adbd1dd71461053f578063ae771f6b1461055f578063b0839a6f1461057f57600080fd5b806352a5f1f8116101dd5780637ea3e6c1116101a15780637ea3e6c11461046c5780637f1fce7814610482578063868e4c61146104a25780638a19c8bc146104c25780638da5cb5b146104d85780639b057610146104f657600080fd5b806352a5f1f8146103ee5780636549471b1461040e578063692b69ae1461042e5780636f9fb98a14610444578063715018a61461045757600080fd5b806337f3061d1161022f57806337f3061d146103325780633b96b2d8146103545780634081ca2b146103675780634626402b1461039f57806349088ed8146103bf5780634b7c8e83146103e657600080fd5b806309bc33a7146102775780630ee52dfb1461029b57806310e870db146102bd5780631a595f651461030857806325f227751461031d57600080fd5b3661027257005b600080fd5b34801561028357600080fd5b506004545b6040519081526020015b60405180910390f35b3480156102a757600080fd5b506102bb6102b636600461212d565b610770565b005b3480156102c957600080fd5b506102f86102d8366004612151565b600f60209081526000928352604080842090915290825290205460ff1681565b6040519015158152602001610292565b34801561031457600080fd5b50600e54610288565b34801561032957600080fd5b50610288610883565b34801561033e57600080fd5b50610347610906565b60405161029291906121bc565b6102bb6103623660046121cf565b61095e565b34801561037357600080fd5b506103876103823660046121cf565b610c03565b6040516001600160a01b039091168152602001610292565b3480156103ab57600080fd5b50600754610387906001600160a01b031681565b3480156103cb57600080fd5b50601154600160a81b900460ff1660405161029291906121fe565b6102bb610c2d565b3480156103fa57600080fd5b506102bb61040936600461223c565b610ec0565b34801561041a57600080fd5b506102886104293660046121cf565b61138a565b34801561043a57600080fd5b50610288600e5481565b34801561045057600080fd5b5047610288565b34801561046357600080fd5b506102bb6113ab565b34801561047857600080fd5b5061028860045481565b34801561048e57600080fd5b506102bb61049d36600461212d565b6113bf565b3480156104ae57600080fd5b506102bb6104bd36600461227d565b611449565b3480156104ce57600080fd5b5061028860105481565b3480156104e457600080fd5b506000546001600160a01b0316610387565b34801561050257600080fd5b50600b54610288565b6102bb6105193660046121cf565b61146f565b34801561052a57600080fd5b506011546102f890600160a01b900460ff1681565b34801561054b57600080fd5b5061038761055a3660046121cf565b6116de565b34801561056b57600080fd5b5061038761057a3660046121cf565b6116ee565b34801561058b57600080fd5b506105946116fe565b6040516102929291906122d8565b3480156105ae57600080fd5b506102bb61187a565b3480156105c357600080fd5b50610288600b5481565b3480156105d957600080fd5b506102bb6119b1565b6102bb611ab2565b3480156105f657600080fd5b506102bb610605366004612306565b611b1b565b34801561061657600080fd5b5061061f611ba0565b604051610292919061237b565b34801561063857600080fd5b5061028860095481565b34801561064e57600080fd5b5061038761065d3660046121cf565b611c01565b34801561066e57600080fd5b5061028861067d36600461212d565b600c6020526000908152604090205481565b34801561069b57600080fd5b506102bb611c31565b3480156106b057600080fd5b506106b9611da9565b604051610292919061238e565b3480156106d257600080fd5b506102bb6106e136600461212d565b611e09565b3480156106f257600080fd5b506102bb61070136600461212d565b611ec1565b34801561071257600080fd5b50601154610387906001600160a01b031681565b34801561073257600080fd5b50600554610288565b34801561074757600080fd5b506102bb611f3a565b34801561075c57600080fd5b506102bb61076b3660046121cf565b611fd6565b610778611fe3565b60005b60085481101561087f57816001600160a01b0316600882815481106107a2576107a26123db565b6000918252602090912001546001600160a01b03160361086d57600880546107cc90600190612407565b815481106107dc576107dc6123db565b600091825260209091200154600880546001600160a01b039092169183908110610808576108086123db565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600880548061084757610847612420565b600082815260209020810160001990810180546001600160a01b03191690550190555050565b8061087781612436565b91505061077b565b5050565b600254600354604051631711922960e31b81526001600160a01b039182166004820152600092919091169063b88c914890602401602060405180830381865afa1580156108d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f8919061244f565b6001600160801b0316905090565b6060600680548060200260200160405190810160405280929190818152602001828054801561095457602002820191906000526020600020905b815481526020019060010190808311610940575b5050505050905090565b6000601154600160a81b900460ff16600181111561097e5761097e6121e8565b146109c95760405162461bcd60e51b815260206004820152601660248201527529b830b1b2a9bbb2b2b82230bcafafa737ba27b832b760511b60448201526064015b60405180910390fd5b601154600090600160a01b900460ff166109e4576000610a54565b600254600354604051631711922960e31b81526001600160a01b03918216600482015291169063b88c914890602401602060405180830381865afa158015610a30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a54919061244f565b6001600160801b031690508060096000828254610a719190612478565b9091555050600454600090610a8790849061248b565b905080341015610ad95760405162461bcd60e51b815260206004820152601e60248201527f537061636553776565704461795f5f4e6f74456e6f75676853546f6b656e000060448201526064016109c0565b610ae38234612407565b336000908152600d602052604081208054909190610b02908490612478565b90915550610b1290508234612407565b600e6000828254610b239190612478565b90915550600090505b83811015610bb9576004546006805460018181019092557ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01919091556005805491820181556000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319163317905580610bb181612436565b915050610b2c565b50336000818152600d60209081526040918290205491519182527f90cd7542367f969062db5e88125ffc7d350c72e089c0895c5bd3b404619dac34910160405180910390a2505050565b60088181548110610c1357600080fd5b6000918252602090912001546001600160a01b0316905081565b6000601154600160a81b900460ff166001811115610c4d57610c4d6121e8565b14610c935760405162461bcd60e51b815260206004820152601660248201527529b830b1b2a9bbb2b2b82230bcafafa737ba27b832b760511b60448201526064016109c0565b6000805b600854811015610d965760088181548110610cb457610cb46123db565b6000918252602090912001546001600160a01b03163303610d84576008805460019350610ce2908490612407565b81548110610cf257610cf26123db565b600091825260209091200154600880546001600160a01b039092169183908110610d1e57610d1e6123db565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506008805480610d5d57610d5d612420565b600082815260209020810160001990810180546001600160a01b0319169055019055610d96565b80610d8e81612436565b915050610c97565b5080610de45760405162461bcd60e51b815260206004820152601f60248201527f537061636553776565704461795f5f4e6f745370656369616c57616c6c65740060448201526064016109c0565b6005805460018181019092557f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b03191633908117909155600680549283019055347ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f9092018290556000908152600d602052604081208054909190610e74908490612478565b9091555050336000818152600d60209081526040918290205491519182527f90cd7542367f969062db5e88125ffc7d350c72e089c0895c5bd3b404619dac34910160405180910390a250565b6011546001600160a01b0316331480610ee357506000546001600160a01b031633145b610eff5760405162461bcd60e51b81526004016109c0906124aa565b600380546001600160a01b0319166001600160a01b038416179055610f26600a60006120e6565b600e5460006064610f3883601461248b565b610f42919061250f565b90508060096000828254610f569190612478565b90915550600090506064610f6b84601461248b565b610f75919061250f565b610f7f9084612407565b60408051610140810182526023815260146020820152600f91810191909152600a606082015260056080820152600460a0820181905260c0820152600360e08201526002610100820181905261012082015290915084600080805b600a81108015610feb575060055483105b1561124257604080516020808201879052818301859052606080830185905283518084039091018152608090920190925280519101206005546000906110319083612523565b9050600060058281548110611048576110486123db565b60009182526020808320909101546010548352600f825260408084206001600160a01b039092168085529190925291205490915060ff1661121e57600060648986600a8110611099576110996123db565b60200201516110a8908c61248b565b6110b2919061250f565b6001600160a01b0383166000908152600c60205260408120805492935083929091906110df908490612478565b9250508190555080600b60008282546110f89190612478565b90915550506010546000908152600f602090815260408083206001600160a01b03861680855292528220805460ff19166001908117909155600a8054808301825593527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a890920180546001600160a01b03191682179055907f0c94cfc5a2ba1b9f32b037a5042267ae4df56cb9d5308471e0b3d05d099d591d90839061119f908990612478565b6005546040805193845260208401929092529082015260600160405180910390a27fd23b55fd8b0237a5047b6b3502d3531f75a8a4a1d614caefd33672eed9c8b1758f6040516111ff919067ffffffffffffffff91909116815260200190565b60405180910390a18461121181612436565b955050600096505061123a565b8561122881612436565b965050848061123690612436565b9550505b505050610fda565b506007546009546040516000926001600160a01b031691908381818185875af1925050503d8060008114611292576040519150601f19603f3d011682016040523d82523d6000602084013e611297565b606091505b50509050806112db5760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b60448201526064016109c0565b600060098190556011805460ff60a81b19169055600e8190555b60055481101561134f576000600d600060058481548110611318576113186123db565b60009182526020808320909101546001600160a01b031683528201929092526040019020558061134781612436565b9150506112f5565b5061135c600560006120e6565b611368600660006120e6565b6010805490600061137883612436565b91905055505050505050505050505050565b6006818154811061139a57600080fd5b600091825260209091200154905081565b6113b3611fe3565b6113bd600061203d565b565b6113c7611fe3565b6001600160a01b0381166114275760405162461bcd60e51b815260206004820152602160248201527f4e65772063616c6c65722063616e6e6f74206265207a65726f206164647265736044820152607360f81b60648201526084016109c0565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b611451611fe3565b60118054911515600160a01b0260ff60a01b19909216919091179055565b6011546001600160a01b031633148061149257506000546001600160a01b031633145b6114ae5760405162461bcd60e51b81526004016109c0906124aa565b601154600090600160a81b900460ff1660018111156114cf576114cf6121e8565b600e5460055491159250151590600a111560008380156114ec5750825b80156114f55750815b90508061154a57600e54600554601154600160a81b900460ff166001811115611520576115206121e8565b604051630bc994e360e11b81526004810193909352602483019190915260448201526064016109c0565b60118054600160a81b60ff60a81b19909116179055600254600354604051631711922960e31b81526001600160a01b039182166004820152600092919091169063b88c914890602401602060405180830381865afa1580156115b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d4919061244f565b6002546003546040516319cb825f60e01b81526001600160a01b039182166004820152602481018a90526001600160801b039390931693506000929116906319cb825f90849060440160206040518083038185885af115801561163b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906116609190612537565b60405190915067ffffffffffffffff8216907fd9c809fa33a5b212bc801c83ede3f79a5186dc995dcbc7ff1bbc825342f7112090600090a260405167ffffffffffffffff821681527f9176cdce2dc17ba917a9e4c394221243edc538168f4b4e5218ac9ed15859d5a89060200160405180910390a150505050505050565b600a8181548110610c1357600080fd5b60058181548110610c1357600080fd5b600a54606090819060008167ffffffffffffffff81111561172157611721612554565b60405190808252806020026020018201604052801561174a578160200160208202803683370190505b50905060008267ffffffffffffffff81111561176857611768612554565b604051908082528060200260200182016040528015611791578160200160208202803683370190505b50905060005b8381101561186f57600a81815481106117b2576117b26123db565b9060005260206000200160009054906101000a90046001600160a01b03168382815181106117e2576117e26123db565b60200260200101906001600160a01b031690816001600160a01b031681525050600c6000600a8381548110611819576118196123db565b60009182526020808320909101546001600160a01b031683528201929092526040019020548251839083908110611852576118526123db565b60209081029190910101528061186781612436565b915050611797565b509094909350915050565b61188261208d565b336000908152600c6020526040902054806118d65760405162461bcd60e51b81526020600482015260146024820152734e6f2077696e6e696e677320746f20636c61696d60601b60448201526064016109c0565b336000908152600c60205260408120819055600b80548392906118fa908490612407565b9091555050604051600090339083908381818185875af1925050503d8060008114611941576040519150601f19603f3d011682016040523d82523d6000602084013e611946565b606091505b50509050806119a65760405162461bcd60e51b815260206004820152602660248201527f4661696c656420746f2073656e642077696e6e696e677320746f2075736572206044820152651dd85b1b195d60d21b60648201526084016109c0565b50506113bd60018055565b6119b9611fe3565b600060095411611a0b5760405162461bcd60e51b815260206004820152601760248201527f4e6f20747265617375727920746f207472616e7366657200000000000000000060448201526064016109c0565b600980546000918290556007546040519192916001600160a01b039091169083905b60006040518083038185875af1925050503d8060008114611a6a576040519150601f19603f3d011682016040523d82523d6000602084013e611a6f565b606091505b505090508061087f5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016109c0565b60003411611b025760405162461bcd60e51b815260206004820152601e60248201527f4d7573742073656e64205320746f2061646420746f2074686520706f6f6c000060448201526064016109c0565b34600e6000828254611b149190612478565b9091555050565b611b23611fe3565b60005b81811015611b9b576008838383818110611b4257611b426123db565b9050602002016020810190611b57919061212d565b81546001810183556000928352602090922090910180546001600160a01b0319166001600160a01b0390921691909117905580611b9381612436565b915050611b26565b505050565b6060600880548060200260200160405190810160405280929190818152602001828054801561095457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611bda575050505050905090565b600060058281548110611c1657611c166123db565b6000918252602090912001546001600160a01b031692915050565b611c39611fe3565b611c4161208d565b60055460005b81811015611d7257600060058281548110611c6457611c646123db565b60009182526020822001546004546040516001600160a01b03909216935083918381818185875af1925050503d8060008114611cbc576040519150601f19603f3d011682016040523d82523d6000602084013e611cc1565b606091505b505090508015611d1657600454604080516001600160a01b038516815260208101929092527fa171b6942063c6f2800ce40a780edce37baa2b618571b11eedd1e69e626e7d76910160405180910390a1611d5d565b600454604080516001600160a01b038516815260208101929092527faf73b0b217208b61be286bbc37095bce7eb8b9ccf617244c2f0f154e8e04e3ff910160405180910390a15b50508080611d6a90612436565b915050611c47565b506011805460ff60a81b19169055611d8c600560006120e6565b6000600e819055611d9f906006906120e6565b506113bd60018055565b60606005805480602002602001604051908101604052809291908181526020018280548015610954576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311611bda575050505050905090565b611e11611fe3565b6001600160a01b038116611e775760405162461bcd60e51b815260206004820152602760248201527f4e65772074726561737572792063616e6e6f7420626520746865207a65726f206044820152666164647265737360c81b60648201526084016109c0565b600780546001600160a01b0319166001600160a01b0383169081179091556040517fc714d22a2f08b695f81e7c707058db484aa5b4d6b4c9fd64beb10fe85832f60890600090a250565b611ec9611fe3565b6001600160a01b038116611f2e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109c0565b611f378161203d565b50565b611f42611fe3565b6000600e54600b54611f549190612478565b611f5e9047612407565b905060008111611fbc5760405162461bcd60e51b8152602060048201526024808201527f4e6f20646561642066756e647320617661696c61626c6520666f72207472616e60448201526339b332b960e11b60648201526084016109c0565b6007546040516000916001600160a01b0316908390611a2d565b611fde611fe3565b600455565b6000546001600160a01b031633146113bd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109c0565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6002600154036120df5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109c0565b6002600155565b5080546000825590600052602060002090810190611f3791905b808211156121145760008155600101612100565b5090565b6001600160a01b0381168114611f3757600080fd5b60006020828403121561213f57600080fd5b813561214a81612118565b9392505050565b6000806040838503121561216457600080fd5b82359150602083013561217681612118565b809150509250929050565b600081518084526020808501945080840160005b838110156121b157815187529582019590820190600101612195565b509495945050505050565b60208152600061214a6020830184612181565b6000602082840312156121e157600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b602081016002831061222057634e487b7160e01b600052602160045260246000fd5b91905290565b67ffffffffffffffff81168114611f3757600080fd5b60008060006060848603121561225157600080fd5b833561225c81612226565b9250602084013561226c81612118565b929592945050506040919091013590565b60006020828403121561228f57600080fd5b8135801515811461214a57600080fd5b600081518084526020808501945080840160005b838110156121b15781516001600160a01b0316875295820195908201906001016122b3565b6040815260006122eb604083018561229f565b82810360208401526122fd8185612181565b95945050505050565b6000806020838503121561231957600080fd5b823567ffffffffffffffff8082111561233157600080fd5b818501915085601f83011261234557600080fd5b81358181111561235457600080fd5b8660208260051b850101111561236957600080fd5b60209290920196919550909350505050565b60208152600061214a602083018461229f565b6020808252825182820181905260009190848201906040850190845b818110156123cf5783516001600160a01b0316835292840192918401916001016123aa565b50909695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8181038181111561241a5761241a6123f1565b92915050565b634e487b7160e01b600052603160045260246000fd5b600060018201612448576124486123f1565b5060010190565b60006020828403121561246157600080fd5b81516001600160801b038116811461214a57600080fd5b8082018082111561241a5761241a6123f1565b60008160001904831182151516156124a5576124a56123f1565b500290565b6020808252602f908201527f4f6e6c79207468652063616c6c6572206f72206f776e65722063616e2063616c60408201526e36103a3434b990333ab731ba34b7b760891b606082015260800190565b634e487b7160e01b600052601260045260246000fd5b60008261251e5761251e6124f9565b500490565b600082612532576125326124f9565b500690565b60006020828403121561254957600080fd5b815161214a81612226565b634e487b7160e01b600052604160045260246000fdfea26469706673582212200d526b8b5da93909a06bbc97fffde5ccc8164c12780ccc59e8a8d589779107ae64736f6c634300081000330000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000007c817d793715baaee120624e6ce499b29aa105ac00000000000000000000000036825bf3fbdf5a29e2d5148bfe7dcf7b5639e32000000000000000000000000052deaa1c84233f7bb8c8a45baede41091c6165060000000000000000000000005df4707980440d7beb2ad83dfa0321889fb27aed
Deployed Bytecode
0x60806040526004361061026b5760003560e01c8063a1e9b51111610144578063e0c4f12d116100b6578063f0f442601161007a578063f0f44260146106c6578063f2fde38b146106e6578063fc9c8d3914610706578063fd6673f514610726578063fda76a9b1461073b578063fe56f5a01461075057600080fd5b8063e0c4f12d1461062c578063e55ae4e814610642578063ea3a149914610662578063ee7863551461068f578063efa1c482146106a457600080fd5b8063b401faf111610108578063b401faf1146105a2578063b72481f8146105b7578063b8c5bfb9146105cd578063c07401f0146105e2578063ddc382d2146105ea578063e044e9c31461060a57600080fd5b8063a1e9b5111461050b578063a771ebc71461051e578063adbd1dd71461053f578063ae771f6b1461055f578063b0839a6f1461057f57600080fd5b806352a5f1f8116101dd5780637ea3e6c1116101a15780637ea3e6c11461046c5780637f1fce7814610482578063868e4c61146104a25780638a19c8bc146104c25780638da5cb5b146104d85780639b057610146104f657600080fd5b806352a5f1f8146103ee5780636549471b1461040e578063692b69ae1461042e5780636f9fb98a14610444578063715018a61461045757600080fd5b806337f3061d1161022f57806337f3061d146103325780633b96b2d8146103545780634081ca2b146103675780634626402b1461039f57806349088ed8146103bf5780634b7c8e83146103e657600080fd5b806309bc33a7146102775780630ee52dfb1461029b57806310e870db146102bd5780631a595f651461030857806325f227751461031d57600080fd5b3661027257005b600080fd5b34801561028357600080fd5b506004545b6040519081526020015b60405180910390f35b3480156102a757600080fd5b506102bb6102b636600461212d565b610770565b005b3480156102c957600080fd5b506102f86102d8366004612151565b600f60209081526000928352604080842090915290825290205460ff1681565b6040519015158152602001610292565b34801561031457600080fd5b50600e54610288565b34801561032957600080fd5b50610288610883565b34801561033e57600080fd5b50610347610906565b60405161029291906121bc565b6102bb6103623660046121cf565b61095e565b34801561037357600080fd5b506103876103823660046121cf565b610c03565b6040516001600160a01b039091168152602001610292565b3480156103ab57600080fd5b50600754610387906001600160a01b031681565b3480156103cb57600080fd5b50601154600160a81b900460ff1660405161029291906121fe565b6102bb610c2d565b3480156103fa57600080fd5b506102bb61040936600461223c565b610ec0565b34801561041a57600080fd5b506102886104293660046121cf565b61138a565b34801561043a57600080fd5b50610288600e5481565b34801561045057600080fd5b5047610288565b34801561046357600080fd5b506102bb6113ab565b34801561047857600080fd5b5061028860045481565b34801561048e57600080fd5b506102bb61049d36600461212d565b6113bf565b3480156104ae57600080fd5b506102bb6104bd36600461227d565b611449565b3480156104ce57600080fd5b5061028860105481565b3480156104e457600080fd5b506000546001600160a01b0316610387565b34801561050257600080fd5b50600b54610288565b6102bb6105193660046121cf565b61146f565b34801561052a57600080fd5b506011546102f890600160a01b900460ff1681565b34801561054b57600080fd5b5061038761055a3660046121cf565b6116de565b34801561056b57600080fd5b5061038761057a3660046121cf565b6116ee565b34801561058b57600080fd5b506105946116fe565b6040516102929291906122d8565b3480156105ae57600080fd5b506102bb61187a565b3480156105c357600080fd5b50610288600b5481565b3480156105d957600080fd5b506102bb6119b1565b6102bb611ab2565b3480156105f657600080fd5b506102bb610605366004612306565b611b1b565b34801561061657600080fd5b5061061f611ba0565b604051610292919061237b565b34801561063857600080fd5b5061028860095481565b34801561064e57600080fd5b5061038761065d3660046121cf565b611c01565b34801561066e57600080fd5b5061028861067d36600461212d565b600c6020526000908152604090205481565b34801561069b57600080fd5b506102bb611c31565b3480156106b057600080fd5b506106b9611da9565b604051610292919061238e565b3480156106d257600080fd5b506102bb6106e136600461212d565b611e09565b3480156106f257600080fd5b506102bb61070136600461212d565b611ec1565b34801561071257600080fd5b50601154610387906001600160a01b031681565b34801561073257600080fd5b50600554610288565b34801561074757600080fd5b506102bb611f3a565b34801561075c57600080fd5b506102bb61076b3660046121cf565b611fd6565b610778611fe3565b60005b60085481101561087f57816001600160a01b0316600882815481106107a2576107a26123db565b6000918252602090912001546001600160a01b03160361086d57600880546107cc90600190612407565b815481106107dc576107dc6123db565b600091825260209091200154600880546001600160a01b039092169183908110610808576108086123db565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600880548061084757610847612420565b600082815260209020810160001990810180546001600160a01b03191690550190555050565b8061087781612436565b91505061077b565b5050565b600254600354604051631711922960e31b81526001600160a01b039182166004820152600092919091169063b88c914890602401602060405180830381865afa1580156108d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f8919061244f565b6001600160801b0316905090565b6060600680548060200260200160405190810160405280929190818152602001828054801561095457602002820191906000526020600020905b815481526020019060010190808311610940575b5050505050905090565b6000601154600160a81b900460ff16600181111561097e5761097e6121e8565b146109c95760405162461bcd60e51b815260206004820152601660248201527529b830b1b2a9bbb2b2b82230bcafafa737ba27b832b760511b60448201526064015b60405180910390fd5b601154600090600160a01b900460ff166109e4576000610a54565b600254600354604051631711922960e31b81526001600160a01b03918216600482015291169063b88c914890602401602060405180830381865afa158015610a30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a54919061244f565b6001600160801b031690508060096000828254610a719190612478565b9091555050600454600090610a8790849061248b565b905080341015610ad95760405162461bcd60e51b815260206004820152601e60248201527f537061636553776565704461795f5f4e6f74456e6f75676853546f6b656e000060448201526064016109c0565b610ae38234612407565b336000908152600d602052604081208054909190610b02908490612478565b90915550610b1290508234612407565b600e6000828254610b239190612478565b90915550600090505b83811015610bb9576004546006805460018181019092557ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01919091556005805491820181556000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319163317905580610bb181612436565b915050610b2c565b50336000818152600d60209081526040918290205491519182527f90cd7542367f969062db5e88125ffc7d350c72e089c0895c5bd3b404619dac34910160405180910390a2505050565b60088181548110610c1357600080fd5b6000918252602090912001546001600160a01b0316905081565b6000601154600160a81b900460ff166001811115610c4d57610c4d6121e8565b14610c935760405162461bcd60e51b815260206004820152601660248201527529b830b1b2a9bbb2b2b82230bcafafa737ba27b832b760511b60448201526064016109c0565b6000805b600854811015610d965760088181548110610cb457610cb46123db565b6000918252602090912001546001600160a01b03163303610d84576008805460019350610ce2908490612407565b81548110610cf257610cf26123db565b600091825260209091200154600880546001600160a01b039092169183908110610d1e57610d1e6123db565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506008805480610d5d57610d5d612420565b600082815260209020810160001990810180546001600160a01b0319169055019055610d96565b80610d8e81612436565b915050610c97565b5080610de45760405162461bcd60e51b815260206004820152601f60248201527f537061636553776565704461795f5f4e6f745370656369616c57616c6c65740060448201526064016109c0565b6005805460018181019092557f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b03191633908117909155600680549283019055347ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f9092018290556000908152600d602052604081208054909190610e74908490612478565b9091555050336000818152600d60209081526040918290205491519182527f90cd7542367f969062db5e88125ffc7d350c72e089c0895c5bd3b404619dac34910160405180910390a250565b6011546001600160a01b0316331480610ee357506000546001600160a01b031633145b610eff5760405162461bcd60e51b81526004016109c0906124aa565b600380546001600160a01b0319166001600160a01b038416179055610f26600a60006120e6565b600e5460006064610f3883601461248b565b610f42919061250f565b90508060096000828254610f569190612478565b90915550600090506064610f6b84601461248b565b610f75919061250f565b610f7f9084612407565b60408051610140810182526023815260146020820152600f91810191909152600a606082015260056080820152600460a0820181905260c0820152600360e08201526002610100820181905261012082015290915084600080805b600a81108015610feb575060055483105b1561124257604080516020808201879052818301859052606080830185905283518084039091018152608090920190925280519101206005546000906110319083612523565b9050600060058281548110611048576110486123db565b60009182526020808320909101546010548352600f825260408084206001600160a01b039092168085529190925291205490915060ff1661121e57600060648986600a8110611099576110996123db565b60200201516110a8908c61248b565b6110b2919061250f565b6001600160a01b0383166000908152600c60205260408120805492935083929091906110df908490612478565b9250508190555080600b60008282546110f89190612478565b90915550506010546000908152600f602090815260408083206001600160a01b03861680855292528220805460ff19166001908117909155600a8054808301825593527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a890920180546001600160a01b03191682179055907f0c94cfc5a2ba1b9f32b037a5042267ae4df56cb9d5308471e0b3d05d099d591d90839061119f908990612478565b6005546040805193845260208401929092529082015260600160405180910390a27fd23b55fd8b0237a5047b6b3502d3531f75a8a4a1d614caefd33672eed9c8b1758f6040516111ff919067ffffffffffffffff91909116815260200190565b60405180910390a18461121181612436565b955050600096505061123a565b8561122881612436565b965050848061123690612436565b9550505b505050610fda565b506007546009546040516000926001600160a01b031691908381818185875af1925050503d8060008114611292576040519150601f19603f3d011682016040523d82523d6000602084013e611297565b606091505b50509050806112db5760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b60448201526064016109c0565b600060098190556011805460ff60a81b19169055600e8190555b60055481101561134f576000600d600060058481548110611318576113186123db565b60009182526020808320909101546001600160a01b031683528201929092526040019020558061134781612436565b9150506112f5565b5061135c600560006120e6565b611368600660006120e6565b6010805490600061137883612436565b91905055505050505050505050505050565b6006818154811061139a57600080fd5b600091825260209091200154905081565b6113b3611fe3565b6113bd600061203d565b565b6113c7611fe3565b6001600160a01b0381166114275760405162461bcd60e51b815260206004820152602160248201527f4e65772063616c6c65722063616e6e6f74206265207a65726f206164647265736044820152607360f81b60648201526084016109c0565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b611451611fe3565b60118054911515600160a01b0260ff60a01b19909216919091179055565b6011546001600160a01b031633148061149257506000546001600160a01b031633145b6114ae5760405162461bcd60e51b81526004016109c0906124aa565b601154600090600160a81b900460ff1660018111156114cf576114cf6121e8565b600e5460055491159250151590600a111560008380156114ec5750825b80156114f55750815b90508061154a57600e54600554601154600160a81b900460ff166001811115611520576115206121e8565b604051630bc994e360e11b81526004810193909352602483019190915260448201526064016109c0565b60118054600160a81b60ff60a81b19909116179055600254600354604051631711922960e31b81526001600160a01b039182166004820152600092919091169063b88c914890602401602060405180830381865afa1580156115b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d4919061244f565b6002546003546040516319cb825f60e01b81526001600160a01b039182166004820152602481018a90526001600160801b039390931693506000929116906319cb825f90849060440160206040518083038185885af115801561163b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906116609190612537565b60405190915067ffffffffffffffff8216907fd9c809fa33a5b212bc801c83ede3f79a5186dc995dcbc7ff1bbc825342f7112090600090a260405167ffffffffffffffff821681527f9176cdce2dc17ba917a9e4c394221243edc538168f4b4e5218ac9ed15859d5a89060200160405180910390a150505050505050565b600a8181548110610c1357600080fd5b60058181548110610c1357600080fd5b600a54606090819060008167ffffffffffffffff81111561172157611721612554565b60405190808252806020026020018201604052801561174a578160200160208202803683370190505b50905060008267ffffffffffffffff81111561176857611768612554565b604051908082528060200260200182016040528015611791578160200160208202803683370190505b50905060005b8381101561186f57600a81815481106117b2576117b26123db565b9060005260206000200160009054906101000a90046001600160a01b03168382815181106117e2576117e26123db565b60200260200101906001600160a01b031690816001600160a01b031681525050600c6000600a8381548110611819576118196123db565b60009182526020808320909101546001600160a01b031683528201929092526040019020548251839083908110611852576118526123db565b60209081029190910101528061186781612436565b915050611797565b509094909350915050565b61188261208d565b336000908152600c6020526040902054806118d65760405162461bcd60e51b81526020600482015260146024820152734e6f2077696e6e696e677320746f20636c61696d60601b60448201526064016109c0565b336000908152600c60205260408120819055600b80548392906118fa908490612407565b9091555050604051600090339083908381818185875af1925050503d8060008114611941576040519150601f19603f3d011682016040523d82523d6000602084013e611946565b606091505b50509050806119a65760405162461bcd60e51b815260206004820152602660248201527f4661696c656420746f2073656e642077696e6e696e677320746f2075736572206044820152651dd85b1b195d60d21b60648201526084016109c0565b50506113bd60018055565b6119b9611fe3565b600060095411611a0b5760405162461bcd60e51b815260206004820152601760248201527f4e6f20747265617375727920746f207472616e7366657200000000000000000060448201526064016109c0565b600980546000918290556007546040519192916001600160a01b039091169083905b60006040518083038185875af1925050503d8060008114611a6a576040519150601f19603f3d011682016040523d82523d6000602084013e611a6f565b606091505b505090508061087f5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016109c0565b60003411611b025760405162461bcd60e51b815260206004820152601e60248201527f4d7573742073656e64205320746f2061646420746f2074686520706f6f6c000060448201526064016109c0565b34600e6000828254611b149190612478565b9091555050565b611b23611fe3565b60005b81811015611b9b576008838383818110611b4257611b426123db565b9050602002016020810190611b57919061212d565b81546001810183556000928352602090922090910180546001600160a01b0319166001600160a01b0390921691909117905580611b9381612436565b915050611b26565b505050565b6060600880548060200260200160405190810160405280929190818152602001828054801561095457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611bda575050505050905090565b600060058281548110611c1657611c166123db565b6000918252602090912001546001600160a01b031692915050565b611c39611fe3565b611c4161208d565b60055460005b81811015611d7257600060058281548110611c6457611c646123db565b60009182526020822001546004546040516001600160a01b03909216935083918381818185875af1925050503d8060008114611cbc576040519150601f19603f3d011682016040523d82523d6000602084013e611cc1565b606091505b505090508015611d1657600454604080516001600160a01b038516815260208101929092527fa171b6942063c6f2800ce40a780edce37baa2b618571b11eedd1e69e626e7d76910160405180910390a1611d5d565b600454604080516001600160a01b038516815260208101929092527faf73b0b217208b61be286bbc37095bce7eb8b9ccf617244c2f0f154e8e04e3ff910160405180910390a15b50508080611d6a90612436565b915050611c47565b506011805460ff60a81b19169055611d8c600560006120e6565b6000600e819055611d9f906006906120e6565b506113bd60018055565b60606005805480602002602001604051908101604052809291908181526020018280548015610954576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311611bda575050505050905090565b611e11611fe3565b6001600160a01b038116611e775760405162461bcd60e51b815260206004820152602760248201527f4e65772074726561737572792063616e6e6f7420626520746865207a65726f206044820152666164647265737360c81b60648201526084016109c0565b600780546001600160a01b0319166001600160a01b0383169081179091556040517fc714d22a2f08b695f81e7c707058db484aa5b4d6b4c9fd64beb10fe85832f60890600090a250565b611ec9611fe3565b6001600160a01b038116611f2e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109c0565b611f378161203d565b50565b611f42611fe3565b6000600e54600b54611f549190612478565b611f5e9047612407565b905060008111611fbc5760405162461bcd60e51b8152602060048201526024808201527f4e6f20646561642066756e647320617661696c61626c6520666f72207472616e60448201526339b332b960e11b60648201526084016109c0565b6007546040516000916001600160a01b0316908390611a2d565b611fde611fe3565b600455565b6000546001600160a01b031633146113bd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109c0565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6002600154036120df5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109c0565b6002600155565b5080546000825590600052602060002090810190611f3791905b808211156121145760008155600101612100565b5090565b6001600160a01b0381168114611f3757600080fd5b60006020828403121561213f57600080fd5b813561214a81612118565b9392505050565b6000806040838503121561216457600080fd5b82359150602083013561217681612118565b809150509250929050565b600081518084526020808501945080840160005b838110156121b157815187529582019590820190600101612195565b509495945050505050565b60208152600061214a6020830184612181565b6000602082840312156121e157600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b602081016002831061222057634e487b7160e01b600052602160045260246000fd5b91905290565b67ffffffffffffffff81168114611f3757600080fd5b60008060006060848603121561225157600080fd5b833561225c81612226565b9250602084013561226c81612118565b929592945050506040919091013590565b60006020828403121561228f57600080fd5b8135801515811461214a57600080fd5b600081518084526020808501945080840160005b838110156121b15781516001600160a01b0316875295820195908201906001016122b3565b6040815260006122eb604083018561229f565b82810360208401526122fd8185612181565b95945050505050565b6000806020838503121561231957600080fd5b823567ffffffffffffffff8082111561233157600080fd5b818501915085601f83011261234557600080fd5b81358181111561235457600080fd5b8660208260051b850101111561236957600080fd5b60209290920196919550909350505050565b60208152600061214a602083018461229f565b6020808252825182820181905260009190848201906040850190845b818110156123cf5783516001600160a01b0316835292840192918401916001016123aa565b50909695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8181038181111561241a5761241a6123f1565b92915050565b634e487b7160e01b600052603160045260246000fd5b600060018201612448576124486123f1565b5060010190565b60006020828403121561246157600080fd5b81516001600160801b038116811461214a57600080fd5b8082018082111561241a5761241a6123f1565b60008160001904831182151516156124a5576124a56123f1565b500290565b6020808252602f908201527f4f6e6c79207468652063616c6c6572206f72206f776e65722063616e2063616c60408201526e36103a3434b990333ab731ba34b7b760891b606082015260800190565b634e487b7160e01b600052601260045260246000fd5b60008261251e5761251e6124f9565b500490565b600082612532576125326124f9565b500690565b60006020828403121561254957600080fd5b815161214a81612226565b634e487b7160e01b600052604160045260246000fdfea26469706673582212200d526b8b5da93909a06bbc97fffde5ccc8164c12780ccc59e8a8d589779107ae64736f6c63430008100033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000007c817d793715baaee120624e6ce499b29aa105ac00000000000000000000000036825bf3fbdf5a29e2d5148bfe7dcf7b5639e32000000000000000000000000052deaa1c84233f7bb8c8a45baede41091c6165060000000000000000000000005df4707980440d7beb2ad83dfa0321889fb27aed
-----Decoded View---------------
Arg [0] : entranceFee (uint256): 1000000000000000000
Arg [1] : _treasuryWallet (address): 0x7c817d793715baAEe120624E6cE499B29aa105ac
Arg [2] : _entropy (address): 0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320
Arg [3] : _entropyProvider (address): 0x52DeaA1c84233F7bb8C8A45baeDE41091c616506
Arg [4] : _caller (address): 0x5DF4707980440D7BEB2AD83dfA0321889FB27AeD
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000de0b6b3a7640000
Arg [1] : 0000000000000000000000007c817d793715baaee120624e6ce499b29aa105ac
Arg [2] : 00000000000000000000000036825bf3fbdf5a29e2d5148bfe7dcf7b5639e320
Arg [3] : 00000000000000000000000052deaa1c84233f7bb8c8a45baede41091c616506
Arg [4] : 0000000000000000000000005df4707980440d7beb2ad83dfa0321889fb27aed
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$12.35
Net Worth in S
Token Allocations
S
100.00%
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| SONIC | 100.00% | $0.067881 | 181.9279 | $12.35 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.