S Price: $0.801644 (-6.52%)

Contract

0xDAAb6abCC4a3689CD3fc62a2dC2CB97B46B9444A

Overview

S Balance

Sonic LogoSonic LogoSonic Logo29.810796998929000524 S

S Value

$23.90 (@ $0.80/S)

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Enter Astro Spin94513802025-02-22 22:29:171 hr ago1740263357IN
0xDAAb6abC...B46B9444A
10.71766402 S0.0077179855
Perform Upkeep93037532025-02-22 7:00:0216 hrs ago1740207602IN
0xDAAb6abC...B46B9444A
0.036 S0.00487150
Enter Astro Spin93035572025-02-22 6:58:4216 hrs ago1740207522IN
0xDAAb6abC...B46B9444A
20.54000002 S0.0071176355.01
Enter Astro Spin92772972025-02-22 3:52:5820 hrs ago1740196378IN
0xDAAb6abC...B46B9444A
20.54000002 S0.0077179855
Perform Upkeep91343932025-02-21 13:03:0134 hrs ago1740142981IN
0xDAAb6abC...B46B9444A
0.036 S0.00487150
Enter Astro Spin91343262025-02-21 13:02:3534 hrs ago1740142955IN
0xDAAb6abC...B46B9444A
2.90461181 S0.0031536153.66666666
Enter Astro Spin91342762025-02-21 13:02:1834 hrs ago1740142938IN
0xDAAb6abC...B46B9444A
2.35359445 S0.0061613550
Enter Astro Spin91341942025-02-21 13:01:4934 hrs ago1740142909IN
0xDAAb6abC...B46B9444A
2.560617 S0.0061613550
Enter Astro Spin91341492025-02-21 13:01:3134 hrs ago1740142891IN
0xDAAb6abC...B46B9444A
2.07543154 S0.0029381550
Enter Astro Spin91340992025-02-21 13:01:1434 hrs ago1740142874IN
0xDAAb6abC...B46B9444A
1.34194329 S0.01290272104.70694943
Enter Astro Spin91340222025-02-21 13:00:4534 hrs ago1740142845IN
0xDAAb6abC...B46B9444A
1.29033009 S0.0029381550
Enter Astro Spin91339402025-02-21 13:00:1734 hrs ago1740142817IN
0xDAAb6abC...B46B9444A
2.08511931 S0.0061613550
Enter Astro Spin91339322025-02-21 13:00:1334 hrs ago1740142813IN
0xDAAb6abC...B46B9444A
10.54000002 S0.0081053355.01
Perform Upkeep91323482025-02-21 12:51:0235 hrs ago1740142262IN
0xDAAb6abC...B46B9444A
0.04555268 S0.0063822465.51266666
Enter Astro Spin91322582025-02-21 12:50:3035 hrs ago1740142230IN
0xDAAb6abC...B46B9444A
1.21856539 S0.0081371766.03402298
Enter Astro Spin91321692025-02-21 12:50:0135 hrs ago1740142201IN
0xDAAb6abC...B46B9444A
10.68329027 S0.0081053355.01
Perform Upkeep91142032025-02-21 11:09:0136 hrs ago1740136141IN
0xDAAb6abC...B46B9444A
0.036 S0.0064021165.71666666
Enter Astro Spin91138442025-02-21 11:07:0436 hrs ago1740136024IN
0xDAAb6abC...B46B9444A
1.06367861 S0.0088448271.77666666
Enter Astro Spin91137932025-02-21 11:06:4736 hrs ago1740136007IN
0xDAAb6abC...B46B9444A
1.01302724 S0.0082805467.19748777
Enter Astro Spin91137422025-02-21 11:06:3036 hrs ago1740135990IN
0xDAAb6abC...B46B9444A
0.96478785 S0.0070650157.33333333
Enter Astro Spin91137022025-02-21 11:06:1636 hrs ago1740135976IN
0xDAAb6abC...B46B9444A
0.06507492 S0.0073178559.38515111
Enter Astro Spin91136772025-02-21 11:06:0836 hrs ago1740135968IN
0xDAAb6abC...B46B9444A
0.04865456 S0.0093360366.5305864
Perform Upkeep91136602025-02-21 11:06:0236 hrs ago1740135962IN
0xDAAb6abC...B46B9444A
0.036 S0.0063128164.8
Enter Astro Spin91136512025-02-21 11:05:5936 hrs ago1740135959IN
0xDAAb6abC...B46B9444A
0.07151801 S0.0075702461.43333333
Enter Astro Spin91136282025-02-21 11:05:5236 hrs ago1740135952IN
0xDAAb6abC...B46B9444A
1.32939424 S0.0061613550
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
93037572025-02-22 7:00:0316 hrs ago1740207603
0xDAAb6abC...B46B9444A
8.20160001 S
93037572025-02-22 7:00:0316 hrs ago1740207603
0xDAAb6abC...B46B9444A
32.80640004 S
93037532025-02-22 7:00:0216 hrs ago1740207602
0xDAAb6abC...B46B9444A
0.036 S
91344022025-02-21 13:03:0534 hrs ago1740142985
0xDAAb6abC...B46B9444A
4.9727295 S
91344022025-02-21 13:03:0534 hrs ago1740142985
0xDAAb6abC...B46B9444A
19.89091802 S
91343932025-02-21 13:03:0134 hrs ago1740142981
0xDAAb6abC...B46B9444A
0.036 S
91323542025-02-21 12:51:0435 hrs ago1740142264
0xDAAb6abC...B46B9444A
11.8107503 S
91323482025-02-21 12:51:0235 hrs ago1740142262
0xDAAb6abC...B46B9444A
0.04555268 S
91142122025-02-21 11:09:0436 hrs ago1740136144
0xDAAb6abC...B46B9444A
0.59504463 S
91142122025-02-21 11:09:0436 hrs ago1740136144
0xDAAb6abC...B46B9444A
2.38017855 S
91142032025-02-21 11:09:0136 hrs ago1740136141
0xDAAb6abC...B46B9444A
0.036 S
91136632025-02-21 11:06:0336 hrs ago1740135963
0xDAAb6abC...B46B9444A
1.41594522 S
91136602025-02-21 11:06:0236 hrs ago1740135962
0xDAAb6abC...B46B9444A
0.036 S
90859282025-02-21 8:33:0439 hrs ago1740126784
0xDAAb6abC...B46B9444A
3.36621087 S
90859282025-02-21 8:33:0439 hrs ago1740126784
0xDAAb6abC...B46B9444A
13.46484349 S
90859192025-02-21 8:33:0139 hrs ago1740126781
0xDAAb6abC...B46B9444A
0.04159058 S
90848402025-02-21 8:27:0239 hrs ago1740126422
0xDAAb6abC...B46B9444A
6.22355905 S
90848402025-02-21 8:27:0239 hrs ago1740126422
0xDAAb6abC...B46B9444A
24.89423622 S
90848362025-02-21 8:27:0139 hrs ago1740126421
0xDAAb6abC...B46B9444A
0.04159058 S
90810512025-02-21 8:06:0439 hrs ago1740125164
0xDAAb6abC...B46B9444A
3.27615654 S
90810512025-02-21 8:06:0439 hrs ago1740125164
0xDAAb6abC...B46B9444A
13.10462619 S
90810422025-02-21 8:06:0239 hrs ago1740125162
0xDAAb6abC...B46B9444A
0.036 S
90799252025-02-21 8:00:0339 hrs ago1740124803
0xDAAb6abC...B46B9444A
10.10801964 S
90799192025-02-21 8:00:0139 hrs ago1740124801
0xDAAb6abC...B46B9444A
0.04975369 S
89935762025-02-20 23:54:032 days ago1740095643
0xDAAb6abC...B46B9444A
0.02316757 S
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AstroSpin

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 8 : AstroSpin.sol
// 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";

