Skip to content

Commit d19cd23

Browse files
committed
feat: add ERC721Soulbound contract
1 parent 9aa3a14 commit d19cd23

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

contracts/ERC721Soulbound.sol

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.4;
3+
4+
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
5+
6+
abstract contract ERC721Soulbound is ERC721 {
7+
function _beforeTokenTransfer(
8+
address from,
9+
address to,
10+
uint256 tokenId,
11+
uint256 batchSize
12+
) internal virtual override {
13+
require(from == address(0) || to == address(0), "ERC721Soulbound: token is non-transferable");
14+
super._beforeTokenTransfer(from, to, tokenId, batchSize);
15+
}
16+
}

0 commit comments

Comments
 (0)