Skip to content

Commit

Permalink
remove link before SBT transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelcabot committed Oct 9, 2022
1 parent e2df88b commit 98dbfa7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contracts/tokens/NFT.sol
Expand Up @@ -129,7 +129,7 @@ abstract contract NFT is
address from,
address to,
uint256 tokenId
) internal override(ERC721, ERC721Enumerable) whenNotPaused {
) internal virtual override(ERC721, ERC721Enumerable) whenNotPaused {
super._beforeTokenTransfer(from, to, tokenId);
}

Expand Down
13 changes: 12 additions & 1 deletion contracts/tokens/SBT.sol
Expand Up @@ -96,11 +96,22 @@ abstract contract SBT is NFT {

/* ========== PRIVATE FUNCTIONS ========================================= */

function _beforeTokenTransfer(
address from,
address,
uint256 tokenId
) internal virtual override {
if (from != address(0)) {
// if its not newly minted, remove the soul links
soulLinker.removeLink(address(this), tokenId);
}
}

function _afterTokenTransfer(
address,
address,
uint256 tokenId
) internal override {
) internal virtual override {
soulLinker.createLink(address(this), tokenId, 0);
}

Expand Down

0 comments on commit 98dbfa7

Please sign in to comment.