SFS - Registering a contract with Remix
How to register a smart contract on Mode’s SFS register contract.
Introducing SFS (Sequencer Fee Sharing)
SFS register function review
/// @notice Mints ownership NFT that allows the owner to collect fees earned by the smart contract.
/// `msg.sender` is assumed to be a smart contract that earns fees. Only smart contract itself
/// can register a fee receipient.
/// @param _recipient recipient of the ownership NFT
/// @return tokenId of the ownership NFT that collects fees
function register(address _recipient) public onlyUnregistered returns (uint256 tokenId) {
address smartContract = msg.sender;
if (_recipient == address(0)) revert InvalidRecipient();
tokenId = _tokenIdTracker.current();
_mint(_recipient, tokenId);
_tokenIdTracker.increment();
emit Register(smartContract, _recipient, tokenId);
feeRecipient[smartContract] = NftData({
tokenId: tokenId,
registered: true,
balanceUpdatedBlock: block.number
});
}Sample smart contract
Deploying and registering the contract
Last updated
Was this helpful?