Skip to content

Commit

Permalink
[sksend] Fix ownedAfterClaim check (MystenLabs#15680)
Browse files Browse the repository at this point in the history
## Description 

Describe the changes or additions included in this PR.

## Test Plan 

How did you test the new or updated feature?

---
If your changes are not user-facing and do not break anything, you can
skip the following section. Otherwise, please briefly describe what has
changed under the Release Notes section.

### Type of Change (Check all that apply)

- [ ] protocol change
- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
  • Loading branch information
hayes-mysten authored Jan 12, 2024
1 parent f09f738 commit ae9ae17
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/young-ducks-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@mysten/zksend': patch
---

Fix ownedAfterClaim check
7 changes: 5 additions & 2 deletions sdk/zksend/src/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,15 @@ export class ZkSendLink {
function ownedAfterChange(
objectChange: SuiObjectChange,
address: string,
): objectChange is Extract<SuiObjectChange, { type: 'created' | 'transferred' }> {
): objectChange is Extract<SuiObjectChange, { type: 'created' | 'transferred' | 'mutated' }> {
if (objectChange.type === 'transferred' && isOwner(objectChange.recipient, address)) {
return true;
}

if (objectChange.type === 'created' && isOwner(objectChange.owner, address)) {
if (
(objectChange.type === 'created' || objectChange.type === 'mutated') &&
isOwner(objectChange.owner, address)
) {
return true;
}

Expand Down

0 comments on commit ae9ae17

Please sign in to comment.