Conversation
zksend/zk_bag/sources/zk_bag.move
Outdated
|
|
||
| /// Event emitted when a ZkBag is destroyed after all items are claimed | ||
| public struct BagDestroyedEvent has copy, drop { | ||
| bag_id: ID, |
There was a problem hiding this comment.
The contract requires that all items are claimed, and the bag is destroyed in the same transaction, so I'm not sure this makes sense as a separate event
| public struct BagItemAddedEvent<phantom T> has copy, drop { | ||
| bag_id: ID, | ||
| creator: address, | ||
| } |
There was a problem hiding this comment.
I'm not sure if this event is useful without the id of the added item. In practice items won't be added to links outside the creating transaction, so this is effectively just a duplicate of the create event that let's you count the number of items in the link
zksend/zk_bag/sources/zk_bag.move
Outdated
| public struct BagItemClaimedEvent<phantom T> has copy, drop { | ||
| bag_id: ID, | ||
| creator: address, | ||
| receiver: address, |
There was a problem hiding this comment.
Some comment as the add item event, expect here we enforce that all items will be claimed together
Yes I think that too, but we don't know coin value even if we know ID. Actually I recommended we separate Coin and Object (NFT) deposit like I implemented at Buck You, which is Bucket version's zkSend https://github.com/Bucket-Protocol/Buck-You-Move/blob/main/sources/locker.move
but what if someone do it differently? Then we can catch it by checking event. |
The contract enforced this, so it can't be done differently |
|
OK, thank you for the clarification, here is the updated PR with commit 130373e |
No description provided.