ETH Price: $2,518.92 (+2.64%)
Gas: 0.65 Gwei

Contract

0x382776C06F19723f12D97AdaF481cdaCD350a45a
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Refund159205942022-11-07 20:40:11665 days ago1667853611IN
0x382776C0...CD350a45a
0 ETH0.0011644818.85401611
Refund159205942022-11-07 20:40:11665 days ago1667853611IN
0x382776C0...CD350a45a
0 ETH0.0011647218.85795465
Refund159205942022-11-07 20:40:11665 days ago1667853611IN
0x382776C0...CD350a45a
0 ETH0.0011622918.81862864
Refund159205942022-11-07 20:40:11665 days ago1667853611IN
0x382776C0...CD350a45a
0 ETH0.0011617618.81011858
Refund159205942022-11-07 20:40:11665 days ago1667853611IN
0x382776C0...CD350a45a
0 ETH0.0011617618.81011858
Refund159205942022-11-07 20:40:11665 days ago1667853611IN
0x382776C0...CD350a45a
0 ETH0.0011622918.81862864
Refund159205942022-11-07 20:40:11665 days ago1667853611IN
0x382776C0...CD350a45a
0 ETH0.0011622918.81862864
Refund159205942022-11-07 20:40:11665 days ago1667853611IN
0x382776C0...CD350a45a
0 ETH0.0011617618.81011858
Refund159205942022-11-07 20:40:11665 days ago1667853611IN
0x382776C0...CD350a45a
0 ETH0.0011622918.81862864
Refund159205932022-11-07 20:39:59665 days ago1667853599IN
0x382776C0...CD350a45a
0 ETH0.0011316318.32215168
Refund159205932022-11-07 20:39:59665 days ago1667853599IN
0x382776C0...CD350a45a
0 ETH0.0011316318.32215168
Refund159205932022-11-07 20:39:59665 days ago1667853599IN
0x382776C0...CD350a45a
0 ETH0.0011393718.44749444
Refund159205932022-11-07 20:39:59665 days ago1667853599IN
0x382776C0...CD350a45a
0 ETH0.0011346818.37155205
Refund159205932022-11-07 20:39:59665 days ago1667853599IN
0x382776C0...CD350a45a
0 ETH0.0011346818.37155205
Refund159205932022-11-07 20:39:59665 days ago1667853599IN
0x382776C0...CD350a45a
0 ETH0.0011346818.37155205
Refund159205932022-11-07 20:39:59665 days ago1667853599IN
0x382776C0...CD350a45a
0 ETH0.0011346818.37155205
Refund159205932022-11-07 20:39:59665 days ago1667853599IN
0x382776C0...CD350a45a
0 ETH0.0011332418.34828353
Refund159205932022-11-07 20:39:59665 days ago1667853599IN
0x382776C0...CD350a45a
0 ETH0.0011330218.34828353
Refund159205932022-11-07 20:39:59665 days ago1667853599IN
0x382776C0...CD350a45a
0 ETH0.0011332418.34828353
Refund159205932022-11-07 20:39:59665 days ago1667853599IN
0x382776C0...CD350a45a
0 ETH0.0011332418.34828353
Refund159205932022-11-07 20:39:59665 days ago1667853599IN
0x382776C0...CD350a45a
0 ETH0.0011316318.32215168
Refund159205932022-11-07 20:39:59665 days ago1667853599IN
0x382776C0...CD350a45a
0 ETH0.0011316318.32215168
Refund159205932022-11-07 20:39:59665 days ago1667853599IN
0x382776C0...CD350a45a
0 ETH0.0011965119.37647148
Refund159205932022-11-07 20:39:59665 days ago1667853599IN
0x382776C0...CD350a45a
0 ETH0.0011316318.32215168
Refund159205932022-11-07 20:39:59665 days ago1667853599IN
0x382776C0...CD350a45a
0 ETH0.0011307718.30834485
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
159205942022-11-07 20:40:11665 days ago1667853611
0x382776C0...CD350a45a
0.02 ETH
159205942022-11-07 20:40:11665 days ago1667853611
0x382776C0...CD350a45a
0.02 ETH
159205942022-11-07 20:40:11665 days ago1667853611
0x382776C0...CD350a45a
0.02 ETH
159205942022-11-07 20:40:11665 days ago1667853611
0x382776C0...CD350a45a
0.02 ETH
159205942022-11-07 20:40:11665 days ago1667853611
0x382776C0...CD350a45a
0.02 ETH
159205942022-11-07 20:40:11665 days ago1667853611
0x382776C0...CD350a45a
0.02 ETH
159205942022-11-07 20:40:11665 days ago1667853611
0x382776C0...CD350a45a
0.02 ETH
159205942022-11-07 20:40:11665 days ago1667853611
0x382776C0...CD350a45a
0.02 ETH
159205942022-11-07 20:40:11665 days ago1667853611
0x382776C0...CD350a45a
0.02 ETH
159205932022-11-07 20:39:59665 days ago1667853599
0x382776C0...CD350a45a
0.02 ETH
159205932022-11-07 20:39:59665 days ago1667853599
0x382776C0...CD350a45a
0.02 ETH
159205932022-11-07 20:39:59665 days ago1667853599
0x382776C0...CD350a45a
0.02 ETH
159205932022-11-07 20:39:59665 days ago1667853599
0x382776C0...CD350a45a
0.02 ETH
159205932022-11-07 20:39:59665 days ago1667853599
0x382776C0...CD350a45a
0.02 ETH
159205932022-11-07 20:39:59665 days ago1667853599
0x382776C0...CD350a45a
0.02 ETH
159205932022-11-07 20:39:59665 days ago1667853599
0x382776C0...CD350a45a
0.02 ETH
159205932022-11-07 20:39:59665 days ago1667853599
0x382776C0...CD350a45a
0.02 ETH
159205932022-11-07 20:39:59665 days ago1667853599
0x382776C0...CD350a45a
0.02 ETH
159205932022-11-07 20:39:59665 days ago1667853599
0x382776C0...CD350a45a
0.02 ETH
159205932022-11-07 20:39:59665 days ago1667853599
0x382776C0...CD350a45a
0.02 ETH
159205932022-11-07 20:39:59665 days ago1667853599
0x382776C0...CD350a45a
0.02 ETH
159205932022-11-07 20:39:59665 days ago1667853599
0x382776C0...CD350a45a
0.02 ETH
159205932022-11-07 20:39:59665 days ago1667853599
0x382776C0...CD350a45a
0.02 ETH
159205932022-11-07 20:39:59665 days ago1667853599
0x382776C0...CD350a45a
0.02 ETH
159205932022-11-07 20:39:59665 days ago1667853599
0x382776C0...CD350a45a
0.02 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Serenity

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 6 : 1_serenity.sol
// SPDX-License-Identifier: Proprietary

