Source Code
Latest 25 from a total of 32,288 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Coin Flip_Play | 43985026 | 952 days ago | IN | 0.6542023 POL | 0.07139464 | ||||
| Coin Flip_Play | 43982064 | 953 days ago | IN | 8.82554228 POL | 0.07515947 | ||||
| Coin Flip_Play | 43981335 | 953 days ago | IN | 0.62268933 POL | 0.06792545 | ||||
| Coin Flip_Play | 43981304 | 953 days ago | IN | 0.63098789 POL | 0.06485464 | ||||
| Coin Flip_Play | 43981269 | 953 days ago | IN | 0.68125529 POL | 0.07006817 | ||||
| Coin Flip_Play | 43981212 | 953 days ago | IN | 1.67911743 POL | 0.06540045 | ||||
| Coin Flip_Play | 43979365 | 953 days ago | IN | 0.90869791 POL | 0.0936513 | ||||
| Coin Flip_Play | 43979264 | 953 days ago | IN | 0.78594514 POL | 0.08469285 | ||||
| Coin Flip_Play | 43979182 | 953 days ago | IN | 0.80849751 POL | 0.08714095 | ||||
| Coin Flip_Play | 43978620 | 953 days ago | IN | 1.09322579 POL | 0.11805286 | ||||
| Coin Flip_Play | 43978540 | 953 days ago | IN | 1.22679573 POL | 0.12477222 | ||||
| Coin Flip_Play | 43978468 | 953 days ago | IN | 1.29416398 POL | 0.13165616 | ||||
| Coin Flip_Play | 43978406 | 953 days ago | IN | 1.34595699 POL | 0.13694856 | ||||
| Coin Flip_Play | 43978368 | 953 days ago | IN | 1.23362731 POL | 0.13329422 | ||||
| Coin Flip_Play | 43978303 | 953 days ago | IN | 1.21654937 POL | 0.13144031 | ||||
| Coin Flip_Play | 43978207 | 953 days ago | IN | 1.00739319 POL | 0.10235286 | ||||
| Coin Flip_Play | 43977737 | 953 days ago | IN | 0.53613914 POL | 0.05420434 | ||||
| Coin Flip_Play | 43977609 | 953 days ago | IN | 0.61542969 POL | 0.06618943 | ||||
| Coin Flip_Play | 43977555 | 953 days ago | IN | 0.56858655 POL | 0.06110453 | ||||
| Coin Flip_Play | 43977468 | 953 days ago | IN | 0.58610982 POL | 0.0593083 | ||||
| Coin Flip_Play | 43977370 | 953 days ago | IN | 0.60074256 POL | 0.06459283 | ||||
| Coin Flip_Play | 43977297 | 953 days ago | IN | 0.53718027 POL | 0.05769328 | ||||
| Coin Flip_Play | 43972360 | 953 days ago | IN | 0.51211375 POL | 0.05576177 | ||||
| Coin Flip_Play | 43970619 | 953 days ago | IN | 0.63117914 POL | 0.06279876 | ||||
| Coin Flip_Play | 43954628 | 953 days ago | IN | 0.5466107 POL | 0.05872925 |
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 44091043 | 950 days ago | 1,554.80585333 POL | ||||
| 43985026 | 952 days ago | 0.44213261 POL | ||||
| 43982072 | 953 days ago | 8 POL | ||||
| 43982064 | 953 days ago | 0.55864379 POL | ||||
| 43981335 | 953 days ago | 0.42070379 POL | ||||
| 43981304 | 953 days ago | 0.42634681 POL | ||||
| 43981269 | 953 days ago | 0.46052864 POL | ||||
| 43981218 | 953 days ago | 0.96 POL | ||||
| 43981212 | 953 days ago | 0.4862749 POL | ||||
| 43979365 | 953 days ago | 0.6151606 POL | ||||
| 43979264 | 953 days ago | 0.53168872 POL | ||||
| 43979182 | 953 days ago | 0.54702433 POL | ||||
| 43978620 | 953 days ago | 0.74063956 POL | ||||
| 43978540 | 953 days ago | 0.83146712 POL | ||||
| 43978468 | 953 days ago | 0.87727753 POL | ||||
| 43978406 | 953 days ago | 0.91249678 POL | ||||
| 43978368 | 953 days ago | 0.83611259 POL | ||||
| 43978303 | 953 days ago | 0.8244996 POL | ||||
| 43978207 | 953 days ago | 0.68227339 POL | ||||
| 43977737 | 953 days ago | 0.36184857 POL | ||||
| 43977609 | 953 days ago | 0.41576614 POL | ||||
| 43977555 | 953 days ago | 0.38391281 POL | ||||
| 43977468 | 953 days ago | 0.39582863 POL | ||||
| 43977370 | 953 days ago | 0.4057789 POL | ||||
| 43977297 | 953 days ago | 0.36255654 POL |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
CoinFlip
Compiler Version
v0.8.11+commit.d7f03943
Optimization Enabled:
Yes with 1000 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 Coin Flip game, players predict if outcome will be heads or tails
*/
contract CoinFlip is Common {
using SafeERC20 for IERC20;
constructor(address _bankroll, address _vrf, address link_eth_feed) {
Bankroll = IBankRoll(_bankroll);
IChainLinkVRF = IVRFCoordinatorV2(_vrf);
LINK_ETH_FEED = AggregatorV3Interface(link_eth_feed);
ChainLinkVRF = _vrf;
}
struct CoinFlipGame {
uint256 wager;
uint256 stopGain;
uint256 stopLoss;
uint256 requestID;
address tokenAddress;
uint64 blockNumber;
uint32 numBets;
bool isHeads;
}
mapping(address => CoinFlipGame) coinFlipGames;
mapping(uint256 => address) coinIDs;
/**
* @dev event emitted by the VRF callback with the bet 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 coinOutcomes results of coinFlip, 1-> Heads, 0 ->Tails
* @param payouts individual payouts for each bet
* @param numGames number of games performed
*/
event CoinFlip_Outcome_Event(
address indexed playerAddress,
uint256 wager,
uint256 payout,
address tokenAddress,
uint8[] coinOutcomes,
uint256[] payouts,
uint32 numGames
);
/**
* @dev event emitted when a refund is done in coin flip
* @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 CoinFlip_Refund_Event(
address indexed player,
uint256 wager,
address tokenAddress
);
error WagerAboveLimit(uint256 wager, uint256 maxWager);
error AwaitingVRF(uint256 requestID);
error InvalidNumBets(uint256 maxNumBets);
error NotAwaitingVRF();
error BlockNumberTooLow(uint256 have, uint256 want);
error OnlyCoordinatorCanFulfill(address have, address want);
/**
* @dev function to get current request player is await from VRF, returns 0 if none
* @param player address of the player to get the state
*/
function CoinFlip_GetState(
address player
) external view returns (CoinFlipGame memory) {
return (coinFlipGames[player]);
}
/**
* @dev Function to play Coin Flip, 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
* @param numBets number of bets to make, and amount of random numbers to request
* @param stopGain treshold value at which the bets stop if a certain profit is obtained
* @param stopLoss treshold value at which the bets stop if a certain loss is obtained
* @param isHeads if bet selected heads or Tails
*/
function CoinFlip_Play(
uint256 wager,
address tokenAddress,
bool isHeads,
uint32 numBets,
uint256 stopGain,
uint256 stopLoss
) external payable nonReentrant {
if (coinFlipGames[msg.sender].requestID != 0) {
revert AwaitingVRF(coinFlipGames[msg.sender].requestID);
}
if (!(numBets > 0 && numBets <= 100)) {
revert InvalidNumBets(100);
}
_kellyWager(wager, tokenAddress);
_transferWager(tokenAddress, wager * numBets, 1000000);
uint256 id = _requestRandomWords(numBets);
coinFlipGames[msg.sender] = CoinFlipGame(
wager,
stopGain,
stopLoss,
id,
tokenAddress,
uint64(block.number),
numBets,
isHeads
);
coinIDs[id] = msg.sender;
}
/**
* @dev Function to refund user in case of VRF request failling
*/
function CoinFlip_Refund() external nonReentrant {
CoinFlipGame storage game = coinFlipGames[msg.sender];
if (game.requestID == 0) {
revert NotAwaitingVRF();
}
if (game.blockNumber + 200 > block.number) {
revert BlockNumberTooLow(block.number, game.blockNumber + 200);
}
uint256 wager = game.wager * game.numBets;
address tokenAddress = game.tokenAddress;
delete (coinIDs[game.requestID]);
delete (coinFlipGames[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 CoinFlip_Refund_Event(msg.sender, wager, tokenAddress);
}
/**
* @dev function called by Chainlink VRF with random numbers
* @param requestId id provided when the request was made
* @param randomWords array of random numbers
*/
function rawFulfillRandomWords(
uint256 requestId,
uint256[] memory randomWords
) external {
if (msg.sender != ChainLinkVRF) {
revert OnlyCoordinatorCanFulfill(msg.sender, ChainLinkVRF);
}
fulfillRandomWords(requestId, randomWords);
}
function fulfillRandomWords(
uint256 requestId,
uint256[] memory randomWords
) internal {
address playerAddress = coinIDs[requestId];
if (playerAddress == address(0)) revert();
CoinFlipGame storage game = coinFlipGames[playerAddress];
int256 totalValue;
uint256 payout;
uint32 i;
uint8[] memory coinFlip = new uint8[](game.numBets);
uint256[] memory payouts = new uint256[](game.numBets);
address tokenAddress = game.tokenAddress;
for (i = 0; i < game.numBets; i++) {
if (totalValue >= int256(game.stopGain)) {
break;
}
if (totalValue <= -int256(game.stopLoss)) {
break;
}
coinFlip[i] = uint8(randomWords[i] % 2);
if (coinFlip[i] == 1 && game.isHeads == true) {
totalValue += int256((game.wager * 9800) / 10000);
payout += (game.wager * 19800) / 10000;
payouts[i] = (game.wager * 19800) / 10000;
continue;
}
if (coinFlip[i] == 0 && game.isHeads == false) {
totalValue += int256((game.wager * 9800) / 10000);
payout += (game.wager * 19800) / 10000;
payouts[i] = (game.wager * 19800) / 10000;
continue;
}
totalValue -= int256(game.wager);
}
payout += (game.numBets - i) * game.wager;
emit CoinFlip_Outcome_Event(
playerAddress,
game.wager,
payout,
tokenAddress,
coinFlip,
payouts,
i
);
_transferToBankroll(tokenAddress, game.wager * game.numBets);
delete (coinIDs[requestId]);
delete (coinFlipGames[playerAddress]);
if (payout != 0) {
_transferPayout(playerAddress, payout, tokenAddress);
}
}
/**
* @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 * 1122448) / 100000000;
if (wager > maxWager) {
revert WagerAboveLimit(wager, maxWager);
}
}
}// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
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);
}
interface IVRFCoordinatorV2 is VRFCoordinatorV2Interface {
function getFeeConfig()
external
view
returns (
uint32,
uint32,
uint32,
uint32,
uint32,
uint24,
uint24,
uint24,
uint24
);
}
contract Common is ReentrancyGuard {
using SafeERC20 for IERC20;
uint256 public VRFFees;
address public ChainLinkVRF;
AggregatorV3Interface public LINK_ETH_FEED;
IVRFCoordinatorV2 public IChainLinkVRF;
IBankRoll public Bankroll;
error NotApprovedBankroll();
error InvalidValue(uint256 required, uint256 sent);
error TransferFailed();
error RefundFailed();
error NotOwner(address want, address have);
error ZeroWager();
error PlayerSuspended(uint256 suspensionTime);
/**
* @dev function to transfer the player wager to bankroll, and charge for VRF fee
* , reverts if bankroll doesn't approve game or token
* @param tokenAddress address of the token the wager is made on
* @param wager total amount wagered
*/
function _transferWager(
address tokenAddress,
uint256 wager,
uint256 gasAmount
) internal {
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);
}
uint256 VRFfee = getVRFFee(gasAmount);
if (tokenAddress == address(0)) {
if (msg.value < wager + VRFfee) {
revert InvalidValue(wager + VRFfee, msg.value);
}
_refundExcessValue(msg.value - (VRFfee + wager));
} else {
if (msg.value < VRFfee) {
revert InvalidValue(VRFfee, msg.value);
}
IERC20(tokenAddress).safeTransferFrom(
msg.sender,
address(this),
wager
);
_refundExcessValue(msg.value - VRFfee);
}
VRFFees += 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 chainlink VRF
* @return fee amount of fee user has to pay
*/
function getVRFFee(uint256 gasAmount) public view returns (uint256 fee) {
(, int256 answer, , , ) = LINK_ETH_FEED.latestRoundData();
(uint32 fulfillmentFlatFeeLinkPPMTier1, , , , , , , , ) = IChainLinkVRF
.getFeeConfig();
fee =
tx.gasprice *
(gasAmount) +
((1e12 *
uint256(fulfillmentFlatFeeLinkPPMTier1) *
uint256(answer)) / 1e18);
}
/**
* @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(uint256 gasAmount) internal {
uint256 VRFfee = getVRFFee(gasAmount);
if (msg.value < VRFfee) {
revert InvalidValue(VRFfee, msg.value);
}
_refundExcessValue(msg.value - VRFfee);
VRFFees += VRFfee;
}
/**
* @dev function to transfer VRF fees acumulated in the contract to the Bankroll
* Can only be called by owner
*/
function transferFees(address to) external nonReentrant {
if (msg.sender != Bankroll.getOwner()) {
revert NotOwner(Bankroll.getOwner(), msg.sender);
}
uint256 fee = VRFFees;
VRFFees = 0;
(bool success, ) = payable(address(to)).call{value: fee}("");
if (!success) {
revert TransferFailed();
}
}
/**
* @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,
uint256 gasAmount
) internal {
if (!Bankroll.getIsValidWager(address(this), tokenAddress)) {
revert NotApprovedBankroll();
}
uint256 VRFfee = getVRFFee(gasAmount);
if (tokenAddress == address(0)) {
if (msg.value < wager + VRFfee) {
revert InvalidValue(wager, msg.value);
}
_refundExcessValue(msg.value - (VRFfee + wager));
} else {
if (msg.value < VRFfee) {
revert InvalidValue(VRFfee, msg.value);
}
IERC20(tokenAddress).safeTransferFrom(
msg.sender,
address(this),
wager
);
_refundExcessValue(msg.value - VRFfee);
}
VRFFees += 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 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);
}
/**
* @dev function to send the request for randomness to chainlink
* @param numWords number of random numbers required
*/
function _requestRandomWords(
uint32 numWords
) internal returns (uint256 s_requestId) {
s_requestId = VRFCoordinatorV2Interface(ChainLinkVRF)
.requestRandomWords(
0xd729dc84e21ae57ffb6be0053bf2b0668aa2aaf300a2a7b2ddf7dc0bb6e875a8,
576,
3,
2500000,
numWords
);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
function getRoundData(uint80 _roundId)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface VRFCoordinatorV2Interface {
/**
* @notice Get configuration relevant for making requests
* @return minimumRequestConfirmations global min for request confirmations
* @return maxGasLimit global max for request gas limit
* @return s_provingKeyHashes list of registered key hashes
*/
function getRequestConfig()
external
view
returns (
uint16,
uint32,
bytes32[] memory
);
/**
* @notice Request a set of random words.
* @param keyHash - Corresponds to a particular oracle job which uses
* that key for generating the VRF proof. Different keyHash's have different gas price
* ceilings, so you can select a specific one to bound your maximum per request cost.
* @param subId - The ID of the VRF subscription. Must be funded
* with the minimum subscription balance required for the selected keyHash.
* @param minimumRequestConfirmations - How many blocks you'd like the
* oracle to wait before responding to the request. See SECURITY CONSIDERATIONS
* for why you may want to request more. The acceptable range is
* [minimumRequestBlockConfirmations, 200].
* @param callbackGasLimit - How much gas you'd like to receive in your
* fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords
* may be slightly less than this amount because of gas used calling the function
* (argument decoding etc.), so you may need to request slightly more than you expect
* to have inside fulfillRandomWords. The acceptable range is
* [0, maxGasLimit]
* @param numWords - The number of uint256 random values you'd like to receive
* in your fulfillRandomWords callback. Note these numbers are expanded in a
* secure way by the VRFCoordinator from a single random value supplied by the oracle.
* @return requestId - A unique identifier of the request. Can be used to match
* a request to a response in fulfillRandomWords.
*/
function requestRandomWords(
bytes32 keyHash,
uint64 subId,
uint16 minimumRequestConfirmations,
uint32 callbackGasLimit,
uint32 numWords
) external returns (uint256 requestId);
/**
* @notice Create a VRF subscription.
* @return subId - A unique subscription id.
* @dev You can manage the consumer set dynamically with addConsumer/removeConsumer.
* @dev Note to fund the subscription, use transferAndCall. For example
* @dev LINKTOKEN.transferAndCall(
* @dev address(COORDINATOR),
* @dev amount,
* @dev abi.encode(subId));
*/
function createSubscription() external returns (uint64 subId);
/**
* @notice Get a VRF subscription.
* @param subId - ID of the subscription
* @return balance - LINK balance of the subscription in juels.
* @return reqCount - number of requests for this subscription, determines fee tier.
* @return owner - owner of the subscription.
* @return consumers - list of consumer address which are able to use this subscription.
*/
function getSubscription(uint64 subId)
external
view
returns (
uint96 balance,
uint64 reqCount,
address owner,
address[] memory consumers
);
/**
* @notice Request subscription owner transfer.
* @param subId - ID of the subscription
* @param newOwner - proposed new owner of the subscription
*/
function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external;
/**
* @notice Request subscription owner transfer.
* @param subId - ID of the subscription
* @dev will revert if original owner of subId has
* not requested that msg.sender become the new owner.
*/
function acceptSubscriptionOwnerTransfer(uint64 subId) external;
/**
* @notice Add a consumer to a VRF subscription.
* @param subId - ID of the subscription
* @param consumer - New consumer which can use the subscription
*/
function addConsumer(uint64 subId, address consumer) external;
/**
* @notice Remove a consumer from a VRF subscription.
* @param subId - ID of the subscription
* @param consumer - Consumer to remove from the subscription
*/
function removeConsumer(uint64 subId, address consumer) external;
/**
* @notice Cancel a subscription
* @param subId - ID of the subscription
* @param to - Where to send the remaining LINK to
*/
function cancelSubscription(uint64 subId, address to) external;
/*
* @notice Check to see if there exists a request commitment consumers
* for all consumers and keyhashes for a given sub.
* @param subId - ID of the subscription
* @return true if there exists at least one unfulfilled request for the subscription, false
* otherwise.
*/
function pendingRequestExists(uint64 subId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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.7.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 functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// 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);
}{
"optimizer": {
"enabled": true,
"runs": 1000
},
"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"},{"internalType":"address","name":"link_eth_feed","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"maxNumBets","type":"uint256"}],"name":"InvalidNumBets","type":"error"},{"inputs":[{"internalType":"uint256","name":"required","type":"uint256"},{"internalType":"uint256","name":"sent","type":"uint256"}],"name":"InvalidValue","type":"error"},{"inputs":[],"name":"NotApprovedBankroll","type":"error"},{"inputs":[],"name":"NotAwaitingVRF","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":"OnlyCoordinatorCanFulfill","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"},{"indexed":false,"internalType":"uint8[]","name":"coinOutcomes","type":"uint8[]"},{"indexed":false,"internalType":"uint256[]","name":"payouts","type":"uint256[]"},{"indexed":false,"internalType":"uint32","name":"numGames","type":"uint32"}],"name":"CoinFlip_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":"CoinFlip_Refund_Event","type":"event"},{"inputs":[],"name":"Bankroll","outputs":[{"internalType":"contract IBankRoll","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ChainLinkVRF","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"player","type":"address"}],"name":"CoinFlip_GetState","outputs":[{"components":[{"internalType":"uint256","name":"wager","type":"uint256"},{"internalType":"uint256","name":"stopGain","type":"uint256"},{"internalType":"uint256","name":"stopLoss","type":"uint256"},{"internalType":"uint256","name":"requestID","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint64","name":"blockNumber","type":"uint64"},{"internalType":"uint32","name":"numBets","type":"uint32"},{"internalType":"bool","name":"isHeads","type":"bool"}],"internalType":"struct CoinFlip.CoinFlipGame","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"wager","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"bool","name":"isHeads","type":"bool"},{"internalType":"uint32","name":"numBets","type":"uint32"},{"internalType":"uint256","name":"stopGain","type":"uint256"},{"internalType":"uint256","name":"stopLoss","type":"uint256"}],"name":"CoinFlip_Play","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"CoinFlip_Refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"IChainLinkVRF","outputs":[{"internalType":"contract IVRFCoordinatorV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LINK_ETH_FEED","outputs":[{"internalType":"contract AggregatorV3Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VRFFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"gasAmount","type":"uint256"}],"name":"getVRFFee","outputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"transferFees","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b506040516200228d3803806200228d8339810160408190526200003491620000a4565b6001600055600580546001600160a01b03199081166001600160a01b03958616179091556004805482169385169384179055600380548216929094169190911790925560028054909216179055620000ee565b80516001600160a01b03811681146200009f57600080fd5b919050565b600080600060608486031215620000ba57600080fd5b620000c58462000087565b9250620000d56020850162000087565b9150620000e56040850162000087565b90509250925092565b61218f80620000fe6000396000f3fe6080604052600436106100bc5760003560e01c80637df3128411610074578063953995ea1161004e578063953995ea14610318578063ad17836114610338578063d0bcfc0c1461035857600080fd5b80637df31284146101685780638bd16114146102d45780638d7c16d21461030257600080fd5b8063522d2c24116100a5578063522d2c241461012057806363dc4ef5146101355780636d9747731461015557600080fd5b80631fe543e3146100c15780634dd189d5146100e3575b600080fd5b3480156100cd57600080fd5b506100e16100dc366004611ae1565b610378565b005b3480156100ef57600080fd5b50600454610103906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561012c57600080fd5b506100e16103e4565b34801561014157600080fd5b506100e1610150366004611bc3565b610690565b6100e1610163366004611c00565b6108c8565b34801561017457600080fd5b50610258610183366004611bc3565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810191909152506001600160a01b03908116600090815260066020908152604091829020825161010081018452815481526001820154928101929092526002810154928201929092526003820154606082015260048201549283166080820152600160a01b830467ffffffffffffffff1660a0820152600160e01b90920463ffffffff1660c08301526005015460ff16151560e082015290565b6040516101179190600061010082019050825182526020830151602083015260408301516040830152606083015160608301526001600160a01b03608084015116608083015267ffffffffffffffff60a08401511660a083015263ffffffff60c08401511660c083015260e0830151151560e083015292915050565b3480156102e057600080fd5b506102f46102ef366004611c65565b610b9c565b604051908152602001610117565b34801561030e57600080fd5b506102f460015481565b34801561032457600080fd5b50600254610103906001600160a01b031681565b34801561034457600080fd5b50600354610103906001600160a01b031681565b34801561036457600080fd5b50600554610103906001600160a01b031681565b6002546001600160a01b031633146103d6576002546040517f1cf993f40000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911660248201526044015b60405180910390fd5b6103e08282610cff565b5050565b600260005414156104375760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103cd565b600260009081553381526006602052604090206003810154610485576040517f49050b3000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600481015443906104a890600160a01b900467ffffffffffffffff1660c8611c94565b67ffffffffffffffff16111561052057600481015443906104db90600160a01b900467ffffffffffffffff1660c8611c94565b6040517fb4ae675a000000000000000000000000000000000000000000000000000000008152600481019290925267ffffffffffffffff1660248201526044016103cd565b6004810154815460009161054291600160e01b90910463ffffffff1690611cc0565b6004808401546003808601546000908152600760209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19169055338352600690915281208181556001810182905560028101829055918201819055928101929092556005909101805460ff191690559091506001600160a01b03168061062f57604051600090339084908381818185875af1925050503d8060008114610602576040519150601f19603f3d011682016040523d82523d6000602084013e610607565b606091505b5050905080610629576040516312171d8360e31b815260040160405180910390fd5b50610643565b6106436001600160a01b0382163384611124565b604080518381526001600160a01b038316602082015233917f60f5ec2f86c0cf8ae72815b61b05473a9382c1c34a74749680302b342c04138a910160405180910390a25050600160005550565b600260005414156106e35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103cd565b6002600055600554604080517f893d20e800000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169163893d20e8916004808201926020929091908290030181865afa15801561074b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f9190611cdf565b6001600160a01b0316336001600160a01b03161461084257600560009054906101000a90046001600160a01b03166001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fe9190611cdf565b6040517f23295f0e0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201523360248201526044016103cd565b600180546000918290556040519091906001600160a01b0384169083908381818185875af1925050503d8060008114610897576040519150601f19603f3d011682016040523d82523d6000602084013e61089c565b606091505b50509050806108be576040516312171d8360e31b815260040160405180910390fd5b5050600160005550565b6002600054141561091b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103cd565b6002600090815533815260066020526040902060030154156109815733600090815260066020526040908190206003015490517f440db96e00000000000000000000000000000000000000000000000000000000815260048101919091526024016103cd565b60008363ffffffff1611801561099e575060648363ffffffff1611155b6109d7576040517f93107491000000000000000000000000000000000000000000000000000000008152606460048201526024016103cd565b6109e186866111d2565b6109fe856109f563ffffffff861689611cc0565b620f42406112e9565b6000610a0984611590565b9050604051806101000160405280888152602001848152602001838152602001828152602001876001600160a01b031681526020014367ffffffffffffffff1681526020018563ffffffff16815260200186151581525060066000336001600160a01b03166001600160a01b031681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060a08201518160040160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c082015181600401601c6101000a81548163ffffffff021916908363ffffffff16021790555060e08201518160050160006101000a81548160ff021916908315150217905550905050336007600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550506001600081905550505050505050565b600080600360009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610bf2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c169190611d1b565b505060048054604080517f5fbbc0d20000000000000000000000000000000000000000000000000000000081529051949650600095506001600160a01b0390911693635fbbc0d2935081830192610120928290030181865afa158015610c80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca49190611d7e565b50505050505050509050670de0b6b3a7640000828263ffffffff1664e8d4a51000610ccf9190611cc0565b610cd99190611cc0565b610ce39190611e4a565b610ced853a611cc0565b610cf79190611e5e565b949350505050565b6000828152600760205260409020546001600160a01b031680610d2157600080fd5b6001600160a01b03811660009081526006602052604081206004810154909190819081908190600160e01b900463ffffffff1667ffffffffffffffff811115610d6c57610d6c611acb565b604051908082528060200260200182016040528015610d95578160200160208202803683370190505b506004860154909150600090600160e01b900463ffffffff1667ffffffffffffffff811115610dc657610dc6611acb565b604051908082528060200260200182016040528015610def578160200160208202803683370190505b506004870154600094509091506001600160a01b03165b600487015463ffffffff600160e01b90910481169085161015610fea5786600101548612610e3357610fea565b8660020154610e4190611e76565b8613610e4c57610fea565b6002898563ffffffff1681518110610e6657610e66611e93565b6020026020010151610e789190611ea9565b838563ffffffff1681518110610e9057610e90611e93565b602002602001019060ff16908160ff1681525050828463ffffffff1681518110610ebc57610ebc611e93565b602002602001015160ff166001148015610edf5750600587015460ff1615156001145b15610f7b57865461271090610ef690612648611cc0565b610f009190611e4a565b610f0a9087611ebd565b875490965061271090610f1f90614d58611cc0565b610f299190611e4a565b610f339086611e5e565b875490955061271090610f4890614d58611cc0565b610f529190611e4a565b828563ffffffff1681518110610f6a57610f6a611e93565b602002602001018181525050610fd8565b828463ffffffff1681518110610f9357610f93611e93565b602002602001015160ff166000148015610fb25750600587015460ff16155b15610fc957865461271090610ef690612648611cc0565b8654610fd59087611f15565b95505b83610fe281611f6d565b945050610e06565b86546004880154611009908690600160e01b900463ffffffff16611f91565b63ffffffff166110199190611cc0565b6110239086611e5e565b9450876001600160a01b03167f063ba2c91a70f945b84c24531b0de813d66f430987169cb7d878431c04cb00048860000154878487878a60405161106c96959493929190611fb6565b60405180910390a26004870154875461109d91839161109891600160e01b900463ffffffff1690611cc0565b611662565b60008a8152600760209081526040808320805473ffffffffffffffffffffffffffffffffffffffff191690556001600160a01b038b168352600690915281208181556001810182905560028101829055600381018290556004810191909155600501805460ff191690558415611118576111188886836116fe565b50505050505050505050565b6040516001600160a01b0383166024820152604481018290526111cd9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915261178a565b505050565b60006001600160a01b0382166111f557506005546001600160a01b03163161127f565b6005546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152908316906370a0823190602401602060405180830381865afa158015611258573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127c9190612063565b90505b60006305f5e1006112938362112090611cc0565b61129d9190611e4a565b9050808411156112e3576040517fd53662aa00000000000000000000000000000000000000000000000000000000815260048101859052602481018290526044016103cd565b50505050565b6005546040517fbfd7f9cc0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0385811660248301529091169063bfd7f9cc90604401602060405180830381865afa158015611352573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611376919061207c565b6113ac576040517f51c3b94f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816113e3576040517f07375c8400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005546040517f0a5748a800000000000000000000000000000000000000000000000000000000815233600482015260009182916001600160a01b0390911690630a5748a8906024016040805180830381865afa158015611448573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146c9190612099565b9150915081156114ab576040517f6c2775f5000000000000000000000000000000000000000000000000000000008152600481018290526024016103cd565b60006114b684610b9c565b90506001600160a01b038616611525576114d08186611e5e565b341015611504576114e18186611e5e565b60405163de9b74a160e01b815260048101919091523460248201526044016103cd565b6115206115118683611e5e565b61151b90346120c7565b61186f565b611571565b8034101561154f5760405163de9b74a160e01b8152600481018290523460248201526044016103cd565b6115646001600160a01b0387163330886118e0565b61157161151b82346120c7565b80600160008282546115839190611e5e565b9091555050505050505050565b6002546040517f5d3b1d300000000000000000000000000000000000000000000000000000000081527fd729dc84e21ae57ffb6be0053bf2b0668aa2aaf300a2a7b2ddf7dc0bb6e875a86004820152610240602482015260036044820152622625a0606482015263ffffffff831660848201526000916001600160a01b031690635d3b1d309060a4016020604051808303816000875af1158015611638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061165c9190612063565b92915050565b6001600160a01b0382166116e4576005546040516000916001600160a01b03169083908381818185875af1925050503d80600081146116bd576040519150601f19603f3d011682016040523d82523d6000602084013e6116c2565b606091505b50509050806111cd57604051633c31275160e21b815260040160405180910390fd5b6005546103e0906001600160a01b03848116911683611124565b6005546040517f6c025ec20000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015260248201859052838116604483015290911690636c025ec290606401600060405180830381600087803b15801561176d57600080fd5b505af1158015611781573d6000803e3d6000fd5b50505050505050565b60006117df826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166119319092919063ffffffff16565b8051909150156111cd57808060200190518101906117fd919061207c565b6111cd5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016103cd565b806118775750565b604051600090339083908381818185875af1925050503d80600081146118b9576040519150601f19603f3d011682016040523d82523d6000602084013e6118be565b606091505b50509050806103e057604051633c31275160e21b815260040160405180910390fd5b6040516001600160a01b03808516602483015283166044820152606481018290526112e39085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611169565b6060611940848460008561194a565b90505b9392505050565b6060824710156119c25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016103cd565b6001600160a01b0385163b611a195760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103cd565b600080866001600160a01b03168587604051611a35919061210a565b60006040518083038185875af1925050503d8060008114611a72576040519150601f19603f3d011682016040523d82523d6000602084013e611a77565b606091505b5091509150611a87828286611a92565b979650505050505050565b60608315611aa1575081611943565b825115611ab15782518084602001fd5b8160405162461bcd60e51b81526004016103cd9190612126565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215611af457600080fd5b8235915060208084013567ffffffffffffffff80821115611b1457600080fd5b818601915086601f830112611b2857600080fd5b813581811115611b3a57611b3a611acb565b8060051b604051601f19603f83011681018181108582111715611b5f57611b5f611acb565b604052918252848201925083810185019189831115611b7d57600080fd5b938501935b82851015611b9b57843584529385019392850192611b82565b8096505050505050509250929050565b6001600160a01b0381168114611bc057600080fd5b50565b600060208284031215611bd557600080fd5b813561194381611bab565b8015158114611bc057600080fd5b63ffffffff81168114611bc057600080fd5b60008060008060008060c08789031215611c1957600080fd5b863595506020870135611c2b81611bab565b94506040870135611c3b81611be0565b93506060870135611c4b81611bee565b9598949750929560808101359460a0909101359350915050565b600060208284031215611c7757600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b600067ffffffffffffffff808316818516808303821115611cb757611cb7611c7e565b01949350505050565b6000816000190483118215151615611cda57611cda611c7e565b500290565b600060208284031215611cf157600080fd5b815161194381611bab565b805169ffffffffffffffffffff81168114611d1657600080fd5b919050565b600080600080600060a08688031215611d3357600080fd5b611d3c86611cfc565b9450602086015193506040860151925060608601519150611d5f60808701611cfc565b90509295509295909350565b805162ffffff81168114611d1657600080fd5b60008060008060008060008060006101208a8c031215611d9d57600080fd5b8951611da881611bee565b60208b0151909950611db981611bee565b60408b0151909850611dca81611bee565b60608b0151909750611ddb81611bee565b60808b0151909650611dec81611bee565b9450611dfa60a08b01611d6b565b9350611e0860c08b01611d6b565b9250611e1660e08b01611d6b565b9150611e256101008b01611d6b565b90509295985092959850929598565b634e487b7160e01b600052601260045260246000fd5b600082611e5957611e59611e34565b500490565b60008219821115611e7157611e71611c7e565b500190565b6000600160ff1b821415611e8c57611e8c611c7e565b5060000390565b634e487b7160e01b600052603260045260246000fd5b600082611eb857611eb8611e34565b500690565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03841381151615611ef757611ef7611c7e565b82600160ff1b038412811615611f0f57611f0f611c7e565b50500190565b600080831283600160ff1b01831281151615611f3357611f33611c7e565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018313811615611f6757611f67611c7e565b50500390565b600063ffffffff80831681811415611f8757611f87611c7e565b6001019392505050565b600063ffffffff83811690831681811015611fae57611fae611c7e565b039392505050565b600060c08201888352602088818501526001600160a01b038816604085015260c0606085015281875180845260e086019150828901935060005b8181101561200f57845160ff1683529383019391830191600101611ff0565b50508481036080860152865180825290820192508187019060005b818110156120465782518552938301939183019160010161202a565b50505063ffffffff851660a0850152509050979650505050505050565b60006020828403121561207557600080fd5b5051919050565b60006020828403121561208e57600080fd5b815161194381611be0565b600080604083850312156120ac57600080fd5b82516120b781611be0565b6020939093015192949293505050565b6000828210156120d9576120d9611c7e565b500390565b60005b838110156120f95781810151838201526020016120e1565b838111156112e35750506000910152565b6000825161211c8184602087016120de565b9190910192915050565b60208152600082518060208401526121458160408501602087016120de565b601f01601f1916919091016040019291505056fea26469706673582212207bdd411bd3c9c6f146d64c6be7f5a5699fd5917c5351046f20bde3572417f86764736f6c634300080b003300000000000000000000000051e99a0d09eeca8d7efec3062ac024b6d0989959000000000000000000000000ae975071be8f8ee67addbc1a82488f1c248580670000000000000000000000005787befdc0ecd210dfa948264631cd53e68f7802
Deployed Bytecode
0x6080604052600436106100bc5760003560e01c80637df3128411610074578063953995ea1161004e578063953995ea14610318578063ad17836114610338578063d0bcfc0c1461035857600080fd5b80637df31284146101685780638bd16114146102d45780638d7c16d21461030257600080fd5b8063522d2c24116100a5578063522d2c241461012057806363dc4ef5146101355780636d9747731461015557600080fd5b80631fe543e3146100c15780634dd189d5146100e3575b600080fd5b3480156100cd57600080fd5b506100e16100dc366004611ae1565b610378565b005b3480156100ef57600080fd5b50600454610103906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561012c57600080fd5b506100e16103e4565b34801561014157600080fd5b506100e1610150366004611bc3565b610690565b6100e1610163366004611c00565b6108c8565b34801561017457600080fd5b50610258610183366004611bc3565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810191909152506001600160a01b03908116600090815260066020908152604091829020825161010081018452815481526001820154928101929092526002810154928201929092526003820154606082015260048201549283166080820152600160a01b830467ffffffffffffffff1660a0820152600160e01b90920463ffffffff1660c08301526005015460ff16151560e082015290565b6040516101179190600061010082019050825182526020830151602083015260408301516040830152606083015160608301526001600160a01b03608084015116608083015267ffffffffffffffff60a08401511660a083015263ffffffff60c08401511660c083015260e0830151151560e083015292915050565b3480156102e057600080fd5b506102f46102ef366004611c65565b610b9c565b604051908152602001610117565b34801561030e57600080fd5b506102f460015481565b34801561032457600080fd5b50600254610103906001600160a01b031681565b34801561034457600080fd5b50600354610103906001600160a01b031681565b34801561036457600080fd5b50600554610103906001600160a01b031681565b6002546001600160a01b031633146103d6576002546040517f1cf993f40000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911660248201526044015b60405180910390fd5b6103e08282610cff565b5050565b600260005414156104375760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103cd565b600260009081553381526006602052604090206003810154610485576040517f49050b3000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600481015443906104a890600160a01b900467ffffffffffffffff1660c8611c94565b67ffffffffffffffff16111561052057600481015443906104db90600160a01b900467ffffffffffffffff1660c8611c94565b6040517fb4ae675a000000000000000000000000000000000000000000000000000000008152600481019290925267ffffffffffffffff1660248201526044016103cd565b6004810154815460009161054291600160e01b90910463ffffffff1690611cc0565b6004808401546003808601546000908152600760209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19169055338352600690915281208181556001810182905560028101829055918201819055928101929092556005909101805460ff191690559091506001600160a01b03168061062f57604051600090339084908381818185875af1925050503d8060008114610602576040519150601f19603f3d011682016040523d82523d6000602084013e610607565b606091505b5050905080610629576040516312171d8360e31b815260040160405180910390fd5b50610643565b6106436001600160a01b0382163384611124565b604080518381526001600160a01b038316602082015233917f60f5ec2f86c0cf8ae72815b61b05473a9382c1c34a74749680302b342c04138a910160405180910390a25050600160005550565b600260005414156106e35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103cd565b6002600055600554604080517f893d20e800000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169163893d20e8916004808201926020929091908290030181865afa15801561074b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f9190611cdf565b6001600160a01b0316336001600160a01b03161461084257600560009054906101000a90046001600160a01b03166001600160a01b031663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fe9190611cdf565b6040517f23295f0e0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201523360248201526044016103cd565b600180546000918290556040519091906001600160a01b0384169083908381818185875af1925050503d8060008114610897576040519150601f19603f3d011682016040523d82523d6000602084013e61089c565b606091505b50509050806108be576040516312171d8360e31b815260040160405180910390fd5b5050600160005550565b6002600054141561091b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103cd565b6002600090815533815260066020526040902060030154156109815733600090815260066020526040908190206003015490517f440db96e00000000000000000000000000000000000000000000000000000000815260048101919091526024016103cd565b60008363ffffffff1611801561099e575060648363ffffffff1611155b6109d7576040517f93107491000000000000000000000000000000000000000000000000000000008152606460048201526024016103cd565b6109e186866111d2565b6109fe856109f563ffffffff861689611cc0565b620f42406112e9565b6000610a0984611590565b9050604051806101000160405280888152602001848152602001838152602001828152602001876001600160a01b031681526020014367ffffffffffffffff1681526020018563ffffffff16815260200186151581525060066000336001600160a01b03166001600160a01b031681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060a08201518160040160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060c082015181600401601c6101000a81548163ffffffff021916908363ffffffff16021790555060e08201518160050160006101000a81548160ff021916908315150217905550905050336007600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550506001600081905550505050505050565b600080600360009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610bf2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c169190611d1b565b505060048054604080517f5fbbc0d20000000000000000000000000000000000000000000000000000000081529051949650600095506001600160a01b0390911693635fbbc0d2935081830192610120928290030181865afa158015610c80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca49190611d7e565b50505050505050509050670de0b6b3a7640000828263ffffffff1664e8d4a51000610ccf9190611cc0565b610cd99190611cc0565b610ce39190611e4a565b610ced853a611cc0565b610cf79190611e5e565b949350505050565b6000828152600760205260409020546001600160a01b031680610d2157600080fd5b6001600160a01b03811660009081526006602052604081206004810154909190819081908190600160e01b900463ffffffff1667ffffffffffffffff811115610d6c57610d6c611acb565b604051908082528060200260200182016040528015610d95578160200160208202803683370190505b506004860154909150600090600160e01b900463ffffffff1667ffffffffffffffff811115610dc657610dc6611acb565b604051908082528060200260200182016040528015610def578160200160208202803683370190505b506004870154600094509091506001600160a01b03165b600487015463ffffffff600160e01b90910481169085161015610fea5786600101548612610e3357610fea565b8660020154610e4190611e76565b8613610e4c57610fea565b6002898563ffffffff1681518110610e6657610e66611e93565b6020026020010151610e789190611ea9565b838563ffffffff1681518110610e9057610e90611e93565b602002602001019060ff16908160ff1681525050828463ffffffff1681518110610ebc57610ebc611e93565b602002602001015160ff166001148015610edf5750600587015460ff1615156001145b15610f7b57865461271090610ef690612648611cc0565b610f009190611e4a565b610f0a9087611ebd565b875490965061271090610f1f90614d58611cc0565b610f299190611e4a565b610f339086611e5e565b875490955061271090610f4890614d58611cc0565b610f529190611e4a565b828563ffffffff1681518110610f6a57610f6a611e93565b602002602001018181525050610fd8565b828463ffffffff1681518110610f9357610f93611e93565b602002602001015160ff166000148015610fb25750600587015460ff16155b15610fc957865461271090610ef690612648611cc0565b8654610fd59087611f15565b95505b83610fe281611f6d565b945050610e06565b86546004880154611009908690600160e01b900463ffffffff16611f91565b63ffffffff166110199190611cc0565b6110239086611e5e565b9450876001600160a01b03167f063ba2c91a70f945b84c24531b0de813d66f430987169cb7d878431c04cb00048860000154878487878a60405161106c96959493929190611fb6565b60405180910390a26004870154875461109d91839161109891600160e01b900463ffffffff1690611cc0565b611662565b60008a8152600760209081526040808320805473ffffffffffffffffffffffffffffffffffffffff191690556001600160a01b038b168352600690915281208181556001810182905560028101829055600381018290556004810191909155600501805460ff191690558415611118576111188886836116fe565b50505050505050505050565b6040516001600160a01b0383166024820152604481018290526111cd9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915261178a565b505050565b60006001600160a01b0382166111f557506005546001600160a01b03163161127f565b6005546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152908316906370a0823190602401602060405180830381865afa158015611258573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127c9190612063565b90505b60006305f5e1006112938362112090611cc0565b61129d9190611e4a565b9050808411156112e3576040517fd53662aa00000000000000000000000000000000000000000000000000000000815260048101859052602481018290526044016103cd565b50505050565b6005546040517fbfd7f9cc0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0385811660248301529091169063bfd7f9cc90604401602060405180830381865afa158015611352573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611376919061207c565b6113ac576040517f51c3b94f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816113e3576040517f07375c8400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005546040517f0a5748a800000000000000000000000000000000000000000000000000000000815233600482015260009182916001600160a01b0390911690630a5748a8906024016040805180830381865afa158015611448573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146c9190612099565b9150915081156114ab576040517f6c2775f5000000000000000000000000000000000000000000000000000000008152600481018290526024016103cd565b60006114b684610b9c565b90506001600160a01b038616611525576114d08186611e5e565b341015611504576114e18186611e5e565b60405163de9b74a160e01b815260048101919091523460248201526044016103cd565b6115206115118683611e5e565b61151b90346120c7565b61186f565b611571565b8034101561154f5760405163de9b74a160e01b8152600481018290523460248201526044016103cd565b6115646001600160a01b0387163330886118e0565b61157161151b82346120c7565b80600160008282546115839190611e5e565b9091555050505050505050565b6002546040517f5d3b1d300000000000000000000000000000000000000000000000000000000081527fd729dc84e21ae57ffb6be0053bf2b0668aa2aaf300a2a7b2ddf7dc0bb6e875a86004820152610240602482015260036044820152622625a0606482015263ffffffff831660848201526000916001600160a01b031690635d3b1d309060a4016020604051808303816000875af1158015611638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061165c9190612063565b92915050565b6001600160a01b0382166116e4576005546040516000916001600160a01b03169083908381818185875af1925050503d80600081146116bd576040519150601f19603f3d011682016040523d82523d6000602084013e6116c2565b606091505b50509050806111cd57604051633c31275160e21b815260040160405180910390fd5b6005546103e0906001600160a01b03848116911683611124565b6005546040517f6c025ec20000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015260248201859052838116604483015290911690636c025ec290606401600060405180830381600087803b15801561176d57600080fd5b505af1158015611781573d6000803e3d6000fd5b50505050505050565b60006117df826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166119319092919063ffffffff16565b8051909150156111cd57808060200190518101906117fd919061207c565b6111cd5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016103cd565b806118775750565b604051600090339083908381818185875af1925050503d80600081146118b9576040519150601f19603f3d011682016040523d82523d6000602084013e6118be565b606091505b50509050806103e057604051633c31275160e21b815260040160405180910390fd5b6040516001600160a01b03808516602483015283166044820152606481018290526112e39085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611169565b6060611940848460008561194a565b90505b9392505050565b6060824710156119c25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016103cd565b6001600160a01b0385163b611a195760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103cd565b600080866001600160a01b03168587604051611a35919061210a565b60006040518083038185875af1925050503d8060008114611a72576040519150601f19603f3d011682016040523d82523d6000602084013e611a77565b606091505b5091509150611a87828286611a92565b979650505050505050565b60608315611aa1575081611943565b825115611ab15782518084602001fd5b8160405162461bcd60e51b81526004016103cd9190612126565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215611af457600080fd5b8235915060208084013567ffffffffffffffff80821115611b1457600080fd5b818601915086601f830112611b2857600080fd5b813581811115611b3a57611b3a611acb565b8060051b604051601f19603f83011681018181108582111715611b5f57611b5f611acb565b604052918252848201925083810185019189831115611b7d57600080fd5b938501935b82851015611b9b57843584529385019392850192611b82565b8096505050505050509250929050565b6001600160a01b0381168114611bc057600080fd5b50565b600060208284031215611bd557600080fd5b813561194381611bab565b8015158114611bc057600080fd5b63ffffffff81168114611bc057600080fd5b60008060008060008060c08789031215611c1957600080fd5b863595506020870135611c2b81611bab565b94506040870135611c3b81611be0565b93506060870135611c4b81611bee565b9598949750929560808101359460a0909101359350915050565b600060208284031215611c7757600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b600067ffffffffffffffff808316818516808303821115611cb757611cb7611c7e565b01949350505050565b6000816000190483118215151615611cda57611cda611c7e565b500290565b600060208284031215611cf157600080fd5b815161194381611bab565b805169ffffffffffffffffffff81168114611d1657600080fd5b919050565b600080600080600060a08688031215611d3357600080fd5b611d3c86611cfc565b9450602086015193506040860151925060608601519150611d5f60808701611cfc565b90509295509295909350565b805162ffffff81168114611d1657600080fd5b60008060008060008060008060006101208a8c031215611d9d57600080fd5b8951611da881611bee565b60208b0151909950611db981611bee565b60408b0151909850611dca81611bee565b60608b0151909750611ddb81611bee565b60808b0151909650611dec81611bee565b9450611dfa60a08b01611d6b565b9350611e0860c08b01611d6b565b9250611e1660e08b01611d6b565b9150611e256101008b01611d6b565b90509295985092959850929598565b634e487b7160e01b600052601260045260246000fd5b600082611e5957611e59611e34565b500490565b60008219821115611e7157611e71611c7e565b500190565b6000600160ff1b821415611e8c57611e8c611c7e565b5060000390565b634e487b7160e01b600052603260045260246000fd5b600082611eb857611eb8611e34565b500690565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03841381151615611ef757611ef7611c7e565b82600160ff1b038412811615611f0f57611f0f611c7e565b50500190565b600080831283600160ff1b01831281151615611f3357611f33611c7e565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018313811615611f6757611f67611c7e565b50500390565b600063ffffffff80831681811415611f8757611f87611c7e565b6001019392505050565b600063ffffffff83811690831681811015611fae57611fae611c7e565b039392505050565b600060c08201888352602088818501526001600160a01b038816604085015260c0606085015281875180845260e086019150828901935060005b8181101561200f57845160ff1683529383019391830191600101611ff0565b50508481036080860152865180825290820192508187019060005b818110156120465782518552938301939183019160010161202a565b50505063ffffffff851660a0850152509050979650505050505050565b60006020828403121561207557600080fd5b5051919050565b60006020828403121561208e57600080fd5b815161194381611be0565b600080604083850312156120ac57600080fd5b82516120b781611be0565b6020939093015192949293505050565b6000828210156120d9576120d9611c7e565b500390565b60005b838110156120f95781810151838201526020016120e1565b838111156112e35750506000910152565b6000825161211c8184602087016120de565b9190910192915050565b60208152600082518060208401526121458160408501602087016120de565b601f01601f1916919091016040019291505056fea26469706673582212207bdd411bd3c9c6f146d64c6be7f5a5699fd5917c5351046f20bde3572417f86764736f6c634300080b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000051e99a0d09eeca8d7efec3062ac024b6d0989959000000000000000000000000ae975071be8f8ee67addbc1a82488f1c248580670000000000000000000000005787befdc0ecd210dfa948264631cd53e68f7802
-----Decoded View---------------
Arg [0] : _bankroll (address): 0x51e99A0D09EeCa8d7EFEc3062AC024B6d0989959
Arg [1] : _vrf (address): 0xAE975071Be8F8eE67addBC1A82488F1C24858067
Arg [2] : link_eth_feed (address): 0x5787BefDc0ECd210Dfa948264631CD53E68F7802
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000051e99a0d09eeca8d7efec3062ac024b6d0989959
Arg [1] : 000000000000000000000000ae975071be8f8ee67addbc1a82488f1c24858067
Arg [2] : 0000000000000000000000005787befdc0ecd210dfa948264631cd53e68f7802
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in POL
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
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.