Assign a Smart Contract
Learn to assign a smart contract to an existing SFS NFT
/// @notice Assigns smart contract to existing NFT. That NFT will collect fees generated by the smart contract.
/// Callable only by smart contract itself.
/// @param _tokenId tokenId which will collect fees
/// @return tokenId of the ownership NFT that collects fees
function assign(uint256 _tokenId) public onlyUnregistered returns (uint256) {
address smartContract = msg.sender;
if (!_exists(_tokenId)) revert InvalidTokenId();
emit Assign(smartContract, _tokenId);
feeRecipient[smartContract] = NftData({
tokenId: _tokenId,
registered: true,
balanceUpdatedBlock: block.number
});
return _tokenId;
}Last updated
Was this helpful?