Skip to content

Commit

Permalink
Merge pull request #430 from algorandfoundation/dev
Browse files Browse the repository at this point in the history
0.83.1: boolean and label fixes
  • Loading branch information
joe-p committed Feb 17, 2024
2 parents 77bab18 + 5bb136a commit 7ea7398
Show file tree
Hide file tree
Showing 355 changed files with 2,988 additions and 2,761 deletions.
60 changes: 30 additions & 30 deletions examples/amm/tealscript_artifacts/ConstantProductAMM.approval.teal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma version 10

// This TEAL was generated by TEALScript v0.83.0
// This TEAL was generated by TEALScript v0.83.1
// https://github.com/algorandfoundation/TEALScript

// This contract is compliant with and/or implements the following ARCs: [ ARC4 ]
Expand All @@ -9,20 +9,20 @@
// This pattern is used to make it easy for anyone to parse the start of the program and determine if a specific action is allowed
// Here, action refers to the OnComplete in combination with whether the app is being created or called
// Every possible action for this contract is represented in the switch statement
// If the action is not implmented in the contract, its respective branch will be "NOT_IMPLEMENTED" which just contains "err"
// If the action is not implemented in the contract, its respective branch will be "*NOT_IMPLEMENTED" which just contains "err"
txn ApplicationID
!
int 6
*
txn OnCompletion
+
switch call_NoOp NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED create_NoOp NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED
switch *call_NoOp *NOT_IMPLEMENTED *NOT_IMPLEMENTED *NOT_IMPLEMENTED *NOT_IMPLEMENTED *NOT_IMPLEMENTED *create_NoOp *NOT_IMPLEMENTED *NOT_IMPLEMENTED *NOT_IMPLEMENTED *NOT_IMPLEMENTED *NOT_IMPLEMENTED

NOT_IMPLEMENTED:
*NOT_IMPLEMENTED:
err

// createApplication()void
abi_route_createApplication:
*abi_route_createApplication:
// execute createApplication()void
callsub createApplication
int 1
Expand Down Expand Up @@ -209,14 +209,14 @@ tokensToMint:
frame_dig 0 // aRatio: uint64
frame_dig 1 // bRatio: uint64
<
bz ternary1_false
bz *ternary1_false
frame_dig 0 // aRatio: uint64
b ternary1_end
b *ternary1_end

ternary1_false:
*ternary1_false:
frame_dig 1 // bRatio: uint64

ternary1_end:
*ternary1_end:
frame_bury 2 // ratio: uint64

// examples/amm/amm.algo.ts:58
Expand Down Expand Up @@ -335,7 +335,7 @@ tokensToSwap:
retsub

// set_governor(account)void
abi_route_set_governor:
*abi_route_set_governor:
// governor: account
txna ApplicationArgs 1
btoi
Expand Down Expand Up @@ -367,7 +367,7 @@ set_governor:
retsub

// bootstrap(pay,asset,asset)uint64
abi_route_bootstrap:
*abi_route_bootstrap:
// The ABI return prefix
byte 0x151f7c75

Expand Down Expand Up @@ -479,7 +479,7 @@ bootstrap:
retsub

// mint(axfer,axfer,asset,asset,asset)void
abi_route_mint:
*abi_route_mint:
// bAsset: asset
txna ApplicationArgs 3
btoi
Expand Down Expand Up @@ -624,7 +624,7 @@ mint:
==
assert

// if0_condition
// *if0_condition
// examples/amm/amm.algo.ts:123
// this.app.address.assetBalance(aAsset) === aXfer.assetAmount &&
// this.app.address.assetBalance(bAsset) === bXfer.assetAmount
Expand All @@ -636,7 +636,7 @@ mint:
gtxns AssetAmount
==
dup
bz skip_and0
bz *skip_and0
global CurrentApplicationAddress
frame_dig -5 // bAsset: Asset
asset_holding_get AssetBalance
Expand All @@ -646,20 +646,20 @@ mint:
==
&&

skip_and0:
bz if0_else
*skip_and0:
bz *if0_else

// if0_consequent
// *if0_consequent
// examples/amm/amm.algo.ts:126
// this.tokensToMintIntial(aXfer.assetAmount, bXfer.assetAmount)
frame_dig -2 // bXfer: AssetTransferTxn
gtxns AssetAmount
frame_dig -1 // aXfer: AssetTransferTxn
gtxns AssetAmount
callsub tokensToMintIntial
b if0_end
b *if0_end

if0_else:
*if0_else:
// examples/amm/amm.algo.ts:128
// toMint = this.tokensToMint(
// TOTAL_SUPPLY - this.app.address.assetBalance(poolAsset),
Expand Down Expand Up @@ -709,11 +709,11 @@ if0_else:
txn Sender
callsub doAxfer

if0_end:
*if0_end:
retsub

// burn(axfer,asset,asset,asset)void
abi_route_burn:
*abi_route_burn:
// bAsset: asset
txna ApplicationArgs 3
btoi
Expand Down Expand Up @@ -872,7 +872,7 @@ burn:
retsub

// swap(axfer,asset,asset)void
abi_route_swap:
*abi_route_swap:
// bAsset: asset
txna ApplicationArgs 2
btoi
Expand Down Expand Up @@ -969,14 +969,14 @@ swap:
gtxns XferAsset
frame_dig -2 // aAsset: Asset
==
bz ternary3_false
bz *ternary3_false
frame_dig -2 // aAsset: Asset
b ternary3_end
b *ternary3_end

ternary3_false:
*ternary3_false:
frame_dig -3 // bAsset: Asset

ternary3_end:
*ternary3_end:
frame_bury 0 // outId: asset

// examples/amm/amm.algo.ts:182
Expand Down Expand Up @@ -1028,18 +1028,18 @@ ternary3_end:
app_global_put
retsub

create_NoOp:
*create_NoOp:
method "createApplication()void"
txna ApplicationArgs 0
match abi_route_createApplication
match *abi_route_createApplication
err

call_NoOp:
*call_NoOp:
method "set_governor(account)void"
method "bootstrap(pay,asset,asset)uint64"
method "mint(axfer,axfer,asset,asset,asset)void"
method "burn(axfer,asset,asset,asset)void"
method "swap(axfer,asset,asset)void"
txna ApplicationArgs 0
match abi_route_set_governor abi_route_bootstrap abi_route_mint abi_route_burn abi_route_swap
match *abi_route_set_governor *abi_route_bootstrap *abi_route_mint *abi_route_burn *abi_route_swap
err

Large diffs are not rendered by default.

Loading

0 comments on commit 7ea7398

Please sign in to comment.