-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a quine to test app_params_get
- Loading branch information
1 parent
8835bfd
commit 4e0388f
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma version 5 | ||
// To modify the program: | ||
// 1. Replace the first line with `pushbytes ""`. | ||
// 2. Compile the program. | ||
// 3. Replace the first line with `pushbytes <compiled bytecode>` | ||
// 4. Update the varuint length of the new bytecode (line 10) | ||
// 5. The quine is complete. Compile again. | ||
pushbytes 0x0580004957000280011a504f0149570300505081007200441243 | ||
dup | ||
extract 0 2 | ||
pushbytes 0x1a // the varuint length of 0x0580... | ||
concat | ||
uncover 1 | ||
dup | ||
extract 3 0 // the range here must be updated if the varuint length is longer than 1 byte | ||
concat | ||
concat // after this line the whole program is on the stack | ||
int 0 | ||
app_params_get AppApprovalProgram | ||
assert | ||
== | ||
return |