Skip to content

Commit

Permalink
Merge pull request #3 from algorandfoundation/initial-setup
Browse files Browse the repository at this point in the history
chore: minor updates to Initial setup
  • Loading branch information
iskysun96 authored Oct 15, 2024
2 parents 3efe87a + e6dbed8 commit 13c0447
Show file tree
Hide file tree
Showing 7 changed files with 5,332 additions and 3,963 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ Changes must be done via a Pull Request (PR).
Ensure the following acceptance criteria are met before submitting a PR:

- Ensure there are no typos in the content
- Ensure `algokit project run audit` passes
- Ensure `algokit project run test` passes
- Ensure `algokit project run lint` passes
- Ensure `algokit project run build` passes
- Ensure `algokit project run audit` passes
- Ensure `algokit project run audit-teal` passes
- Ensure `algokit project run test` passes. Make sure to have the localnet running with `algokit localnet start`

## Code example guidelines

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ smart_contracts.inner_transactions.contract.InnerTransactions.approval_program:
__puya_arc4_router__:
proto 0 1
txn NumAppArgs
bz __puya_arc4_router___bare_routing@15
bz __puya_arc4_router___bare_routing@17
method "payment()uint64"
method "asset_create()uint64"
method "fungible_asset_create()uint64"
method "non_fungible_asset_create()uint64"
method "asset_opt_in(asset)void"
method "asset_transfer(asset,account,uint64)void"
method "asset_freeze(account,asset)void"
Expand All @@ -20,9 +21,10 @@ __puya_arc4_router__:
method "asset_delete(asset)void"
method "multi_inner_txns(application)(uint64,string)"
method "deploy_app()uint64"
method "arc4_deploy_app()uint64"
method "noop_app_call(application)(string,string)"
txna ApplicationArgs 0
match __puya_arc4_router___payment_route@2 __puya_arc4_router___asset_create_route@3 __puya_arc4_router___asset_opt_in_route@4 __puya_arc4_router___asset_transfer_route@5 __puya_arc4_router___asset_freeze_route@6 __puya_arc4_router___asset_revoke_route@7 __puya_arc4_router___asset_config_route@8 __puya_arc4_router___asset_delete_route@9 __puya_arc4_router___multi_inner_txns_route@10 __puya_arc4_router___deploy_app_route@11 __puya_arc4_router___noop_app_call_route@12
match __puya_arc4_router___payment_route@2 __puya_arc4_router___fungible_asset_create_route@3 __puya_arc4_router___non_fungible_asset_create_route@4 __puya_arc4_router___asset_opt_in_route@5 __puya_arc4_router___asset_transfer_route@6 __puya_arc4_router___asset_freeze_route@7 __puya_arc4_router___asset_revoke_route@8 __puya_arc4_router___asset_config_route@9 __puya_arc4_router___asset_delete_route@10 __puya_arc4_router___multi_inner_txns_route@11 __puya_arc4_router___deploy_app_route@12 __puya_arc4_router___arc4_deploy_app_route@13 __puya_arc4_router___noop_app_call_route@14
int 0
retsub

Expand All @@ -41,13 +43,13 @@ __puya_arc4_router___payment_route@2:
int 1
retsub

__puya_arc4_router___asset_create_route@3:
__puya_arc4_router___fungible_asset_create_route@3:
txn OnCompletion
!
assert // OnCompletion is NoOp
txn ApplicationID
assert // is not creating
callsub asset_create
callsub fungible_asset_create
itob
byte 0x151f7c75
swap
Expand All @@ -56,7 +58,22 @@ __puya_arc4_router___asset_create_route@3:
int 1
retsub

__puya_arc4_router___asset_opt_in_route@4:
__puya_arc4_router___non_fungible_asset_create_route@4:
txn OnCompletion
!
assert // OnCompletion is NoOp
txn ApplicationID
assert // is not creating
callsub non_fungible_asset_create
itob
byte 0x151f7c75
swap
concat
log
int 1
retsub

__puya_arc4_router___asset_opt_in_route@5:
txn OnCompletion
!
assert // OnCompletion is NoOp
Expand All @@ -69,7 +86,7 @@ __puya_arc4_router___asset_opt_in_route@4:
int 1
retsub

__puya_arc4_router___asset_transfer_route@5:
__puya_arc4_router___asset_transfer_route@6:
txn OnCompletion
!
assert // OnCompletion is NoOp
Expand All @@ -87,7 +104,7 @@ __puya_arc4_router___asset_transfer_route@5:
int 1
retsub

__puya_arc4_router___asset_freeze_route@6:
__puya_arc4_router___asset_freeze_route@7:
txn OnCompletion
!
assert // OnCompletion is NoOp
Expand All @@ -103,7 +120,7 @@ __puya_arc4_router___asset_freeze_route@6:
int 1
retsub

