feat: Soulbound Token implement with ERC721
This commit is contained in:
parent
9bd872d7d4
commit
03d708d94f
File diff suppressed because one or more lines are too long
@ -20,6 +20,12 @@ contract SoulboundToken is ERC721 {
|
||||
return newItemId;
|
||||
}
|
||||
|
||||
function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual override {
|
||||
require(from == address(0) || to == address(0), "SOULBOUND: Non-Transferable.");
|
||||
require(balanceOf(to)==0, "SOULBOUND: Everyone should only have 1 SBT.");
|
||||
super._beforeTokenTransfer(from, to, firstTokenId, batchSize);
|
||||
}
|
||||
|
||||
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
|
||||
_requireMinted(tokenId);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user