Skip to content

Commit

Permalink
feat: add ARC-56 support
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-makerx committed Oct 24, 2024
1 parent a256d75 commit 9324238
Show file tree
Hide file tree
Showing 214 changed files with 20,398 additions and 763 deletions.
506 changes: 506 additions & 0 deletions examples/amm/out/ConstantProductAMM.arc56.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion examples/amm/puya.log

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions examples/arc_28/out/EventEmitter.approval.mir
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,16 @@ emit_swapped_block@0: (
concat (𝕡) a#0,b#0 | encoded_tuple_buffer%2#0
method Swapped(uint64,uint64) (𝕡) a#0,b#0 | encoded_tuple_buffer%2#0,Method(Swapped(uint64,uint64))
l-load encoded_tuple_buffer%2#0 1 (𝕡) a#0,b#0 | Method(Swapped(uint64,uint64)),encoded_tuple_buffer%2#0
concat (𝕡) a#0,b#0 | tmp%0#0
l-load-copy tmp%0#0 0 (𝕡) a#0,b#0 | tmp%0#0,tmp%0#0 (copy)
log (𝕡) a#0,b#0 | tmp%0#0
concat (𝕡) a#0,b#0 | event%0#0
l-load-copy event%0#0 0 (𝕡) a#0,b#0 | event%0#0,event%0#0 (copy)
log (𝕡) a#0,b#0 | event%0#0
// arc_28/contract.py:15
// arc4.emit("Swapped(uint64,uint64)", b, a)
l-load-copy tmp%0#0 0 (𝕡) a#0,b#0 | tmp%0#0,tmp%0#0 (copy)
log (𝕡) a#0,b#0 | tmp%0#0
l-load-copy event%0#0 0 (𝕡) a#0,b#0 | event%0#0,event%0#0 (copy)
log (𝕡) a#0,b#0 | event%0#0
// arc_28/contract.py:16
// arc4.emit("Swapped", b, a)
l-load tmp%0#0 0 (𝕡) a#0,b#0 | tmp%0#0
l-load event%0#0 0 (𝕡) a#0,b#0 | event%0#0
log (𝕡) a#0,b#0 |
retsub

Expand All @@ -140,7 +140,7 @@ emit_ufixed_block@0: (
concat (𝕡) a#0,b#0 | encoded_tuple_buffer%2#0
method AnEvent(ufixed256x16,ufixed64x2) (𝕡) a#0,b#0 | encoded_tuple_buffer%2#0,Method(AnEvent(ufixed256x16,ufixed64x2))
l-load encoded_tuple_buffer%2#0 1 (𝕡) a#0,b#0 | Method(AnEvent(ufixed256x16,ufixed64x2)),encoded_tuple_buffer%2#0
concat (𝕡) a#0,b#0 | tmp%0#0
concat (𝕡) a#0,b#0 | event%0#0
log (𝕡) a#0,b#0 |
retsub

Expand Down
219 changes: 219 additions & 0 deletions examples/arc_28/out/EventEmitter.arc56.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
{
"arcs": [
22,
28
],
"name": "EventEmitter",
"structs": {},
"methods": [
{
"name": "emit_swapped",
"args": [
{
"type": "uint64",
"name": "a"
},
{
"type": "uint64",
"name": "b"
}
],
"returns": {
"type": "void"
},
"actions": {
"create": [],
"call": [
"NoOp"
]
},
"readonly": false,
"events": [
{
"name": "Swapped",
"args": [
{
"type": "uint64",
"name": "a"
},
{
"type": "uint64",
"name": "b"
}
]
},
{
"name": "Swapped",
"args": [
{
"type": "uint64",
"name": "field1"
},
{
"type": "uint64",
"name": "field2"
}
]
}
],
"recommendations": {}
},
{
"name": "emit_ufixed",
"args": [
{
"type": "ufixed256x16",
"name": "a"
},
{
"type": "ufixed64x2",
"name": "b"
}
],
"returns": {
"type": "void"
},
"actions": {
"create": [],
"call": [
"NoOp"
]
},
"readonly": false,
"events": [
{
"name": "AnEvent",
"args": [
{
"type": "ufixed256x16",
"name": "field1"
},
{
"type": "ufixed64x2",
"name": "field2"
}
]
}
],
"recommendations": {}
}
],
"state": {
"schema": {
"global": {
"ints": 0,
"bytes": 0
},
"local": {
"ints": 0,
"bytes": 0
}
},
"keys": {
"global": {},
"local": {},
"box": {}
},
"maps": {
"global": {},
"local": {},
"box": {}
}
},
"bareActions": {
"create": [
"NoOp"
],
"call": []
},
"events": [
{
"name": "Swapped",
"args": [
{
"type": "uint64",
"name": "a"
},
{
"type": "uint64",
"name": "b"
}
]
},
{
"name": "Swapped",
"args": [
{
"type": "uint64",
"name": "field1"
},
{
"type": "uint64",
"name": "field2"
}
]
},
{
"name": "AnEvent",
"args": [
{
"type": "ufixed256x16",
"name": "field1"
},
{
"type": "ufixed64x2",
"name": "field2"
}
]
}
],
"templateVariables": {},
"networks": {},
"sourceInfo": {
"approval": {
"sourceInfo": [
{
"pc": [
43,
61
],
"errorMessage": "OnCompletion is NoOp"
},
{
"pc": [
84
],
"errorMessage": "is creating"
},
{
"pc": [
46,
64
],
"errorMessage": "is not creating"
}
],
"pcOffsetMethod": "none"
},
"clear": {
"sourceInfo": [],
"pcOffsetMethod": "none"
}
},
"source": {
"approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgpleGFtcGxlcy5hcmNfMjguY29udHJhY3QuRXZlbnRFbWl0dGVyLmFwcHJvdmFsX3Byb2dyYW06CiAgICBpbnRjYmxvY2sgMSAwCiAgICBjYWxsc3ViIF9fcHV5YV9hcmM0X3JvdXRlcl9fCiAgICByZXR1cm4KCgovLyBleGFtcGxlcy5hcmNfMjguY29udHJhY3QuRXZlbnRFbWl0dGVyLl9fcHV5YV9hcmM0X3JvdXRlcl9fKCkgLT4gdWludDY0OgpfX3B1eWFfYXJjNF9yb3V0ZXJfXzoKICAgIC8vIGFyY18yOC9jb250cmFjdC5weToxMQogICAgLy8gY2xhc3MgRXZlbnRFbWl0dGVyKEFSQzRDb250cmFjdCk6CiAgICBwcm90byAwIDEKICAgIHR4biBOdW1BcHBBcmdzCiAgICBieiBfX3B1eWFfYXJjNF9yb3V0ZXJfX19iYXJlX3JvdXRpbmdANgogICAgcHVzaGJ5dGVzcyAweDBhOTU0MmNkIDB4NzFhMzE1MWYgLy8gbWV0aG9kICJlbWl0X3N3YXBwZWQodWludDY0LHVpbnQ2NCl2b2lkIiwgbWV0aG9kICJlbWl0X3VmaXhlZCh1Zml4ZWQyNTZ4MTYsdWZpeGVkNjR4Mil2b2lkIgogIC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NjR4MikiLCBhLCBiKQogICAgZnJhbWVfZGlnIC0yCiAgICBmcmFtZV9kaWcgLTEKICAgIGNvbmNhdAogICAgcHVzaGJ5dGVzIDB4NzM4OWIxYmEgLy8gbWV0aG9kICJBbkV2ZW50KHVmaXhlZDI1NngxNix1Zml4ZWQ2NHgyKSIKICAgIHN3YXAKICAgIGNvbmNhdAogICAgbG9nCiAgICByZXRzdWIK",
"clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCgpleGFtcGxlcy5hcmNfMjguY29udHJhY3QuRXZlbnRFbWl0dGVyLmNsZWFyX3N0YXRlX3Byb2dyYW06CiAgICBwdXNoaW50IDEgLy8gMQogICAgcmV0dXJuCg=="
},
"byteCode": {
"approval": "CiACAQCIAAFDigABMRtBADuCAgQKlULNBHGjFR82GgCOAgACABQjiTEZFEQxGEQ2GgE2GgKIACEiiTEZFEQxGEQ2GgE2GgKIACUiiTEZQAAGMRgURCKJI4mKAgCL/4v+UIAEHMvZJUxQSbBJsLCJigIAi/6L/1CABHOJsbpMULCJ",
"clear": "CoEBQw=="
},
"compilerInfo": {
"compiler": "puya",
"compilerVersion": {
"major": 99,
"minor": 99,
"patch": 99
}
}
}
12 changes: 6 additions & 6 deletions examples/arc_28/out/EventEmitter.destructured.ir

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions examples/arc_28/out/EventEmitter.ssa.ir

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9324238

Please sign in to comment.