error AstroSpin__NotEnoughEth();
error AstroSpin__TransferFailed();
error AstroSpin__NotOpen();
error AstroSpin__UpkeepNotNeeded(
	uint256 currentBalance,
	uint256 numPlayers,
	uint256 astroSpinState
);

contract AstroSpin is IEntropyConsumer, Ownable, ReentrancyGuard {
	// Entropy
	IEntropy entropy;
	address entropyProvider;

	/* state variables */
	uint256 public i_minEntranceFee;
	address payable[] public s_players;
	address payable public treasuryWallet;
	bool public feeEnabled = true;
	uint256 public feePool;

	address payable[] public s_recentWinner;
	mapping(address => bool) public isPlayerEntered;
	uint256 public roundCount = 0;

	mapping(address => uint256) public contributions;
	address public caller;

	/** Variables */
	enum AstroSpinState {
		OPEN,
		CALCULATING
	}
	AstroSpinState private s_AstroSpinState;
	uint256 private s_lastTimeStamp;

	/* events */
	event AstroSpinEnterRequest(uint64 sequenceNumber);
	event AstroSpinEnterResult(uint64 sequenceNumber);
	event AstroSpinEnter(address indexed player, uint256 amount);
	event AstroSpinResult(uint64 sequenceNumber);
	event RefundProcessed(address indexed player, uint256 amount);
	event RefundCompleted(uint256 playerCount, uint256 totalAmount);

	event RequestedAstroSpinWinner(uint256 indexed requestId);
	event WinnerPicked(
		address indexed winner,
		uint256 prize,
		uint256 contribution
	);
	event TreasuryChanged(address indexed newTreasury);

	// Events for tracking refund status
	event RefundIssued(address to, uint256 amount);
	event RefundFailed(address to, uint256 amount);
	event SpecialWalletPoolFilled(uint256 amount, uint256 newTotal);

	/**
	 * @notice Constructor initializes the AstroSpin contract
	 * @param minEntranceFee The fee required to enter the game
	 * @param _treasuryWallet Address where treasury funds will be sent
	 * @param _entropy Address of the Entropy contract for randomness
	 * @param _entropyProvider Address of the entropy provider
	 */
	constructor(
		uint256 minEntranceFee,
		address payable _treasuryWallet,
		address _entropy,
		address _entropyProvider,
		address _caller
	) {
		i_minEntranceFee = minEntranceFee;
		s_AstroSpinState = AstroSpinState.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 enterAstroSpin() public payable {
		require(s_AstroSpinState == AstroSpinState.OPEN, "AstroSpin__NotOpen");

		uint256 flipFee = feeEnabled ? entropy.getFee(entropyProvider) : 0;
		feePool += flipFee;

		require(msg.value >= i_minEntranceFee, "AstroSpin__NotEnoughEth");
		contributions[msg.sender] += msg.value - flipFee;

		if (!isPlayerEntered[msg.sender]) {
			s_players.push(payable(msg.sender));
			isPlayerEntered[msg.sender] = true;
		}

		emit AstroSpinEnter(msg.sender, contributions[msg.sender]);
	}

	/**
	 * @notice Initiates the random winner selection process if conditions are met
	 * @dev Checks if game is open, has balance and minimum players before requesting entropy
	 * @param userRandomNumber Additional entropy input from user
	 */
	function performUpkeep(
		bytes32 userRandomNumber
	) external payable onlyCaller {
		bool isOpen = AstroSpinState.OPEN == s_AstroSpinState;
		bool hasBalance = address(this).balance > 0;
		bool hasPlayers = s_players.length >= 2;

		bool upkeepNeeded = (isOpen && hasBalance && hasPlayers);

		if (!upkeepNeeded) {
			revert AstroSpin__UpkeepNotNeeded(
				address(this).balance,
				s_players.length,
				uint256(s_AstroSpinState)
			);
		}

		s_AstroSpinState = AstroSpinState.CALCULATING;

		uint256 fee = entropy.getFee(entropyProvider);

		uint64 sequenceNumber = entropy.requestWithCallback{ value: fee }(
			entropyProvider,
			userRandomNumber
		);

		emit RequestedAstroSpinWinner(sequenceNumber);
		emit AstroSpinEnterRequest(sequenceNumber);
	}

	/**
	 * @notice Callback function called by entropy provider with random number
	 * @dev Selects winner based on weighted contributions and distributes prizes
	 * @param sequenceNumber The sequence number of the entropy request
	 * @param randomNumber The random number provided by entropy source
	 */
	function entropyCallback(
		uint64 sequenceNumber,
		address,
		bytes32 randomNumber
	) internal override {
		delete s_recentWinner;

		uint256 totalContributions = 0;
		for (uint256 i = 0; i < s_players.length; i++) {
			totalContributions += contributions[s_players[i]];
		}

		require(totalContributions > 0, "Total contributions must be positive");

		uint256 winningThreshold = uint256(randomNumber) % totalContributions;
		uint256 cumulativeContribution = 0;
		address payable recentWinner = payable(address(0));

		for (uint256 i = 0; i < s_players.length; i++) {
			cumulativeContribution += contributions[s_players[i]];
			if (winningThreshold < cumulativeContribution) {
				recentWinner = s_players[i];
				break;
			}
		}

		uint256 pool = address(this).balance - feePool;

		uint256 prizes;
		uint256 treasuryAmount;

		// Check if winner's contribution is greater than potential prize
		uint256 potentialPrize = (pool * 80) / 100;
		if (contributions[recentWinner] > potentialPrize) {
			// If winner would get less than their contribution, give them the full pool
			prizes = pool;
			treasuryAmount = 0;
		} else {
			// Otherwise proceed with normal 80/20 split
			prizes = potentialPrize;
			treasuryAmount = (pool * 20) / 100;
		}
		// Transfer prize directly to winner
		(bool prizeSuccess, ) = recentWinner.call{ value: prizes }("");
		require(prizeSuccess, "Prize transfer failed");

		// Transfer treasury amount to treasury wallet if any
		if (treasuryAmount > 0) {
			(bool treasurySuccess, ) = treasuryWallet.call{
				value: treasuryAmount
			}("");
			require(treasurySuccess, "Treasury transfer failed");
		}

		s_recentWinner.push(recentWinner);
		emit WinnerPicked(recentWinner, prizes, contributions[recentWinner]);
		emit AstroSpinResult(sequenceNumber);

		// Reset for next AstroSpin
		for (uint256 i = 0; i < s_players.length; i++) {
			address player = s_players[i];
			contributions[player] = 0;
			isPlayerEntered[player] = false;
		}
		roundCount++;
		s_AstroSpinState = AstroSpinState.OPEN;
		s_players = new address payable[](0);
		s_lastTimeStamp = block.timestamp;
	}

	function getContractBalance() public view returns (uint256) {
		return address(this).balance;
	}

	function getBalanceWithoutPlatformFund() public view returns (uint256) {
		if (feePool > address(this).balance) {
			return 0;
		}
		uint256 totalDeductions = address(this).balance - feePool;
		return totalDeductions;
	}

	function getAstroSpinState() public view returns (AstroSpinState) {
		return s_AstroSpinState;
	}

	function getMinEntranceFee() public view returns (uint256) {
		return i_minEntranceFee;
	}

	function getPlayer(uint256 index) public view returns (address) {
		return s_players[index];
	}

	function getAllPlayers() public view returns (address payable[] memory) {
		return s_players;
	}

	function getRecentWinners() public view returns (address payable[] memory) {
		return s_recentWinner;
	}

	function getLastTimeStamp() public view returns (uint256) {
		return s_lastTimeStamp;
	}

	function getNumberOfPlayers() public view returns (uint256) {
		return s_players.length;
	}

	function getRoundCount() public view returns (uint256) {
		return roundCount;
	}

	function getFeePool() public view returns (uint256) {
		return feePool;
	}

	function transferFeeFunds(address payable _to) public onlyOwner {
		require(_to != address(0), "Invalid address");
		require(feePool > 0, "No funds to transfer");

		uint256 amountToTransfer = feePool;
		feePool = 0; // Reset before transfer to prevent reentrancy

		(bool success, ) = _to.call{ value: amountToTransfer }("");
		require(success, "Transfer failed");
	}

	function getPlayerContributionsPercentages()
		public
		view
		returns (address[] memory, uint256[] memory, uint256[] memory)
	{
		address[] memory players = new address[](s_players.length);
		uint256[] memory percentages = new uint256[](s_players.length);
		uint256[] memory contributionsArray = new uint256[](s_players.length);
		uint256 total = 0;

		// Calculate total contributions
		for (uint256 i = 0; i < s_players.length; i++) {
			total += contributions[s_players[i]];
		}

		// Calculate each player's percentage of total contributions and get their contribution
		for (uint256 i = 0; i < s_players.length; i++) {
			players[i] = s_players[i];
			contributionsArray[i] = contributions[s_players[i]]; // Store individual contributions
			if (total > 0) {
				percentages[i] = (contributions[s_players[i]] * 100) / total;
			} else {
				percentages[i] = 0;
			}
		}

		return (players, percentages, contributionsArray);
	}

	// Function to update the entrance fee
	function updateEntranceFee(uint256 _newMinEntranceFee) external onlyOwner {
		i_minEntranceFee = _newMinEntranceFee;
	}

	function setTreasury(address payable _newTreasury) public onlyOwner {
		require(
			_newTreasury != address(0),
			"New treasury cannot be the zero address"
		);
		treasuryWallet = _newTreasury;
		emit TreasuryChanged(_newTreasury);
	}

	function refundAllParticipants() external onlyOwner nonReentrant {
		require(s_players.length > 0, "No players to refund");

		// Store length since we'll modify the array
		uint256 playerCount = s_players.length;

		// Track refund amount for validation
		uint256 totalRefunded = 0;

		// Process refunds
		for (uint256 i = 0; i < playerCount; i++) {
			address payable player = s_players[i];
			uint256 playerContribution = contributions[player];

			if (playerContribution > 0) {
				// Update state before transfer to prevent reentrancy
				uint256 amountToRefund = playerContribution;
				contributions[player] = 0;
				isPlayerEntered[player] = false;

				// Process refund
				(bool success, ) = player.call{ value: amountToRefund }("");
				require(success, "Refund transfer failed");

				totalRefunded += amountToRefund;

				emit RefundProcessed(player, amountToRefund);
			}
		}

		// Reset contract state
		s_AstroSpinState = AstroSpinState.OPEN;
		s_players = new address payable[](0);

		emit RefundCompleted(playerCount, totalRefunded);
	}

	receive() external payable {}
}

File 2 of 8 : Ownable.sol
// 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);
    }
}

