With a smart contract
How To Withdraw funds from Mode SFS programatically.
Prerequisites
How does the SFS Withdraw function work?
function withdraw(uint256 _tokenId, address payable _recipient, uint256 _amount)
public
onlyNftOwner(_tokenId)
returns (uint256)
{
uint256 earnedFees = balances[_tokenId];
if (earnedFees == 0 || _amount == 0) revert NothingToWithdraw();
if (_amount > earnedFees) _amount = earnedFees;
balances[_tokenId] = earnedFees - _amount;
emit Withdraw(_tokenId, _recipient, _amount);
Address.sendValue(_recipient, _amount);
return _amount;
}Key steps and features include:
The Withdraw Function in Practice
Here are some things to note:
Deploying Our Contract to Thirdweb
Test
Check balance

Withdraw

Internal transaction

Summary
Last updated