pragma solidity >=0.8.0 <0.9.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

contract Serenity is Ownable, Pausable, ReentrancyGuard {
    using EnumerableSet for EnumerableSet.AddressSet;

    struct StakeStatus {
        uint staked;
        uint alcohol;
        uint refunded;
    }

    event SerenityStake(address indexed staker, bool indexed alcoholic, uint stakeAmount, uint alcoholAmount);
    event SerenityAddAlcohol(address indexed staker, uint alcoholAmount);
    event SerenityUnstake(address indexed staker, uint unstakeAmount);
    event SerenityRefund(address indexed staker, uint refundAmount);
    event SerenityNewStakePrice(uint newStakeAmount);
    event SerenityNewAlcoholPrice(uint newAlcoholAmount);
    event SerenityNewAlcoholCollector(address indexed collector);
    event SerenityNewRefunder(address indexed refunder);
    event SerenityNewPartyStatus(uint8 newPartyStatus);

    mapping (address => StakeStatus) private stakers;
    EnumerableSet.AddressSet private stakedAddresses;
    uint private stakePrice;
    uint private alcoholPrice;
    address payable private alcoholCollector;
    uint8 private partyStatus; // 0 = before, 1 = during, 2 = after
    address private refunder;

    modifier beforeParty {
      require(partyStatus == 0);
      _;
    }

    modifier beforeOrDuringParty {
      require(partyStatus == 0 || partyStatus == 1);
      _;
    }

    modifier onlyRefunder {
        require(msg.sender == refunder);
        _;
    }

    constructor(uint stakePrice_, uint alcoholPrice_, address alcoholCollector_, address refunder_) {
        stakePrice = stakePrice_;
        alcoholPrice = alcoholPrice_;
        alcoholCollector = payable(alcoholCollector_);
        partyStatus = 0;
        refunder = refunder_;
    }

    function stake(bool alcohol) public payable whenNotPaused beforeOrDuringParty nonReentrant {
        StakeStatus memory status = stakers[msg.sender];
        
        require(status.staked == 0, "Already staked.");
        require(status.refunded == 0, "Already refunded.");
        
        uint requiredAlcoholAmount = alcohol ? alcoholPrice - status.alcohol : 0 ether;
        require(msg.value >= stakePrice + requiredAlcoholAmount, "Not enough ether sent.");

        if (alcohol && requiredAlcoholAmount > 0) {
            (bool alcoholSent, ) = alcoholCollector.call{value: requiredAlcoholAmount}("");
            require(alcoholSent, "Failed to send eth to alcohol collector.");
        }

        status.staked = stakePrice;
        status.alcohol += requiredAlcoholAmount;
        stakers[msg.sender] = status;
        stakedAddresses.add(msg.sender);

        // somehow, more eth was sent than necessary. immediately give it back
        if (msg.value > stakePrice + requiredAlcoholAmount) {
            uint overpaymentRefundAmount = msg.value - stakePrice - requiredAlcoholAmount;
            (bool overpaymentRefundSent, ) = payable(msg.sender).call{value: overpaymentRefundAmount}("");
            require(overpaymentRefundSent, "Failed to refund overpayment.");
        }

        emit SerenityStake(msg.sender, alcohol, stakePrice, requiredAlcoholAmount);
    }

    function addAlcohol() public payable whenNotPaused beforeOrDuringParty nonReentrant {
        StakeStatus memory status = stakers[msg.sender];
        
        require(status.staked > 0, "Not staked.");
        require(status.refunded == 0, "Already refunded.");
        require(status.alcohol == 0, "Already alcoholic.");
        require(msg.value >= alcoholPrice, "Not enough ether sent.");

        (bool alcoholSent, ) = alcoholCollector.call{value: alcoholPrice}("");
        require(alcoholSent, "Failed to send eth to alcohol collector.");

        status.alcohol = alcoholPrice;
        stakers[msg.sender] = status;

        // somehow, more eth was sent than necessary. immediately give it back
        if (msg.value > alcoholPrice) {
            uint overpaymentRefundAmount = msg.value - alcoholPrice;
            (bool overpaymentRefundSent, ) = payable(msg.sender).call{value: overpaymentRefundAmount}("");
            require(overpaymentRefundSent, "Failed to refund overpayment.");
        }

        emit SerenityAddAlcohol(msg.sender, alcoholPrice);
    }

    function unstake() public whenNotPaused beforeParty nonReentrant {
        StakeStatus memory status = stakers[msg.sender];
        
        require(status.staked > 0, "Not staked.");
        require(status.refunded == 0, "Already refunded.");

        (bool unstakeSent, ) = payable(msg.sender).call{value: status.staked}("");
        require(unstakeSent, "Failed to send eth to unstaker.");
        emit SerenityUnstake(msg.sender, status.staked);

        status.staked = 0;
        stakers[msg.sender] = status;
        stakedAddresses.remove(msg.sender);
    }

    function refund(address addy) public onlyRefunder {
        StakeStatus memory status = stakers[addy];
        
        require(status.staked > 0, "Not staked.");
        require(status.refunded == 0, "Already refunded.");

        (bool refundSent, ) = payable(addy).call{value: status.staked}("");
        require(refundSent, "Failed to refund eth to staker.");

        status.refunded = status.staked;
        stakers[addy] = status;

        emit SerenityRefund(msg.sender, status.staked);
    }

    function withdraw(address to) public onlyOwner {
        (bool withdrawSent, ) = payable(to).call{value: address(this).balance}("");
        require(withdrawSent, "Failed to withdraw eth.");
    }

    function getStatus(address addy) public view returns (uint staked, uint alcohol, uint refunded) {
        StakeStatus memory status = stakers[addy];
        
        staked = status.staked;
        alcohol = status.alcohol;
        refunded = status.refunded;
    }

    function getStakers() public view returns (address[] memory) {
        return stakedAddresses.values();
    }

    function setStakeAmount(uint newStakeAmount) public onlyOwner {
        stakePrice = newStakeAmount;
        emit SerenityNewStakePrice(newStakeAmount);
    }

    function setAlcoholAmount(uint newAlcoholAmount) public onlyOwner {
        alcoholPrice = newAlcoholAmount;
        emit SerenityNewAlcoholPrice(newAlcoholAmount);
    }

    function setAlcoholCollector(address newAlcoholCollector) public onlyOwner {
        alcoholCollector = payable(newAlcoholCollector);
        emit SerenityNewAlcoholCollector(newAlcoholCollector);
    }

    function setRefunder(address newRefunder) public onlyOwner {
        refunder = newRefunder;
        emit SerenityNewRefunder(newRefunder);
    }

    function setPartyStatus(uint8 newPartyStatus) public onlyOwner {
        partyStatus = newPartyStatus;
        emit SerenityNewPartyStatus(newPartyStatus);
    }

    function stakeAmount() public view returns (uint stakeAmount_) {
        stakeAmount_ = stakePrice;
    }

    function alcoholAmount() public view returns (uint alcoholAmount_) {
        alcoholAmount_ = alcoholPrice;
    }

    function getAlcoholCollector() public view returns (address collector) {
        collector = alcoholCollector;
    }

    function getRefunder() public view returns (address refunder_) {
        refunder_ = refunder;
    }

    function getPartyStatus() public view returns (uint8 partyStatus_) {
        partyStatus_ = partyStatus;
    }

    // don't allow accidental receipt of ether
    receive() external payable {
        revert();
    }

    // don't allow accidental function calls
    fallback() external payable {
        revert();
    }
}

