Canto/contracts/turnstile.sol:
  127      /// @return amount of fees withdrawn
  128:     function withdraw(uint256 _tokenId, address payable _recipient, uint256 _amount)
  129:         public
  130:         onlyNftOwner(_tokenId)
  131:         returns (uint256)
  132:     {
  133:         uint256 earnedFees = balances[_tokenId];
  134: 
  135:         if (earnedFees == 0 || _amount == 0) revert NothingToWithdraw();
  136:         if (_amount > earnedFees) _amount = earnedFees;
  137: 
  138:         balances[_tokenId] = earnedFees - _amount;
  139: 
  140:         emit Withdraw(_tokenId, _recipient, _amount);
  141: 
  142:         Address.sendValue(_recipient, _amount);
  143: 
  144:         return _amount;
  145:     }
* IMPORTANT: because control is transferred to `recipient`, care must be
      * taken to not create reentrancy vulnerabilities. Consider using
      * {ReentrancyGuard} or the
      * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
      */
