Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better use of box_extract/replace for static types #364

Merged
merged 9 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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