hello @benji @domwoe
will there be calls again regarding icrc7?
Hello @ttt, did you have time to address my feedback? If you’re unable to respond within 1 week we would re-assign this bounty.
hello @benji , if that’s the case, I also have written my own implementation. Can I take over the bounty?
@pramitgaha If @ttt doesn’t respond in the next 2 days then you can take it. BTW the next NFT WG meeting is Tue 18 July, 5pm CEST. You can find a calendar here Announcing Technical Working Groups - #9 by bobbylingus
what’s the update about changing image property?
dom mentioned that the team is working for the update.
changing it to url: will give flexibility of uploading any type of image. that was my thinking…
Yes it’s changed to url preliminarily.
Hey @benji. I am sorry for delay. I’ve had some personal issues. I’ll finish addressing changes you requested by Sunday (Jul 16).
here is my implementation: GitHub - pramitgaha/icrc7: ICRC7 implementation in Rust
would like to get some review, improvement suggestion…
one point I couldn’t understood:
type TransferArgs = record {
from : opt Account; /* if supplied and is not caller then is permit transfer, if not supplied defaults to subaccount 0 of the caller principal */
to : Account;
token_ids : vec nat;
// type: leave open for now
memo : opt blob;
created_at_time : opt nat64;
is_atomic : opt bool;
};
if the caller and the from are same the transaction should fail?
also, the approval transfer is only activated when from is specified and allowed to transfer approved token of user specified in from field?
Thanks for raising those points. Some of the discussions we had prior to ICRC-2 was finalized, and we decided just to follow ICRC-2 in the WG. Those points are reflected in my latest commit.
caller: A
spender_subaccount: S1
from: principal: A subaccount: S1
→ it’s a normal transfer
caller: A
spender_subaccount: any (defaults to 0)
from: principal: B subaccount: any (defaults to 0)
→ it’s a permit transfer, accept only if (caller, spender_subaccount) has been approved enough allowance to spend from from.
caller: A
spender_subaccount: S1
from: principal: A subaccount: S2
→ it’s a permit transfer, accept only if (caller, S1) has been approved enough allowance to spend from (A, S2).
I have some questions
A) regarding Transfer operation authorization, do i have this right?
- if
fromandtois same, throwSelfTransfer - go through each token in
token_ids - if
fromis the tokenownerandcalleris thespender, then the newownerbecomestoand remove thespender. - if the
callerorfromfails the ownership test, then put the token id inunauthorizedarray. - check if
is_atomicistrue (default), rollback all of the ownership changes and throw theunauthorizedarray. - if
is_atomicisfalse, if ownership changes even once while the rest failed, then the transfer will be considered as success.
B) For transaction deduplication, so whenever we’re throwing the TransferError we have to rollback any changes, yes?
C) The same applies to approve operation? if Fail then Rollback?
D) One of the Approve arguments is the token_ids: ?[Nat]. Am I correct to assume that if this is null, this means that the caller want to approve the spender for ALL of his tokens?
A:
1: yes. that’s what I’m also doing
2: yes, you need to go through each id, there might be some token_ids that isn’t available in the collection yet. you need to handle the error.
3: I think you need to remove all the spender assigned by previous owner. this will leave backdoor for the previous owner to gain the ownership again.
4: yes…
5: another yes.
6: this is kinda open, I guess I’m collecting unauthorized and returning it as an error. but the changes made when the ownership/approval check succeed remains unchanged.
B: you’re just checking for the transaction that matches up. there is no need for state changes to no rollback needed.
C: if you do the ownership check earlier, I think there is no place for error according to the reference document.
D: yes.
-
for the Transfer deduplication process, how should we check
created_at_timepotential duplicate? by using==for exactly similar time? or should we compare if theA.created_at_timewindow and future, overlaps withB.created_at_timewindow and future? -
When can I expect the standard spec to be completed along with other update operations such as
mintandburn? Do we want to also includetoken_idsarray argument to apply many mints per update call and many burns per update call too? along with deduplication? -
Why is the Transfer’s token_id arg is definite, but the Approve’s token_id is optional? Can’t we make Approve’s token_id also definite so if the token_id array being empty, it can be regarded as it being null. Also, the ApprovalError is missing the
CreatedInFuture { ledger_time: Nat64 }variant, but is present in ICRC-2. -
When should I throw the
TemporarilyUnavailableerror? -
Based on ICRC-2, I propose that we also include
Expirederror if the user set very low expiry time such as
I addPERMITTED_DRIFTsince i think it’s a good idea to also give a minimum time for approval. If the user set it to exactly NOW, then the approval will be pointless because by the time thetransfergets called, it’s already expired.
i apologize for asking too much.
1:
hmm, i didn’t understood your question quite well.
so I’ll try to explain you the deduplication process.
current_time - TX_window + permitted_drift <—> current_time + pemitted_drift.
the time specified in created_at_time must be between these two time or else return error.
3: that’s open for proposal.
following up the changes: icrc7 update fix · pramitgaha/icrc7@0f9cb16 · GitHub
@benji what’s the update for the bounty. It will be remain assigned to ttt?
Thanks for the heads up @ttt.
We assign @pramitgaha to this bounty.
Hi @domwoe, I have a question, does the Dfinity Foundation has determined to accept the icrc7 repo written by @pramitgaha as the formal icrc7 standard on IC network?
hello, dom is on 2 weeks vacation!
