relevant tag icon
Referral Code NFTs
copy icon
0xadeeb
• version 1.0.0
nft
claim
merkleTrees
Deployable

Referral Code NFTs

Creators can set their NFTs for claim, but only for selected group of people with whom they have shared the referral code as QR or simply the code. Vulnerable to mempool scanning attacks. Do not attempt on high valued NFTs.

*Visit desktop site to download or deploy

Version

1.0.0

Creator

0xadeeb

Last Publish

12/14/2022
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
claimTokenWithReferral(address,address,uint256,string,bytes32[]) :
The main function to call when a user with referral code from nft owner to claim it. @from : address of nft owner @tokenAddr: nft contract address @tokenId: id of the nft @referral: referral code (alpha numeric , depends on your merkle tree generation logic) @proof: proof is set of hashes that ultimatey gives the root hash when combined with the referral code hash
owner() :
Returns the address of the current owner.
paused() :
Returns true if the contract is paused, and false otherwise.
renounceOwnership() :
Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.
setMerkleRoot(address,uint256,bytes32) :
set root hash of given nft (contract, id)
transferOwnership(address) :
Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.
userCodeClaimed(address,string) :
returns true if given referral code has been used the user
userTokenRoot(address,string) :
returns the root hash given nft(contract, id) and nft owner

Get Cookin'
share iconShare

copy iconNo-Code Deploy
copy iconDownload Source
copy iconnpx cookbookdev i Referral-Code-NFTs
copy icon

Bytecode

Download

Verification

Download

Last Publish

12/14/2022

Solidity Compiler

v0.8.17+commit.8df45f5f

Version

1.0.0

Creator

0xadeeb

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.