Skip to content

Commit

Permalink
Merge pull request #364 from algorandfoundation/feat/extract_big_box
Browse files Browse the repository at this point in the history
better use of box_extract/replace for static types
  • Loading branch information
joe-p authored Jan 23, 2024
2 parents 58c4253 + 19e5110 commit 89d0f05
Show file tree
Hide file tree
Showing 52 changed files with 2,457 additions and 2,346 deletions.
22 changes: 9 additions & 13 deletions examples/arc72/artifacts/ARC72.approval.teal
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ arc72_ownerOf:
// examples/arc72/arc72.algo.ts:25
// return this.tokenBox(tokenId).value.owner;
frame_dig -1 // tokenId: uint256
box_get
assert
extract 0 32
int 0
int 32
box_extract
retsub

abi_route_arc72_tokenURI:
Expand Down Expand Up @@ -90,11 +90,9 @@ arc72_tokenURI:
// examples/arc72/arc72.algo.ts:37
// return this.tokenBox(tokenId).value.uri;
frame_dig -1 // tokenId: uint256
box_get
assert
int 32
int 32 // headOffset
int 256
extract3
box_extract
retsub

// transferTo(uint256,address)void
Expand Down Expand Up @@ -170,12 +168,10 @@ arc72_transferFrom:
dup
bnz skip_or0
txn Sender
frame_dig 0 // storage key//token
box_get
assert
int 288
frame_dig -3 // tokenId: uint256
int 288 // headOffset
int 32
extract3
box_extract
==
||

Expand Down Expand Up @@ -240,7 +236,7 @@ arc72_approve:
// examples/arc72/arc72.algo.ts:65
// this.tokenBox(tokenId).value.controller = approved
frame_dig -2 // tokenId: uint256
int 288
int 288 // headOffset
frame_dig -1 // approved: Address
box_replace
retsub
Expand Down
2 changes: 1 addition & 1 deletion examples/arc72/artifacts/ARC72.arc32.json

Large diffs are not rendered by default.

Loading

0 comments on commit 89d0f05

Please sign in to comment.