-
Notifications
You must be signed in to change notification settings - Fork 523
Op base64 decode #3220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Op base64 decode #3220
Changes from all commits
7b019e5
64a849c
882e836
1dc22a0
4f5ac9e
4874c07
fdc3e05
4adc7a2
fb3e02f
0a6dff4
024973c
93afa06
91d1be0
8296238
46b8b14
4ed5366
df3f3ec
b1498a2
570bbf9
855754b
1e823eb
f55986f
757daef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,3 +65,5 @@ assets | |
|
|
||
| index.html | ||
|
|
||
| # test summary | ||
| testresults.json | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -854,6 +854,17 @@ When A is a uint64, index 0 is the least significant bit. Setting bit 3 to 1 on | |
| - pop a byte-array A and integer B. Extract a range of bytes from A starting at B up to but not including B+8, convert bytes as big endian and push the uint64 result. If B+8 is larger than the array length, the program fails | ||
| - LogicSigVersion >= 5 | ||
|
|
||
| ## base64_decode e | ||
|
|
||
| - Opcode: 0x5c {uint8 alphabet index} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "encoding" index
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| - Pops: *... stack*, []byte | ||
| - Pushes: []byte | ||
| - decode X which was base64-encoded using _encoding alphabet_ E. Fail if X is not base64 encoded with alphabet E | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like the switch from A to E by going with encoding. Let's just avoid calling it an alphabet, just say "encoding".
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| - **Cost**: 25 | ||
| - LogicSigVersion >= 6 | ||
|
|
||
| decodes X using the base64 encoding alphabet E. Specify the alphabet with an immediate arg either as URL and Filename Safe (`URLAlph`) or Standard (`StdAlph`). See <a href="https://rfc-editor.org/rfc/rfc4648.html#section-4">RFC 4648</a> (sections 4 and 5) | ||
tzaffi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## balance | ||
|
|
||
| - Opcode: 0x60 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,6 +133,7 @@ var opDocByName = map[string]string{ | |
| "extract_uint16": "pop a byte-array A and integer B. Extract a range of bytes from A starting at B up to but not including B+2, convert bytes as big endian and push the uint64 result. If B+2 is larger than the array length, the program fails", | ||
| "extract_uint32": "pop a byte-array A and integer B. Extract a range of bytes from A starting at B up to but not including B+4, convert bytes as big endian and push the uint64 result. If B+4 is larger than the array length, the program fails", | ||
| "extract_uint64": "pop a byte-array A and integer B. Extract a range of bytes from A starting at B up to but not including B+8, convert bytes as big endian and push the uint64 result. If B+8 is larger than the array length, the program fails", | ||
| "base64_decode": "decode X which was base64-encoded using _encoding alphabet_ E. Fail if X is not base64 encoded with alphabet E", | ||
|
|
||
| "balance": "get balance for account A, in microalgos. The balance is observed after the effects of previous transactions in the group, and after the fee for the current transaction is deducted.", | ||
| "min_balance": "get minimum required balance for account A, in microalgos. Required balance is affected by [ASA](https://developer.algorand.org/docs/features/asa/#assets-overview) and [App](https://developer.algorand.org/docs/features/asc1/stateful/#minimum-balance-requirement-for-a-smart-contract) usage. When creating or opting into an app, the minimum balance grows before the app code runs, therefore the increase is visible there. When deleting or closing out, the minimum balance decreases after the app executes.", | ||
|
|
@@ -229,6 +230,8 @@ var opcodeImmediateNotes = map[string]string{ | |
| "ecdsa_verify": "{uint8 curve index}", | ||
| "ecdsa_pk_decompress": "{uint8 curve index}", | ||
| "ecdsa_pk_recover": "{uint8 curve index}", | ||
|
|
||
| "base64_decode": "{uint8 alphabet index}", | ||
| } | ||
|
|
||
| // OpImmediateNote returns a short string about immediate data which follows the op byte | ||
|
|
@@ -283,6 +286,7 @@ var opDocExtras = map[string]string{ | |
| "itxn_begin": "`itxn_begin` initializes Sender to the application address; Fee to the minimum allowable, taking into account MinTxnFee and credit from overpaying in earlier transactions; FirstValid/LastValid to the values in the top-level transaction, and all other fields to zero values.", | ||
| "itxn_field": "`itxn_field` fails if X is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if X is an account or asset that does not appear in `txn.Accounts` or `txn.ForeignAssets` of the top-level transaction. (Setting addresses in asset creation are exempted from this requirement.)", | ||
| "itxn_submit": "`itxn_submit` resets the current transaction so that it can not be resubmitted. A new `itxn_begin` is required to prepare another inner transaction.", | ||
| "base64_decode": "decodes X using the base64 encoding alphabet E. Specify the alphabet with an immediate arg either as URL and Filename Safe (`URLAlph`) or Standard (`StdAlph`). See <a href=\"https://rfc-editor.org/rfc/rfc4648.html#section-4\">RFC 4648</a> (sections 4 and 5)", | ||
| } | ||
|
|
||
| // OpDocExtra returns extra documentation text about an op | ||
|
|
@@ -295,7 +299,7 @@ func OpDocExtra(opName string) string { | |
| // opcodes consecutively, even if their opcode values are not. | ||
| var OpGroups = map[string][]string{ | ||
| "Arithmetic": {"sha256", "keccak256", "sha512_256", "ed25519verify", "ecdsa_verify", "ecdsa_pk_recover", "ecdsa_pk_decompress", "+", "-", "/", "*", "<", ">", "<=", ">=", "&&", "||", "shl", "shr", "sqrt", "bitlen", "exp", "==", "!=", "!", "len", "itob", "btoi", "%", "|", "&", "^", "~", "mulw", "addw", "divmodw", "expw", "getbit", "setbit", "getbyte", "setbyte", "concat"}, | ||
| "Byte Array Slicing": {"substring", "substring3", "extract", "extract3", "extract_uint16", "extract_uint32", "extract_uint64"}, | ||
| "Byte Array Slicing": {"substring", "substring3", "extract", "extract3", "extract_uint16", "extract_uint32", "extract_uint64", "base64_decode"}, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change "Slicing" to "Manipulation"?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe this shows up in the docs, it's only an internal naming reference. However, it can be a bit confusing to future developers so I'll try and fix this inconsistency. |
||
| "Byte Array Arithmetic": {"b+", "b-", "b/", "b*", "b<", "b>", "b<=", "b>=", "b==", "b!=", "b%"}, | ||
| "Byte Array Logic": {"b|", "b&", "b^", "b~"}, | ||
| "Loading Values": {"intcblock", "intc", "intc_0", "intc_1", "intc_2", "intc_3", "pushint", "bytecblock", "bytec", "bytec_0", "bytec_1", "bytec_2", "bytec_3", "pushbytes", "bzero", "arg", "arg_0", "arg_1", "arg_2", "arg_3", "args", "txn", "gtxn", "txna", "txnas", "gtxna", "gtxnas", "gtxns", "gtxnsa", "gtxnsas", "global", "load", "loads", "store", "stores", "gload", "gloads", "gaid", "gaids"}, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.