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

WIP: Adds a spell for NEAR blockchain ft_transfer_calls #7900

Closed
wants to merge 1 commit into from

Conversation

danzipie
Copy link

Adds a spell for NEAR blockchain ft_transfer_calls.

ft_transfer_call is one of the two ways to send fungible tokens according to the NEP-141 standard. Until now only the other method is covered (ft_transfer through the ft_transfers table).

This contribution adds coverage for the ft_transfer_call, which according to the standard:

transfer tokens and call a method on a receiver contract. A successful workflow will end in a success execution outcome to the callback on the same contract at the method ft_resolve_transfer. You can think of this as being similar to attaching native NEAR tokens to a function call. It allows you to attach any Fungible Token in a call to a receiver contract.

source: https://github.com/near/NEPs/blob/master/neps/nep-0141.md

TLDR: Without this spell, many Fungible Token transfers are simply not parsed, because they don't appear in the ft_transfers.

@github-actions github-actions bot marked this pull request as draft March 21, 2025 13:39
@github-actions github-actions bot added WIP work in progress dbt: daily covers the Daily dbt subproject labels Mar 21, 2025
@danzipie danzipie force-pushed the ft_transfer_call branch 6 times, most recently from 8f1fb0e to 59733b9 Compare March 22, 2025 13:56
@danzipie danzipie changed the title WIP: Adds a spell for NEAR blockchain ft_transfer_calls Adds a spell for NEAR blockchain ft_transfer_calls Mar 23, 2025
@danzipie danzipie marked this pull request as ready for review March 23, 2025 16:45
@github-actions github-actions bot added ready-for-review this PR development is complete, please review and removed WIP work in progress labels Mar 23, 2025
@jeff-dude jeff-dude self-assigned this Mar 24, 2025
@jeff-dude jeff-dude added in review Assignee is currently reviewing the PR and removed ready-for-review this PR development is complete, please review labels Mar 24, 2025
@danzipie danzipie force-pushed the ft_transfer_call branch 6 times, most recently from 3357657 to aa5eb71 Compare March 25, 2025 12:05
@danzipie danzipie force-pushed the ft_transfer_call branch 2 times, most recently from 943a6ae to 532d448 Compare March 25, 2025 15:59
@jeff-dude
Copy link
Member

once you apply all changes and CI workflows complete, plz do test the data output to ensure you are happy with results.

you can go into logs here (when complete)
https://github.com/duneanalytics/spellbook/actions/runs/14064331256/job/39382873996?pr=7900
and copy/paste table names and query on dune app like any other table

@danzipie danzipie force-pushed the ft_transfer_call branch 6 times, most recently from b348bde to 4f8d7a3 Compare March 26, 2025 15:52
Adds a spell for NEAR blockchain (resolution of ft_transfer_calls).

ft_transfer_call is one of the two ways to send fungible tokens according to the NEP-141 standard.
Until now only the other method is covered (ft_transfer through the ft_transfers table).
This contribution adds coverage for the ft_transfer_call, which according to the standard: transfer tokens and call a method on a receiver contract. A successful workflow will end in a success execution outcome to the callback on the same contract at the method ft_resolve_transfer. You can think of this as being similar to attaching native NEAR tokens to a function call. It allows you to attach any Fungible Token in a call to a receiver contract.
@jeff-dude
Copy link
Member

run times look much better & code looking good 🔥

did you get a chance to query test_schema.git_dunesql_36ba26e_near_ft_transfer_calls results and see if you're happy with output?

@danzipie danzipie changed the title Adds a spell for NEAR blockchain ft_transfer_calls WIP: Adds a spell for NEAR blockchain ft_transfer_calls Mar 26, 2025
@danzipie
Copy link
Author

Hi @jeff-dude that you very much for your reviews!

After doing several manual tests, I realised that I had initially misunderstood the problem. The near.ft_transfers table already includes most of the ft_transfer_calls. The actual problem is that a subset of tokens is not emitting the right FT Event hence the transfer goes undetected (and it’s not included in ft_transfers).

example of undetected transfer: https://nearblocks.io/txns/6a2Pddo4MQgePhj3NLVqhh6HAECrP6xzatp78wKJRoeV#

I will close this PR and work on the actual problem.

@danzipie danzipie closed this Mar 27, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2025
@jeff-dude
Copy link
Member

all good, hopefully the process still helped you understand spellbook further 🙏

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dbt: daily covers the Daily dbt subproject in review Assignee is currently reviewing the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants