i see there is a ‘receiver’ parameter given to the function, but this value is actually hard-coded in this specific template. I was wondering if there is a way to pass one (or more) arguments to the function using the Java SDK. In my specific case, i need to create a LogicSig in a dynamic way (receiver and other values change each time), so having the possibility to do it from within my application would be great!
So what i need is:
compile PyTeal to TEAL (generic signature smart contract)
open the TEAL file in my Java application, and create the LogicSig with given parameters (receiver, amount etc.)
The issue with that approach is parameters to a stateless contract are not covered under the signature, so you have to be very careful how you use parameters in the logic. For example if you make receiver a parameter that signed logic sig could be used by anyone to change the receiver without having to get a new signature. You can pass parameters to the contract like you are wanting to do, but you must be very careful. Instead of doing that why not just put placeholders in the pyteal file and use code to replace those before compiling the pyteal to teal?
Ok i got the issue with my approach. So you suggest to use some sort of Python compiling mechanism inside my java application, so i can go from PyTeal → Teal → LogicSig, all inside my application so that every parameter is covered by the signature of the user that releases the contract, right?