I'm trying to deal with the example https://docs.wavesplatform.com/en/smart-contracts/ride4dapps/examples.html and change it a bit to extend it to any types of assets. It is not clear what type of data is returned to the function and how to bring it to the string so that it can be written to the state later.
let payment = match(i.payment) { #even none or exact amount of the attached payment(InvokeScriptTransaction).
case p : AttachedPayment => p
case _ => throw("You have to provide a payment to deposit")
}
let assetId = toBase58String(payment.assetId)