Verified contractExactMIT
SantaProtocol
Address0x1a03347e1ffa36498379b9e20140bb02ea78f991
- Balance
0 ETH
- Transactions
6,093
- Compiler
solc 0.8.7
- Same code
Only this contract
Details
- Compiler
- solc 0.8.7+commit.e28d00a7
- Language
- solidity
- Optimization
- Yes, 200 runs
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 16,194,800
- Creation transaction
- 0xfb56472954…f390bc74eb
Read22
- MAX_GIFTS() → (uint32)
- PAUSED() → (bool)
- SEED() → (uint256)
- SEED_REQUEST_ID() → (uint256)
- SHUFFLED() → (bool)
- getChosenGifts(address) → (tuple[])
- getContractHash() → (bytes32)
- getGiftPool() → (tuple[])
- getGiftPoolIndices() → (uint32[])
- getGiftPoolSize() → (uint256)
- getNumberOfChosenGifts(address) → (uint256)
- giftSupports721(address) → (bool)
- hashGift(address,address,uint256) → (bytes32)
- owner() → (address)
- s_giftPool(uint256) → (address,address,uint256)
- s_giftPoolIndices(uint256) → (uint32)
- s_randomWords(uint256) → (uint256)
- s_redemptionStart() → (uint256)
- s_registrationEnd() → (uint256)
- s_requestId() → (uint256)
- s_requestIdMapping(uint256) → (address)
- validateGiftHashSignature(address,address,uint256,bytes) → (bool)
Write16
- addGift(address,uint256,bytes)
- onERC721Received(address,address,uint256,bytes) → (bytes4)
- openGift(uint256)
- rawFulfillRandomWords(uint256,uint256[])
- renounceOwnership()
- requestSeed()
- setCallbackGasLimit(uint32)
- setKeyHash(bytes32)
- setMaxGifts(uint32)
- setPaused(bool)
- setRedemptionStart(uint256)
- setRegistrationEnd(uint256)
- setSigner(address)
- setSubscriptionId(uint64)
- shuffleRandomGiftIndices(uint32,uint32)
- transferOwnership(address)
Events10
- AddGift(address,address,uint256)
- ERC721Received(address,address,uint256,bytes)
- GiftAdded(address,address,uint256)
- GiftChosen(address,uint256,address,uint256)
- GiftUnwrapped(address,address,uint256)
- NewOwner(address)
- NewRandomNumberConsumerOwner(address)
- NewSigner(address)
- OwnershipTransferred(address,address)
- ReturnedRandomness(uint256,uint256[])
Errors14
- AllGiftsGiven()
- CannotGiftPresent()
- DoesNotOwnPresent()
- GiftMustSupportERC721Interface()
- HasNotBeenShuffled()
- InvalidSenderMustNotBeContract()
- InvalidSignature()
- MaxGiftsReached()
- MustApproveContract()
- MustOwnTokenId()
- OnlyCoordinatorCanFulfill(address,address)
- PoolSizeExceedsAmount()
- RedemptionHasNotStarted()
- RegistrationEnded()
ABI as JSON
[
{
"type": "constructor",
"inputs": [
{
"name": "subscriptionId",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "vrfCoordinator",
"type": "address",
"internalType": "address"
},
{
"name": "keyHash",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "registrationEnd",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "redemptionStart",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "signer",
"type": "address",
"internalType": "address"
},
{
"name": "presentNft",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "nonpayable"
},
{
"name": "AllGiftsGiven",
"type": "error",
"inputs": []
},
{
"name": "CannotGiftPresent",
"type": "error",
"inputs": []
},
{
"name": "DoesNotOwnPresent",
"type": "error",
"inputs": []
},
{
"name": "GiftMustSupportERC721Interface",
"type": "error",
"inputs": []
},
{
"name": "HasNotBeenShuffled",
"type": "error",
"inputs": []
},
{
"name": "InvalidSenderMustNotBeContract",
"type": "error",
"inputs": []
},
{
"name": "InvalidSignature",
"type": "error",
"inputs": []
},
{
"name": "MaxGiftsReached",
"type": "error",
"inputs": []
},
{
"name": "MustApproveContract",
"type": "error",
"inputs": []
},
{
"name": "MustOwnTokenId",
"type": "error",
"inputs": []
},
{
"name": "OnlyCoordinatorCanFulfill",
"type": "error",
"inputs": [
{
"name": "have",
"type": "address",
"internalType": "address"
},
{
"name": "want",
"type": "address",
"internalType": "address"
}
]
},
{
"name": "PoolSizeExceedsAmount",
"type": "error",
"inputs": []
},
{
"name": "RedemptionHasNotStarted",
"type": "error",
"inputs": []
},
{
"name": "RegistrationEnded",
"type": "error",
"inputs": []
},
{
"name": "AddGift",
"type": "event",
"inputs": [
{
"name": "gifter",
"type": "address",
"indexed": false,
"internalType": "address"
},
{
"name": "nft",
"type": "address",
"indexed": false,
"internalType": "address"
},
{
"name": "tokenId",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"name": "ERC721Received",
"type": "event",
"inputs": [
{
"name": "operator",
"type": "address",
"indexed": false,
"internalType": "address"
},
{
"name": "from",
"type": "address",
"indexed": false,
"internalType": "address"
},
{
"name": "tokenId",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "data",
"type": "bytes",
"indexed": false,
"internalType": "bytes"
}
],
"anonymous": false
},
{
"name": "GiftAdded",
"type": "event",
"inputs": [
{
"name": "gifter",
"type": "address",
"indexed": false,
"internalType": "address"
},
{
"name": "nft",
"type": "address",
"indexed": false,
"internalType": "address"
},
{
"name": "tokenId",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"name": "GiftChosen",
"type": "event",
"inputs": [
{
"name": "account",
"type": "address",
"indexed": false,
"internalType": "address"
},
{
"name": "presentTokenId",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "nft",
"type": "address",
"indexed": false,
"internalType": "address"
},
{
"name": "tokenId",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"name": "GiftUnwrapped",
"type": "event",
"inputs": [
{
"name": "receiver",
"type": "address",
"indexed": false,
"internalType": "address"
},
{
"name": "nft",
"type": "address",
"indexed": false,
"internalType": "address"
},
{
"name": "tokenId",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"name": "NewOwner",
"type": "event",
"inputs": [
{
"name": "newOwner",
"type": "address",
"indexed": false,
"internalType": "address"
}
],
"anonymous": false
},
{
"name": "NewRandomNumberConsumerOwner",
"type": "event",
"inputs": [
{
"name": "newOwner",
"type": "address",
"indexed": false,
"internalType": "address"
}
],
"anonymous": false
},
{
"name": "NewSigner",
"type": "event",
"inputs": [
{
"name": "newSigner",
"type": "address",
"indexed": false,
"internalType": "address"
}
],
"anonymous": false
},
{
"name": "OwnershipTransferred",
"type": "event",
"inputs": [
{
"name": "previousOwner",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "newOwner",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"name": "ReturnedRandomness",
"type": "event",
"inputs": [
{
"name": "requestId",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "randomWords",
"type": "uint256[]",
"indexed": false,
"internalType": "uint256[]"
}
],
"anonymous": false
},
{
"name": "MAX_GIFTS",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint32",
"internalType": "uint32"
}
],
"stateMutability": "view"
},
{
"name": "PAUSED",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"name": "SEED",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "SEED_REQUEST_ID",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "SHUFFLED",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"name": "addGift",
"type": "function",
"inputs": [
{
"name": "nft",
"type": "address",
"internalType": "address"
},
{
"name": "tokenId",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "sig",
"type": "bytes",
"internalType": "bytes"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "getChosenGifts",
"type": "function",
"inputs": [
{
"name": "account",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{
"name": "gifts",
"type": "tuple[]",
"components": [
{
"name": "gifter",
"type": "address",
"internalType": "address"
},
{
"name": "nft",
"type": "address",
"internalType": "address"
},
{
"name": "tokenId",
"type": "uint256",
"internalType": "uint256"
}
],
"internalType": "struct SantaProtocol.Gift[]"
}
],
"stateMutability": "view"
},
{
"name": "getContractHash",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"name": "getGiftPool",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "tuple[]",
"components": [
{
"name": "gifter",
"type": "address",
"internalType": "address"
},
{
"name": "nft",
"type": "address",
"internalType": "address"
},
{
"name": "tokenId",
"type": "uint256",
"internalType": "uint256"
}
],
"internalType": "struct SantaProtocol.Gift[]"
}
],
"stateMutability": "view"
},
{
"name": "getGiftPoolIndices",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint32[]",
"internalType": "uint32[]"
}
],
"stateMutability": "view"
},
{
"name": "getGiftPoolSize",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "getNumberOfChosenGifts",
"type": "function",
"inputs": [
{
"name": "account",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "giftSupports721",
"type": "function",
"inputs": [
{
"name": "nft",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"name": "hashGift",
"type": "function",
"inputs": [
{
"name": "gifter",
"type": "address",
"internalType": "address"
},
{
"name": "nft",
"type": "address",
"internalType": "address"
},
{
"name": "tokenId",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"name": "onERC721Received",
"type": "function",
"inputs": [
{
"name": "operator",
"type": "address",
"internalType": "address"
},
{
"name": "from",
"type": "address",
"internalType": "address"
},
{
"name": "tokenId",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "data",
"type": "bytes",
"internalType": "bytes"
}
],
"outputs": [
{
"name": "",
"type": "bytes4",
"internalType": "bytes4"
}
],
"stateMutability": "nonpayable"
},
{
"name": "openGift",
"type": "function",
"inputs": [
{
"name": "tokenId",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "owner",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "view"
},
{
"name": "rawFulfillRandomWords",
"type": "function",
"inputs": [
{
"name": "requestId",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "randomWords",
"type": "uint256[]",
"internalType": "uint256[]"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "renounceOwnership",
"type": "function",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "requestSeed",
"type": "function",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "s_giftPool",
"type": "function",
"inputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "gifter",
"type": "address",
"internalType": "address"
},
{
"name": "nft",
"type": "address",
"internalType": "address"
},
{
"name": "tokenId",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "s_giftPoolIndices",
"type": "function",
"inputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "uint32",
"internalType": "uint32"
}
],
"stateMutability": "view"
},
{
"name": "s_randomWords",
"type": "function",
"inputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "s_redemptionStart",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "s_registrationEnd",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "s_requestId",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "s_requestIdMapping",
"type": "function",
"inputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "view"
},
{
"name": "setCallbackGasLimit",
"type": "function",
"inputs": [
{
"name": "callbackGasLimit",
"type": "uint32",
"internalType": "uint32"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "setKeyHash",
"type": "function",
"inputs": [
{
"name": "keyHash",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "setMaxGifts",
"type": "function",
"inputs": [
{
"name": "_maxGifts",
"type": "uint32",
"internalType": "uint32"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "setPaused",
"type": "function",
"inputs": [
{
"name": "_isPaused",
"type": "bool",
"internalType": "bool"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "setRedemptionStart",
"type": "function",
"inputs": [
{
"name": "newRedemptionStart",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "setRegistrationEnd",
"type": "function",
"inputs": [
{
"name": "newRegistrationEnd",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "setSigner",
"type": "function",
"inputs": [
{
"name": "newSigner",
"type": "address",
"internalType": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "setSubscriptionId",
"type": "function",
"inputs": [
{
"name": "subscriptionId",
"type": "uint64",
"internalType": "uint64"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "shuffleRandomGiftIndices",
"type": "function",
"inputs": [
{
"name": "startPosition",
"type": "uint32",
"internalType": "uint32"
},
{
"name": "endPosition",
"type": "uint32",
"internalType": "uint32"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "transferOwnership",
"type": "function",
"inputs": [
{
"name": "newOwner",
"type": "address",
"internalType": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "validateGiftHashSignature",
"type": "function",
"inputs": [
{
"name": "gifter",
"type": "address",
"internalType": "address"
},
{
"name": "nft",
"type": "address",
"internalType": "address"
},
{
"name": "tokenId",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "sig",
"type": "bytes",
"internalType": "bytes"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
}
]Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.