File 2 of 6 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 *  Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.
 *  See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 *  In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 3 of 6 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 4 of 6 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 5 of 6 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing 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 6 of 6 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"stakePrice_","type":"uint256"},{"internalType":"uint256","name":"alcoholPrice_","type":"uint256"},{"internalType":"address","name":"alcoholCollector_","type":"address"},{"internalType":"address","name":"refunder_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"alcoholAmount","type":"uint256"}],"name":"SerenityAddAlcohol","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collector","type":"address"}],"name":"SerenityNewAlcoholCollector","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newAlcoholAmount","type":"uint256"}],"name":"SerenityNewAlcoholPrice","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"newPartyStatus","type":"uint8"}],"name":"SerenityNewPartyStatus","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"refunder","type":"address"}],"name":"SerenityNewRefunder","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newStakeAmount","type":"uint256"}],"name":"SerenityNewStakePrice","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"refundAmount","type":"uint256"}],"name":"SerenityRefund","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":true,"internalType":"bool","name":"alcoholic","type":"bool"},{"indexed":false,"internalType":"uint256","name":"stakeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"alcoholAmount","type":"uint256"}],"name":"SerenityStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"unstakeAmount","type":"uint256"}],"name":"SerenityUnstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"addAlcohol","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"alcoholAmount","outputs":[{"internalType":"uint256","name":"alcoholAmount_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAlcoholCollector","outputs":[{"internalType":"address","name":"collector","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPartyStatus","outputs":[{"internalType":"uint8","name":"partyStatus_","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRefunder","outputs":[{"internalType":"address","name":"refunder_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStakers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addy","type":"address"}],"name":"getStatus","outputs":[{"internalType":"uint256","name":"staked","type":"uint256"},{"internalType":"uint256","name":"alcohol","type":"uint256"},{"internalType":"uint256","name":"refunded","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addy","type":"address"}],"name":"refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newAlcoholAmount","type":"uint256"}],"name":"setAlcoholAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAlcoholCollector","type":"address"}],"name":"setAlcoholCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"newPartyStatus","type":"uint8"}],"name":"setPartyStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRefunder","type":"address"}],"name":"setRefunder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newStakeAmount","type":"uint256"}],"name":"setStakeAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"alcohol","type":"bool"}],"name":"stake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"stakeAmount","outputs":[{"internalType":"uint256","name":"stakeAmount_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b506040516200172638038062001726833981016040819052620000349162000102565b6200003f3362000095565b6000805460ff60a01b1916905560018055600593909355600691909155600780546001600160a01b039283166001600160a81b0319909116179055600880546001600160a01b031916919092161790556200014d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000fd57600080fd5b919050565b600080600080608085870312156200011957600080fd5b84519350602085015192506200013260408601620000e5565b91506200014260608601620000e5565b905092959194509250565b6115c9806200015d6000396000f3fe60806040526004361061012e5760003560e01c806379c0802b116100ab578063b629ba351161006f578063b629ba3514610352578063d74b27221461037e578063df0cc9cd1461039e578063ed039667146103bc578063f2fde38b146103dc578063fa89401a146103fc57600080fd5b806379c0802b146102c75780637c1b9cba146102e75780637fab9e46146103195780638da5cb5b1461032c578063af10ea311461034a57600080fd5b806351cff8d9116100f257806351cff8d9146102345780635c975abb1461025457806360959f501461027e57806360c7dc471461029d578063715018a6146102b257600080fd5b8063108daa2f1461013d5780632def66201461015f57806330ccebb51461017457806343352d61146101f257806343808c501461021457600080fd5b3661013857600080fd5b600080fd5b34801561014957600080fd5b5061015d610158366004611388565b61041c565b005b34801561016b57600080fd5b5061015d610460565b34801561018057600080fd5b506101d261018f3660046113a1565b6001600160a01b03166000908152600260208181526040928390208351606081018552815480825260018301549382018490529190930154929093018290529192565b604080519384526020840192909252908201526060015b60405180910390f35b3480156101fe57600080fd5b50610207610631565b6040516101e991906113ca565b34801561022057600080fd5b5061015d61022f366004611388565b610642565b34801561024057600080fd5b5061015d61024f3660046113a1565b61067f565b34801561026057600080fd5b50600054600160a01b900460ff1660405190151581526020016101e9565b34801561028a57600080fd5b506006545b6040519081526020016101e9565b3480156102a957600080fd5b5060055461028f565b3480156102be57600080fd5b5061015d61072e565b3480156102d357600080fd5b5061015d6102e23660046113a1565b610742565b3480156102f357600080fd5b506007546001600160a01b03165b6040516001600160a01b0390911681526020016101e9565b61015d610327366004611417565b610794565b34801561033857600080fd5b506000546001600160a01b0316610301565b61015d610aed565b34801561035e57600080fd5b50600754600160a01b900460ff1660405160ff90911681526020016101e9565b34801561038a57600080fd5b5061015d6103993660046113a1565b610de7565b3480156103aa57600080fd5b506008546001600160a01b0316610301565b3480156103c857600080fd5b5061015d6103d7366004611439565b610e39565b3480156103e857600080fd5b5061015d6103f73660046113a1565b610e8f565b34801561040857600080fd5b5061015d6104173660046113a1565b610f08565b6104246110ac565b60068190556040518181527f7bcaf1ca2f48d0691ebd2d3b8321bbb5998ee9828a96fd9ae5fc637f8c83aa02906020015b60405180910390a150565b610468611106565b600754600160a01b900460ff161561047f57600080fd5b6002600154036104aa5760405162461bcd60e51b81526004016104a19061145c565b60405180910390fd5b60026001818155336000908152602083815260409182902082516060810184528154808252948201549281019290925290930154908301526104fe5760405162461bcd60e51b81526004016104a190611493565b6040810151156105205760405162461bcd60e51b81526004016104a1906114b8565b805160405160009133918381818185875af1925050503d8060008114610562576040519150601f19603f3d011682016040523d82523d6000602084013e610567565b606091505b50509050806105b85760405162461bcd60e51b815260206004820152601f60248201527f4661696c656420746f2073656e642065746820746f20756e7374616b65722e0060448201526064016104a1565b815160405190815233907f9a1aedae05d8e9f5e36601466e0e081fe5d92f55652f375cdc536daba69a8f829060200160405180910390a260008083523380825260026020818152604093849020865181559086015160018201559285015192019190915561062890600390611153565b50506001805550565b606061063d6003611171565b905090565b61064a6110ac565b60058190556040518181527f9ac92efaa0f206fa9bb72a2ead59c8ca2135492f7c0d9fe1fb93ee416220e47890602001610455565b6106876110ac565b6000816001600160a01b03164760405160006040518083038185875af1925050503d80600081146106d4576040519150601f19603f3d011682016040523d82523d6000602084013e6106d9565b606091505b505090508061072a5760405162461bcd60e51b815260206004820152601760248201527f4661696c656420746f207769746864726177206574682e00000000000000000060448201526064016104a1565b5050565b6107366110ac565b6107406000611185565b565b61074a6110ac565b600780546001600160a01b0319166001600160a01b0383169081179091556040517fa37031a52eb05e20a38f57dec59178ed44d3f2e72a216cc83c4ae82d7fa7c8c290600090a250565b61079c611106565b600754600160a01b900460ff1615806107c15750600754600160a01b900460ff166001145b6107ca57600080fd5b6002600154036107ec5760405162461bcd60e51b81526004016104a19061145c565b6002600181815533600090815260208381526040918290208251606081018452815480825294820154928101929092529093015490830152156108635760405162461bcd60e51b815260206004820152600f60248201526e20b63932b0b23c9039ba30b5b2b21760891b60448201526064016104a1565b6040810151156108855760405162461bcd60e51b81526004016104a1906114b8565b6000826108935760006108a5565b81602001516006546108a591906114f9565b9050806005546108b5919061150c565b3410156108fd5760405162461bcd60e51b81526020600482015260166024820152752737ba1032b737bab3b41032ba3432b91039b2b73a1760511b60448201526064016104a1565b82801561090a5750600081115b15610984576007546040516000916001600160a01b03169083908381818185875af1925050503d806000811461095c576040519150601f19603f3d011682016040523d82523d6000602084013e610961565b606091505b50509050806109825760405162461bcd60e51b81526004016104a19061151f565b505b600554825260208201805182919061099d90839061150c565b9052503360008181526002602081815260409283902086518155908601516001820155918501519101556109d3906003906111d5565b50806005546109e2919061150c565b341115610aa257600081600554346109fa91906114f9565b610a0491906114f9565b604051909150600090339083908381818185875af1925050503d8060008114610a49576040519150601f19603f3d011682016040523d82523d6000602084013e610a4e565b606091505b5050905080610a9f5760405162461bcd60e51b815260206004820152601d60248201527f4661696c656420746f20726566756e64206f7665727061796d656e742e00000060448201526064016104a1565b50505b60055460408051918252602082018390528415159133917f320e3ac205778eb6c92e450e41c3996b365da34d216dbd1deaac6f6b9b063259910160405180910390a350506001805550565b610af5611106565b600754600160a01b900460ff161580610b1a5750600754600160a01b900460ff166001145b610b2357600080fd5b600260015403610b455760405162461bcd60e51b81526004016104a19061145c565b6002600181815533600090815260208381526040918290208251606081018452815480825294820154928101929092529093015490830152610b995760405162461bcd60e51b81526004016104a190611493565b604081015115610bbb5760405162461bcd60e51b81526004016104a1906114b8565b602081015115610c025760405162461bcd60e51b815260206004820152601260248201527120b63932b0b23c9030b631b7b437b634b19760711b60448201526064016104a1565b600654341015610c4d5760405162461bcd60e51b81526020600482015260166024820152752737ba1032b737bab3b41032ba3432b91039b2b73a1760511b60448201526064016104a1565b6007546006546040516000926001600160a01b031691908381818185875af1925050503d8060008114610c9c576040519150601f19603f3d011682016040523d82523d6000602084013e610ca1565b606091505b5050905080610cc25760405162461bcd60e51b81526004016104a19061151f565b600680546020808501918252336000908152600291829052604090819020865181559251600184015585015191015554341115610da757600060065434610d0991906114f9565b604051909150600090339083908381818185875af1925050503d8060008114610d4e576040519150601f19603f3d011682016040523d82523d6000602084013e610d53565b606091505b5050905080610da45760405162461bcd60e51b815260206004820152601d60248201527f4661696c656420746f20726566756e64206f7665727061796d656e742e00000060448201526064016104a1565b50505b60065460405190815233907f42b2331f4a9e7f8b3b87dd98947c9ced960f30786cca133ad1a2d146ea74bab69060200160405180910390a2505060018055565b610def6110ac565b600880546001600160a01b0319166001600160a01b0383169081179091556040517f92e90c1b94ca587a44eff77f330d9482d7004c112f6dcc52445274b4f87f133990600090a250565b610e416110ac565b6007805460ff60a01b1916600160a01b60ff8416908102919091179091556040519081527fa91a1fa2620a2d2066c1ed0016380d04cf5afbad6fe2b2905f183517c441610b90602001610455565b610e976110ac565b6001600160a01b038116610efc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104a1565b610f0581611185565b50565b6008546001600160a01b03163314610f1f57600080fd5b6001600160a01b038116600090815260026020818152604092839020835160608101855281548082526001830154938201939093529201549282019290925290610f7b5760405162461bcd60e51b81526004016104a190611493565b604081015115610f9d5760405162461bcd60e51b81526004016104a1906114b8565b80516040516000916001600160a01b038516918381818185875af1925050503d8060008114610fe8576040519150601f19603f3d011682016040523d82523d6000602084013e610fed565b606091505b505090508061103e5760405162461bcd60e51b815260206004820152601f60248201527f4661696c656420746f20726566756e642065746820746f207374616b65722e0060448201526064016104a1565b815160408084019182526001600160a01b0385166000908152600260208181529183902086518082558388015160018301559451910155905191825233917fed081be009e88565c6e7e442efc411b4cc1336497ee612fed74c87dc4adce4d8910160405180910390a2505050565b6000546001600160a01b031633146107405760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104a1565b600054600160a01b900460ff16156107405760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016104a1565b6000611168836001600160a01b0384166111ea565b90505b92915050565b6060600061117e836112dd565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000611168836001600160a01b038416611339565b600081815260018301602052604081205480156112d357600061120e6001836114f9565b8554909150600090611222906001906114f9565b905081811461128757600086600001828154811061124257611242611567565b906000526020600020015490508087600001848154811061126557611265611567565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806112985761129861157d565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061116b565b600091505061116b565b60608160000180548060200260200160405190810160405280929190818152602001828054801561132d57602002820191906000526020600020905b815481526020019060010190808311611319575b50505050509050919050565b60008181526001830160205260408120546113805750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561116b565b50600061116b565b60006020828403121561139a57600080fd5b5035919050565b6000602082840312156113b357600080fd5b81356001600160a01b038116811461117e57600080fd5b6020808252825182820181905260009190848201906040850190845b8181101561140b5783516001600160a01b0316835292840192918401916001016113e6565b50909695505050505050565b60006020828403121561142957600080fd5b8135801515811461117e57600080fd5b60006020828403121561144b57600080fd5b813560ff8116811461117e57600080fd5b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252600b908201526a2737ba1039ba30b5b2b21760a91b604082015260600190565b60208082526011908201527020b63932b0b23c903932b33ab73232b21760791b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561116b5761116b6114e3565b8082018082111561116b5761116b6114e3565b60208082526028908201527f4661696c656420746f2073656e642065746820746f20616c636f686f6c20636f604082015267363632b1ba37b91760c11b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fdfea2646970667358221220bed307275c68d9eb4710facf57d81c6fbf8f2ec3e44922605fbdf01e7977e24864736f6c6343000811003300000000000000000000000000000000000000000000000000470de4df82000000000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000003d0b30f13405a41ec8e4eada792c72952db8355c000000000000000000000000b40dcdaff983f05be814c87972e58895abb09585

