Source Code
Latest 25 from a total of 1,792 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Video Poker_Repl... | 101843035 | 954 days ago | IN | 0 ETH | 0.00008171 | ||||
| Video Poker_Star... | 101842908 | 954 days ago | IN | 0.01285958 ETH | 0.00008959 | ||||
| Video Poker_Repl... | 101725338 | 954 days ago | IN | 0 ETH | 0.00005632 | ||||
| Video Poker_Star... | 101725198 | 954 days ago | IN | 0.00204466 ETH | 0.00007363 | ||||
| Video Poker_Star... | 100782958 | 957 days ago | IN | 0.00241908 ETH | 0.00008541 | ||||
| Video Poker_Repl... | 100767024 | 957 days ago | IN | 0.00246313 ETH | 0.00009138 | ||||
| Video Poker_Star... | 100766834 | 957 days ago | IN | 0.00246313 ETH | 0.00008295 | ||||
| Video Poker_Repl... | 100765637 | 957 days ago | IN | 0.00246313 ETH | 0.0000938 | ||||
| Video Poker_Star... | 100765392 | 957 days ago | IN | 0.00246313 ETH | 0.00008547 | ||||
| Video Poker_Star... | 100765289 | 957 days ago | IN | 0.00217681 ETH | 0.00005811 | ||||
| Video Poker_Repl... | 100689244 | 957 days ago | IN | 0.00186846 ETH | 0.00007694 | ||||
| Video Poker_Star... | 100688970 | 957 days ago | IN | 0.00186846 ETH | 0.00007416 | ||||
| Video Poker_Repl... | 100688478 | 957 days ago | IN | 0 ETH | 0.00005932 | ||||
| Video Poker_Star... | 100688245 | 957 days ago | IN | 0.00186846 ETH | 0.00007416 | ||||
| Video Poker_Repl... | 100346074 | 958 days ago | IN | 0 ETH | 0.00005883 | ||||
| Video Poker_Star... | 100345886 | 958 days ago | IN | 0.00195656 ETH | 0.00007204 | ||||
| Video Poker_Repl... | 100345591 | 958 days ago | IN | 0.00195656 ETH | 0.00007725 | ||||
| Video Poker_Star... | 100345328 | 958 days ago | IN | 0.00195656 ETH | 0.00007136 | ||||
| Video Poker_Repl... | 100345062 | 958 days ago | IN | 0.00195656 ETH | 0.00007626 | ||||
| Video Poker_Star... | 100344814 | 958 days ago | IN | 0.00195656 ETH | 0.00007357 | ||||
| Video Poker_Repl... | 99699957 | 960 days ago | IN | 0 ETH | 0.00005776 | ||||
| Video Poker_Star... | 99699756 | 960 days ago | IN | 0.00211073 ETH | 0.00007533 | ||||
| Video Poker_Repl... | 99355568 | 961 days ago | IN | 0.00213276 ETH | 0.00008553 | ||||
| Video Poker_Star... | 99355320 | 961 days ago | IN | 0.00213276 ETH | 0.00008043 | ||||
| Video Poker_Repl... | 99028862 | 962 days ago | IN | 0.00224288 ETH | 0.00008982 |
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 101843035 | 954 days ago | 0.01 ETH | ||||
| 101842908 | 954 days ago | 0.00023496 ETH | ||||
| 101842908 | 954 days ago | 0.00262461 ETH | ||||
| 101725198 | 954 days ago | 0.00016087 ETH | ||||
| 101725198 | 954 days ago | 0.00188378 ETH | ||||
| 100782958 | 957 days ago | 0.00019491 ETH | ||||
| 100782958 | 957 days ago | 0.00222416 ETH | ||||
| 100767024 | 957 days ago | 0.00019892 ETH | ||||
| 100767024 | 957 days ago | 0.00226421 ETH | ||||
| 100766834 | 957 days ago | 0.00019892 ETH | ||||
| 100766834 | 957 days ago | 0.00226421 ETH | ||||
| 100765637 | 957 days ago | 0.00019892 ETH | ||||
| 100765637 | 957 days ago | 0.00226421 ETH | ||||
| 100765392 | 957 days ago | 0.00019892 ETH | ||||
| 100765392 | 957 days ago | 0.00226421 ETH | ||||
| 100689244 | 957 days ago | 0.00014486 ETH | ||||
| 100689244 | 957 days ago | 0.0017236 ETH | ||||
| 100688970 | 957 days ago | 0.00014486 ETH | ||||
| 100688970 | 957 days ago | 0.0017236 ETH | ||||
| 100688245 | 957 days ago | 0.00014486 ETH | ||||
| 100688245 | 957 days ago | 0.0017236 ETH | ||||
| 100345886 | 958 days ago | 0.00015286 ETH | ||||
| 100345886 | 958 days ago | 0.00180369 ETH | ||||
| 100345591 | 958 days ago | 0.00015286 ETH | ||||
| 100345591 | 958 days ago | 0.00180369 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
VideoPoker
Compiler Version
v0.8.11+commit.d7f03943
Optimization Enabled:
Yes with 10000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
import "./Common.sol";
/**
* @title video poker game, players get dealt a 5 card hand and can replace any number of cards to form winning combinations
*/
contract VideoPoker is Common {
using SafeERC20 for IERC20;
constructor(address _bankroll, address _vrf) {
Bankroll = IBankRoll(_bankroll);
randomizer = _vrf;
VRFgasLimit = 2000000;
for (uint8 s = 0; s < 4; s++) {
for (uint8 n = 1; n < 14; n++) {
initialDeck.push(Card(n, s));
}
}
}
struct Card {
uint8 number;
uint8 suit;
}
struct VideoPokerGame {
uint256 wager;
uint256 requestID;
address tokenAddress;
uint64 blockNumber;
Card[5] cardsInHand;
bool[5] toReplace;
bool ingame;
bool isFirstRequest;
}
struct VRFData {
uint256 id;
uint256 feePayed;
}
Card[] initialDeck;
mapping(address => VideoPokerGame) videoPokerGames;
mapping(uint256 => address) videoPokerIDs;
mapping(address => VRFData) vrfdata;
/**
* @dev event emitted by the VRF callback with the intial 5 card hand
* @param playerAddress address of the player that made the bet
* @param playerHand initial player Hand
*/
event VideoPoker_Start_Event(
address indexed playerAddress,
Card[5] playerHand
);
/**
* @dev event emitted by the VRF callback with the final results
* @param playerAddress address of the player that made the bet
* @param wager wager amount
* @param payout total payout transfered to the player
* @param tokenAddress address of token the wager was made and payout, 0 address is considered the native coin
* @param playerHand final player Hand
* @param outcome result of final hand, 0-> no winning combination
*/
event VideoPoker_Outcome_Event(
address indexed playerAddress,
uint256 wager,
uint256 payout,
address tokenAddress,
Card[5] playerHand,
uint256 outcome
);
/**
* @dev event emitted when a refund is done in video poker
* @param player address of the player reciving the refund
* @param wager amount of wager that was refunded
* @param tokenAddress address of token the refund was made in
*/
event VideoPoker_Refund_Event(
address indexed player,
uint256 wager,
address tokenAddress
);
error AlreadyInGame();
error NotInGame();
error AwaitingVRF(uint256 requestID);
error NoFeeRequired();
error NoRequestPending();
error BlockNumberTooLow(uint256 have, uint256 want);
/**
* @dev Function to get current state of video Poker
* @param player address of player to view game state
* @return videopokerState current state of game of the player
*/
function VideoPoker_GetState(
address player
) external view returns (VideoPokerGame memory videopokerState) {
videopokerState = videoPokerGames[player];
return videopokerState;
}
/**
* @dev Function to start Video poker, takes the user wager saves bet parameters and makes a request to the VRF
* @param wager wager amount
* @param tokenAddress address of token to bet, 0 address is considered the native coin
*/
function VideoPoker_Start(
uint256 wager,
address tokenAddress
) external payable nonReentrant {
VideoPokerGame storage game = videoPokerGames[msg.sender];
if (game.requestID != 0) {
revert AwaitingVRF(game.requestID);
}
if (game.ingame) {
revert AlreadyInGame();
}
VRFData storage data = vrfdata[msg.sender];
uint256[2] memory fees = IRandomizer(randomizer).getFeeStats(data.id);
if (fees[0] > fees[1] && data.feePayed > fees[0] - fees[1]) {
IRandomizer(randomizer).clientWithdrawTo(
msg.sender,
((data.feePayed - (fees[0] - fees[1])) * 90) / 100
);
}
_kellyWager(wager, tokenAddress);
uint256 feePayed = _transferWager(tokenAddress, wager);
uint256 id = _requestRandomWords(1);
videoPokerIDs[id] = msg.sender;
game.tokenAddress = tokenAddress;
game.wager = wager;
game.isFirstRequest = true;
game.requestID = id;
game.blockNumber = uint64(block.number);
game.ingame = true;
vrfdata[msg.sender] = VRFData(id, feePayed);
}
error WagerAboveLimit(uint256 wager, uint256 maxWager);
/**
* @dev Function to replace cards in player hand, if no cards to replace are selected there isn't a VRF request
* @param toReplace array of cards that the player whished to replace, true equals that the card will be replaced
*/
function VideoPoker_Replace(
bool[5] calldata toReplace
) external payable nonReentrant {
VideoPokerGame storage game = videoPokerGames[msg.sender];
if (!game.ingame) {
revert NotInGame();
}
if (game.requestID != 0) {
revert AwaitingVRF(game.requestID);
}
VRFData storage data = vrfdata[msg.sender];
uint256[2] memory fees = IRandomizer(randomizer).getFeeStats(data.id);
if (fees[0] > fees[1] && data.feePayed > fees[0] - fees[1]) {
IRandomizer(randomizer).clientWithdrawTo(
msg.sender,
((data.feePayed - (fees[0] - fees[1])) * 90) / 100
);
}
delete (vrfdata[msg.sender]);
bool replaceCards;
for (uint8 i = 0; i < 5; i++) {
if (toReplace[i]) {
replaceCards = true;
break;
}
}
if (replaceCards) {
uint256 VRFfee = _payVRFFee();
uint256 id = _requestRandomWords(5);
videoPokerIDs[id] = msg.sender;
game.toReplace = toReplace;
game.requestID = id;
game.blockNumber = uint64(block.number);
vrfdata[msg.sender] = VRFData(id, VRFfee);
} else {
if (msg.value != 0) {
revert NoFeeRequired();
}
(uint256 multiplier, uint256 outcome) = _determineHandPayout(
game.cardsInHand
);
address tokenAddress = game.tokenAddress;
uint256 wager = game.wager;
emit VideoPoker_Outcome_Event(
msg.sender,
wager,
multiplier * wager,
tokenAddress,
game.cardsInHand,
outcome
);
_transferToBankroll(tokenAddress, game.wager);
delete (videoPokerGames[msg.sender]);
if (multiplier != 0) {
_transferPayout(msg.sender, multiplier * wager, tokenAddress);
}
}
}
/**
* @dev Function to get refund for game if VRF request fails
*/
function VideoPoker_Refund() external nonReentrant {
VideoPokerGame storage game = videoPokerGames[msg.sender];
if (!game.ingame) {
revert NotInGame();
}
if (game.requestID == 0) {
revert NoRequestPending();
}
if (game.blockNumber + 20 > block.number) {
revert BlockNumberTooLow(block.number, game.blockNumber + 20);
}
uint256 wager = game.wager;
address tokenAddress = game.tokenAddress;
delete (videoPokerGames[msg.sender]);
if (tokenAddress == address(0)) {
(bool success, ) = payable(msg.sender).call{value: wager}("");
if (!success) {
revert TransferFailed();
}
} else {
IERC20(tokenAddress).safeTransfer(msg.sender, wager);
}
emit VideoPoker_Refund_Event(msg.sender, wager, tokenAddress);
}
error OnlyRandomizerCanFulfill(address have, address want);
/**
* @dev function called by Randomizer.ai with the random number
* @param _id id provided when the request was made
* @param _value random number
*/
function randomizerCallback(uint256 _id, bytes32 _value) external {
//Callback can only be called by randomizer
if (msg.sender != randomizer) {
revert OnlyRandomizerCanFulfill(msg.sender, randomizer);
}
address player = videoPokerIDs[_id];
delete (videoPokerIDs[_id]);
VideoPokerGame storage game = videoPokerGames[player];
if (game.isFirstRequest) {
Card[] memory deck = initialDeck;
for (uint8 i = 0; i < 5; i++) {
uint256 rng = uint256(keccak256(abi.encodePacked(_value, i)));
_pickCard(i, rng, player, deck);
}
game.requestID = 0;
game.isFirstRequest = false;
emit VideoPoker_Start_Event(player, game.cardsInHand);
} else {
Card[] memory deck = initialDeck;
for (uint256 g = 0; g < 5; g++) {
for (uint256 j = 0; j < 52; j++) {
if (
game.cardsInHand[g].number == deck[j].number &&
game.cardsInHand[g].suit == deck[j].suit
) {
deck[j] = deck[deck.length - 1];
assembly {
mstore(deck, sub(mload(deck), 1))
}
break;
}
}
}
for (uint8 i = 0; i < 5; i++) {
if (game.toReplace[i]) {
uint256 rng = uint256(
keccak256(abi.encodePacked(_value, i))
);
_pickCard(i, rng, player, deck);
}
}
uint256 wager = game.wager;
address tokenAddress = game.tokenAddress;
(uint256 multiplier, uint256 outcome) = _determineHandPayout(
game.cardsInHand
);
emit VideoPoker_Outcome_Event(
player,
wager,
wager * multiplier,
tokenAddress,
game.cardsInHand,
outcome
);
_transferToBankroll(tokenAddress, game.wager);
delete (videoPokerGames[player]);
_transferPayout(player, wager * multiplier, tokenAddress);
}
}
function _pickCard(
uint8 handPosition,
uint256 rng,
address player,
Card[] memory deck
) internal {
uint256 cardPosition = rng % deck.length;
videoPokerGames[player].cardsInHand[handPosition] = deck[cardPosition];
_removeCardFromDeck(cardPosition, deck);
}
function _removeCardFromDeck(
uint256 cardPositon,
Card[] memory deck
) internal pure {
deck[cardPositon] = deck[deck.length - 1];
assembly {
mstore(deck, sub(mload(deck), 1))
}
}
function _determineHandPayout(
Card[5] memory cardsInHand
) public pure returns (uint256, uint256) {
Card[5] memory sortedCards = _sort(cardsInHand);
//check 4 of a kind
if (
sortedCards[1].number == sortedCards[2].number &&
sortedCards[2].number == sortedCards[3].number
) {
if (
sortedCards[1].number == sortedCards[0].number ||
sortedCards[3].number == sortedCards[4].number
) {
return (30, 7);
}
}
//check full house -> 3 of a kind + pair
if (
sortedCards[1].number == sortedCards[0].number &&
sortedCards[4].number == sortedCards[3].number
) {
if (
sortedCards[1].number == sortedCards[2].number ||
sortedCards[3].number == sortedCards[2].number
) {
return (8, 6);
}
}
//check royal flush + straight flush + flush
if (
sortedCards[0].suit == sortedCards[1].suit &&
sortedCards[2].suit == sortedCards[3].suit &&
sortedCards[0].suit == sortedCards[4].suit &&
sortedCards[2].suit == sortedCards[1].suit
) {
if (sortedCards[0].number == 1 && sortedCards[4].number == 13) {
if (
sortedCards[2].number == sortedCards[3].number - 1 &&
sortedCards[3].number == sortedCards[4].number - 1 &&
sortedCards[1].number == sortedCards[2].number - 1
) {
return (100, 9);
}
}
if (sortedCards[0].number == 1 && sortedCards[1].number == 2) {
if (
sortedCards[0].number == sortedCards[1].number - 1 &&
sortedCards[2].number == sortedCards[3].number - 1 &&
sortedCards[3].number == sortedCards[4].number - 1 &&
sortedCards[1].number == sortedCards[2].number - 1
) {
return (50, 8);
}
}
if (
sortedCards[0].number == sortedCards[1].number - 1 &&
sortedCards[2].number == sortedCards[3].number - 1 &&
sortedCards[3].number == sortedCards[4].number - 1 &&
sortedCards[1].number == sortedCards[2].number - 1
) {
return (50, 8);
}
return (6, 5);
}
//check straight
if (sortedCards[0].number == 1 && sortedCards[1].number == 2) {
if (
sortedCards[0].number == sortedCards[1].number - 1 &&
sortedCards[2].number == sortedCards[3].number - 1 &&
sortedCards[3].number == sortedCards[4].number - 1 &&
sortedCards[1].number == sortedCards[2].number - 1
) {
return (5, 4);
}
}
if (sortedCards[0].number == 1 && sortedCards[4].number == 13) {
if (
sortedCards[2].number == sortedCards[3].number - 1 &&
sortedCards[3].number == sortedCards[4].number - 1 &&
sortedCards[1].number == sortedCards[2].number - 1
) {
return (5, 4);
}
}
if (
sortedCards[0].number == sortedCards[1].number - 1 &&
sortedCards[1].number == sortedCards[2].number - 1 &&
sortedCards[2].number == sortedCards[3].number - 1 &&
sortedCards[3].number == sortedCards[4].number - 1
) {
return (5, 4);
}
//check three of a kind
if (
sortedCards[0].number == sortedCards[1].number &&
sortedCards[1].number == sortedCards[2].number
) {
return (3, 3);
}
if (
sortedCards[1].number == sortedCards[2].number &&
sortedCards[2].number == sortedCards[3].number
) {
return (3, 3);
}
if (
sortedCards[2].number == sortedCards[3].number &&
sortedCards[3].number == sortedCards[4].number
) {
return (3, 3);
}
//check two pair
if (sortedCards[0].number == sortedCards[1].number) {
if (
sortedCards[2].number == sortedCards[3].number ||
sortedCards[3].number == sortedCards[4].number
) {
return (2, 2);
}
}
if (sortedCards[1].number == sortedCards[2].number) {
if (sortedCards[3].number == sortedCards[4].number) {
return (2, 2);
}
}
//check one pair jacks or higher
if (sortedCards[0].number == sortedCards[1].number) {
if (sortedCards[0].number > 10 || sortedCards[0].number == 1) {
return (1, 1);
}
}
if (sortedCards[1].number == sortedCards[2].number) {
if (sortedCards[1].number > 10 || sortedCards[1].number == 1) {
return (1, 1);
}
}
if (sortedCards[2].number == sortedCards[3].number) {
if (sortedCards[2].number > 10 || sortedCards[2].number == 1) {
return (1, 1);
}
}
if (sortedCards[3].number == sortedCards[4].number) {
if (sortedCards[3].number > 10 || sortedCards[3].number == 1) {
return (1, 1);
}
}
return (0, 0);
}
function _quickSort(
Card[5] memory arr,
int256 left,
int256 right
) internal pure {
int256 i = left;
int256 j = right;
if (i == j) return;
uint256 pivot = arr[uint256(left + (right - left) / 2)].number;
while (i <= j) {
while (arr[uint256(i)].number < pivot) i++;
while (pivot < arr[uint256(j)].number) j--;
if (i <= j) {
(arr[uint256(i)].number, arr[uint256(j)].number) = (
arr[uint256(j)].number,
arr[uint256(i)].number
);
(arr[uint256(i)].suit, arr[uint256(j)].suit) = (
arr[uint256(j)].suit,
arr[uint256(i)].suit
);
i++;
j--;
}
}
if (left < j) {
_quickSort(arr, left, j);
}
if (i < right) {
_quickSort(arr, i, right);
}
}
function _sort(Card[5] memory data) internal pure returns (Card[5] memory) {
_quickSort(data, int256(0), int256(data.length - 1));
return data;
}
/**
* @dev calculates the maximum wager allowed based on the bankroll size
*/
function _kellyWager(uint256 wager, address tokenAddress) internal view {
uint256 balance;
if (tokenAddress == address(0)) {
balance = address(Bankroll).balance;
} else {
balance = IERC20(tokenAddress).balanceOf(address(Bankroll));
}
uint256 maxWager = (balance * 133937) / 100000000;
if (wager > maxWager) {
revert WagerAboveLimit(wager, maxWager);
}
}
}// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
interface IRandomizer {
function request(
uint256 _callbackGasLimit,
uint256 _confirmations
) external returns (uint256);
function clientWithdrawTo(address _to, uint256 _amount) external;
function estimateFee(
uint256 _callbackGasLimit,
uint256 _confirmations
) external view returns (uint256);
function clientDeposit(address _client) external payable;
function getFeeStats(
uint256 _request
) external view returns (uint256[2] memory);
}
interface IBankRoll {
function getIsGame(address game) external view returns (bool);
function getIsValidWager(
address game,
address tokenAddress
) external view returns (bool);
function transferPayout(
address player,
uint256 payout,
address token
) external;
function getOwner() external view returns (address);
function isPlayerSuspended(
address player
) external view returns (bool, uint256);
}
contract Common is ReentrancyGuard {
IBankRoll public Bankroll;
address public randomizer;
uint256 VRFgasLimit;
using SafeERC20 for IERC20;
error NotApprovedBankroll();
error InvalidValue(uint256 sent, uint256 required);
error TransferFailed();
error RefundFailed();
error NotOwner(address want, address have);
error ZeroWager();
error PlayerSuspended(uint256 suspensionTime);
function _transferWager(
address tokenAddress,
uint256 wager
) internal returns (uint256 VRFfee) {
if (!Bankroll.getIsValidWager(address(this), tokenAddress)) {
revert NotApprovedBankroll();
}
if (wager == 0) {
revert ZeroWager();
}
(bool suspended, uint256 suspendedTime) = Bankroll.isPlayerSuspended(
msg.sender
);
if (suspended) {
revert PlayerSuspended(suspendedTime);
}
VRFfee = getVRFFee();
if (tokenAddress == address(0)) {
if (msg.value < wager + VRFfee) {
revert InvalidValue(msg.value, wager + VRFfee);
}
IRandomizer(randomizer).clientDeposit{value: VRFfee}(address(this));
_refundExcessValue(msg.value - (VRFfee + wager));
} else {
if (msg.value < VRFfee) {
revert InvalidValue(VRFfee, msg.value);
}
IRandomizer(randomizer).clientDeposit{value: VRFfee}(address(this));
IERC20(tokenAddress).safeTransferFrom(
msg.sender,
address(this),
wager
);
_refundExcessValue(msg.value - VRFfee);
}
}
/**
* @dev function to transfer the wager held by the game contract to the bankroll
* @param tokenAddress address of the token to transfer
* @param amount token amount to transfer
*/
function _transferToBankroll(
address tokenAddress,
uint256 amount
) internal {
if (tokenAddress == address(0)) {
(bool success, ) = payable(address(Bankroll)).call{value: amount}(
""
);
if (!success) {
revert RefundFailed();
}
} else {
IERC20(tokenAddress).safeTransfer(address(Bankroll), amount);
}
}
/**
* @dev calculates in form of native token the fee charged by VRF
* @return fee amount of fee user has to pay
*/
function getVRFFee() public view returns (uint256 fee) {
fee = (IRandomizer(randomizer).estimateFee(2500000, 4) * 125) / 100;
}
/**
* @dev returns to user the excess fee sent to pay for the VRF
* @param refund amount to send back to user
*/
function _refundExcessValue(uint256 refund) internal {
if (refund == 0) {
return;
}
(bool success, ) = payable(msg.sender).call{value: refund}("");
if (!success) {
revert RefundFailed();
}
}
/**
* @dev function to charge user for VRF
*/
function _payVRFFee() internal returns (uint256 VRFfee) {
VRFfee = getVRFFee();
if (msg.value < VRFfee) {
revert InvalidValue(VRFfee, msg.value);
}
IRandomizer(randomizer).clientDeposit{value: VRFfee}(address(this));
_refundExcessValue(msg.value - VRFfee);
}
function _transferWagerNoVRF(
address tokenAddress,
uint256 wager,
uint32 numBets
) internal {
require(Bankroll.getIsGame(address(this)), "not valid");
require(numBets > 0 && numBets < 500, "invalid bet number");
if (tokenAddress == address(0)) {
require(msg.value == wager * numBets, "incorrect value");
(bool success, ) = payable(address(Bankroll)).call{
value: msg.value
}("");
require(success, "eth transfer failed");
} else {
IERC20(tokenAddress).safeTransferFrom(
msg.sender,
address(Bankroll),
wager * numBets
);
}
}
/**
* @dev function to transfer wager to game contract, without charging for VRF
* @param tokenAddress tokenAddress the wager is made on
* @param wager wager amount
*/
function _transferWagerPvPNoVRF(
address tokenAddress,
uint256 wager
) internal {
if (!Bankroll.getIsValidWager(address(this), tokenAddress)) {
revert NotApprovedBankroll();
}
if (tokenAddress == address(0)) {
if (!(msg.value == wager)) {
revert InvalidValue(wager, msg.value);
}
} else {
IERC20(tokenAddress).safeTransferFrom(
msg.sender,
address(this),
wager
);
}
}
/**
* @dev function to transfer wager to game contract, including charge for VRF
* @param tokenAddress tokenAddress the wager is made on
* @param wager wager amount
*/
function _transferWagerPvP(address tokenAddress, uint256 wager) internal {
if (!Bankroll.getIsValidWager(address(this), tokenAddress)) {
revert NotApprovedBankroll();
}
uint256 VRFfee = getVRFFee();
if (tokenAddress == address(0)) {
if (msg.value < wager + VRFfee) {
revert InvalidValue(msg.value, wager);
}
_refundExcessValue(msg.value - (VRFfee + wager));
} else {
if (msg.value < VRFfee) {
revert InvalidValue(VRFfee, msg.value);
}
IERC20(tokenAddress).transferFrom(msg.sender, address(this), wager);
_refundExcessValue(msg.value - VRFfee);
}
}
/**
* @dev transfers payout from the game contract to the players
* @param player address of the player to transfer the payout to
* @param payout amount of payout to transfer
* @param tokenAddress address of the token that payout will be transfered
*/
function _transferPayoutPvP(
address player,
uint256 payout,
address tokenAddress
) internal {
if (tokenAddress == address(0)) {
(bool success, ) = payable(player).call{value: payout}("");
if (!success) {
revert TransferFailed();
}
} else {
IERC20(tokenAddress).safeTransfer(player, payout);
}
}
/**
* @dev transfers house edge from game contract to bankroll
* @param amount amount to transfer
* @param tokenAddress address of token to transfer
*/
function _transferHouseEdgePvP(
uint256 amount,
address tokenAddress
) internal {
if (tokenAddress == address(0)) {
(bool success, ) = payable(address(Bankroll)).call{value: amount}(
""
);
if (!success) {
revert TransferFailed();
}
} else {
IERC20(tokenAddress).safeTransfer(address(Bankroll), amount);
}
}
/**@dev function to alter gaslimit of vrf request
* @param limit new gas Limit on request
*/
function setVRFGasLimit(uint256 limit) external {
if (msg.sender != Bankroll.getOwner()) {
revert NotOwner(Bankroll.getOwner(), msg.sender);
}
VRFgasLimit = limit;
}
/**
* @dev function to request bankroll to give payout to player
* @param player address of the player
* @param payout amount of payout to give
* @param tokenAddress address of the token in which to give the payout
*/
function _transferPayout(
address player,
uint256 payout,
address tokenAddress
) internal {
Bankroll.transferPayout(player, payout, tokenAddress);
}
function _requestRandomWords(
uint32 numWords
) internal returns (uint256 s_requestId) {
s_requestId = IRandomizer(randomizer).request(VRFgasLimit, 4);
return s_requestId;
}
function whithdrawVRF(address to, uint256 amount) external {
if (msg.sender != Bankroll.getOwner()) {
revert NotOwner(Bankroll.getOwner(), msg.sender);
}
IRandomizer(randomizer).clientWithdrawTo(to, amount);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}{
"optimizer": {
"enabled": true,
"runs": 10000
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_bankroll","type":"address"},{"internalType":"address","name":"_vrf","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyInGame","type":"error"},{"inputs":[{"internalType":"uint256","name":"requestID","type":"uint256"}],"name":"AwaitingVRF","type":"error"},{"inputs":[{"internalType":"uint256","name":"have","type":"uint256"},{"internalType":"uint256","name":"want","type":"uint256"}],"name":"BlockNumberTooLow","type":"error"},{"inputs":[{"internalType":"uint256","name":"sent","type":"uint256"},{"internalType":"uint256","name":"required","type":"uint256"}],"name":"InvalidValue","type":"error"},{"inputs":[],"name":"NoFeeRequired","type":"error"},{"inputs":[],"name":"NoRequestPending","type":"error"},{"inputs":[],"name":"NotApprovedBankroll","type":"error"},{"inputs":[],"name":"NotInGame","type":"error"},{"inputs":[{"internalType":"address","name":"want","type":"address"},{"internalType":"address","name":"have","type":"address"}],"name":"NotOwner","type":"error"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyRandomizerCanFulfill","type":"error"},{"inputs":[{"internalType":"uint256","name":"suspensionTime","type":"uint256"}],"name":"PlayerSuspended","type":"error"},{"inputs":[],"name":"RefundFailed","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[{"internalType":"uint256","name":"wager","type":"uint256"},{"internalType":"uint256","name":"maxWager","type":"uint256"}],"name":"WagerAboveLimit","type":"error"},{"inputs":[],"name":"ZeroWager","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"playerAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"wager","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"components":[{"internalType":"uint8","name":"number","type":"uint8"},{"internalType":"uint8","name":"suit","type":"uint8"}],"indexed":false,"internalType":"struct VideoPoker.Card[5]","name":"playerHand","type":"tuple[5]"},{"indexed":false,"internalType":"uint256","name":"outcome","type":"uint256"}],"name":"VideoPoker_Outcome_Event","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"wager","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"}],"name":"VideoPoker_Refund_Event","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"playerAddress","type":"address"},{"components":[{"internalType":"uint8","name":"number","type":"uint8"},{"internalType":"uint8","name":"suit","type":"uint8"}],"indexed":false,"internalType":"struct VideoPoker.Card[5]","name":"playerHand","type":"tuple[5]"}],"name":"VideoPoker_Start_Event","type":"event"},{"inputs":[],"name":"Bankroll","outputs":[{"internalType":"contract IBankRoll","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"player","type":"address"}],"name":"VideoPoker_GetState","outputs":[{"components":[{"internalType":"uint256","name":"wager","type":"uint256"},{"internalType":"uint256","name":"requestID","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint64","name":"blockNumber","type":"uint64"},{"components":[{"internalType":"uint8","name":"number","type":"uint8"},{"internalType":"uint8","name":"suit","type":"uint8"}],"internalType":"struct VideoPoker.Card[5]","name":"cardsInHand","type":"tuple[5]"},{"internalType":"bool[5]","name":"toReplace","type":"bool[5]"},{"internalType":"bool","name":"ingame","type":"bool"},{"internalType":"bool","name":"isFirstRequest","type":"bool"}],"internalType":"struct VideoPoker.VideoPokerGame","name":"videopokerState","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VideoPoker_Refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool[5]","name":"toReplace","type":"bool[5]"}],"name":"VideoPoker_Replace","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"wager","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"VideoPoker_Start","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"number","type":"uint8"},{"internalType":"uint8","name":"suit","type":"uint8"}],"internalType":"struct VideoPoker.Card[5]","name":"cardsInHand","type":"tuple[5]"}],"name":"_determineHandPayout","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getVRFFee","outputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomizer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"bytes32","name":"_value","type":"bytes32"}],"name":"randomizerCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"limit","type":"uint256"}],"name":"setVRFGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"whithdrawVRF","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b5060405162003d0538038062003d05833981016040819052620000349162000150565b6001600081815581546001600160a01b038086166001600160a01b031992831617909355600280549385169390911692909217909155621e84806003555b60048160ff1610156200012a5760015b600e8160ff16101562000114576040805180820190915260ff8083168252838116602083019081526004805460018101825560009190915292517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b9093018054915183166101000261ffff199092169390921692909217919091179055806200010b8162000188565b91505062000082565b5080620001218162000188565b91505062000072565b505050620001b7565b80516001600160a01b03811681146200014b57600080fd5b919050565b600080604083850312156200016457600080fd5b6200016f8362000133565b91506200017f6020840162000133565b90509250929050565b600060ff821660ff811415620001ae57634e487b7160e01b600052601160045260246000fd5b60010192915050565b613b3e80620001c76000396000f3fe6080604052600436106100bc5760003560e01c8063e67ae76911610074578063f0034a7e1161004e578063f0034a7e146101d0578063f10fb584146101f3578063f2d3444b1461021357600080fd5b8063e67ae76914610166578063ebe93caf1461017b578063ec0f5d8c1461019b57600080fd5b8063d0bcfc0c116100a5578063d0bcfc0c146100f6578063d6e23e6c14610133578063e40ea4bc1461015357600080fd5b80636c8abecc146100c1578063745b303e146100d6575b600080fd5b6100d46100cf366004613239565b610240565b005b3480156100e257600080fd5b506100d46100f1366004613269565b6105d3565b34801561010257600080fd5b50600154610116906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561013f57600080fd5b506100d461014e366004613295565b6107a0565b6100d46101613660046132ae565b610887565b34801561017257600080fd5b506100d4610dc3565b34801561018757600080fd5b506100d46101963660046132d6565b6110a1565b3480156101a757600080fd5b506101bb6101b6366004613389565b61167a565b6040805192835260208301919091520161012a565b3480156101dc57600080fd5b506101e5611edb565b60405190815260200161012a565b3480156101ff57600080fd5b50600254610116906001600160a01b031681565b34801561021f57600080fd5b5061023361022e36600461341f565b611f8a565b60405161012a919061349d565b6102486120d5565b3360009081526005602052604090206001810154156102a45780600101546040517f440db96e00000000000000000000000000000000000000000000000000000000815260040161029b91815260200190565b60405180910390fd5b600981015460ff16156102e3576040517fc56fb25300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260076020526040808220600254815492517f9dfa24e300000000000000000000000000000000000000000000000000000000815260048101939093529092916001600160a01b0390911690639dfa24e3906024016040805180830381865afa158015610359573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061037d9190613521565b602081015181519192501080156103a75750602081015181516103a091906135ff565b8260010154115b1561047157600254602082015182516001600160a01b0390921691632465f8f59133916064916103d6916135ff565b86600101546103e591906135ff565b6103f090605a613616565b6103fa9190613682565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561045857600080fd5b505af115801561046c573d6000803e3d6000fd5b505050505b61047b8585612149565b6000610487858761225a565b90506000610495600161260e565b9050336006600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550858560020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555086856000018190555060018560090160016101000a81548160ff021916908315150217905550808560010181905550438560020160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060018560090160006101000a81548160ff02191690831515021790555060405180604001604052808281526020018381525060076000336001600160a01b03166001600160a01b03168152602001908152602001600020600082015181600001556020820151816001015590505050505050506105cf6001600055565b5050565b600160009054906101000a90046001600160a01b03166001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa158015610626573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064a9190613696565b6001600160a01b0316336001600160a01b03161461071d57600160009054906101000a90046001600160a01b03166001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d99190613696565b6040517f23295f0e0000000000000000000000000000000000000000000000000000000081526001600160a01b03909116600482015233602482015260440161029b565b6002546040517f2465f8f50000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301526024820184905290911690632465f8f590604401600060405180830381600087803b15801561078457600080fd5b505af1158015610798573d6000803e3d6000fd5b505050505050565b600160009054906101000a90046001600160a01b03166001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108179190613696565b6001600160a01b0316336001600160a01b03161461088257600160009054906101000a90046001600160a01b03166001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b5573d6000803e3d6000fd5b600355565b61088f6120d5565b336000908152600560205260409020600981015460ff166108dc576040517f43050d9600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001810154156109205780600101546040517f440db96e00000000000000000000000000000000000000000000000000000000815260040161029b91815260200190565b33600090815260076020526040808220600254815492517f9dfa24e300000000000000000000000000000000000000000000000000000000815260048101939093529092916001600160a01b0390911690639dfa24e3906024016040805180830381865afa158015610996573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ba9190613521565b602081015181519192501080156109e45750602081015181516109dd91906135ff565b8260010154115b15610aae57600254602082015182516001600160a01b0390921691632465f8f5913391606491610a13916135ff565b8660010154610a2291906135ff565b610a2d90605a613616565b610a379190613682565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015610a9557600080fd5b505af1158015610aa9573d6000803e3d6000fd5b505050505b336000908152600760205260408120818155600101819055805b60058160ff161015610b1c57858160ff1660058110610ae957610ae96135a1565b602002016020810190610afc91906136c1565b15610b0a5760019150610b1c565b80610b14816136de565b915050610ac8565b508015610c06576000610b2d6126ae565b90506000610b3b600561260e565b600081815260066020526040902080547fffffffffffffffffffffffff000000000000000000000000000000000000000016331790559050610b826008870188600561307e565b5060018681018290556002870180547fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000004367ffffffffffffffff16021790556040805180820182529283526020808401948552336000908152600790915220915182559151910155610db2565b3415610c3e576040517f0c0682b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160a081019091526000908190610ca09060038801600584835b82821015610c9757604080518082019091528285015460ff80821683526101009091041660208083019190915290825260019092019101610c5b565b5050505061167a565b600288015488549294509092506001600160a01b031690337fb73b6b634aea9965e3c60d60ac8d2380100c337b6d66167d297351746f4f1ac982610ce48188613616565b858c60030188604051610cfb959493929190613732565b60405180910390a2610d11828960000154612787565b336000908152600560205260408120818155600181018290556002810180547fffffffff0000000000000000000000000000000000000000000000000000000016905590610d62600383018261310e565b600060088301555060090180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690558315610dad57610dad33610da78387613616565b84612841565b505050505b50505050610dc06001600055565b50565b610dcb6120d5565b336000908152600560205260409020600981015460ff16610e18576040517f43050d9600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001810154610e53576040517f90a7340b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028101544390610e879074010000000000000000000000000000000000000000900467ffffffffffffffff16601461376e565b67ffffffffffffffff161115610f105760028101544390610ecb9074010000000000000000000000000000000000000000900467ffffffffffffffff16601461376e565b6040517fb4ae675a000000000000000000000000000000000000000000000000000000008152600481019290925267ffffffffffffffff16602482015260440161029b565b80546002808301543360009081526005602052604081208181556001810182905592830180547fffffffff000000000000000000000000000000000000000000000000000000001690556001600160a01b039091169190610f74600383018261310e565b600060088301555060090180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690556001600160a01b03811661103b57604051600090339084908381818185875af1925050503d8060008114610ff5576040519150601f19603f3d011682016040523d82523d6000602084013e610ffa565b606091505b5050905080611035576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5061104f565b61104f6001600160a01b03821633846128cd565b604080518381526001600160a01b038316602082015233917fa961a003e6bad850d2b19455e8db60fa1a37e0fce8259beadbb4f4958f4b8de1910160405180910390a250505061109f6001600055565b565b6002546001600160a01b031633146110fa576002546040517f2f6a7bdb0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03909116602482015260440161029b565b600082815260066020908152604080832080547fffffffffffffffffffffffff000000000000000000000000000000000000000081169091556001600160a01b031680845260059092529091206009810154610100900460ff16156112ce5760006004805480602002602001604051908101604052809291908181526020016000905b828210156111be576000848152602090819020604080518082019091529084015460ff8082168352610100909104168183015282526001909201910161117d565b50505050905060005b60058160ff161015611250576000858260405160200161121692919091825260f81b7fff0000000000000000000000000000000000000000000000000000000000000016602082015260210190565b6040516020818303038152906040528051906020012060001c905061123d82828786612994565b5080611248816136de565b9150506111c7565b50600060018301556009820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690556040516001600160a01b038416907fc3b36130c75d38724a3591fd74cfe9738bf5234994a2bebe0d81ec71e012282a906112c090600386019061379a565b60405180910390a250611674565b60006004805480602002602001604051908101604052809291908181526020016000905b82821015611333576000848152602090819020604080518082019091529084015460ff808216835261010090910416818301528252600190920191016112f2565b50505050905060005b60058110156114505760005b603481101561143d57828181518110611363576113636135a1565b60200260200101516000015160ff16846003018360058110611387576113876135a1565b015460ff161480156113d657508281815181106113a6576113a66135a1565b60200260200101516020015160ff168460030183600581106113ca576113ca6135a1565b0154610100900460ff16145b1561142b5782600184516113ea91906135ff565b815181106113fa576113fa6135a1565b6020026020010151838281518110611414576114146135a1565b60200260200101819052506001835103835261143d565b80611435816137a9565b915050611348565b5080611448816137a9565b91505061133c565b5060005b60058160ff16101561151157826008018160ff1660058110611478576114786135a1565b602081049091015460ff601f9092166101000a900416156114ff57600085826040516020016114d692919091825260f81b7fff0000000000000000000000000000000000000000000000000000000000000016602082015260210190565b6040516020818303038152906040528051906020012060001c90506114fd82828786612994565b505b80611509816136de565b915050611454565b50815460028301546040805160e0810190915260038501805460ff80821660a085019081526101009092041660c084015282526001600160a01b0390921691600091829161156791906005600160208401610c5b565b90925090506001600160a01b0387167fb73b6b634aea9965e3c60d60ac8d2380100c337b6d66167d297351746f4f1ac9856115a28582613616565b868a600301866040516115b9959493929190613732565b60405180910390a26115cf838760000154612787565b6001600160a01b0387166000908152600560205260408120818155600181018290556002810180547fffffffff0000000000000000000000000000000000000000000000000000000016905590611629600383018261310e565b600060088301555060090180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016905561166e876116688487613616565b85612841565b50505050505b50505050565b600080600061168884612a51565b60408101515160208201515191925060ff91821691161480156116bb575060608101515160408201515160ff9081169116145b156116fe5780515160208201515160ff908116911614806116ec575060808101515160608201515160ff9081169116145b156116fe5750601e9360079350915050565b80515160208201515160ff908116911614801561172b575060608101515160808201515160ff9081169116145b156117715760408101515160208201515160ff9081169116148061175f575060408101515160608201515160ff9081169116145b15611771575060089360069350915050565b602080820151015160ff1681600060200201516020015160ff161480156117b0575060608101516020015160ff1681600260200201516020015160ff16145b80156117d4575060808101516020015160ff1681600060200201516020015160ff16145b80156117f75750602080820151015160ff1681600260200201516020015160ff16145b15611a2f5780515160ff166001148015611819575060808101515160ff16600d145b156118a657606081015151611830906001906137e2565b60ff1681600260200201515160ff1614801561186a5750608081015151611859906001906137e2565b60ff1681600360200201515160ff16145b80156118945750604081015151611883906001906137e2565b60ff1681600160200201515160ff16145b156118a6575060649360099350915050565b80515160ff1660011480156118c3575060208101515160ff166002145b15611975576020810151516118da906001906137e2565b81515160ff908116911614801561190f57506060810151516118fe906001906137e2565b60ff1681600260200201515160ff16145b80156119395750608081015151611928906001906137e2565b60ff1681600360200201515160ff16145b80156119635750604081015151611952906001906137e2565b60ff1681600160200201515160ff16145b15611975575060329360089350915050565b602081015151611987906001906137e2565b81515160ff90811691161480156119bc57506060810151516119ab906001906137e2565b60ff1681600260200201515160ff16145b80156119e657506080810151516119d5906001906137e2565b60ff1681600360200201515160ff16145b8015611a1057506040810151516119ff906001906137e2565b60ff1681600160200201515160ff16145b15611a22575060329360089350915050565b5060069360059350915050565b80515160ff166001148015611a4c575060208101515160ff166002145b15611afe57602081015151611a63906001906137e2565b81515160ff9081169116148015611a985750606081015151611a87906001906137e2565b60ff1681600260200201515160ff16145b8015611ac25750608081015151611ab1906001906137e2565b60ff1681600360200201515160ff16145b8015611aec5750604081015151611adb906001906137e2565b60ff1681600160200201515160ff16145b15611afe575060059360049350915050565b80515160ff166001148015611b1b575060808101515160ff16600d145b15611ba857606081015151611b32906001906137e2565b60ff1681600260200201515160ff16148015611b6c5750608081015151611b5b906001906137e2565b60ff1681600360200201515160ff16145b8015611b965750604081015151611b85906001906137e2565b60ff1681600160200201515160ff16145b15611ba8575060059360049350915050565b602081015151611bba906001906137e2565b81515160ff9081169116148015611bef5750604081015151611bde906001906137e2565b60ff1681600160200201515160ff16145b8015611c195750606081015151611c08906001906137e2565b60ff1681600260200201515160ff16145b8015611c435750608081015151611c32906001906137e2565b60ff1681600360200201515160ff16145b15611c55575060059360049350915050565b60208101515181515160ff9081169116148015611c82575060408101515160208201515160ff9081169116145b15611c935750600393849350915050565b60408101515160208201515160ff9081169116148015611cc3575060608101515160408201515160ff9081169116145b15611cd45750600393849350915050565b60608101515160408201515160ff9081169116148015611d04575060808101515160608201515160ff9081169116145b15611d155750600393849350915050565b60208101515181515160ff90811691161415611d6b5760608101515160408201515160ff90811691161480611d5a575060808101515160608201515160ff9081169116145b15611d6b5750600293849350915050565b60408101515160208201515160ff90811691161415611da95760808101515160608201515160ff90811691161415611da95750600293849350915050565b60208101515181515160ff90811691161415611deb57805151600a60ff9091161180611dda575080515160ff166001145b15611deb5750600193849350915050565b60408101515160208201515160ff90811691161415611e3757600a81600160200201515160ff161180611e26575060208101515160ff166001145b15611e375750600193849350915050565b60608101515160408201515160ff90811691161415611e8357600a81600260200201515160ff161180611e72575060408101515160ff166001145b15611e835750600193849350915050565b60808101515160608201515160ff90811691161415611ecf57600a81600360200201515160ff161180611ebe575060608101515160ff166001145b15611ecf5750600193849350915050565b50600093849350915050565b6002546040517ee1d8d0000000000000000000000000000000000000000000000000000000008152622625a060048083019190915260248201526000916064916001600160a01b039091169062e1d8d090604401602060405180830381865afa158015611f4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f709190613805565b611f7b90607d613616565b611f859190613682565b905090565b611f9261311d565b6001600160a01b038281166000908152600560208181526040808420815161010081018352815481526001820154938101939093526002810154958616838301527401000000000000000000000000000000000000000090950467ffffffffffffffff166060830152805160a0810190915290939260808501926003850191835b8282101561204f57604080518082019091528285015460ff80821683526101009091041660208083019190915290825260019092019101612013565b505050908252506040805160a0810191829052602090920191906008840190600590826000855b825461010083900a900460ff161515815260206001928301818104948501949093039092029101808411612076575050509284525050506009919091015460ff8082161515602084015261010090910416151560409091015292915050565b60026000541415612142576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161029b565b6002600055565b60006001600160a01b03821661216c57506001546001600160a01b0316316121f6565b6001546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152908316906370a0823190602401602060405180830381865afa1580156121cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121f39190613805565b90505b60006305f5e10061220a8362020b31613616565b6122149190613682565b905080841115611674576040517fd53662aa000000000000000000000000000000000000000000000000000000008152600481018590526024810182905260440161029b565b6001546040517fbfd7f9cc0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038481166024830152600092169063bfd7f9cc90604401602060405180830381865afa1580156122c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122e8919061381e565b61231e576040517f51c3b94f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81612355576040517f07375c8400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001546040517f0a5748a800000000000000000000000000000000000000000000000000000000815233600482015260009182916001600160a01b0390911690630a5748a8906024016040805180830381865afa1580156123ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123de919061383b565b91509150811561241d576040517f6c2775f50000000000000000000000000000000000000000000000000000000081526004810182905260240161029b565b612425611edb565b92506001600160a01b0385166125275761243f8385613869565b34101561248c57346124518486613869565b6040517fde9b74a10000000000000000000000000000000000000000000000000000000081526004810192909252602482015260440161029b565b6002546040517f4ffd2e430000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0390911690634ffd2e439085906024016000604051808303818588803b1580156124eb57600080fd5b505af11580156124ff573d6000803e3d6000fd5b505050505061252284846125139190613869565b61251d90346135ff565b612a74565b612606565b8234101561256a576040517fde9b74a10000000000000000000000000000000000000000000000000000000081526004810184905234602482015260440161029b565b6002546040517f4ffd2e430000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0390911690634ffd2e439085906024016000604051808303818588803b1580156125c957600080fd5b505af11580156125dd573d6000803e3d6000fd5b506125f9935050506001600160a01b0387169050333087612afe565b61260661251d84346135ff565b505092915050565b6002546003546040517f8bc802fb0000000000000000000000000000000000000000000000000000000081526000926001600160a01b031691638bc802fb9161266591906004908101918252602082015260400190565b6020604051808303816000875af1158015612684573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126a89190613805565b92915050565b60006126b8611edb565b9050803410156126fd576040517fde9b74a10000000000000000000000000000000000000000000000000000000081526004810182905234602482015260440161029b565b6002546040517f4ffd2e430000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0390911690634ffd2e439083906024016000604051808303818588803b15801561275c57600080fd5b505af1158015612770573d6000803e3d6000fd5b5050505050612784813461251d91906135ff565b90565b6001600160a01b038216612827576001546040516000916001600160a01b03169083908381818185875af1925050503d80600081146127e2576040519150601f19603f3d011682016040523d82523d6000602084013e6127e7565b606091505b5050905080612822576040517ff0c49d4400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b6001546105cf906001600160a01b038481169116836128cd565b6001546040517f6c025ec20000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015260248201859052838116604483015290911690636c025ec290606401600060405180830381600087803b1580156128b057600080fd5b505af11580156128c4573d6000803e3d6000fd5b50505050505050565b6040516001600160a01b0383166024820152604481018290526128229084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612b4f565b60008151846129a39190613881565b90508181815181106129b7576129b76135a1565b602002602001015160056000856001600160a01b03166001600160a01b031681526020019081526020016000206003018660ff16600581106129fb576129fb6135a1565b82519101805460209093015160ff908116610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909416921691909117919091179055612a4a8183612c4e565b5050505050565b612a59613181565b612a70826000612a6b600160056135ff565b612c9d565b5090565b80612a7c5750565b604051600090339083908381818185875af1925050503d8060008114612abe576040519150601f19603f3d011682016040523d82523d6000602084013e612ac3565b606091505b50509050806105cf576040517ff0c49d4400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516001600160a01b03808516602483015283166044820152606481018290526116749085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401612912565b6000612ba4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612e8c9092919063ffffffff16565b8051909150156128225780806020019051810190612bc2919061381e565b612822576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161029b565b8060018251612c5d91906135ff565b81518110612c6d57612c6d6135a1565b6020026020010151818381518110612c8757612c876135a1565b6020026020010181905250600181510381525050565b818180821415612cae575050505050565b6000856002612cbd8787613895565b612cc79190613909565b612cd19087613971565b60058110612ce157612ce16135a1565b60200201515160ff1690505b818313612e66575b80868460058110612d0857612d086135a1565b60200201515160ff161015612d295782612d21816139e5565b935050612cf5565b858260058110612d3b57612d3b6135a1565b60200201515160ff16811015612d5d5781612d5581613a17565b925050612d29565b818313612e6157858260058110612d7657612d766135a1565b602002015151868460058110612d8e57612d8e6135a1565b602002015151878560058110612da657612da66135a1565b6020020151888560058110612dbd57612dbd6135a1565b602002015160ff928316905291169052858260058110612ddf57612ddf6135a1565b602002015160200151868460058110612dfa57612dfa6135a1565b602002015160200151878560058110612e1557612e156135a1565b6020020151602001888560058110612e2f57612e2f6135a1565b6020908102919091015160ff9384169101529116905282612e4f816139e5565b9350508180612e5d90613a17565b9250505b612ced565b81851215612e7957612e79868684612c9d565b8383121561079857610798868486612c9d565b6060612e9b8484600085612ea3565b949350505050565b606082471015612f35576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161029b565b600080866001600160a01b03168587604051612f519190613a9b565b60006040518083038185875af1925050503d8060008114612f8e576040519150601f19603f3d011682016040523d82523d6000602084013e612f93565b606091505b5091509150612fa487838387612faf565b979650505050505050565b6060831561303557825161302e576001600160a01b0385163b61302e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161029b565b5081612e9b565b612e9b838381511561304a5781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161029b9190613ab7565b6001830191839082156131025791602002820160005b838211156130d3578335151583826101000a81548160ff0219169083151502179055509260200192600101602081600001049283019260010302613094565b80156131005782816101000a81549060ff02191690556001016020816000010492830192600103026130d3565b505b50612a709291506131ba565b50610dc09060058101906131cf565b604051806101000160405280600081526020016000815260200160006001600160a01b03168152602001600067ffffffffffffffff168152602001613160613181565b815260200161316d613206565b815260006020820181905260409091015290565b6040518060a001604052806005905b60408051808201909152600080825260208201528152602001906001900390816131905790505090565b5b80821115612a7057600081556001016131bb565b5b80821115612a705780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001681556001016131d0565b6040518060a001604052806005906020820280368337509192915050565b6001600160a01b0381168114610dc057600080fd5b6000806040838503121561324c57600080fd5b82359150602083013561325e81613224565b809150509250929050565b6000806040838503121561327c57600080fd5b823561328781613224565b946020939093013593505050565b6000602082840312156132a757600080fd5b5035919050565b600060a082840312156132c057600080fd5b8260a0830111156132d057600080fd5b50919050565b600080604083850312156132e957600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561334a5761334a6132f8565b60405290565b60405160a0810167ffffffffffffffff8111828210171561334a5761334a6132f8565b803560ff8116811461338457600080fd5b919050565b600061014080838503121561339d57600080fd5b83601f8401126133ac57600080fd5b6133b4613350565b9083019080858311156133c657600080fd5b845b8381101561341557604081880312156133e15760008081fd5b6133e9613327565b6133f282613373565b81526020613401818401613373565b8282015290845292909201916040016133c8565b5095945050505050565b60006020828403121561343157600080fd5b813561343c81613224565b9392505050565b8060005b6005811015611674578151805160ff9081168652602091820151168186015260409094019390910190600101613447565b8060005b6005811015611674578151151584526020938401939091019060010161347c565b60006102a08201905082518252602083015160208301526001600160a01b03604084015116604083015267ffffffffffffffff606084015116606083015260808301516134ed6080840182613443565b5060a08301516135016101c0840182613478565b5060c0830151151561026083015260e09092015115156102809091015290565b60006040828403121561353357600080fd5b82601f83011261354257600080fd5b6040516040810181811067ffffffffffffffff82111715613565576135656132f8565b806040525080604084018581111561357c57600080fd5b845b8181101561359657805183526020928301920161357e565b509195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015613611576136116135d0565b500390565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561364e5761364e6135d0565b500290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261369157613691613653565b500490565b6000602082840312156136a857600080fd5b815161343c81613224565b8015158114610dc057600080fd5b6000602082840312156136d357600080fd5b813561343c816136b3565b600060ff821660ff8114156136f5576136f56135d0565b60010192915050565b8060005b600581101561167457815460ff808216865260089190911c16602085015260409093019260019182019101613702565b858152602081018590526001600160a01b03841660408201526101c0810161375d60608301856136fe565b826101a08301529695505050505050565b600067ffffffffffffffff808316818516808303821115613791576137916135d0565b01949350505050565b61014081016126a882846136fe565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156137db576137db6135d0565b5060010190565b600060ff821660ff8416808210156137fc576137fc6135d0565b90039392505050565b60006020828403121561381757600080fd5b5051919050565b60006020828403121561383057600080fd5b815161343c816136b3565b6000806040838503121561384e57600080fd5b8251613859816136b3565b6020939093015192949293505050565b6000821982111561387c5761387c6135d0565b500190565b60008261389057613890613653565b500690565b6000808312837f8000000000000000000000000000000000000000000000000000000000000000018312811516156138cf576138cf6135d0565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018313811615613903576139036135d0565b50500390565b60008261391857613918613653565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f80000000000000000000000000000000000000000000000000000000000000008314161561396c5761396c6135d0565b500590565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038413811516156139ab576139ab6135d0565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156139df576139df6135d0565b50500190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156137db576137db6135d0565b60007f8000000000000000000000000000000000000000000000000000000000000000821415613a4957613a496135d0565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60005b83811015613a8a578181015183820152602001613a72565b838111156116745750506000910152565b60008251613aad818460208701613a6f565b9190910192915050565b6020815260008251806020840152613ad6816040850160208701613a6f565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea2646970667358221220c1bc795facf7c042efc09cae79403435d9e1ef2f34d4bc70a024e2f65ff659c564736f6c634300080b003300000000000000000000000051e99a0d09eeca8d7efec3062ac024b6d09899590000000000000000000000005b8bb80f2d72d0c85cab8fb169e8170a05c94baf
Deployed Bytecode
0x6080604052600436106100bc5760003560e01c8063e67ae76911610074578063f0034a7e1161004e578063f0034a7e146101d0578063f10fb584146101f3578063f2d3444b1461021357600080fd5b8063e67ae76914610166578063ebe93caf1461017b578063ec0f5d8c1461019b57600080fd5b8063d0bcfc0c116100a5578063d0bcfc0c146100f6578063d6e23e6c14610133578063e40ea4bc1461015357600080fd5b80636c8abecc146100c1578063745b303e146100d6575b600080fd5b6100d46100cf366004613239565b610240565b005b3480156100e257600080fd5b506100d46100f1366004613269565b6105d3565b34801561010257600080fd5b50600154610116906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561013f57600080fd5b506100d461014e366004613295565b6107a0565b6100d46101613660046132ae565b610887565b34801561017257600080fd5b506100d4610dc3565b34801561018757600080fd5b506100d46101963660046132d6565b6110a1565b3480156101a757600080fd5b506101bb6101b6366004613389565b61167a565b6040805192835260208301919091520161012a565b3480156101dc57600080fd5b506101e5611edb565b60405190815260200161012a565b3480156101ff57600080fd5b50600254610116906001600160a01b031681565b34801561021f57600080fd5b5061023361022e36600461341f565b611f8a565b60405161012a919061349d565b6102486120d5565b3360009081526005602052604090206001810154156102a45780600101546040517f440db96e00000000000000000000000000000000000000000000000000000000815260040161029b91815260200190565b60405180910390fd5b600981015460ff16156102e3576040517fc56fb25300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260076020526040808220600254815492517f9dfa24e300000000000000000000000000000000000000000000000000000000815260048101939093529092916001600160a01b0390911690639dfa24e3906024016040805180830381865afa158015610359573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061037d9190613521565b602081015181519192501080156103a75750602081015181516103a091906135ff565b8260010154115b1561047157600254602082015182516001600160a01b0390921691632465f8f59133916064916103d6916135ff565b86600101546103e591906135ff565b6103f090605a613616565b6103fa9190613682565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561045857600080fd5b505af115801561046c573d6000803e3d6000fd5b505050505b61047b8585612149565b6000610487858761225a565b90506000610495600161260e565b9050336006600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550858560020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555086856000018190555060018560090160016101000a81548160ff021916908315150217905550808560010181905550438560020160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060018560090160006101000a81548160ff02191690831515021790555060405180604001604052808281526020018381525060076000336001600160a01b03166001600160a01b03168152602001908152602001600020600082015181600001556020820151816001015590505050505050506105cf6001600055565b5050565b600160009054906101000a90046001600160a01b03166001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa158015610626573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064a9190613696565b6001600160a01b0316336001600160a01b03161461071d57600160009054906101000a90046001600160a01b03166001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d99190613696565b6040517f23295f0e0000000000000000000000000000000000000000000000000000000081526001600160a01b03909116600482015233602482015260440161029b565b6002546040517f2465f8f50000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301526024820184905290911690632465f8f590604401600060405180830381600087803b15801561078457600080fd5b505af1158015610798573d6000803e3d6000fd5b505050505050565b600160009054906101000a90046001600160a01b03166001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108179190613696565b6001600160a01b0316336001600160a01b03161461088257600160009054906101000a90046001600160a01b03166001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b5573d6000803e3d6000fd5b600355565b61088f6120d5565b336000908152600560205260409020600981015460ff166108dc576040517f43050d9600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001810154156109205780600101546040517f440db96e00000000000000000000000000000000000000000000000000000000815260040161029b91815260200190565b33600090815260076020526040808220600254815492517f9dfa24e300000000000000000000000000000000000000000000000000000000815260048101939093529092916001600160a01b0390911690639dfa24e3906024016040805180830381865afa158015610996573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ba9190613521565b602081015181519192501080156109e45750602081015181516109dd91906135ff565b8260010154115b15610aae57600254602082015182516001600160a01b0390921691632465f8f5913391606491610a13916135ff565b8660010154610a2291906135ff565b610a2d90605a613616565b610a379190613682565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015610a9557600080fd5b505af1158015610aa9573d6000803e3d6000fd5b505050505b336000908152600760205260408120818155600101819055805b60058160ff161015610b1c57858160ff1660058110610ae957610ae96135a1565b602002016020810190610afc91906136c1565b15610b0a5760019150610b1c565b80610b14816136de565b915050610ac8565b508015610c06576000610b2d6126ae565b90506000610b3b600561260e565b600081815260066020526040902080547fffffffffffffffffffffffff000000000000000000000000000000000000000016331790559050610b826008870188600561307e565b5060018681018290556002870180547fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000004367ffffffffffffffff16021790556040805180820182529283526020808401948552336000908152600790915220915182559151910155610db2565b3415610c3e576040517f0c0682b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160a081019091526000908190610ca09060038801600584835b82821015610c9757604080518082019091528285015460ff80821683526101009091041660208083019190915290825260019092019101610c5b565b5050505061167a565b600288015488549294509092506001600160a01b031690337fb73b6b634aea9965e3c60d60ac8d2380100c337b6d66167d297351746f4f1ac982610ce48188613616565b858c60030188604051610cfb959493929190613732565b60405180910390a2610d11828960000154612787565b336000908152600560205260408120818155600181018290556002810180547fffffffff0000000000000000000000000000000000000000000000000000000016905590610d62600383018261310e565b600060088301555060090180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690558315610dad57610dad33610da78387613616565b84612841565b505050505b50505050610dc06001600055565b50565b610dcb6120d5565b336000908152600560205260409020600981015460ff16610e18576040517f43050d9600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001810154610e53576040517f90a7340b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028101544390610e879074010000000000000000000000000000000000000000900467ffffffffffffffff16601461376e565b67ffffffffffffffff161115610f105760028101544390610ecb9074010000000000000000000000000000000000000000900467ffffffffffffffff16601461376e565b6040517fb4ae675a000000000000000000000000000000000000000000000000000000008152600481019290925267ffffffffffffffff16602482015260440161029b565b80546002808301543360009081526005602052604081208181556001810182905592830180547fffffffff000000000000000000000000000000000000000000000000000000001690556001600160a01b039091169190610f74600383018261310e565b600060088301555060090180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690556001600160a01b03811661103b57604051600090339084908381818185875af1925050503d8060008114610ff5576040519150601f19603f3d011682016040523d82523d6000602084013e610ffa565b606091505b5050905080611035576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5061104f565b61104f6001600160a01b03821633846128cd565b604080518381526001600160a01b038316602082015233917fa961a003e6bad850d2b19455e8db60fa1a37e0fce8259beadbb4f4958f4b8de1910160405180910390a250505061109f6001600055565b565b6002546001600160a01b031633146110fa576002546040517f2f6a7bdb0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03909116602482015260440161029b565b600082815260066020908152604080832080547fffffffffffffffffffffffff000000000000000000000000000000000000000081169091556001600160a01b031680845260059092529091206009810154610100900460ff16156112ce5760006004805480602002602001604051908101604052809291908181526020016000905b828210156111be576000848152602090819020604080518082019091529084015460ff8082168352610100909104168183015282526001909201910161117d565b50505050905060005b60058160ff161015611250576000858260405160200161121692919091825260f81b7fff0000000000000000000000000000000000000000000000000000000000000016602082015260210190565b6040516020818303038152906040528051906020012060001c905061123d82828786612994565b5080611248816136de565b9150506111c7565b50600060018301556009820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690556040516001600160a01b038416907fc3b36130c75d38724a3591fd74cfe9738bf5234994a2bebe0d81ec71e012282a906112c090600386019061379a565b60405180910390a250611674565b60006004805480602002602001604051908101604052809291908181526020016000905b82821015611333576000848152602090819020604080518082019091529084015460ff808216835261010090910416818301528252600190920191016112f2565b50505050905060005b60058110156114505760005b603481101561143d57828181518110611363576113636135a1565b60200260200101516000015160ff16846003018360058110611387576113876135a1565b015460ff161480156113d657508281815181106113a6576113a66135a1565b60200260200101516020015160ff168460030183600581106113ca576113ca6135a1565b0154610100900460ff16145b1561142b5782600184516113ea91906135ff565b815181106113fa576113fa6135a1565b6020026020010151838281518110611414576114146135a1565b60200260200101819052506001835103835261143d565b80611435816137a9565b915050611348565b5080611448816137a9565b91505061133c565b5060005b60058160ff16101561151157826008018160ff1660058110611478576114786135a1565b602081049091015460ff601f9092166101000a900416156114ff57600085826040516020016114d692919091825260f81b7fff0000000000000000000000000000000000000000000000000000000000000016602082015260210190565b6040516020818303038152906040528051906020012060001c90506114fd82828786612994565b505b80611509816136de565b915050611454565b50815460028301546040805160e0810190915260038501805460ff80821660a085019081526101009092041660c084015282526001600160a01b0390921691600091829161156791906005600160208401610c5b565b90925090506001600160a01b0387167fb73b6b634aea9965e3c60d60ac8d2380100c337b6d66167d297351746f4f1ac9856115a28582613616565b868a600301866040516115b9959493929190613732565b60405180910390a26115cf838760000154612787565b6001600160a01b0387166000908152600560205260408120818155600181018290556002810180547fffffffff0000000000000000000000000000000000000000000000000000000016905590611629600383018261310e565b600060088301555060090180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016905561166e876116688487613616565b85612841565b50505050505b50505050565b600080600061168884612a51565b60408101515160208201515191925060ff91821691161480156116bb575060608101515160408201515160ff9081169116145b156116fe5780515160208201515160ff908116911614806116ec575060808101515160608201515160ff9081169116145b156116fe5750601e9360079350915050565b80515160208201515160ff908116911614801561172b575060608101515160808201515160ff9081169116145b156117715760408101515160208201515160ff9081169116148061175f575060408101515160608201515160ff9081169116145b15611771575060089360069350915050565b602080820151015160ff1681600060200201516020015160ff161480156117b0575060608101516020015160ff1681600260200201516020015160ff16145b80156117d4575060808101516020015160ff1681600060200201516020015160ff16145b80156117f75750602080820151015160ff1681600260200201516020015160ff16145b15611a2f5780515160ff166001148015611819575060808101515160ff16600d145b156118a657606081015151611830906001906137e2565b60ff1681600260200201515160ff1614801561186a5750608081015151611859906001906137e2565b60ff1681600360200201515160ff16145b80156118945750604081015151611883906001906137e2565b60ff1681600160200201515160ff16145b156118a6575060649360099350915050565b80515160ff1660011480156118c3575060208101515160ff166002145b15611975576020810151516118da906001906137e2565b81515160ff908116911614801561190f57506060810151516118fe906001906137e2565b60ff1681600260200201515160ff16145b80156119395750608081015151611928906001906137e2565b60ff1681600360200201515160ff16145b80156119635750604081015151611952906001906137e2565b60ff1681600160200201515160ff16145b15611975575060329360089350915050565b602081015151611987906001906137e2565b81515160ff90811691161480156119bc57506060810151516119ab906001906137e2565b60ff1681600260200201515160ff16145b80156119e657506080810151516119d5906001906137e2565b60ff1681600360200201515160ff16145b8015611a1057506040810151516119ff906001906137e2565b60ff1681600160200201515160ff16145b15611a22575060329360089350915050565b5060069360059350915050565b80515160ff166001148015611a4c575060208101515160ff166002145b15611afe57602081015151611a63906001906137e2565b81515160ff9081169116148015611a985750606081015151611a87906001906137e2565b60ff1681600260200201515160ff16145b8015611ac25750608081015151611ab1906001906137e2565b60ff1681600360200201515160ff16145b8015611aec5750604081015151611adb906001906137e2565b60ff1681600160200201515160ff16145b15611afe575060059360049350915050565b80515160ff166001148015611b1b575060808101515160ff16600d145b15611ba857606081015151611b32906001906137e2565b60ff1681600260200201515160ff16148015611b6c5750608081015151611b5b906001906137e2565b60ff1681600360200201515160ff16145b8015611b965750604081015151611b85906001906137e2565b60ff1681600160200201515160ff16145b15611ba8575060059360049350915050565b602081015151611bba906001906137e2565b81515160ff9081169116148015611bef5750604081015151611bde906001906137e2565b60ff1681600160200201515160ff16145b8015611c195750606081015151611c08906001906137e2565b60ff1681600260200201515160ff16145b8015611c435750608081015151611c32906001906137e2565b60ff1681600360200201515160ff16145b15611c55575060059360049350915050565b60208101515181515160ff9081169116148015611c82575060408101515160208201515160ff9081169116145b15611c935750600393849350915050565b60408101515160208201515160ff9081169116148015611cc3575060608101515160408201515160ff9081169116145b15611cd45750600393849350915050565b60608101515160408201515160ff9081169116148015611d04575060808101515160608201515160ff9081169116145b15611d155750600393849350915050565b60208101515181515160ff90811691161415611d6b5760608101515160408201515160ff90811691161480611d5a575060808101515160608201515160ff9081169116145b15611d6b5750600293849350915050565b60408101515160208201515160ff90811691161415611da95760808101515160608201515160ff90811691161415611da95750600293849350915050565b60208101515181515160ff90811691161415611deb57805151600a60ff9091161180611dda575080515160ff166001145b15611deb5750600193849350915050565b60408101515160208201515160ff90811691161415611e3757600a81600160200201515160ff161180611e26575060208101515160ff166001145b15611e375750600193849350915050565b60608101515160408201515160ff90811691161415611e8357600a81600260200201515160ff161180611e72575060408101515160ff166001145b15611e835750600193849350915050565b60808101515160608201515160ff90811691161415611ecf57600a81600360200201515160ff161180611ebe575060608101515160ff166001145b15611ecf5750600193849350915050565b50600093849350915050565b6002546040517ee1d8d0000000000000000000000000000000000000000000000000000000008152622625a060048083019190915260248201526000916064916001600160a01b039091169062e1d8d090604401602060405180830381865afa158015611f4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f709190613805565b611f7b90607d613616565b611f859190613682565b905090565b611f9261311d565b6001600160a01b038281166000908152600560208181526040808420815161010081018352815481526001820154938101939093526002810154958616838301527401000000000000000000000000000000000000000090950467ffffffffffffffff166060830152805160a0810190915290939260808501926003850191835b8282101561204f57604080518082019091528285015460ff80821683526101009091041660208083019190915290825260019092019101612013565b505050908252506040805160a0810191829052602090920191906008840190600590826000855b825461010083900a900460ff161515815260206001928301818104948501949093039092029101808411612076575050509284525050506009919091015460ff8082161515602084015261010090910416151560409091015292915050565b60026000541415612142576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161029b565b6002600055565b60006001600160a01b03821661216c57506001546001600160a01b0316316121f6565b6001546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152908316906370a0823190602401602060405180830381865afa1580156121cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121f39190613805565b90505b60006305f5e10061220a8362020b31613616565b6122149190613682565b905080841115611674576040517fd53662aa000000000000000000000000000000000000000000000000000000008152600481018590526024810182905260440161029b565b6001546040517fbfd7f9cc0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038481166024830152600092169063bfd7f9cc90604401602060405180830381865afa1580156122c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122e8919061381e565b61231e576040517f51c3b94f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81612355576040517f07375c8400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001546040517f0a5748a800000000000000000000000000000000000000000000000000000000815233600482015260009182916001600160a01b0390911690630a5748a8906024016040805180830381865afa1580156123ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123de919061383b565b91509150811561241d576040517f6c2775f50000000000000000000000000000000000000000000000000000000081526004810182905260240161029b565b612425611edb565b92506001600160a01b0385166125275761243f8385613869565b34101561248c57346124518486613869565b6040517fde9b74a10000000000000000000000000000000000000000000000000000000081526004810192909252602482015260440161029b565b6002546040517f4ffd2e430000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0390911690634ffd2e439085906024016000604051808303818588803b1580156124eb57600080fd5b505af11580156124ff573d6000803e3d6000fd5b505050505061252284846125139190613869565b61251d90346135ff565b612a74565b612606565b8234101561256a576040517fde9b74a10000000000000000000000000000000000000000000000000000000081526004810184905234602482015260440161029b565b6002546040517f4ffd2e430000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0390911690634ffd2e439085906024016000604051808303818588803b1580156125c957600080fd5b505af11580156125dd573d6000803e3d6000fd5b506125f9935050506001600160a01b0387169050333087612afe565b61260661251d84346135ff565b505092915050565b6002546003546040517f8bc802fb0000000000000000000000000000000000000000000000000000000081526000926001600160a01b031691638bc802fb9161266591906004908101918252602082015260400190565b6020604051808303816000875af1158015612684573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126a89190613805565b92915050565b60006126b8611edb565b9050803410156126fd576040517fde9b74a10000000000000000000000000000000000000000000000000000000081526004810182905234602482015260440161029b565b6002546040517f4ffd2e430000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0390911690634ffd2e439083906024016000604051808303818588803b15801561275c57600080fd5b505af1158015612770573d6000803e3d6000fd5b5050505050612784813461251d91906135ff565b90565b6001600160a01b038216612827576001546040516000916001600160a01b03169083908381818185875af1925050503d80600081146127e2576040519150601f19603f3d011682016040523d82523d6000602084013e6127e7565b606091505b5050905080612822576040517ff0c49d4400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b6001546105cf906001600160a01b038481169116836128cd565b6001546040517f6c025ec20000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015260248201859052838116604483015290911690636c025ec290606401600060405180830381600087803b1580156128b057600080fd5b505af11580156128c4573d6000803e3d6000fd5b50505050505050565b6040516001600160a01b0383166024820152604481018290526128229084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612b4f565b60008151846129a39190613881565b90508181815181106129b7576129b76135a1565b602002602001015160056000856001600160a01b03166001600160a01b031681526020019081526020016000206003018660ff16600581106129fb576129fb6135a1565b82519101805460209093015160ff908116610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909416921691909117919091179055612a4a8183612c4e565b5050505050565b612a59613181565b612a70826000612a6b600160056135ff565b612c9d565b5090565b80612a7c5750565b604051600090339083908381818185875af1925050503d8060008114612abe576040519150601f19603f3d011682016040523d82523d6000602084013e612ac3565b606091505b50509050806105cf576040517ff0c49d4400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516001600160a01b03808516602483015283166044820152606481018290526116749085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401612912565b6000612ba4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612e8c9092919063ffffffff16565b8051909150156128225780806020019051810190612bc2919061381e565b612822576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161029b565b8060018251612c5d91906135ff565b81518110612c6d57612c6d6135a1565b6020026020010151818381518110612c8757612c876135a1565b6020026020010181905250600181510381525050565b818180821415612cae575050505050565b6000856002612cbd8787613895565b612cc79190613909565b612cd19087613971565b60058110612ce157612ce16135a1565b60200201515160ff1690505b818313612e66575b80868460058110612d0857612d086135a1565b60200201515160ff161015612d295782612d21816139e5565b935050612cf5565b858260058110612d3b57612d3b6135a1565b60200201515160ff16811015612d5d5781612d5581613a17565b925050612d29565b818313612e6157858260058110612d7657612d766135a1565b602002015151868460058110612d8e57612d8e6135a1565b602002015151878560058110612da657612da66135a1565b6020020151888560058110612dbd57612dbd6135a1565b602002015160ff928316905291169052858260058110612ddf57612ddf6135a1565b602002015160200151868460058110612dfa57612dfa6135a1565b602002015160200151878560058110612e1557612e156135a1565b6020020151602001888560058110612e2f57612e2f6135a1565b6020908102919091015160ff9384169101529116905282612e4f816139e5565b9350508180612e5d90613a17565b9250505b612ced565b81851215612e7957612e79868684612c9d565b8383121561079857610798868486612c9d565b6060612e9b8484600085612ea3565b949350505050565b606082471015612f35576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161029b565b600080866001600160a01b03168587604051612f519190613a9b565b60006040518083038185875af1925050503d8060008114612f8e576040519150601f19603f3d011682016040523d82523d6000602084013e612f93565b606091505b5091509150612fa487838387612faf565b979650505050505050565b6060831561303557825161302e576001600160a01b0385163b61302e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161029b565b5081612e9b565b612e9b838381511561304a5781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161029b9190613ab7565b6001830191839082156131025791602002820160005b838211156130d3578335151583826101000a81548160ff0219169083151502179055509260200192600101602081600001049283019260010302613094565b80156131005782816101000a81549060ff02191690556001016020816000010492830192600103026130d3565b505b50612a709291506131ba565b50610dc09060058101906131cf565b604051806101000160405280600081526020016000815260200160006001600160a01b03168152602001600067ffffffffffffffff168152602001613160613181565b815260200161316d613206565b815260006020820181905260409091015290565b6040518060a001604052806005905b60408051808201909152600080825260208201528152602001906001900390816131905790505090565b5b80821115612a7057600081556001016131bb565b5b80821115612a705780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001681556001016131d0565b6040518060a001604052806005906020820280368337509192915050565b6001600160a01b0381168114610dc057600080fd5b6000806040838503121561324c57600080fd5b82359150602083013561325e81613224565b809150509250929050565b6000806040838503121561327c57600080fd5b823561328781613224565b946020939093013593505050565b6000602082840312156132a757600080fd5b5035919050565b600060a082840312156132c057600080fd5b8260a0830111156132d057600080fd5b50919050565b600080604083850312156132e957600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561334a5761334a6132f8565b60405290565b60405160a0810167ffffffffffffffff8111828210171561334a5761334a6132f8565b803560ff8116811461338457600080fd5b919050565b600061014080838503121561339d57600080fd5b83601f8401126133ac57600080fd5b6133b4613350565b9083019080858311156133c657600080fd5b845b8381101561341557604081880312156133e15760008081fd5b6133e9613327565b6133f282613373565b81526020613401818401613373565b8282015290845292909201916040016133c8565b5095945050505050565b60006020828403121561343157600080fd5b813561343c81613224565b9392505050565b8060005b6005811015611674578151805160ff9081168652602091820151168186015260409094019390910190600101613447565b8060005b6005811015611674578151151584526020938401939091019060010161347c565b60006102a08201905082518252602083015160208301526001600160a01b03604084015116604083015267ffffffffffffffff606084015116606083015260808301516134ed6080840182613443565b5060a08301516135016101c0840182613478565b5060c0830151151561026083015260e09092015115156102809091015290565b60006040828403121561353357600080fd5b82601f83011261354257600080fd5b6040516040810181811067ffffffffffffffff82111715613565576135656132f8565b806040525080604084018581111561357c57600080fd5b845b8181101561359657805183526020928301920161357e565b509195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015613611576136116135d0565b500390565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561364e5761364e6135d0565b500290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261369157613691613653565b500490565b6000602082840312156136a857600080fd5b815161343c81613224565b8015158114610dc057600080fd5b6000602082840312156136d357600080fd5b813561343c816136b3565b600060ff821660ff8114156136f5576136f56135d0565b60010192915050565b8060005b600581101561167457815460ff808216865260089190911c16602085015260409093019260019182019101613702565b858152602081018590526001600160a01b03841660408201526101c0810161375d60608301856136fe565b826101a08301529695505050505050565b600067ffffffffffffffff808316818516808303821115613791576137916135d0565b01949350505050565b61014081016126a882846136fe565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156137db576137db6135d0565b5060010190565b600060ff821660ff8416808210156137fc576137fc6135d0565b90039392505050565b60006020828403121561381757600080fd5b5051919050565b60006020828403121561383057600080fd5b815161343c816136b3565b6000806040838503121561384e57600080fd5b8251613859816136b3565b6020939093015192949293505050565b6000821982111561387c5761387c6135d0565b500190565b60008261389057613890613653565b500690565b6000808312837f8000000000000000000000000000000000000000000000000000000000000000018312811516156138cf576138cf6135d0565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018313811615613903576139036135d0565b50500390565b60008261391857613918613653565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f80000000000000000000000000000000000000000000000000000000000000008314161561396c5761396c6135d0565b500590565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038413811516156139ab576139ab6135d0565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156139df576139df6135d0565b50500190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156137db576137db6135d0565b60007f8000000000000000000000000000000000000000000000000000000000000000821415613a4957613a496135d0565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60005b83811015613a8a578181015183820152602001613a72565b838111156116745750506000910152565b60008251613aad818460208701613a6f565b9190910192915050565b6020815260008251806020840152613ad6816040850160208701613a6f565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea2646970667358221220c1bc795facf7c042efc09cae79403435d9e1ef2f34d4bc70a024e2f65ff659c564736f6c634300080b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000051e99a0d09eeca8d7efec3062ac024b6d09899590000000000000000000000005b8bb80f2d72d0c85cab8fb169e8170a05c94baf
-----Decoded View---------------
Arg [0] : _bankroll (address): 0x51e99A0D09EeCa8d7EFEc3062AC024B6d0989959
Arg [1] : _vrf (address): 0x5b8bB80f2d72D0C85caB8fB169e8170A05C94bAF
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000051e99a0d09eeca8d7efec3062ac024b6d0989959
Arg [1] : 0000000000000000000000005b8bb80f2d72d0c85cab8fb169e8170a05c94baf
Loading...
Loading
Loading...
Loading
OVERVIEW
VideoPoker is a smart contract that allows players to participate in Jacks or Better video poker games. Players are dealt five cards randomly and can choose to replace any or all of them. The final outcome of the game, and the corresponding payout, are determined by the cards in the player's hand..Loading...
Loading
Net Worth in USD
$848.55
Net Worth in ETH
0.296198
Token Allocations
USDC.E
77.96%
ETH
14.45%
BUSD
7.05%
Others
0.53%
Multichain Portfolio | 35 Chains
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.