Java SDK question

I found this in HTLC template. Wanted to know what tool was used to generate these 2 parameters (reference program and reference offsets). What is the process if I want to make my own template?

public class HTLC {

private static String referenceProgram = "ASAEBQEABiYDIP68oLsUSlpOp7Q4pGgayA5soQW8tgf8VlMlyVaV9qITAQYg5pqWHm8tX3rIZgeSZVK+mCNe0zNjyoiRi7nJOKkVtvkxASIOMRAjEhAxBzIDEhAxCCQSEDEJKBItASkSEDEJKhIxAiUNEBEQ";
private static int [] referenceOffsets = {3, 6, 10, 42, 45, 102};

The first parameter is the base64 representation of the program bytes of the TEAL program and the referenceOffsets are byte offsets into that byte array for swapping template values. These were very specific to those templates. If you are trying to build your own templates, it is probably better to just use args to the TEAL program for now. Ie arg 0, arg 1 etc and then pass those on the command like or in the sdks. Does that make sense?

Thanks Jason. Argument is a nice idea. How can I pass this address as argument?

txn CloseRemainderTo
addr QA75IQ76F6H2T55G65BY7BPLF5QNWSLT5XGI62COZSYB4ZQ3MSKI3EQ25A

&&

Are you wanting to do this with JavaScript (other sdk) or from the command line with goal?

Also look at argument passing in my post on TEAL https://medium.com/algorand/understanding-algorand-smart-contracts-b9fc743e7a0f

Thanks. I got it to work. But this looks like bad ASC-1 where anyone can close the contract and wipe out the amount :frowning:

txn CloseRemainderTo
arg 0

&&

it is. CloseRemainderTo should only be checked again an address you are expecting or the ZeroAddress to verify that it is not set.