Hi, I am trying to opt-in a smart contract to an ASA asset but got the Unavailable Asset error when running the opt-in code.
This is the Tealscript code that I have to opt-in to the asset
assert(this.txn.sender === this.sender.value);
assert(!this.app.address.isOptedInToAsset(this.assetId.value));
verifyPayTxn(mbrTxn, {
receiver: this.app.address,
amount: globals.minBalance + globals.assetOptInMinBalance,
});
sendAssetTransfer({
xferAsset: this.assetId.value,
assetAmount: 0,
fee: 0,
assetReceiver: globals.currentApplicationAddress,
});
}```