Invalid App Reference - Algorand

Invalid App Reference

You have selected 0 posts.

post by xavier on Dec 10, 2021

I am grouping 2 transactions:

  1. App creation transaction
  2. App (Different) Opt-in transaction

I am trying to store the app id created in the first transaction while opting into a different app. But when I try to access the app id created in the first transaction using “gaid” opcode, I am getting the error as “Invalid App Reference”? I can’t add the app id as a foreignApp while constructing the transaction because the app hasn’t been created yet.

Any idea on how I could fix it?


post by Ben on Dec 10, 2021

This is not something you can currently do. In order for the other app to “see” the newly created App, you’d have to pass it in the foreign apps list. Of course you cant do this ahead of time since you don’t know what the App ID will be.

I think the TEAL devs are looking into making something like this possible, where you get to access any newly created assets/apps automatically but I’m not sure if/when it will be available.

Ben


post by xavier on Dec 11, 2021

Thank you, Ben, for the prompt reply.

Related topics

Topic Replies Views Activity
Get the App ID of new Application created by inner transaction 3 202 May 2024
Invalid app Reference? 1 548 Apr 2022
TEAL ‘foreign apps’ 2 542 Mar 2021
App address from app id 1 904 Mar 2022
How to make app available for call inside an inner transaction? 0 349 Aug 2023