Skip to content

Conversation

pali101
Copy link
Contributor

@pali101 pali101 commented Oct 6, 2025

This change is a precursor to solve FilOzone/synapse-sdk#244. The SDK requires the full USDFC ABI to integrate features that use extensions like ERC-2612 and ERC-3009. This PR provides a reliable, automated way to source that ABI.

Problem

Previously, we used a generic ERC20 ABI which lacks support for the ERC-2612 and ERC-3009 specific extensions. This required manual ABI additions and could lead to discrepancies, blocking integration in synapse-sdk.

Solution

  • A new script, tools/fetch-usdfc-abi.sh, is added. It resolves the USDFC proxy address to its underlying implementation contract and fetches the correct ABI
  • The Makefile is updated to integrate the script. The USDFC ABI can be fetched on-demand with make abi/Usdfc.abi.json and is also automatically updated with all other contracts when running make update-abi
  • The most recent USDFC ABI has been checked in to reflect this change

This streamlines the process of keeping the ABI in sync with the deployed contract and ensures all necessary function definitions are available.

@FilOzzy FilOzzy added this to FS Oct 6, 2025
@github-project-automation github-project-automation bot moved this to 📌 Triage in FS Oct 6, 2025
@rjan90 rjan90 requested a review from hugomrdias October 6, 2025 17:55
@rjan90 rjan90 moved this from 📌 Triage to 🔎 Awaiting review in FS Oct 6, 2025
KEYSTORE ?=
PASSWORD ?=
CHALLENGE_FINALITY ?=
USDFC_PROXY_ADDRESS ?= 0x80B98d3aa09ffff255c3ba4A241111Ff1262F045
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
USDFC_PROXY_ADDRESS ?= 0x80B98d3aa09ffff255c3ba4A241111Ff1262F045
# Mainnet address by default
USDFC_PROXY_ADDRESS ?= 0x80B98d3aa09ffff255c3ba4A241111Ff1262F045

Comment on lines +4 to +5
# Fetches the ABI for a Filecoin proxy contract's implementation and saves it.
#
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# Fetches the ABI for a Filecoin proxy contract's implementation and saves it.
#
# Fetches the ABI for a Filecoin mainnet proxy contract's implementation and saves it.
#

Comment on lines +79 to +83
echo "$IMPL_RESPONSE" | jq '.abi | fromjson' > "$OUTPUT_PATH" || {
# Clean up the potentially empty/corrupt file on failure.
rm -f "$OUTPUT_PATH" 2>/dev/null
die "Failed to parse ABI. The '.abi' field may be missing, null, or not valid JSON."
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be more graceful - you could send it to a temporary file and then move it to OUTPUT_PATH, but the way this is now, a failure to fetch will leave you with a deleted ABI file in your repo.

@rvagg
Copy link
Collaborator

rvagg commented Oct 7, 2025

lgtm, just some minor notes

@rvagg
Copy link
Collaborator

rvagg commented Oct 7, 2025

I just saw FilOzone/synapse-sdk#281 (comment) so I'll let @hugomrdias tell us which way this has to go to get it into synapse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 Awaiting review

Development

Successfully merging this pull request may close these issues.

3 participants