File 3 of 8 : ReentrancyGuard.sol
// 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;
    }
}

File 4 of 8 : Context.sol
// 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;
    }
}

File 5 of 8 : EntropyEvents.sol
// 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
    );
}

File 6 of 8 : EntropyStructs.sol
// 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.
    }
}

File 7 of 8 : IEntropy.sol
// 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);
}

File 8 of 8 : IEntropyConsumer.sol
// 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;
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"minEntranceFee","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":"astroSpinState","type":"uint256"}],"name":"AstroSpin__UpkeepNotNeeded","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AstroSpinEnter","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"sequenceNumber","type":"uint64"}],"name":"AstroSpinEnterRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"sequenceNumber","type":"uint64"}],"name":"AstroSpinEnterResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"sequenceNumber","type":"uint64"}],"name":"AstroSpinResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"playerCount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalAmount","type":"uint256"}],"name":"RefundCompleted","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":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RefundProcessed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"requestId","type":"uint256"}],"name":"RequestedAstroSpinWinner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newTotal","type":"uint256"}],"name":"SpecialWalletPoolFilled","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":"contribution","type":"uint256"}],"name":"WinnerPicked","type":"event"},{"inputs":[{"internalType":"uint64","name":"sequence","type":"uint64"},{"internalType":"address","name":"provider","type":"address"},{"internalType":"bytes32","name":"randomNumber","type":"bytes32"}],"name":"_entropyCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"caller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"contributions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enterAstroSpin","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"feeEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feePool","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":"getAstroSpinState","outputs":[{"internalType":"enum AstroSpin.AstroSpinState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalanceWithoutPlatformFund","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getContractBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFeePool","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":"getLastTimeStamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMinEntranceFee","outputs":[{"internalType":"uint256","name":"","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":"getPlayerContributionsPercentages","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRecentWinners","outputs":[{"internalType":"address payable[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRoundCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"i_minEntranceFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isPlayerEntered","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[],"name":"refundAllParticipants","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"roundCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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_recentWinner","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","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":"bool","name":"_enabled","type":"bool"}],"name":"toggleFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_to","type":"address"}],"name":"transferFeeFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasuryWallet","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newMinEntranceFee","type":"uint256"}],"name":"updateEntranceFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040526006805460ff60a01b1916600160a01b1790556000600a553480156200002957600080fd5b506040516200218e3803806200218e8339810160408190526200004c9162000128565b6200005733620000bf565b60018055600494909455600c8054600680546001600160a01b03199081166001600160a01b03978816179091556002805482169587169590951790945560038054909416928516929092179092556001600160a81b031916929091169190911790556200019c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200012557600080fd5b50565b600080600080600060a086880312156200014157600080fd5b85519450602086015162000155816200010f565b604087015190945062000168816200010f565b60608701519093506200017b816200010f565b60808701519092506200018e816200010f565b809150509295509295909350565b611fe280620001ac6000396000f3fe6080604052600436106102085760003560e01c80638da5cb5b11610118578063e55ae4e8116100a0578063f077b9741161006f578063f077b97414610592578063f0f44260146105a7578063f2fde38b146105c7578063fc9c8d39146105e7578063fd6673f51461060757600080fd5b8063e55ae4e81461051b578063e72496161461053b578063ee7863551461055b578063efa1c4821461057057600080fd5b8063ae771f6b116100e7578063ae771f6b1461046f578063c1c244e81461048f578063d604e29b146104a4578063df66a836146104d4578063e2a6b148146104fb57600080fd5b80638da5cb5b146103f7578063a1e9b51114610415578063a771ebc714610428578063ae2e933b1461045957600080fd5b80634626402b1161019b5780636f9fb98a1161016a5780636f9fb98a14610379578063715018a61461038c57806377ec0f9a146103a15780637f1fce78146103b7578063868e4c61146103d757600080fd5b80634626402b146102e85780634edbf60a1461032057806352a5f1f8146103445780636de7da781461036457600080fd5b80633b35c517116101d75780633b35c517146102715780634244b0da1461028657806342aaa9e4146102a657806342e94c90146102bb57600080fd5b8063046596fa14610214578063127f0b3f1461021e57806325f2277514610247578063385160641461025c57600080fd5b3661020f57005b600080fd5b61021c61061c565b005b34801561022a57600080fd5b50610234600a5481565b6040519081526020015b60405180910390f35b34801561025357600080fd5b50610234610869565b34801561026857600080fd5b50600754610234565b34801561027d57600080fd5b50600454610234565b34801561029257600080fd5b5061021c6102a1366004611c82565b6108ec565b3480156102b257600080fd5b506102346108f9565b3480156102c757600080fd5b506102346102d6366004611cb0565b600b6020526000908152604090205481565b3480156102f457600080fd5b50600654610308906001600160a01b031681565b6040516001600160a01b03909116815260200161023e565b34801561032c57600080fd5b50610335610921565b60405161023e93929190611d0f565b34801561035057600080fd5b5061021c61035f366004611d9a565b610bf7565b34801561037057600080fd5b50600a54610234565b34801561038557600080fd5b5047610234565b34801561039857600080fd5b5061021c610cd8565b3480156103ad57600080fd5b5061023460045481565b3480156103c357600080fd5b5061021c6103d2366004611cb0565b610cec565b3480156103e357600080fd5b5061021c6103f2366004611ddb565b610d76565b34801561040357600080fd5b506000546001600160a01b0316610308565b61021c610423366004611c82565b610d9c565b34801561043457600080fd5b5060065461044990600160a01b900460ff1681565b604051901515815260200161023e565b34801561046557600080fd5b5061023460075481565b34801561047b57600080fd5b5061030861048a366004611c82565b611050565b34801561049b57600080fd5b50600d54610234565b3480156104b057600080fd5b506104496104bf366004611cb0565b60096020526000908152604090205460ff1681565b3480156104e057600080fd5b50600c54600160a01b900460ff1660405161023e9190611e13565b34801561050757600080fd5b50610308610516366004611c82565b61107a565b34801561052757600080fd5b50610308610536366004611c82565b61108a565b34801561054757600080fd5b5061021c610556366004611cb0565b6110ba565b34801561056757600080fd5b5061021c6111f5565b34801561057c57600080fd5b5061058561142f565b60405161023e9190611e3b565b34801561059e57600080fd5b50610585611491565b3480156105b357600080fd5b5061021c6105c2366004611cb0565b6114f1565b3480156105d357600080fd5b5061021c6105e2366004611cb0565b6115a9565b3480156105f357600080fd5b50600c54610308906001600160a01b031681565b34801561061357600080fd5b50600554610234565b6000600c54600160a01b900460ff16600181111561063c5761063c611dfd565b146106835760405162461bcd60e51b815260206004820152601260248201527120b9ba3937a9b834b72fafa737ba27b832b760711b60448201526064015b60405180910390fd5b600654600090600160a01b900460ff1661069e57600061070e565b600254600354604051631711922960e31b81526001600160a01b03918216600482015291169063b88c914890602401602060405180830381865afa1580156106ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070e9190611e88565b6001600160801b03169050806007600082825461072b9190611ec7565b90915550506004543410156107825760405162461bcd60e51b815260206004820152601760248201527f417374726f5370696e5f5f4e6f74456e6f756768457468000000000000000000604482015260640161067a565b61078c8134611eda565b336000908152600b6020526040812080549091906107ab908490611ec7565b90915550503360009081526009602052604090205460ff16610822576005805460018181019092557f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b031916339081179091556000908152600960205260409020805460ff191690911790555b336000818152600b60209081526040918290205491519182527f54c1120c1b252c0b6ef35a1b86ebb8365d71cac345475d39526567501e7dc0b9910160405180910390a250565b600254600354604051631711922960e31b81526001600160a01b039182166004820152600092919091169063b88c914890602401602060405180830381865afa1580156108ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108de9190611e88565b6001600160801b0316905090565b6108f4611622565b600455565b600047600754111561090b5750600090565b60006007544761091b9190611eda565b92915050565b6060806060600060058054905067ffffffffffffffff81111561094657610946611eed565b60405190808252806020026020018201604052801561096f578160200160208202803683370190505b5060055490915060009067ffffffffffffffff81111561099157610991611eed565b6040519080825280602002602001820160405280156109ba578160200160208202803683370190505b5060055490915060009067ffffffffffffffff8111156109dc576109dc611eed565b604051908082528060200260200182016040528015610a05578160200160208202803683370190505b5090506000805b600554811015610a7057600b600060058381548110610a2d57610a2d611f03565b60009182526020808320909101546001600160a01b03168352820192909252604001902054610a5c9083611ec7565b915080610a6881611f19565b915050610a0c565b5060005b600554811015610bea5760058181548110610a9157610a91611f03565b9060005260206000200160009054906101000a90046001600160a01b0316858281518110610ac157610ac1611f03565b60200260200101906001600160a01b031690816001600160a01b031681525050600b600060058381548110610af857610af8611f03565b60009182526020808320909101546001600160a01b031683528201929092526040019020548351849083908110610b3157610b31611f03565b60209081029190910101528115610bb75781600b600060058481548110610b5a57610b5a611f03565b60009182526020808320909101546001600160a01b03168352820192909252604001902054610b8a906064611f32565b610b949190611f67565b848281518110610ba657610ba6611f03565b602002602001018181525050610bd8565b6000848281518110610bcb57610bcb611f03565b6020026020010181815250505b80610be281611f19565b915050610a74565b5092969195509350915050565b6000610c0b6002546001600160a01b031690565b90506001600160a01b038116610c635760405162461bcd60e51b815260206004820152601760248201527f456e74726f70792061646472657373206e6f7420736574000000000000000000604482015260640161067a565b336001600160a01b03821614610cc75760405162461bcd60e51b815260206004820152602360248201527f4f6e6c7920456e74726f70792063616e2063616c6c20746869732066756e637460448201526234b7b760e91b606482015260840161067a565b610cd284848461167c565b50505050565b610ce0611622565b610cea6000611b45565b565b610cf4611622565b6001600160a01b038116610d545760405162461bcd60e51b815260206004820152602160248201527f4e65772063616c6c65722063616e6e6f74206265207a65726f206164647265736044820152607360f81b606482015260840161067a565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b610d7e611622565b60068054911515600160a01b0260ff60a01b19909216919091179055565b600c546001600160a01b0316331480610dbf57506000546001600160a01b031633145b610e235760405162461bcd60e51b815260206004820152602f60248201527f4f6e6c79207468652063616c6c6572206f72206f776e65722063616e2063616c60448201526e36103a3434b990333ab731ba34b7b760891b606482015260840161067a565b600c54600090600160a01b900460ff166001811115610e4457610e44611dfd565b6005549015915047151590600211156000838015610e5f5750825b8015610e685750815b905080610ebc57600554600c54479190600160a01b900460ff166001811115610e9357610e93611dfd565b60405162bf9ea560e61b815260048101939093526024830191909152604482015260640161067a565b600c8054600160a01b60ff60a01b19909116179055600254600354604051631711922960e31b81526001600160a01b039182166004820152600092919091169063b88c914890602401602060405180830381865afa158015610f22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f469190611e88565b6002546003546040516319cb825f60e01b81526001600160a01b039182166004820152602481018a90526001600160801b039390931693506000929116906319cb825f90849060440160206040518083038185885af1158015610fad573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fd29190611f7b565b60405190915067ffffffffffffffff8216907f5beb2af3b50debed400e3605ba22bb501038c089d951d7fa560cf94db564ddb890600090a260405167ffffffffffffffff821681527f7f45e714f78c137943988efd3188c92c586458180c00f18f5ac76b00bbd256d29060200160405180910390a150505050505050565b6005818154811061106057600080fd5b6000918252602090912001546001600160a01b0316905081565b6008818154811061106057600080fd5b60006005828154811061109f5761109f611f03565b6000918252602090912001546001600160a01b031692915050565b6110c2611622565b6001600160a01b03811661110a5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015260640161067a565b6000600754116111535760405162461bcd60e51b8152602060048201526014602482015273273790333ab73239903a37903a3930b739b332b960611b604482015260640161067a565b600780546000918290556040519091906001600160a01b0384169083908381818185875af1925050503d80600081146111a8576040519150601f19603f3d011682016040523d82523d6000602084013e6111ad565b606091505b50509050806111f05760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161067a565b505050565b6111fd611622565b611205611b95565b60055461124b5760405162461bcd60e51b8152602060048201526014602482015273139bc81c1b185e595c9cc81d1bc81c99599d5b9960621b604482015260640161067a565b6005546000805b828110156113bf5760006005828154811061126f5761126f611f03565b60009182526020808320909101546001600160a01b0316808352600b90915260409091205490915080156113aa576001600160a01b0382166000818152600b602090815260408083208390556009909152808220805460ff191690555183929083908381818185875af1925050503d8060008114611309576040519150601f19603f3d011682016040523d82523d6000602084013e61130e565b606091505b50509050806113585760405162461bcd60e51b81526020600482015260166024820152751499599d5b99081d1c985b9cd9995c8819985a5b195960521b604482015260640161067a565b6113628287611ec7565b9550836001600160a01b03167f3367befd2b2f39615cd79917c2153263c4af1d3945ec003e5d5bfc13a8d858338360405161139f91815260200190565b60405180910390a250505b505080806113b790611f19565b915050611252565b50600c805460ff60a01b1916905560408051600081526020810191829052516113ea91600591611bee565b5060408051838152602081018390527f9f97ef2400be5b14e0697468c831e96e59bb11d1872740c533add66e3521537d910160405180910390a15050610cea60018055565b6060600580548060200260200160405190810160405280929190818152602001828054801561148757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611469575b5050505050905090565b60606008805480602002602001604051908101604052809291908181526020018280548015611487576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311611469575050505050905090565b6114f9611622565b6001600160a01b03811661155f5760405162461bcd60e51b815260206004820152602760248201527f4e65772074726561737572792063616e6e6f7420626520746865207a65726f206044820152666164647265737360c81b606482015260840161067a565b600680546001600160a01b0319166001600160a01b0383169081179091556040517fc714d22a2f08b695f81e7c707058db484aa5b4d6b4c9fd64beb10fe85832f60890600090a250565b6115b1611622565b6001600160a01b0381166116165760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161067a565b61161f81611b45565b50565b6000546001600160a01b03163314610cea5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067a565b61168860086000611c53565b6000805b6005548110156116f057600b6000600583815481106116ad576116ad611f03565b60009182526020808320909101546001600160a01b031683528201929092526040019020546116dc9083611ec7565b9150806116e881611f19565b91505061168c565b506000811161174d5760405162461bcd60e51b8152602060048201526024808201527f546f74616c20636f6e747269627574696f6e73206d75737420626520706f73696044820152637469766560e01b606482015260840161067a565b60006117598284611f98565b905060008060005b6005548110156117fc57600b60006005838154811061178257611782611f03565b60009182526020808320909101546001600160a01b031683528201929092526040019020546117b19084611ec7565b9250828410156117ea57600581815481106117ce576117ce611f03565b6000918252602090912001546001600160a01b031691506117fc565b806117f481611f19565b915050611761565b5060006007544761180d9190611eda565b9050600080806064611820856050611f32565b61182a9190611f67565b6001600160a01b0386166000908152600b60205260409020549091508110156118595783925060009150611876565b9150816064611869856014611f32565b6118739190611f67565b91505b6000856001600160a01b03168460405160006040518083038185875af1925050503d80600081146118c3576040519150601f19603f3d011682016040523d82523d6000602084013e6118c8565b606091505b50509050806119115760405162461bcd60e51b8152602060048201526015602482015274141c9a5e99481d1c985b9cd9995c8819985a5b1959605a1b604482015260640161067a565b82156119bc576006546040516000916001600160a01b03169085908381818185875af1925050503d8060008114611964576040519150601f19603f3d011682016040523d82523d6000602084013e611969565b606091505b50509050806119ba5760405162461bcd60e51b815260206004820152601860248201527f5472656173757279207472616e73666572206661696c65640000000000000000604482015260640161067a565b505b60088054600181019091557ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319166001600160a01b0388169081179091556000818152600b6020908152604091829020548251888152918201527f7e57d825a2478cc8123a008d7d1e20c0f6e8cbca89a7bc100c9b05ecb3698deb910160405180910390a260405167ffffffffffffffff8d1681527ffdd45ca0b53cc67af770583f046be250f4ed6e8fa7412fa42ca5565ba08051f59060200160405180910390a160005b600554811015611af257600060058281548110611aab57611aab611f03565b60009182526020808320909101546001600160a01b03168252600b8152604080832083905560099091529020805460ff191690555080611aea81611f19565b915050611a8c565b50600a8054906000611b0383611f19565b9091555050600c805460ff60a01b191690556040805160008152602081019182905251611b3291600591611bee565b505042600d555050505050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600260015403611be75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161067a565b6002600155565b828054828255906000526020600020908101928215611c43579160200282015b82811115611c4357825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611c0e565b50611c4f929150611c6d565b5090565b508054600082559060005260206000209081019061161f91905b5b80821115611c4f5760008155600101611c6e565b600060208284031215611c9457600080fd5b5035919050565b6001600160a01b038116811461161f57600080fd5b600060208284031215611cc257600080fd5b8135611ccd81611c9b565b9392505050565b600081518084526020808501945080840160005b83811015611d0457815187529582019590820190600101611ce8565b509495945050505050565b606080825284519082018190526000906020906080840190828801845b82811015611d515781516001600160a01b031684529284019290840190600101611d2c565b50505083810382850152611d658187611cd4565b9150508281036040840152611d7a8185611cd4565b9695505050505050565b67ffffffffffffffff8116811461161f57600080fd5b600080600060608486031215611daf57600080fd5b8335611dba81611d84565b92506020840135611dca81611c9b565b929592945050506040919091013590565b600060208284031215611ded57600080fd5b81358015158114611ccd57600080fd5b634e487b7160e01b600052602160045260246000fd5b6020810160028310611e3557634e487b7160e01b600052602160045260246000fd5b91905290565b6020808252825182820181905260009190848201906040850190845b81811015611e7c5783516001600160a01b031683529284019291840191600101611e57565b50909695505050505050565b600060208284031215611e9a57600080fd5b81516001600160801b0381168114611ccd57600080fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561091b5761091b611eb1565b8181038181111561091b5761091b611eb1565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600060018201611f2b57611f2b611eb1565b5060010190565b6000816000190483118215151615611f4c57611f4c611eb1565b500290565b634e487b7160e01b600052601260045260246000fd5b600082611f7657611f76611f51565b500490565b600060208284031215611f8d57600080fd5b8151611ccd81611d84565b600082611fa757611fa7611f51565b50069056fea2646970667358221220983fb72ea876b53e93a7811113f899c8198b35b1ca933467d92dbdc8ae84701064736f6c63430008100033000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000007c817d793715baaee120624e6ce499b29aa105ac00000000000000000000000036825bf3fbdf5a29e2d5148bfe7dcf7b5639e32000000000000000000000000052deaa1c84233f7bb8c8a45baede41091c6165060000000000000000000000005df4707980440d7beb2ad83dfa0321889fb27aed