__puya_arc4_router___asset_revoke_route@7:
__puya_arc4_router___asset_revoke_route@8:
txn OnCompletion
!
assert // OnCompletion is NoOp
Expand All @@ -121,7 +138,7 @@ __puya_arc4_router___asset_revoke_route@7:
int 1
retsub

__puya_arc4_router___asset_config_route@8:
__puya_arc4_router___asset_config_route@9:
txn OnCompletion
!
assert // OnCompletion is NoOp
Expand All @@ -134,7 +151,7 @@ __puya_arc4_router___asset_config_route@8:
int 1
retsub

__puya_arc4_router___asset_delete_route@9:
__puya_arc4_router___asset_delete_route@10:
txn OnCompletion
!
assert // OnCompletion is NoOp
Expand All @@ -147,7 +164,7 @@ __puya_arc4_router___asset_delete_route@9:
int 1
retsub

__puya_arc4_router___multi_inner_txns_route@10:
__puya_arc4_router___multi_inner_txns_route@11:
txn OnCompletion
!
assert // OnCompletion is NoOp
Expand All @@ -170,7 +187,7 @@ __puya_arc4_router___multi_inner_txns_route@10:
int 1
retsub

__puya_arc4_router___deploy_app_route@11:
__puya_arc4_router___deploy_app_route@12:
txn OnCompletion
!
assert // OnCompletion is NoOp
Expand All @@ -185,7 +202,22 @@ __puya_arc4_router___deploy_app_route@11:
int 1
retsub

__puya_arc4_router___noop_app_call_route@12:
__puya_arc4_router___arc4_deploy_app_route@13:
txn OnCompletion
!
assert // OnCompletion is NoOp
txn ApplicationID
assert // is not creating
callsub arc4_deploy_app
itob
byte 0x151f7c75
swap
concat
log
int 1
retsub

__puya_arc4_router___noop_app_call_route@14:
txn OnCompletion
!
assert // OnCompletion is NoOp
Expand All @@ -195,6 +227,12 @@ __puya_arc4_router___noop_app_call_route@12:
btoi
txnas Applications
callsub noop_app_call
dup
len
itob
extract 6 2
swap
concat
swap
dup
len
Expand All @@ -216,16 +254,16 @@ __puya_arc4_router___noop_app_call_route@12:
int 1
retsub

__puya_arc4_router___bare_routing@15:
__puya_arc4_router___bare_routing@17:
txn OnCompletion
bnz __puya_arc4_router___after_if_else@19
bnz __puya_arc4_router___after_if_else@21
txn ApplicationID
!
assert // is creating
int 1
retsub

__puya_arc4_router___after_if_else@19:
__puya_arc4_router___after_if_else@21:
int 0
retsub

Expand All @@ -247,8 +285,29 @@ payment:
retsub


// smart_contracts.inner_transactions.contract.InnerTransactions.asset_create() -> uint64:
asset_create:
// smart_contracts.inner_transactions.contract.InnerTransactions.fungible_asset_create() -> uint64:
fungible_asset_create:
proto 0 1
itxn_begin
byte "Royalty Points"
itxn_field ConfigAssetName
byte "RP"
itxn_field ConfigAssetUnitName
int 2
itxn_field ConfigAssetDecimals
int 100000000000
itxn_field ConfigAssetTotal
int acfg
itxn_field TypeEnum
int 0
itxn_field Fee
itxn_submit
itxn CreatedAssetID
retsub


// smart_contracts.inner_transactions.contract.InnerTransactions.non_fungible_asset_create() -> uint64:
non_fungible_asset_create:
proto 0 1
itxn_begin
global CurrentApplicationAddress
Expand Down Expand Up @@ -439,6 +498,23 @@ deploy_app:
retsub


// smart_contracts.inner_transactions.contract.InnerTransactions.arc4_deploy_app() -> uint64:
arc4_deploy_app:
proto 0 1
itxn_begin
byte base64 CoEBQw==
itxn_field ClearStateProgramPages
byte base64 CiACAAGIAAFDigABMRtBADKABAK+zhE2GgCOAQACIokxGRREMRhENhoBVwIAiAAgSRUWVwYCTFCABBUffHVMULAjiTEZQAAGMRgURCOJIomKAQGAB0hlbGxvLCCL/1CJ
itxn_field ApprovalProgramPages
int appl
itxn_field TypeEnum
int 0
itxn_field Fee
itxn_submit
itxn CreatedApplicationID
retsub


// smart_contracts.inner_transactions.contract.InnerTransactions.noop_app_call(app_id: uint64) -> bytes, bytes:
noop_app_call:
proto 1 2
Expand Down Expand Up @@ -482,4 +558,5 @@ noop_app_call:
byte 0x151f7c75
==
assert // ARC4 prefix is valid
extract 2 0
retsub
Loading

0 comments on commit 13c0447

Please sign in to comment.