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

FLIP 281: Integrating LostAndFound with Flow Port and Flow Wallet for Token Transfers #286

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

nvdtf
Copy link
Member

@nvdtf nvdtf commented Aug 7, 2024

FLIP #281

Comment on lines 39 to 45
- **Initialized but lacks storage**

The amount of extra storage and required FLOW tokens will be calculated and displayed to the sender. If the user confirms the transaction, the required FLOW tokens are also sent to the receiver. In this case the `FeeEstimator` contract will be used, but the tokens can be sent directly to the receiver.

- **Not initialized**

The amount of needed storage and required FLOW tokens are calculated and displayed to the sender. Upon confirmation, the tokens and required FLOW for storage will be deposited into the `LostAndFound` contract. The receiver can choose to claim the tokens and FLOW when they are online.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible to also use a resource we call the Depositor for this in case you weren't aware:
https://github.com/Flowtyio/lost-and-found/blob/main/contracts/LostAndFound.cdc#L506

You can find sample transactions for its use here:
https://github.com/Flowtyio/lost-and-found/tree/main/transactions/depositor

The issue I've found with FeeEstimator is that every account on Flow is different. What works the account that does fee estimation might be too little to for another account that intends to use that estimation

Copy link
Member Author

@nvdtf nvdtf Aug 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Despositor is great for more advanced use cases but we're not looking to sponsor storage fees for now. We like to show the total cost of transfer to the user for payment.

The issue I've found with FeeEstimator is that every account on Flow is different. What works the account that does fee estimation might be too little to for another account that intends to use that estimation

Can you elaborate on whats the best way to estimate the total cost of interaction (deposit)? Can we use https://github.com/Flowtyio/lost-and-found/blob/main/scripts/lost-and-found/estimate_deposit_nft.cdc?

application/20240807-lost-and-found.md Outdated Show resolved Hide resolved

#### Using child accounts

Instead of a contract, the sender could create a child account for the recipient and transfer the tokens there. The recipient can later claim the account. However, the minimum storage balance cannot be claimed by the recipient as accounts cannot be destroyed on Flow, making this solution more costly for the sender and recipient.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably worth mentioning here that the minimum cost for a new account is likely to increase (I think?) Which would drastically increase the minimum needed to send things using this method.

I recall doing benchmarks a very long time ago and found that you could send a few thousand NFTs (very basic ones) for 1 FLOW of storage, it should be the cheapest option by far

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the storage balance is the deal breaker for this approach. Added a comment af2cddc

application/20240807-lost-and-found.md Outdated Show resolved Hide resolved
@nvdtf nvdtf requested a review from austinkline August 21, 2024 01:50
@nvdtf nvdtf marked this pull request as ready for review August 21, 2024 01:51
@nvdtf nvdtf requested review from gregsantos and JeffreyDoyle and removed request for austinkline August 26, 2024 19:37
@turbolent turbolent added the flip: application Application FLIP label Oct 23, 2024
@nvdtf
Copy link
Member Author

nvdtf commented Dec 23, 2024

We have a basic integration working live on port.flow.com now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flip: application Application FLIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants