Request form
Cookbook may introduce a token in the future. Share and contribute to be eligible for future airdrops.
close icon
relevant tag icon
BrightID Soulbound
copy icon
BrightID
โ€ข version 1.0.0
Soulbound
Identity

BrightID Soulbound

A proof of concept inspired by Vitalik Buterin's article titled Soulbound and a forum post by Triplespeeder titled Implementing Soulbound NFTs with BrightID

*Visit desktop site to download or deploy

Version

1.0.0

Creator

BrightID

Recent Use

๐Ÿž 0xF65E saved

Last Publish

11/9/2022
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
rescue(bytes32[],uint256,uint256,uint8,bytes32,bytes32) :
This function is used to rescue a token from a contract that has been paused. It takes in an array of contextIds, a timestamp, a tokenId, a v, an r, and an s as parameters. It then calls the rescue() function with the provided parameters and an empty string. The rescue() function will use the provided parameters to verify the signature of the sender and then transfer the token to the sender's account. (autogenerated documentation)
supportsInterface(bytes4) :
This function is used to check if a contract supports a given interface. It does this by comparing the given interfaceId to the interfaceIds of the IERC721 and IERC721Metadata interfaces. If either of these match, the function returns true. If not, it calls the super.supportsInterface() function to check if the interface is supported by the parent contract. (autogenerated documentation)
balanceOf(address) :
This function is used to query the balance of a given address. It takes an address as an argument and returns the corresponding balance of that address as a uint256. The function requires that the address is not the zero address, and it uses the _balances mapping to look up the balance of the given address. (autogenerated documentation)
ownerOf(uint256) :
This function is used to query the owner of a specific token ID. It takes in a uint256 tokenId as an argument and returns the address of the owner. It first looks up the owner address in the _owners mapping and then checks to make sure that the owner address is not equal to address(0). If the owner address is equal to address(0), it will throw an error. Otherwise, it will return the owner address. (autogenerated documentation)
name() :
This function is a public view function that returns a string memory value. It is used to retrieve the name of the contract, which is stored in the _name variable. (autogenerated documentation)
symbol() :
This function returns the symbol of the token associated with the contract. It works by accessing the _symbol variable, which is a string that stores the symbol of the token. The function is marked as public and view, meaning that it can be accessed by anyone and does not modify the state of the contract. (autogenerated documentation)
tokenURI(uint256) :
This function is used to generate a unique URI for a given tokenId. It first checks if the tokenId exists, and if it does, it creates a baseURI string and concatenates it with the tokenId. The result is then encoded and returned as a string. (autogenerated documentation)
_lookup(bytes32[],uint256) :
This function is used to look up the owner and the rescuer of a given tokenId. It takes an array of contextIds and a tokenId as parameters. It first checks the owner of the tokenId and then iterates through the contextIds array to find the owner of the tokenId. If the owner is found, the function returns the owner and the rescuer address. If the owner is not found, the function reverts with an error message. (autogenerated documentation)
_baseURI() :
This function is an internal view function that returns a string memory. It does not have any code in its body, so it simply returns an empty string. (autogenerated documentation)
_safeTransfer(address,address,uint256) :
This function is an internal virtual function that is used to transfer a token with a given ID from one address to another. It first calls the _transfer function to transfer the token, and then checks if the receiving address is an ERC721Receiver implementer by calling the _checkOnERC721Received function. If the receiving address is not an ERC721Receiver implementer, an error is thrown. (autogenerated documentation)
_exists(uint256) :
This function checks if a given tokenId exists in the contract. It does this by checking if the address associated with the tokenId in the _owners mapping is equal to address(0). If it is, then the tokenId does not exist, and the function returns false. If the address associated with the tokenId is not equal to address(0), then the tokenId exists, and the function returns true. (autogenerated documentation)
_safeMint(address,uint256) :
This function is an internal virtual function that is used to mint a non-fungible token with a given token ID to a specified address. It works by calling the _safeMint function, passing in the address of the recipient, the token ID, and an empty string as the third parameter. The _safeMint function then performs the necessary checks to ensure that the token is valid and can be safely minted, and if so, it will mint the token to the specified address. (autogenerated documentation)
_mint(address,uint256) :
This function is used to mint a new token with a given tokenId. It requires that the address to which the token is being minted is not the zero address, and that the tokenId is not already in use. It then updates the _balances and _owners mappings to reflect the new token, and emits a Transfer event. (autogenerated documentation)
_burn(uint256) :
This function is used to burn a token with a given tokenId. It first retrieves the owner of the token from the BrightIDSoulbound contract, then it subtracts 1 from the owner's balance and deletes the token from the _owners mapping. Finally, it emits a Transfer event with the owner, address(0) (the null address) and the tokenId. (autogenerated documentation)
_transfer(address,address,uint256) :
This function is an internal virtual function that is used to transfer a token from one address to another. It requires three parameters: the address of the sender, the address of the recipient, and the token ID. It first checks that the recipient address is not the zero address, then it calls the _beforeTokenTransfer function, which is used to perform any additional checks before the transfer. It then subtracts one token from the sender's balance and adds one token to the recipient's balance, and updates the token's owner to the recipient. Finally, it emits a Transfer event to notify the network of the transfer. (autogenerated documentation)
_checkOnERC721Received(address,address,uint256) :
This function is used to check if a transfer of an ERC721 token is being made to a contract that implements the IERC721Receiver interface. If the recipient is a contract, the function will attempt to call the onERC721Received function of the IERC721Receiver interface. If the call is successful, the function will return true. If the call fails, the function will revert with an error message. (autogenerated documentation)
_beforeTokenTransfer(address,address,uint256) :
This function is an internal virtual function that is used to perform certain operations before a token transfer. It takes three parameters: the address of the sender, the address of the recipient, and the token ID of the token being transferred. The function performs any necessary operations before the token transfer is executed, such as checking the validity of the sender and recipient addresses, verifying that the token ID is valid, and ensuring that the sender has sufficient balance to complete the transfer. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i BrightID-Soulbound
copy icon

Recent Use

๐Ÿž 0xF65E saved

Last Publish

11/9/2022

Version

1.0.0

Creator

BrightID

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