Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
NEP-452 Linkdrop Standard #452
NEP-452 Linkdrop Standard #452
Changes from 8 commits
de47911
de454c1
c0d764b
f4df068
54322db
62398fd
7eac04f
f2f0486
8a2b1d7
f52586a
e1b4b18
5877eba
11d006c
e5bf766
8e50122
382d4a8
3968d96
845cd53
2bd6fcd
1bf0268
c61f9fb
07f4da2
ac9a8bd
17c0294
09ee654
d513e1b
75e6e9b
256a24b
f349084
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you see this gas being split between the calls? There are two arrays that require cross-contract calls (
NFTData[]
andFTData[]
), and there is also some gas to be preallocated for the account creation callback and assets transfer callback functions, so there is a lot to unpack here.P.S. It feels that it is quite trivial to end up with a linkdrop that won't have enough gas to transfer all the assets in a single transaction. Thus, one area for future possibilities would be a multi-stage withdrawal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not provided, will the gas for each leg of the transaction be deducted from the deposit? I would clarify this behavior in the comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I strongly believe that the gas distribution and the inner workings of the logic should not be addressed in this standard. In my eyes, this standard allows anyone to claim a linkdrop regardless of where it originated from (keypom,
near
/testnet
, neardrop etc...). If you have a linkdrop that follows this standard, you will know how to claim it and what to expect.How gas is distributed should be left to the smart contract developer in my opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BenKurrek Well, this is exactly who I care about, the developers of the smart contract who would be in a tough situation where they only have the total gas allocation, and they need to somehow figure out how to spend it wisely. While alternatively, we might have
required_gas
specified on the FTData / NFTData level. How does Keypom handle it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a second thought, I agree with this statement. Consider adding a hint to the readers that it is expected that it is the responsibility of a linkdrop contract to define how exactly to calculate the required gas (either automatically on the contract side with linkdrop creation, or even move this responsibility to the client code of linkdrop creation)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think that we should not standarize the gas logic here. However we should document the issue here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, remove the field at all, is it a so useful field? The user won't be dissatisfied with attaching the 100Tgas by default, or 300TGas in a case of failure.
For instance, what happens if
ft_transfer_call
fails? Nothing bad, the front-end developer specifies more Gas. I also foresee the gas amount is going to be hard-coded (predictable).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My preference is to standardize how much gas to attach but leave it to the developers to choose how they distribute that gas throughout the transaction. I can leave a note explaining that it's the developer's responsibility but not force them through a certain flow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a note under the field. Let me know if this suffices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered renaming it to
near_amount
or even introducingNEARData
type to matchFTData
type whereamount
is used?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
near_amount would make sense here and possibly minimize potential confusion with FT drops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good suggestion although the amount will be in yocto... do you think this would be obvious enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, we can go with
yoctonear_amount
thenThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yNEAR
oryoctoNEAR
,y_near
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like
yoctoNEAR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BenKurrek I just noticed that you've changed it to
yoctoNEAR
- it's against Rust naming convention, it's better to go withyoctonear
oryoctonear_amount
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do
yoctonear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied this directly from the FT standard - do you still wanna change it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the suggestion is more meaningful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robert-zaremba I feel both explanations are equally cumbersome π€·ββοΈ , so I would leave the original one for now since it is an extract from an existing NEP, and think about how we can improve this situation with stringified numbers universally for all the NEPs going forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, the original is text is not clear. Should be changed. Replicating bad documentation should not be an excuse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we include this in a new standard if it is deprecated? let's remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I included it as to be backwards compatible with legacy contracts. If we change it, we're forcing every contract to change if they want to be compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frol do you have opinions here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's better explain it:
Personally I prefer 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BenKurrek I think we should drop the deprecated method from the spec, and migrate wallets to the new method (we should update
get_key_information
in the near-linkdrop to returnyoctoNEAR
and deploy it)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seams the spec was not updated, but the comment was resolved. Reopening it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is worth linking to a specific commit state as who knows how the implementations will evolve in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't implemented this specific standard as it's not finalized but once we finish with the interface, I'll make a PR into keypom and then link the commit here.