Deployed Bytecode

0x60806040526004361061012e5760003560e01c806379c0802b116100ab578063b629ba351161006f578063b629ba3514610352578063d74b27221461037e578063df0cc9cd1461039e578063ed039667146103bc578063f2fde38b146103dc578063fa89401a146103fc57600080fd5b806379c0802b146102c75780637c1b9cba146102e75780637fab9e46146103195780638da5cb5b1461032c578063af10ea311461034a57600080fd5b806351cff8d9116100f257806351cff8d9146102345780635c975abb1461025457806360959f501461027e57806360c7dc471461029d578063715018a6146102b257600080fd5b8063108daa2f1461013d5780632def66201461015f57806330ccebb51461017457806343352d61146101f257806343808c501461021457600080fd5b3661013857600080fd5b600080fd5b34801561014957600080fd5b5061015d610158366004611388565b61041c565b005b34801561016b57600080fd5b5061015d610460565b34801561018057600080fd5b506101d261018f3660046113a1565b6001600160a01b03166000908152600260208181526040928390208351606081018552815480825260018301549382018490529190930154929093018290529192565b604080519384526020840192909252908201526060015b60405180910390f35b3480156101fe57600080fd5b50610207610631565b6040516101e991906113ca565b34801561022057600080fd5b5061015d61022f366004611388565b610642565b34801561024057600080fd5b5061015d61024f3660046113a1565b61067f565b34801561026057600080fd5b50600054600160a01b900460ff1660405190151581526020016101e9565b34801561028a57600080fd5b506006545b6040519081526020016101e9565b3480156102a957600080fd5b5060055461028f565b3480156102be57600080fd5b5061015d61072e565b3480156102d357600080fd5b5061015d6102e23660046113a1565b610742565b3480156102f357600080fd5b506007546001600160a01b03165b6040516001600160a01b0390911681526020016101e9565b61015d610327366004611417565b610794565b34801561033857600080fd5b506000546001600160a01b0316610301565b61015d610aed565b34801561035e57600080fd5b50600754600160a01b900460ff1660405160ff90911681526020016101e9565b34801561038a57600080fd5b5061015d6103993660046113a1565b610de7565b3480156103aa57600080fd5b506008546001600160a01b0316610301565b3480156103c857600080fd5b5061015d6103d7366004611439565b610e39565b3480156103e857600080fd5b5061015d6103f73660046113a1565b610e8f565b34801561040857600080fd5b5061015d6104173660046113a1565b610f08565b6104246110ac565b60068190556040518181527f7bcaf1ca2f48d0691ebd2d3b8321bbb5998ee9828a96fd9ae5fc637f8c83aa02906020015b60405180910390a150565b610468611106565b600754600160a01b900460ff161561047f57600080fd5b6002600154036104aa5760405162461bcd60e51b81526004016104a19061145c565b60405180910390fd5b60026001818155336000908152602083815260409182902082516060810184528154808252948201549281019290925290930154908301526104fe5760405162461bcd60e51b81526004016104a190611493565b6040810151156105205760405162461bcd60e51b81526004016104a1906114b8565b805160405160009133918381818185875af1925050503d8060008114610562576040519150601f19603f3d011682016040523d82523d6000602084013e610567565b606091505b50509050806105b85760405162461bcd60e51b815260206004820152601f60248201527f4661696c656420746f2073656e642065746820746f20756e7374616b65722e0060448201526064016104a1565b815160405190815233907f9a1aedae05d8e9f5e36601466e0e081fe5d92f55652f375cdc536daba69a8f829060200160405180910390a260008083523380825260026020818152604093849020865181559086015160018201559285015192019190915561062890600390611153565b50506001805550565b606061063d6003611171565b905090565b61064a6110ac565b60058190556040518181527f9ac92efaa0f206fa9bb72a2ead59c8ca2135492f7c0d9fe1fb93ee416220e47890602001610455565b6106876110ac565b6000816001600160a01b03164760405160006040518083038185875af1925050503d80600081146106d4576040519150601f19603f3d011682016040523d82523d6000602084013e6106d9565b606091505b505090508061072a5760405162461bcd60e51b815260206004820152601760248201527f4661696c656420746f207769746864726177206574682e00000000000000000060448201526064016104a1565b5050565b6107366110ac565b6107406000611185565b565b61074a6110ac565b600780546001600160a01b0319166001600160a01b0383169081179091556040517fa37031a52eb05e20a38f57dec59178ed44d3f2e72a216cc83c4ae82d7fa7c8c290600090a250565b61079c611106565b600754600160a01b900460ff1615806107c15750600754600160a01b900460ff166001145b6107ca57600080fd5b6002600154036107ec5760405162461bcd60e51b81526004016104a19061145c565b6002600181815533600090815260208381526040918290208251606081018452815480825294820154928101929092529093015490830152156108635760405162461bcd60e51b815260206004820152600f60248201526e20b63932b0b23c9039ba30b5b2b21760891b60448201526064016104a1565b6040810151156108855760405162461bcd60e51b81526004016104a1906114b8565b6000826108935760006108a5565b81602001516006546108a591906114f9565b9050806005546108b5919061150c565b3410156108fd5760405162461bcd60e51b81526020600482015260166024820152752737ba1032b737bab3b41032ba3432b91039b2b73a1760511b60448201526064016104a1565b82801561090a5750600081115b15610984576007546040516000916001600160a01b03169083908381818185875af1925050503d806000811461095c576040519150601f19603f3d011682016040523d82523d6000602084013e610961565b606091505b50509050806109825760405162461bcd60e51b81526004016104a19061151f565b505b600554825260208201805182919061099d90839061150c565b9052503360008181526002602081815260409283902086518155908601516001820155918501519101556109d3906003906111d5565b50806005546109e2919061150c565b341115610aa257600081600554346109fa91906114f9565b610a0491906114f9565b604051909150600090339083908381818185875af1925050503d8060008114610a49576040519150601f19603f3d011682016040523d82523d6000602084013e610a4e565b606091505b5050905080610a9f5760405162461bcd60e51b815260206004820152601d60248201527f4661696c656420746f20726566756e64206f7665727061796d656e742e00000060448201526064016104a1565b50505b60055460408051918252602082018390528415159133917f320e3ac205778eb6c92e450e41c3996b365da34d216dbd1deaac6f6b9b063259910160405180910390a350506001805550565b610af5611106565b600754600160a01b900460ff161580610b1a5750600754600160a01b900460ff166001145b610b2357600080fd5b600260015403610b455760405162461bcd60e51b81526004016104a19061145c565b6002600181815533600090815260208381526040918290208251606081018452815480825294820154928101929092529093015490830152610b995760405162461bcd60e51b81526004016104a190611493565b604081015115610bbb5760405162461bcd60e51b81526004016104a1906114b8565b602081015115610c025760405162461bcd60e51b815260206004820152601260248201527120b63932b0b23c9030b631b7b437b634b19760711b60448201526064016104a1565b600654341015610c4d5760405162461bcd60e51b81526020600482015260166024820152752737ba1032b737bab3b41032ba3432b91039b2b73a1760511b60448201526064016104a1565b6007546006546040516000926001600160a01b031691908381818185875af1925050503d8060008114610c9c576040519150601f19603f3d011682016040523d82523d6000602084013e610ca1565b606091505b5050905080610cc25760405162461bcd60e51b81526004016104a19061151f565b600680546020808501918252336000908152600291829052604090819020865181559251600184015585015191015554341115610da757600060065434610d0991906114f9565b604051909150600090339083908381818185875af1925050503d8060008114610d4e576040519150601f19603f3d011682016040523d82523d6000602084013e610d53565b606091505b5050905080610da45760405162461bcd60e51b815260206004820152601d60248201527f4661696c656420746f20726566756e64206f7665727061796d656e742e00000060448201526064016104a1565b50505b60065460405190815233907f42b2331f4a9e7f8b3b87dd98947c9ced960f30786cca133ad1a2d146ea74bab69060200160405180910390a2505060018055565b610def6110ac565b600880546001600160a01b0319166001600160a01b0383169081179091556040517f92e90c1b94ca587a44eff77f330d9482d7004c112f6dcc52445274b4f87f133990600090a250565b610e416110ac565b6007805460ff60a01b1916600160a01b60ff8416908102919091179091556040519081527fa91a1fa2620a2d2066c1ed0016380d04cf5afbad6fe2b2905f183517c441610b90602001610455565b610e976110ac565b6001600160a01b038116610efc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104a1565b610f0581611185565b50565b6008546001600160a01b03163314610f1f57600080fd5b6001600160a01b038116600090815260026020818152604092839020835160608101855281548082526001830154938201939093529201549282019290925290610f7b5760405162461bcd60e51b81526004016104a190611493565b604081015115610f9d5760405162461bcd60e51b81526004016104a1906114b8565b80516040516000916001600160a01b038516918381818185875af1925050503d8060008114610fe8576040519150601f19603f3d011682016040523d82523d6000602084013e610fed565b606091505b505090508061103e5760405162461bcd60e51b815260206004820152601f60248201527f4661696c656420746f20726566756e642065746820746f207374616b65722e0060448201526064016104a1565b815160408084019182526001600160a01b0385166000908152600260208181529183902086518082558388015160018301559451910155905191825233917fed081be009e88565c6e7e442efc411b4cc1336497ee612fed74c87dc4adce4d8910160405180910390a2505050565b6000546001600160a01b031633146107405760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104a1565b600054600160a01b900460ff16156107405760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016104a1565b6000611168836001600160a01b0384166111ea565b90505b92915050565b6060600061117e836112dd565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000611168836001600160a01b038416611339565b600081815260018301602052604081205480156112d357600061120e6001836114f9565b8554909150600090611222906001906114f9565b905081811461128757600086600001828154811061124257611242611567565b906000526020600020015490508087600001848154811061126557611265611567565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806112985761129861157d565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061116b565b600091505061116b565b60608160000180548060200260200160405190810160405280929190818152602001828054801561132d57602002820191906000526020600020905b815481526020019060010190808311611319575b50505050509050919050565b60008181526001830160205260408120546113805750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561116b565b50600061116b565b60006020828403121561139a57600080fd5b5035919050565b6000602082840312156113b357600080fd5b81356001600160a01b038116811461117e57600080fd5b6020808252825182820181905260009190848201906040850190845b8181101561140b5783516001600160a01b0316835292840192918401916001016113e6565b50909695505050505050565b60006020828403121561142957600080fd5b8135801515811461117e57600080fd5b60006020828403121561144b57600080fd5b813560ff8116811461117e57600080fd5b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252600b908201526a2737ba1039ba30b5b2b21760a91b604082015260600190565b60208082526011908201527020b63932b0b23c903932b33ab73232b21760791b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561116b5761116b6114e3565b8082018082111561116b5761116b6114e3565b60208082526028908201527f4661696c656420746f2073656e642065746820746f20616c636f686f6c20636f604082015267363632b1ba37b91760c11b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fdfea2646970667358221220bed307275c68d9eb4710facf57d81c6fbf8f2ec3e44922605fbdf01e7977e24864736f6c63430008110033

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

00000000000000000000000000000000000000000000000000470de4df82000000000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000003d0b30f13405a41ec8e4eada792c72952db8355c000000000000000000000000b40dcdaff983f05be814c87972e58895abb09585

-----Decoded View---------------
Arg [0] : stakePrice_ (uint256): 20000000000000000
Arg [1] : alcoholPrice_ (uint256): 20000000000000000
Arg [2] : alcoholCollector_ (address): 0x3D0B30F13405a41ec8E4eaDA792c72952DB8355C
Arg [3] : refunder_ (address): 0xB40DcDaFF983f05BE814C87972e58895ABB09585

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000470de4df820000
Arg [1] : 00000000000000000000000000000000000000000000000000470de4df820000
Arg [2] : 0000000000000000000000003d0b30f13405a41ec8e4eada792c72952db8355c
Arg [3] : 000000000000000000000000b40dcdaff983f05be814c87972e58895abb09585


Block Transaction Difficulty 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
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.