More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Purchase Blocks | 5042255 | 7 hrs ago | IN | 0 S | 0.00307908 |
Latest 1 internal transaction
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
4891256 | 30 hrs ago | Contract Creation | 0 S |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x0334830d...ca6e20e7a The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
Blacksail_Parlay
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.20; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "../interfacing/parlays/IParlayFactory.sol"; contract Blacksail_Parlay is ReentrancyGuard, IERC721Receiver, IERC1155Receiver, ERC165 { using SafeERC20 for IERC20; address public GAME_MASTER; address public collection; address public factory; uint256 public ID; uint256 public totalGamePrice; uint256 public callFee; uint256 public contestEnd; address public WINNER; string[] public WINNINGBLOCK; bool public isERC1155; bool public active = true; mapping(string => mapping(uint256 => address)) blockOwner; struct Block { string row; uint256 col; } event PurchaseBlocks( address indexed buyer, Block[] _blocks, uint256 amount ); event GiftBlock( address indexed gifter, address indexed gifted, Block block ); event EndContest( address indexed winner, string[] winningBlock, address indexed Game_Master, uint256 GM_Weth_received ); Block[] owned; constructor( address _game_master, address _collection, uint256 _id, uint256 _gamePrice, uint256 _contestDuration, bool _isERC1155 ) { factory = msg.sender; GAME_MASTER = _game_master; collection = _collection; ID = _id; totalGamePrice = _gamePrice; isERC1155 = _isERC1155; contestEnd = block.timestamp + _contestDuration; callFee = calculateBlockPrice(); } function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external override returns (bytes4) { return this.onERC721Received.selector; } function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external override returns (bytes4) { return this.onERC1155Received.selector; } function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external override returns (bytes4) { return this.onERC1155BatchReceived.selector; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721Receiver).interfaceId || interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); } function calculateBlockPrice() public view returns (uint256 tokens) { return totalGamePrice / 100; } function closable() public view returns (bool) { if (block.timestamp >= contestEnd) { return (true); } else { return (false); } } function getOwnedBlocks() public view returns (string[] memory) { string[] memory ownedBlocks = new string[](owned.length); for (uint256 i = 0; i < owned.length; i++) { ownedBlocks[i] = string( abi.encodePacked(owned[i].row, uintToString(owned[i].col)) ); } return ownedBlocks; } function blocksOwnedBy(address user) public view returns (string[] memory) { uint256 count = 0; for (uint256 i = 0; i < owned.length; i++) { if (blockOwner[owned[i].row][owned[i].col] == user) { count++; } } string[] memory userBlocks = new string[](count); uint256 index = 0; for (uint256 i = 0; i < owned.length; i++) { if (blockOwner[owned[i].row][owned[i].col] == user) { userBlocks[index] = string( abi.encodePacked(owned[i].row, uintToString(owned[i].col)) ); index++; } } return userBlocks; } function uintToString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } function purchaseBlocks(Block[] calldata _block) external nonReentrant { require(active, "This parlay has concluded"); for (uint i; i < _block.length; i++) { require( _block[i].col >= 0 && _block[i].col <= 9 && charToNumber(_block[i].row) >= 0 && charToNumber(_block[i].row) <= 9, "Column out of range" ); require( blockOwner[_block[i].row][_block[i].col] == address(0), "Block already purchased" ); } uint256 cost = calculateBlockPrice() * _block.length; address weth = IParlayFactory(factory).getWETH(); uint256 balance = IERC20(weth).balanceOf(msg.sender); require(balance >= cost, "Not enough WETH balance"); IERC20(weth).safeTransferFrom(msg.sender, address(this), cost); for (uint i; i < _block.length; i++) { Block memory tempBlock; blockOwner[_block[i].row][_block[i].col] = msg.sender; tempBlock.row = _block[i].row; tempBlock.col = _block[i].col; owned.push(tempBlock); } emit PurchaseBlocks(msg.sender, _block, cost); } function closeContest() external { require(closable(), "Not enough time has passed"); require(active, "This event has been concluded"); require(IParlayFactory(factory).isMiner(msg.sender), "!Auth"); // Generate the random in range for row and col uint256[] memory winningBlock = generateWinningBlock(); address winner = blockOwner[numberToChar(winningBlock[0])][ winningBlock[1] ]; WINNER = winner; WINNINGBLOCK = [numberToChar(winningBlock[0]), uintToString(winningBlock[1])]; address weth = IParlayFactory(factory).getWETH(); uint256 wethBal = IERC20(weth).balanceOf(address(this)); uint256 wethToGM; if (wethBal > 0) { // Take protocol fee IERC20(weth).safeTransfer( IParlayFactory(factory).treasury(), (wethBal * IParlayFactory(factory).pFEE()) / IParlayFactory(factory).DIVISOR() ); // Award this function caller the call reward if ( IERC20(weth).balanceOf(address(this)) >= calculateBlockPrice() ) { IERC20(weth).safeTransfer(msg.sender, calculateBlockPrice()); } else { IERC20(weth).safeTransfer( msg.sender, IERC20(weth).balanceOf(address(this)) ); } if (IERC20(weth).balanceOf(address(this)) > 0) { wethToGM = IERC20(weth).balanceOf(address(this)); IERC20(weth).safeTransfer(GAME_MASTER, wethToGM); } } // Check the blockOwner mapping to see if the chosen block has an owner // If it doesn't send all funds to the game_master and the NFT if (winner == address(0)) { if (isERC1155) { uint256 erc1155Bal = IERC1155(collection).balanceOf( address(this), ID ); IERC1155(collection).safeTransferFrom( address(this), GAME_MASTER, ID, erc1155Bal, // Amount for ERC-1155 "" // Data (optional) ); } else { IERC721(collection).safeTransferFrom( address(this), GAME_MASTER, ID ); } } // If it does send funds, minus cost of 1 block, to the Game_master and the NFT to the winner else { if (isERC1155) { uint256 erc1155Bal = IERC1155(collection).balanceOf( address(this), ID ); IERC1155(collection).safeTransferFrom( address(this), winner, ID, erc1155Bal, // Amount for ERC-1155 "" // Data (optional) ); } else { IERC721(collection).safeTransferFrom(address(this), winner, ID); } } // Set active to false active = false; emit EndContest(winner, WINNINGBLOCK, GAME_MASTER, wethToGM); } function giftBlock(address to, Block calldata _block) external { require( blockOwner[_block.row][_block.col] == msg.sender, "You don't own this block" ); blockOwner[_block.row][_block.col] == to; emit GiftBlock(msg.sender, to, _block); } function charToNumber(string memory char) public pure returns (uint256) { bytes memory charBytes = bytes(char); require(charBytes.length == 1, "Input must be a single character."); uint8 ascii = uint8(charBytes[0]); require( ascii >= 65 && ascii <= 74, "Input must be a character between A and J." ); return ascii - 65; } function numberToChar(uint256 number) public pure returns (string memory) { require(number >= 0 && number <= 9, "Input must be between 0 and 9."); bytes memory char = new bytes(1); char[0] = bytes1(uint8(number + 65)); return string(char); } function generateWinningBlock() internal view returns (uint256[] memory) { uint256 l; uint256[] memory random = new uint256[](2); for (uint256 i = 0; i < 2; i++) { random[i] = uint256( keccak256( abi.encodePacked( block.timestamp, block.prevrandao, msg.sender, l ) ) ) % 10; l = random[i]; } return random; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol) pragma solidity ^0.8.20; import {IERC20} from "./IERC20.sol"; import {IERC165} from "./IERC165.sol"; /** * @title IERC1363 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363]. * * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction. */ interface IERC1363 is IERC20, IERC165 { /* * Note: the ERC-165 identifier for this interface is 0xb0202a11. * 0xb0202a11 === * bytes4(keccak256('transferAndCall(address,uint256)')) ^ * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^ * bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^ * bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^ * bytes4(keccak256('approveAndCall(address,uint256)')) ^ * bytes4(keccak256('approveAndCall(address,uint256,bytes)')) */ /** * @dev Moves a `value` amount of tokens from the caller's account to `to` * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferAndCall(address to, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from the caller's account to `to` * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @param data Additional data with no specified format, sent in call to `to`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param from The address which you want to send tokens from. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferFromAndCall(address from, address to, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param from The address which you want to send tokens from. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @param data Additional data with no specified format, sent in call to `to`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`. * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function approveAndCall(address spender, uint256 value) external returns (bool); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`. * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. * @param data Additional data with no specified format, sent in call to `spender`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/IERC165.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../token/ERC20/IERC20.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC-1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[ERC]. */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` amount of tokens of type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the value of tokens of token type `id` owned by `account`. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] calldata accounts, uint256[] calldata ids ) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the zero address. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`. * * WARNING: This function can potentially allow a reentrancy attack when transferring tokens * to an untrusted contract, when invoking {onERC1155Received} on the receiver. * Ensure to follow the checks-effects-interactions pattern and consider employing * reentrancy guards when interacting with untrusted contracts. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `value` amount. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * WARNING: This function can potentially allow a reentrancy attack when transferring tokens * to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver. * Ensure to follow the checks-effects-interactions pattern and consider employing * reentrancy guards when interacting with untrusted contracts. * * Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments. * * Requirements: * * - `ids` and `values` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Interface that must be implemented by smart contracts in order to receive * ERC-1155 token transfers. */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC-1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC-1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-20 standard as defined in the ERC. */ 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 value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` 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 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; import {IERC1363} from "../../../interfaces/IERC1363.sol"; import {Address} from "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC-20 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 { /** * @dev An operation with an ERC-20 token failed. */ error SafeERC20FailedOperation(address token); /** * @dev Indicates a failed `decreaseAllowance` request. */ error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease); /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value))); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value))); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. * * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client" * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); forceApprove(token, spender, oldAllowance + value); } /** * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no * value, non-reverting calls are assumed to be successful. * * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client" * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal { unchecked { uint256 currentAllowance = token.allowance(address(this), spender); if (currentAllowance < requestedDecrease) { revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease); } forceApprove(token, spender, currentAllowance - requestedDecrease); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. * * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being * set here. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); _callOptionalReturn(token, approvalCall); } } /** * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * Reverts if the returned value is other than `true`. */ function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal { if (to.code.length == 0) { safeTransfer(token, to, value); } else if (!token.transferAndCall(to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * Reverts if the returned value is other than `true`. */ function transferFromAndCallRelaxed( IERC1363 token, address from, address to, uint256 value, bytes memory data ) internal { if (to.code.length == 0) { safeTransferFrom(token, from, to, value); } else if (!token.transferFromAndCall(from, to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}. * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall} * once without retrying, and relies on the returned value to be true. * * Reverts if the returned value is other than `true`. */ function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal { if (to.code.length == 0) { forceApprove(token, to, value); } else if (!token.approveAndCall(to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements. */ function _callOptionalReturn(IERC20 token, bytes memory data) private { uint256 returnSize; uint256 returnValue; assembly ("memory-safe") { let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20) // bubble errors if iszero(success) { let ptr := mload(0x40) returndatacopy(ptr, 0, returndatasize()) revert(ptr, returndatasize()) } returnSize := returndatasize() returnValue := mload(0) } if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { bool success; uint256 returnSize; uint256 returnValue; assembly ("memory-safe") { success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20) returnSize := returndatasize() returnValue := mload(0) } return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC-721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC-721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or * {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the address zero. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.20; /** * @title ERC-721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC-721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be * reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol) pragma solidity ^0.8.20; import {Errors} from "./Errors.sol"; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert Errors.InsufficientBalance(address(this).balance, amount); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert Errors.FailedCall(); } } /** * @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 or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {Errors.FailedCall} error. * * 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. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @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`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert Errors.InsufficientBalance(address(this).balance, value); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case * of an unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {Errors.FailedCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}. */ function _revert(bytes memory returndata) 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 assembly ("memory-safe") { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert Errors.FailedCall(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol) pragma solidity ^0.8.20; /** * @dev Collection of common custom errors used in multiple contracts * * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library. * It is recommended to avoid relying on the error API for critical functionality. * * _Available since v5.1._ */ library Errors { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error InsufficientBalance(uint256 balance, uint256 needed); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedCall(); /** * @dev The deployment failed. */ error FailedDeployment(); /** * @dev A necessary precompile is missing. */ error MissingPrecompile(address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[ERC]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @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 EIP-1153 (transient storage) is available on the chain you're deploying at, * consider using {ReentrancyGuardTransient} instead. * * 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; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); 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 if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.20; interface IParlayFactory { struct WhitelistData { address collection; string collectionName; string uriFunc; bool requiresTransform; string imgFileType; bool requiresCustomURI; } function getWETH() external view returns (address); function treasury() external view returns (address); function pFEE() external view returns (uint256); function DIVISOR() external view returns (uint256); function isMiner(address account) external view returns (bool); function fetchActiveParlays() external view returns (address[] memory); function getParlay(uint256 index) external view returns (address); function whitelistedCollections() external view returns (WhitelistData[] memory); function getFriendlyURI(address collection, uint256 id) external view returns (string memory); function getWhitelistDataForCollection(address collection) external view returns (WhitelistData memory); function transformIpfsUri(address nft, uint256 id) external view returns (string memory); function isERC721(address collection) external view returns (bool); function isERC1155(address collection) external view returns (bool); }
{ "viaIR": true, "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_game_master","type":"address"},{"internalType":"address","name":"_collection","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_gamePrice","type":"uint256"},{"internalType":"uint256","name":"_contestDuration","type":"uint256"},{"internalType":"bool","name":"_isERC1155","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":false,"internalType":"string[]","name":"winningBlock","type":"string[]"},{"indexed":true,"internalType":"address","name":"Game_Master","type":"address"},{"indexed":false,"internalType":"uint256","name":"GM_Weth_received","type":"uint256"}],"name":"EndContest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"gifter","type":"address"},{"indexed":true,"internalType":"address","name":"gifted","type":"address"},{"components":[{"internalType":"string","name":"row","type":"string"},{"internalType":"uint256","name":"col","type":"uint256"}],"indexed":false,"internalType":"struct Blacksail_Parlay.Block","name":"block","type":"tuple"}],"name":"GiftBlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"components":[{"internalType":"string","name":"row","type":"string"},{"internalType":"uint256","name":"col","type":"uint256"}],"indexed":false,"internalType":"struct Blacksail_Parlay.Block[]","name":"_blocks","type":"tuple[]"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PurchaseBlocks","type":"event"},{"inputs":[],"name":"GAME_MASTER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WINNER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"WINNINGBLOCK","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"active","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"blocksOwnedBy","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"calculateBlockPrice","outputs":[{"internalType":"uint256","name":"tokens","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"callFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"char","type":"string"}],"name":"charToNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"closable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closeContest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"collection","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contestEnd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOwnedBlocks","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"components":[{"internalType":"string","name":"row","type":"string"},{"internalType":"uint256","name":"col","type":"uint256"}],"internalType":"struct Blacksail_Parlay.Block","name":"_block","type":"tuple"}],"name":"giftBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isERC1155","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"number","type":"uint256"}],"name":"numberToChar","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"row","type":"string"},{"internalType":"uint256","name":"col","type":"uint256"}],"internalType":"struct Blacksail_Parlay.Block[]","name":"_block","type":"tuple[]"}],"name":"purchaseBlocks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalGamePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Deployed Bytecode
0x608080604052600436101561001357600080fd5b600090813560e01c9081620b254314611b1b5750806301ffc9a714611aac57806302fb0c5e14611a86578063150b7a0214611a2f5780631bd0b61614611a0c578063368b4e52146118b157806336d5c9381461186157806341ac8115146118435780635e0750aa146117f557806368c7beee146117c15780636d8aa19b146117a05780637de1e5361461177757806385549b501461175257806390321e1a1461173457806399597b701461170b578063a094c63214610aa2578063b108501f14610a79578063b3cea21714610a5b578063bc197c81146109cb578063c31dd5ae14610392578063c45a015514610369578063d8b2ec27146102b6578063ec5858b0146101855763f23a6e611461012857600080fd5b346101825760a036600319011261018257610141611b37565b5061014a611b4d565b506084356001600160401b03811161017e5761016a903690600401611b63565b505060405163f23a6e6160e01b8152602090f35b5080fd5b80fd5b50346101825760031960403682011261017e576101a0611b37565b6024356001600160401b0381116102b2576040816004019382360301126102b2576024916101ce8480612076565b93908460405195869283378101600b815260209586910301902092013591828652835260018060a01b039182604087205416330361026d57907f0890a8e4433aa07469fe1c3d7ad0d3a4aa9a61c6124ac406fa8a20a3b5956a449291846102358780612076565b91908260405193849283378101600b8152030190209087528452610267604051928392868452169533958301906120f1565b0390a380f35b60405162461bcd60e51b815260048101859052601860248201527f596f7520646f6e2774206f776e207468697320626c6f636b00000000000000006044820152606490fd5b8380fd5b5034610182578060031936011261018257600c546102d381611e1b565b915b8181106102ee57604051806102ea8582611bd8565b0390f35b806102fb61036492611e8a565b50610349610315600161030d85611e8a565b500154611f8d565b60405192839161033a61032d60209384860190611eda565b9182815194859201611b90565b0103601f198101835282611d4e565b6103538286611f79565b5261035e8185611f79565b50611e65565b6102d5565b50346101825780600319360112610182576003546040516001600160a01b039091168152602090f35b5034610182576020366003190112610182576004356001600160401b03811161017e576103c3903690600401611dc1565b9060028354146109b9576002835560ff600a5460081c161561097457825b82811061082657506103f8826064600554046120a8565b600354604051636572f88f60e11b81526001600160a01b03916020908290600490829086165afa9081156107ec5786916107f7575b50166040516370a0823160e01b8152336004820152602081602481855afa80156107ec57839187916107b2575b501061076d576040516323b872dd60e01b6020820152336024820152306044820152606481018390526104a39161049e82608481015b03601f198101845283611d4e565b612151565b835b83811061054a575060405191836040840160408552526060830160608560051b850101948287905b82821061050a576020870186905288337faf4cdb81297e81b4ae6bb64d58205e56e6df95cdfd7d8212b2478c264c4def29898b038aa26001815580f35b9091929396605f198782030185528735603e1983360301811215610546576020610539600193858394016120f1565b99019501939201906104cd565b8980fd5b60405161055681611d0a565b606081528560208201526020610576610570848888612054565b80612076565b91908260405193849283378101600b8152030190206020610598848888612054565b013587526020526040862080546001600160a01b031916331790556105cb6105c4610570848888612054565b3691611d8a565b815260206105da838787612054565b01356020820152600c805490680100000000000000008210156107595760018201905561060690611e8a565b9190916107455780518051906001600160401b0382116107315761062a8454611c3a565b601f81116106f6575b50602090601f83116001146106855792826001936020936106759897968d9261067a575b5050600019600383901b1c191690841b1784555b0151910155611e65565b6104a5565b015190503880610657565b90848a5260208a20918a5b601f19851681106106de57508360209361067598979693600196938794601f198116106106c5575b505050811b01845561066b565b015160001960f88460031b161c191690553880806106b8565b91926020600181928685015181550194019201610690565b61072190858b5260208b20601f850160051c81019160208610610727575b601f0160051c01906120da565b38610633565b9091508190610714565b634e487b7160e01b89526041600452602489fd5b634e487b7160e01b87526004879052602487fd5b634e487b7160e01b88526041600452602488fd5b60405162461bcd60e51b815260206004820152601760248201527f4e6f7420656e6f75676820574554482062616c616e63650000000000000000006044820152606490fd5b9150506020813d6020116107e4575b816107ce60209383611d4e565b810103126107df578290513861045a565b600080fd5b3d91506107c1565b6040513d88823e3d90fd5b610819915060203d60201161081f575b6108118183611d4e565b8101906120bb565b3861042d565b503d610807565b610831818484612054565b506009806020610842848787612054565b013511159081610955575b81610932575b50156108f7576020610869610570838686612054565b91908260405193849283378101600b815203019020602061088b838686612054565b0135855260205260408420546001600160a01b03166108b2576108ad90611e65565b6103e1565b60405162461bcd60e51b815260206004820152601760248201527f426c6f636b20616c7265616479207075726368617365640000000000000000006044820152606490fd5b60405162461bcd60e51b8152602060048201526013602482015272436f6c756d6e206f7574206f662072616e676560681b6044820152606490fd5b905061094d6109486105c4610570858888612054565b6121f4565b111538610853565b905061096b6109486105c4610570858888612054565b5060019061084d565b60405162461bcd60e51b815260206004820152601960248201527f54686973207061726c61792068617320636f6e636c75646564000000000000006044820152606490fd5b604051633ee5aeb560e01b8152600490fd5b50346101825760a0366003190112610182576109e5611b37565b506109ee611b4d565b506001600160401b03604435818111610a5757610a0f903690600401611dc1565b5050606435818111610a5757610a29903690600401611dc1565b505060843590811161017e57610a43903690600401611b63565b505060405163bc197c8160e01b8152602090f35b8280fd5b50346101825780600319360112610182576020600454604051908152f35b50346101825780600319360112610182576008546040516001600160a01b039091168152602090f35b5034610182578060031936011261018257610abb611df1565b156116c65760ff600a5460081c161561168157600354604051631c06dc2b60e21b815233600482015290602090829060249082906001600160a01b03165afa908115610e20578291611646575b5015611619576040516001600160401b038260608301828111848210176116055760405260028352604036602085013783903360601b905b600283106115a757505050610b756020610b62610b5c85611f5c565b516122df565b8160405193828580945193849201611b90565b8101600b815203019020610b8883611f69565b51845260205260018060a01b0360408420541690816bffffffffffffffffffffffff60a01b6008541617600855610be1610bdb60405194610bc886611d0a565b610bd4610b5c82611f5c565b8652611f69565b51611f8d565b60208401526009928354600285558060021061150f575b5083855260008051602061236f83398151915285915b60028310611402575050600354604051636572f88f60e11b81526001600160a01b039091169492509050602081600481875afa90811561103d5785916113e3575b506040516370a0823160e01b8152306004820152936020856024816001600160a01b0386165afa9485156107ec5786956113af575b50859480611048575b50505081610eee57600a5460ff1615610e6f5760025460048054604051627eeac760e11b8152309281019290925260248201819052869290916001600160a01b0390911690602081604481855afa908115610e64578491610e2f575b506001546001600160a01b031691803b15610e2b57604051637921219560e11b81523060048201526001600160a01b039390931660248401526044830193909352606482015260a06084820152600060a4820152908290829060c490829084905af18015610e2057610e0c575b50505b61ff0019600a5416600a5560019060018060a01b0382541693604051926040840190604085528354809252606085019160608160051b87010194895260008051602061236f8339815191529289905b828210610de2578a8a8a7f42063566fa2ef02fb77655456708a0cb10085d7d85f666873974ddaae3d92cd38b808c8c60208301520390a380f35b909192602081610dfd819799605f198c82030186528a611c74565b98019201920190939291610da8565b610e1590611d3b565b6102b2578338610d56565b6040513d84823e3d90fd5b8480fd5b9350506020833d602011610e5c575b81610e4b60209383611d4e565b810103126107df5786925138610ce9565b3d9150610e3e565b6040513d86823e3d90fd5b60025460015460045486926001600160a01b03908116921690823b156102b257604051632142170760e11b81523060048201526001600160a01b03909216602483015260448201529082908290818381606481015b03925af18015610e2057610eda575b5050610d59565b610ee390611d3b565b6102b2578338610ed3565b600a5460ff1615610fc95760025460048054604051627eeac760e11b815230928101929092526024820181905286926001600160a01b031691602081604481865afa908115610e64578491610f94575b50823b156102b257604051637921219560e11b81523060048201526001600160a01b03871660248201526044810192909252606482015260a06084820152600060a4820152908290829081838160c48101610ec4565b9350506020833d602011610fc1575b81610fb060209383611d4e565b810103126107df5786925138610f3e565b3d9150610fa3565b60025460045485916001600160a01b031690813b15610a5757604051632142170760e11b81523060048201526001600160a01b0386166024820152604481019190915291908290606490829084905af1801561103d5761102a575b50610d59565b61103690949194611d3b565b9238611024565b6040513d87823e3d90fd5b6040516361d027b360e01b815291602083600481845afa92831561133e57889361138e575b50604051630f2d145b60e41b815291602083600481855afa928315611383578993611349575b506110a26004936020926120a8565b9160405193848092631a087f3760e11b82525afa91821561133e578892611306575b5081156112f2576110e292919004906001600160a01b0384166121b9565b6040516370a0823160e01b81523060048201526020816024816001600160a01b0386165afa9081156107ec5786916112c0575b5060055460649004116112405760055461113d9060649004336001600160a01b0384166121b9565b6040516370a0823160e01b81523060048201526020816024816001600160a01b0386165afa9081156107ec57869161120a575b5061117d575b8080610c8d565b6040516370a0823160e01b81523060048201529093506020816024816001600160a01b0388165afa801561103d5785906111d6575b60015490946111d0925085916001600160a01b0390811691166121b9565b38611176565b506020813d602011611202575b816111f060209383611d4e565b81010312610e2b576111d090516111b2565b3d91506111e3565b90506020813d602011611238575b8161122560209383611d4e565b81010312611234575138611170565b8580fd5b3d9150611218565b6040516370a0823160e01b81523060048201526020816024816001600160a01b0386165afa80156107ec57869061128c575b6112879150336001600160a01b0384166121b9565b61113d565b506020813d6020116112b8575b816112a660209383611d4e565b81010312611234576112879051611272565b3d9150611299565b90506020813d6020116112ea575b816112db60209383611d4e565b81010312611234575138611115565b3d91506112ce565b634e487b7160e01b88526012600452602488fd5b9091506020813d602011611336575b8161132260209383611d4e565b81010312611332575190386110c4565b8780fd5b3d9150611315565b6040513d8a823e3d90fd5b92506020833d60201161137b575b8161136460209383611d4e565b81010312611377579151916110a2611093565b8880fd5b3d9150611357565b6040513d8b823e3d90fd5b6113a891935060203d60201161081f576108118183611d4e565b913861106d565b9094506020813d6020116113db575b816113cb60209383611d4e565b8101031261123457519338610c84565b3d91506113be565b6113fc915060203d60201161081f576108118183611d4e565b38610c4f565b8051805190858211610731576114188454611c3a565b90601f918281116114d7575b50602091831160011461146e5792826001949360209386958d92611463575b5050600019600383901b1c191690841b1785555b01920192019190610c0e565b015190503880611443565b848a5260208a209190601f1984168b5b8181106114bf5750926001959285928796602096106114a6575b505050831b83018555611457565b015160001960f88460031b161c19169055388080611498565b9293602060018192878601518155019501930161147e565b61150090868c5260208c20600585808801821c83019360208910611506575b01901c01906120da565b38611424565b935082936114f6565b84865260008051602061236f833981519152017f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7b15b8181106115515750610bf8565b808761155f60019354611c3a565b8061156d575b505001611544565b601f808211851461158457505081555b8738611565565b61159e9084845260208420920160051c82018583016120da565b8183555561157d565b604051602081019142835244604083015283606083015260749081830152815260a081018181108682111761075957604052519020600a90066115ea8386611f79565b526115ff6115f88386611f79565b5192611e65565b91610b40565b634e487b7160e01b85526041600452602485fd5b60405162461bcd60e51b815260206004820152600560248201526404282eae8d60db1b6044820152606490fd5b90506020813d602011611679575b8161166160209383611d4e565b8101031261017e5751801515810361017e5738610b08565b3d9150611654565b60405162461bcd60e51b815260206004820152601d60248201527f54686973206576656e7420686173206265656e20636f6e636c756465640000006044820152606490fd5b60405162461bcd60e51b815260206004820152601a60248201527f4e6f7420656e6f7567682074696d6520686173207061737365640000000000006044820152606490fd5b50346101825780600319360112610182576001546040516001600160a01b039091168152602090f35b50346101825780600319360112610182576020600654604051908152f35b5034610182578060031936011261018257602061176d611df1565b6040519015158152f35b50346101825780600319360112610182576002546040516001600160a01b039091168152602090f35b50346101825780600319360112610182576020606460055404604051908152f35b5034610182576020366003190112610182576102ea6117e16004356122df565b604051918291602083526020830190611bb3565b503461018257602036600319011261018257600435906001600160401b038211610182573660238301121561018257602061183b61094836600486013560248701611d8a565b604051908152f35b50346101825780600319360112610182576020600754604051908152f35b50346101825760203660031901126101825760043560095481101561017e576117e16118aa9160096102ea94526040519283809260008051602061236f83398151915201611c74565b0382611d4e565b50346101825760208060031936011261017e576118cc611b37565b600c546001600160a01b0393909184169080805b8481106119b457506118f190611e1b565b938192825b85811061190b57604051806102ea8982611bd8565b6119258361191883611e8a565b5060405192838092611eda565b600b81520301902061193682611e8a565b50906001809201548652845282896040872054161461195f575b5061195a90611e65565b6118f6565b819561032d6119986119ad938761198661197b61195a98611e8a565b509261030d8d611e8a565b61033a60405195869484860190611eda565b6119a2828b611f79565b5261035e818a611f79565b9490611950565b6119c18661191883611e8a565b600b81520301902060016119d483611e8a565b500154845286528387604085205416146119f7575b6119f290611e65565b6118e0565b90611a046119f291611e65565b9190506119e9565b5034610182578060031936011261018257602060ff600a54166040519015158152f35b503461018257608036600319011261018257611a49611b37565b50611a52611b4d565b506064356001600160401b03811161017e57611a72903690600401611b63565b5050604051630a85bd0160e11b8152602090f35b5034610182578060031936011261018257602060ff600a5460081c166040519015158152f35b50346101825760203660031901126101825760043563ffffffff60e01b811680910361017e57602090630a85bd0160e11b8114908115611b0a575b8115611af9575b506040519015158152f35b6301ffc9a760e01b14905082611aee565b630271189760e51b81149150611ae7565b90503461017e578160031936011261017e576020906005548152f35b600435906001600160a01b03821682036107df57565b602435906001600160a01b03821682036107df57565b9181601f840112156107df578235916001600160401b0383116107df57602083818601950101116107df57565b60005b838110611ba35750506000910152565b8181015183820152602001611b93565b90602091611bcc81518092818552858086019101611b90565b601f01601f1916010190565b602080820190808352835180925260408301928160408460051b8301019501936000915b848310611c0c5750505050505090565b9091929394958480611c2a600193603f198682030187528a51611bb3565b9801930193019194939290611bfc565b90600182811c92168015611c6a575b6020831014611c5457565b634e487b7160e01b600052602260045260246000fd5b91607f1691611c49565b9060009291805491611c8583611c3a565b918282526001938481169081600014611ce75750600114611ca7575b50505050565b90919394506000526020928360002092846000945b838610611cd3575050505001019038808080611ca1565b805485870183015294019385908201611cbc565b9294505050602093945060ff191683830152151560051b01019038808080611ca1565b604081019081106001600160401b03821117611d2557604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b038111611d2557604052565b90601f801991011681019081106001600160401b03821117611d2557604052565b6001600160401b038111611d2557601f01601f191660200190565b929192611d9682611d6f565b91611da46040519384611d4e565b8294818452818301116107df578281602093846000960137010152565b9181601f840112156107df578235916001600160401b0383116107df576020808501948460051b0101116107df57565b6007544210611dff57600190565b600090565b6001600160401b038111611d255760051b60200190565b90611e2582611e04565b611e326040519182611d4e565b8281528092611e43601f1991611e04565b019060005b828110611e5457505050565b806060602080938501015201611e48565b6000198114611e745760010190565b634e487b7160e01b600052601160045260246000fd5b600c54811015611ec457600c60005260011b7fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c70190600090565b634e487b7160e01b600052603260045260246000fd5b600092918154611ee981611c3a565b92600191808316908115611f415750600114611f055750505050565b90919293945060005260209081600020906000915b858310611f305750505050019038808080611ca1565b805485840152918301918101611f1a565b60ff1916845250505081151590910201915038808080611ca1565b805115611ec45760200190565b805160011015611ec45760400190565b8051821015611ec45760209160051b010190565b80156120365780816000925b6120205750611fa782611d6f565b91611fb56040519384611d4e565b808352601f19611fc482611d6f565b01908260209236848701375b611fda5750505090565b6000198101908111611e74578092600a9160308383068101809111611e74578651821015611ec45760f81b6001600160f81b03191660001a908601840153049182611fd0565b909161202d600a91611e65565b92910480611f99565b5060405161204381611d0a565b60018152600360fc1b602082015290565b9190811015611ec45760051b81013590603e19813603018212156107df570190565b903590601e19813603018212156107df57018035906001600160401b0382116107df576020019181360383136107df57565b81810292918115918404141715611e7457565b908160209103126107df57516001600160a01b03811681036107df5790565b8181106120e5575050565b600081556001016120da565b908135601e19833603018112156107df5782016020813591016001600160401b0382116107df5781360381136107df57606093826020926040865281604087015286860137600084840186015201356020830152601f01601f1916010190565b906000602091828151910182855af1156121ad576000513d6121a457506001600160a01b0381163b155b6121825750565b604051635274afe760e01b81526001600160a01b039091166004820152602490fd5b6001141561217b565b6040513d6000823e3d90fd5b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448201929092526121f29161049e8260648101610490565b565b600181510361229057805115611ec4576020015160f81c604181101580612285575b1561222d576040190160ff8111611e745760ff1690565b60405162461bcd60e51b815260206004820152602a60248201527f496e707574206d757374206265206120636861726163746572206265747765656044820152693710209030b73210251760b11b6064820152608490fd5b50604a811115612216565b60405162461bcd60e51b815260206004820152602160248201527f496e707574206d75737420626520612073696e676c65206368617261637465726044820152601760f91b6064820152608490fd5b6009811161232957604051906122f482611d0a565b600182526020820190602036833760418101809111611e7457825115611ec45760f81b6001600160f81b03191660001a905390565b60405162461bcd60e51b815260206004820152601e60248201527f496e707574206d757374206265206265747765656e203020616e6420392e00006044820152606490fdfe6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7afa264697066735822122052da9b39f4b16aedad351c90c48fec763fde356676d7be9ab0193acff4c53f9164736f6c63430008140033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 29 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.