Skip to content

Commit

Permalink
Merge pull request #479 from algorandfoundation/feat/arc56_errors
Browse files Browse the repository at this point in the history
feat: arc56 error messages
  • Loading branch information
joe-p committed Apr 29, 2024
2 parents 9d25f41 + aa92d99 commit 604d4e9
Show file tree
Hide file tree
Showing 386 changed files with 5,551 additions and 3,581 deletions.
69 changes: 69 additions & 0 deletions examples/amm/tealscript_artifacts/ConstantProductAMM.approval.teal
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ 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

*NOT_IMPLEMENTED:
// The requested action is not implemented in this contract. Are you using the correct OnComplete? Did you set your app ID?
err

// createApplication()void
Expand Down Expand Up @@ -186,6 +187,8 @@ tokensToMint:
pop
swap
!

// wideRatio failed
assert
frame_bury 0 // aRatio: uint64

Expand All @@ -201,6 +204,8 @@ tokensToMint:
pop
swap
!

// wideRatio failed
assert
frame_bury 1 // bRatio: uint64

Expand Down Expand Up @@ -231,6 +236,8 @@ tokensToMint:
pop
swap
!

// wideRatio failed
assert

// set the subroutine return value
Expand Down Expand Up @@ -267,6 +274,8 @@ computeRatio:
pop
swap
!

// wideRatio failed
assert
retsub

Expand All @@ -286,6 +295,8 @@ tokensToBurn:
pop
swap
!

// wideRatio failed
assert
retsub

Expand Down Expand Up @@ -328,6 +339,8 @@ tokensToSwap:
pop
swap
!

// wideRatio failed
assert

// set the subroutine return value
Expand All @@ -342,6 +355,8 @@ tokensToSwap:
len
int 32
==

// argument 0 (governor) for set_governor must be a address
assert

// execute set_governor(address)void
Expand All @@ -360,6 +375,8 @@ set_governor:
byte 0x67 // "g"
app_global_get
==

// transaction verification failed: {"txn":"this.txn","field":"sender","expected":"this.governor.value"}
assert

// examples/amm/amm.algo.ts:79
Expand Down Expand Up @@ -390,6 +407,8 @@ set_governor:
gtxns TypeEnum
int pay
==

// argument 2 (seed) for bootstrap must be a pay transaction
assert

// execute bootstrap(pay,uint64,uint64)uint64
Expand All @@ -411,6 +430,8 @@ bootstrap:
byte 0x67 // "g"
app_global_get
==

// transaction verification failed: {"txn":"this.txn","field":"sender","expected":"this.governor.value"}
assert

// examples/amm/amm.algo.ts:85
Expand All @@ -427,13 +448,17 @@ bootstrap:
gtxns Receiver
global CurrentApplicationAddress
==

// transaction verification failed: {"txn":"seed","field":"receiver","expected":"this.app.address"}
assert

// verify amount
frame_dig -1 // seed: PayTxn
gtxns Amount
int 300_000
>=

// transaction verification failed: {"txn":"seed","field":"amount","condition":"greaterThanEqualTo","expected":">=300_000"}
assert

// examples/amm/amm.algo.ts:88
Expand Down Expand Up @@ -501,6 +526,8 @@ bootstrap:
gtxns TypeEnum
int axfer
==

// argument 3 (bXfer) for mint must be a axfer transaction
assert

// aXfer: axfer
Expand All @@ -511,6 +538,8 @@ bootstrap:
gtxns TypeEnum
int axfer
==

// argument 4 (aXfer) for mint must be a axfer transaction
assert

// execute mint(axfer,axfer,uint64,uint64,uint64)void
Expand Down Expand Up @@ -563,27 +592,35 @@ mint:
gtxns Sender
txn Sender
==

// transaction verification failed: {"txn":"aXfer","field":"sender","expected":"this.txn.sender"}
assert

// verify assetAmount
frame_dig -1 // aXfer: AssetTransferTxn
gtxns AssetAmount
int 0
>

// transaction verification failed: {"txn":"aXfer","field":"assetAmount","condition":"greaterThan","expected":">0"}
assert

// verify assetReceiver
frame_dig -1 // aXfer: AssetTransferTxn
gtxns AssetReceiver
global CurrentApplicationAddress
==

// transaction verification failed: {"txn":"aXfer","field":"assetReceiver","expected":"this.app.address"}
assert

// verify xferAsset
frame_dig -1 // aXfer: AssetTransferTxn
gtxns XferAsset
frame_dig -4 // aAsset: AssetID
==