Deployed Bytecode

0x6080604052600436106102085760003560e01c80638da5cb5b11610118578063e55ae4e8116100a0578063f077b9741161006f578063f077b97414610592578063f0f44260146105a7578063f2fde38b146105c7578063fc9c8d39146105e7578063fd6673f51461060757600080fd5b8063e55ae4e81461051b578063e72496161461053b578063ee7863551461055b578063efa1c4821461057057600080fd5b8063ae771f6b116100e7578063ae771f6b1461046f578063c1c244e81461048f578063d604e29b146104a4578063df66a836146104d4578063e2a6b148146104fb57600080fd5b80638da5cb5b146103f7578063a1e9b51114610415578063a771ebc714610428578063ae2e933b1461045957600080fd5b80634626402b1161019b5780636f9fb98a1161016a5780636f9fb98a14610379578063715018a61461038c57806377ec0f9a146103a15780637f1fce78146103b7578063868e4c61146103d757600080fd5b80634626402b146102e85780634edbf60a1461032057806352a5f1f8146103445780636de7da781461036457600080fd5b80633b35c517116101d75780633b35c517146102715780634244b0da1461028657806342aaa9e4146102a657806342e94c90146102bb57600080fd5b8063046596fa14610214578063127f0b3f1461021e57806325f2277514610247578063385160641461025c57600080fd5b3661020f57005b600080fd5b61021c61061c565b005b34801561022a57600080fd5b50610234600a5481565b6040519081526020015b60405180910390f35b34801561025357600080fd5b50610234610869565b34801561026857600080fd5b50600754610234565b34801561027d57600080fd5b50600454610234565b34801561029257600080fd5b5061021c6102a1366004611c82565b6108ec565b3480156102b257600080fd5b506102346108f9565b3480156102c757600080fd5b506102346102d6366004611cb0565b600b6020526000908152604090205481565b3480156102f457600080fd5b50600654610308906001600160a01b031681565b6040516001600160a01b03909116815260200161023e565b34801561032c57600080fd5b50610335610921565b60405161023e93929190611d0f565b34801561035057600080fd5b5061021c61035f366004611d9a565b610bf7565b34801561037057600080fd5b50600a54610234565b34801561038557600080fd5b5047610234565b34801561039857600080fd5b5061021c610cd8565b3480156103ad57600080fd5b5061023460045481565b3480156103c357600080fd5b5061021c6103d2366004611cb0565b610cec565b3480156103e357600080fd5b5061021c6103f2366004611ddb565b610d76565b34801561040357600080fd5b506000546001600160a01b0316610308565b61021c610423366004611c82565b610d9c565b34801561043457600080fd5b5060065461044990600160a01b900460ff1681565b604051901515815260200161023e565b34801561046557600080fd5b5061023460075481565b34801561047b57600080fd5b5061030861048a366004611c82565b611050565b34801561049b57600080fd5b50600d54610234565b3480156104b057600080fd5b506104496104bf366004611cb0565b60096020526000908152604090205460ff1681565b3480156104e057600080fd5b50600c54600160a01b900460ff1660405161023e9190611e13565b34801561050757600080fd5b50610308610516366004611c82565b61107a565b34801561052757600080fd5b50610308610536366004611c82565b61108a565b34801561054757600080fd5b5061021c610556366004611cb0565b6110ba565b34801561056757600080fd5b5061021c6111f5565b34801561057c57600080fd5b5061058561142f565b60405161023e9190611e3b565b34801561059e57600080fd5b50610585611491565b3480156105b357600080fd5b5061021c6105c2366004611cb0565b6114f1565b3480156105d357600080fd5b5061021c6105e2366004611cb0565b6115a9565b3480156105f357600080fd5b50600c54610308906001600160a01b031681565b34801561061357600080fd5b50600554610234565b6000600c54600160a01b900460ff16600181111561063c5761063c611dfd565b146106835760405162461bcd60e51b815260206004820152601260248201527120b9ba3937a9b834b72fafa737ba27b832b760711b60448201526064015b60405180910390fd5b600654600090600160a01b900460ff1661069e57600061070e565b600254600354604051631711922960e31b81526001600160a01b03918216600482015291169063b88c914890602401602060405180830381865afa1580156106ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070e9190611e88565b6001600160801b03169050806007600082825461072b9190611ec7565b90915550506004543410156107825760405162461bcd60e51b815260206004820152601760248201527f417374726f5370696e5f5f4e6f74456e6f756768457468000000000000000000604482015260640161067a565b61078c8134611eda565b336000908152600b6020526040812080549091906107ab908490611ec7565b90915550503360009081526009602052604090205460ff16610822576005805460018181019092557f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b031916339081179091556000908152600960205260409020805460ff191690911790555b336000818152600b60209081526040918290205491519182527f54c1120c1b252c0b6ef35a1b86ebb8365d71cac345475d39526567501e7dc0b9910160405180910390a250565b600254600354604051631711922960e31b81526001600160a01b039182166004820152600092919091169063b88c914890602401602060405180830381865afa1580156108ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108de9190611e88565b6001600160801b0316905090565b6108f4611622565b600455565b600047600754111561090b5750600090565b60006007544761091b9190611eda565b92915050565b6060806060600060058054905067ffffffffffffffff81111561094657610946611eed565b60405190808252806020026020018201604052801561096f578160200160208202803683370190505b5060055490915060009067ffffffffffffffff81111561099157610991611eed565b6040519080825280602002602001820160405280156109ba578160200160208202803683370190505b5060055490915060009067ffffffffffffffff8111156109dc576109dc611eed565b604051908082528060200260200182016040528015610a05578160200160208202803683370190505b5090506000805b600554811015610a7057600b600060058381548110610a2d57610a2d611f03565b60009182526020808320909101546001600160a01b03168352820192909252604001902054610a5c9083611ec7565b915080610a6881611f19565b915050610a0c565b5060005b600554811015610bea5760058181548110610a9157610a91611f03565b9060005260206000200160009054906101000a90046001600160a01b0316858281518110610ac157610ac1611f03565b60200260200101906001600160a01b031690816001600160a01b031681525050600b600060058381548110610af857610af8611f03565b60009182526020808320909101546001600160a01b031683528201929092526040019020548351849083908110610b3157610b31611f03565b60209081029190910101528115610bb75781600b600060058481548110610b5a57610b5a611f03565b60009182526020808320909101546001600160a01b03168352820192909252604001902054610b8a906064611f32565b610b949190611f67565b848281518110610ba657610ba6611f03565b602002602001018181525050610bd8565b6000848281518110610bcb57610bcb611f03565b6020026020010181815250505b80610be281611f19565b915050610a74565b5092969195509350915050565b6000610c0b6002546001600160a01b031690565b90506001600160a01b038116610c635760405162461bcd60e51b815260206004820152601760248201527f456e74726f70792061646472657373206e6f7420736574000000000000000000604482015260640161067a565b336001600160a01b03821614610cc75760405162461bcd60e51b815260206004820152602360248201527f4f6e6c7920456e74726f70792063616e2063616c6c20746869732066756e637460448201526234b7b760e91b606482015260840161067a565b610cd284848461167c565b50505050565b610ce0611622565b610cea6000611b45565b565b610cf4611622565b6001600160a01b038116610d545760405162461bcd60e51b815260206004820152602160248201527f4e65772063616c6c65722063616e6e6f74206265207a65726f206164647265736044820152607360f81b606482015260840161067a565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b610d7e611622565b60068054911515600160a01b0260ff60a01b19909216919091179055565b600c546001600160a01b0316331480610dbf57506000546001600160a01b031633145b610e235760405162461bcd60e51b815260206004820152602f60248201527f4f6e6c79207468652063616c6c6572206f72206f776e65722063616e2063616c60448201526e36103a3434b990333ab731ba34b7b760891b606482015260840161067a565b600c54600090600160a01b900460ff166001811115610e4457610e44611dfd565b6005549015915047151590600211156000838015610e5f5750825b8015610e685750815b905080610ebc57600554600c54479190600160a01b900460ff166001811115610e9357610e93611dfd565b60405162bf9ea560e61b815260048101939093526024830191909152604482015260640161067a565b600c8054600160a01b60ff60a01b19909116179055600254600354604051631711922960e31b81526001600160a01b039182166004820152600092919091169063b88c914890602401602060405180830381865afa158015610f22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f469190611e88565b6002546003546040516319cb825f60e01b81526001600160a01b039182166004820152602481018a90526001600160801b039390931693506000929116906319cb825f90849060440160206040518083038185885af1158015610fad573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fd29190611f7b565b60405190915067ffffffffffffffff8216907f5beb2af3b50debed400e3605ba22bb501038c089d951d7fa560cf94db564ddb890600090a260405167ffffffffffffffff821681527f7f45e714f78c137943988efd3188c92c586458180c00f18f5ac76b00bbd256d29060200160405180910390a150505050505050565b6005818154811061106057600080fd5b6000918252602090912001546001600160a01b0316905081565b6008818154811061106057600080fd5b60006005828154811061109f5761109f611f03565b6000918252602090912001546001600160a01b031692915050565b6110c2611622565b6001600160a01b03811661110a5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015260640161067a565b6000600754116111535760405162461bcd60e51b8152602060048201526014602482015273273790333ab73239903a37903a3930b739b332b960611b604482015260640161067a565b600780546000918290556040519091906001600160a01b0384169083908381818185875af1925050503d80600081146111a8576040519150601f19603f3d011682016040523d82523d6000602084013e6111ad565b606091505b50509050806111f05760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161067a565b505050565b6111fd611622565b611205611b95565b60055461124b5760405162461bcd60e51b8152602060048201526014602482015273139bc81c1b185e595c9cc81d1bc81c99599d5b9960621b604482015260640161067a565b6005546000805b828110156113bf5760006005828154811061126f5761126f611f03565b60009182526020808320909101546001600160a01b0316808352600b90915260409091205490915080156113aa576001600160a01b0382166000818152600b602090815260408083208390556009909152808220805460ff191690555183929083908381818185875af1925050503d8060008114611309576040519150601f19603f3d011682016040523d82523d6000602084013e61130e565b606091505b50509050806113585760405162461bcd60e51b81526020600482015260166024820152751499599d5b99081d1c985b9cd9995c8819985a5b195960521b604482015260640161067a565b6113628287611ec7565b9550836001600160a01b03167f3367befd2b2f39615cd79917c2153263c4af1d3945ec003e5d5bfc13a8d858338360405161139f91815260200190565b60405180910390a250505b505080806113b790611f19565b915050611252565b50600c805460ff60a01b1916905560408051600081526020810191829052516113ea91600591611bee565b5060408051838152602081018390527f9f97ef2400be5b14e0697468c831e96e59bb11d1872740c533add66e3521537d910160405180910390a15050610cea60018055565b6060600580548060200260200160405190810160405280929190818152602001828054801561148757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611469575b5050505050905090565b60606008805480602002602001604051908101604052809291908181526020018280548015611487576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311611469575050505050905090565b6114f9611622565b6001600160a01b03811661155f5760405162461bcd60e51b815260206004820152602760248201527f4e65772074726561737572792063616e6e6f7420626520746865207a65726f206044820152666164647265737360c81b606482015260840161067a565b600680546001600160a01b0319166001600160a01b0383169081179091556040517fc714d22a2f08b695f81e7c707058db484aa5b4d6b4c9fd64beb10fe85832f60890600090a250565b6115b1611622565b6001600160a01b0381166116165760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161067a565b61161f81611b45565b50565b6000546001600160a01b03163314610cea5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067a565b61168860086000611c53565b6000805b6005548110156116f057600b6000600583815481106116ad576116ad611f03565b60009182526020808320909101546001600160a01b031683528201929092526040019020546116dc9083611ec7565b9150806116e881611f19565b91505061168c565b506000811161174d5760405162461bcd60e51b8152602060048201526024808201527f546f74616c20636f6e747269627574696f6e73206d75737420626520706f73696044820152637469766560e01b606482015260840161067a565b60006117598284611f98565b905060008060005b6005548110156117fc57600b60006005838154811061178257611782611f03565b60009182526020808320909101546001600160a01b031683528201929092526040019020546117b19084611ec7565b9250828410156117ea57600581815481106117ce576117ce611f03565b6000918252602090912001546001600160a01b031691506117fc565b806117f481611f19565b915050611761565b5060006007544761180d9190611eda565b9050600080806064611820856050611f32565b61182a9190611f67565b6001600160a01b0386166000908152600b60205260409020549091508110156118595783925060009150611876565b9150816064611869856014611f32565b6118739190611f67565b91505b6000856001600160a01b03168460405160006040518083038185875af1925050503d80600081146118c3576040519150601f19603f3d011682016040523d82523d6000602084013e6118c8565b606091505b50509050806119115760405162461bcd60e51b8152602060048201526015602482015274141c9a5e99481d1c985b9cd9995c8819985a5b1959605a1b604482015260640161067a565b82156119bc576006546040516000916001600160a01b03169085908381818185875af1925050503d8060008114611964576040519150601f19603f3d011682016040523d82523d6000602084013e611969565b606091505b50509050806119ba5760405162461bcd60e51b815260206004820152601860248201527f5472656173757279207472616e73666572206661696c65640000000000000000604482015260640161067a565b505b60088054600181019091557ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319166001600160a01b0388169081179091556000818152600b6020908152604091829020548251888152918201527f7e57d825a2478cc8123a008d7d1e20c0f6e8cbca89a7bc100c9b05ecb3698deb910160405180910390a260405167ffffffffffffffff8d1681527ffdd45ca0b53cc67af770583f046be250f4ed6e8fa7412fa42ca5565ba08051f59060200160405180910390a160005b600554811015611af257600060058281548110611aab57611aab611f03565b60009182526020808320909101546001600160a01b03168252600b8152604080832083905560099091529020805460ff191690555080611aea81611f19565b915050611a8c565b50600a8054906000611b0383611f19565b9091555050600c805460ff60a01b191690556040805160008152602081019182905251611b3291600591611bee565b505042600d555050505050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600260015403611be75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161067a565b6002600155565b828054828255906000526020600020908101928215611c43579160200282015b82811115611c4357825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611c0e565b50611c4f929150611c6d565b5090565b508054600082559060005260206000209081019061161f91905b5b80821115611c4f5760008155600101611c6e565b600060208284031215611c9457600080fd5b5035919050565b6001600160a01b038116811461161f57600080fd5b600060208284031215611cc257600080fd5b8135611ccd81611c9b565b9392505050565b600081518084526020808501945080840160005b83811015611d0457815187529582019590820190600101611ce8565b509495945050505050565b606080825284519082018190526000906020906080840190828801845b82811015611d515781516001600160a01b031684529284019290840190600101611d2c565b50505083810382850152611d658187611cd4565b9150508281036040840152611d7a8185611cd4565b9695505050505050565b67ffffffffffffffff8116811461161f57600080fd5b600080600060608486031215611daf57600080fd5b8335611dba81611d84565b92506020840135611dca81611c9b565b929592945050506040919091013590565b600060208284031215611ded57600080fd5b81358015158114611ccd57600080fd5b634e487b7160e01b600052602160045260246000fd5b6020810160028310611e3557634e487b7160e01b600052602160045260246000fd5b91905290565b6020808252825182820181905260009190848201906040850190845b81811015611e7c5783516001600160a01b031683529284019291840191600101611e57565b50909695505050505050565b600060208284031215611e9a57600080fd5b81516001600160801b0381168114611ccd57600080fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561091b5761091b611eb1565b8181038181111561091b5761091b611eb1565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600060018201611f2b57611f2b611eb1565b5060010190565b6000816000190483118215151615611f4c57611f4c611eb1565b500290565b634e487b7160e01b600052601260045260246000fd5b600082611f7657611f76611f51565b500490565b600060208284031215611f8d57600080fd5b8151611ccd81611d84565b600082611fa757611fa7611f51565b50069056fea2646970667358221220983fb72ea876b53e93a7811113f899c8198b35b1ca933467d92dbdc8ae84701064736f6c63430008100033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000007c817d793715baaee120624e6ce499b29aa105ac00000000000000000000000036825bf3fbdf5a29e2d5148bfe7dcf7b5639e32000000000000000000000000052deaa1c84233f7bb8c8a45baede41091c6165060000000000000000000000005df4707980440d7beb2ad83dfa0321889fb27aed

-----Decoded View---------------
Arg [0] : minEntranceFee (uint256): 10000000000000000
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] : 000000000000000000000000000000000000000000000000002386f26fc10000
Arg [1] : 0000000000000000000000007c817d793715baaee120624e6ce499b29aa105ac
Arg [2] : 00000000000000000000000036825bf3fbdf5a29e2d5148bfe7dcf7b5639e320
Arg [3] : 00000000000000000000000052deaa1c84233f7bb8c8a45baede41091c616506
Arg [4] : 0000000000000000000000005df4707980440d7beb2ad83dfa0321889fb27aed


Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.