// transaction verification failed: {"txn":"aXfer","field":"xferAsset","expected":"aAsset"}
assert

// valid asset B axfer
Expand All @@ -599,27 +636,35 @@ mint:
gtxns Sender
txn Sender
==

// transaction verification failed: {"txn":"bXfer","field":"sender","expected":"this.txn.sender"}
assert

// verify assetAmount
frame_dig -2 // bXfer: AssetTransferTxn
gtxns AssetAmount
int 0
>

// transaction verification failed: {"txn":"bXfer","field":"assetAmount","condition":"greaterThan","expected":">0"}
assert

// verify assetReceiver
frame_dig -2 // bXfer: AssetTransferTxn
gtxns AssetReceiver
global CurrentApplicationAddress
==

// transaction verification failed: {"txn":"bXfer","field":"assetReceiver","expected":"this.app.address"}
assert

// verify xferAsset
frame_dig -2 // bXfer: AssetTransferTxn
gtxns XferAsset
frame_dig -5 // bAsset: AssetID
==

// transaction verification failed: {"txn":"bXfer","field":"xferAsset","expected":"bAsset"}
assert

// *if0_condition
Expand Down Expand Up @@ -732,6 +777,8 @@ mint:
gtxns TypeEnum
int axfer
==

// argument 3 (poolXfer) for burn must be a axfer transaction
assert

// execute burn(axfer,uint64,uint64,uint64)void
Expand Down Expand Up @@ -785,27 +832,35 @@ burn:
gtxns Sender
txn Sender
==

// transaction verification failed: {"txn":"poolXfer","field":"sender","expected":"this.txn.sender"}
assert

// verify assetAmount
frame_dig -1 // poolXfer: AssetTransferTxn
gtxns AssetAmount
int 0
>

// transaction verification failed: {"txn":"poolXfer","field":"assetAmount","condition":"greaterThan","expected":">0"}
assert

// verify assetReceiver
frame_dig -1 // poolXfer: AssetTransferTxn
gtxns AssetReceiver
global CurrentApplicationAddress
==

// transaction verification failed: {"txn":"poolXfer","field":"assetReceiver","expected":"this.app.address"}
assert

// verify xferAsset
frame_dig -1 // poolXfer: AssetTransferTxn
gtxns XferAsset
frame_dig -2 // poolAsset: AssetID
==

// transaction verification failed: {"txn":"poolXfer","field":"xferAsset","expected":"poolAsset"}
assert

// examples/amm/amm.algo.ts:156
Expand Down Expand Up @@ -884,6 +939,8 @@ burn:
gtxns TypeEnum
int axfer
==

// argument 2 (swapXfer) for swap must be a axfer transaction
assert

// execute swap(axfer,uint64,uint64)void
Expand Down Expand Up @@ -928,20 +985,26 @@ swap:
gtxns AssetAmount
int 0
>

// transaction verification failed: {"txn":"swapXfer","field":"assetAmount","condition":"greaterThan","expected":">0"}
assert

// verify assetReceiver
frame_dig -1 // swapXfer: AssetTransferTxn
gtxns AssetReceiver
global CurrentApplicationAddress
==

// transaction verification failed: {"txn":"swapXfer","field":"assetReceiver","expected":"this.app.address"}
assert

// verify sender
frame_dig -1 // swapXfer: AssetTransferTxn
gtxns Sender
txn Sender
==

// transaction verification failed: {"txn":"swapXfer","field":"sender","expected":"this.txn.sender"}
assert

// verify xferAsset
Expand All @@ -954,6 +1017,8 @@ swap:
frame_dig -3 // bAsset: AssetID
==
||

// transaction verification failed: {"txn":{"txnText":"swapXfer"},"field":"xferAsset","condition":"includedIn","expected":"[aAsset, bAsset]"}
assert

// examples/amm/amm.algo.ts:180
Expand Down Expand Up @@ -1025,6 +1090,8 @@ swap:
method "createApplication()void"
txna ApplicationArgs 0
match *abi_route_createApplication

// this contract does not implement the given ABI method for create NoOp
err

*call_NoOp:
Expand All @@ -1035,4 +1102,6 @@ swap:
method "swap(axfer,uint64,uint64)void"
txna ApplicationArgs 0
match *abi_route_set_governor *abi_route_bootstrap *abi_route_mint *abi_route_burn *abi_route_swap

// this contract does not implement the given ABI method for call NoOp
err

Large diffs are not rendered by default.

Loading

0 comments on commit 604d4e9

Please sign in to comment.