Skip to content

[WIP] foundry based tooling for yield backend ops#2149

Open
d10r wants to merge 6 commits intodevfrom
2026-03-spark
Open

[WIP] foundry based tooling for yield backend ops#2149
d10r wants to merge 6 commits intodevfrom
2026-03-spark

Conversation

@d10r
Copy link
Collaborator

@d10r d10r commented Mar 11, 2026

This PR adds tooling for deploying and enabling yield backends.
Much of the code added here is generic and to be used for other ops too going forwarded (related to truffle being deprecated).

Typically setting up a yield backend involves the following steps:

  • deploy a new yield backend
  • create gov action for setting the SuperToken admin to the gov owner
  • create admin action for enabling the yield backend

(The second step is needed because unlike for updateCode, there's no code in the host and governance contract for calling the permissioned functions for controlling a yield backend.
Meaning, for SuperTokens using a yield backend, the governance owner directly interacts with the SuperToken contract, without the calls being routed through 2 other contracts. This may change in the future, e.g. in case many SuperTokens get a yield backend, and/or if the current contract size limit is lifted)

Here's the commands used to deploy yield backends and create related gov/admin actions for USDCx on 2 networks:

Aave yield backend for USDCx on base-mainnet

# deploy the yield backend
ops-scripts/deploy-yield-backend.sh base-mainnet aave 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 0xA238Dd80C259a72e81d7e4664a9801593F98d1c5 0xac808840f02c47C05507f48165d2222FF28EF4e1
# yielded new contract 0x44f6d470afb44a4221fcf27ebaa577ff9d86f4ec
# gov action: change USDCx admin to the the security council Safe
ops-scripts/gov-action.sh base-mainnet changeSuperTokenAdmin 0xD04383398dD2426297da660F9CCA3d439AF9ce1b 0x06a858185b3B2ABB246128Bb9415D57e5C09aEB6
# USDCx admin action: enable yield backend
SUPER_TOKEN_ADMIN_OVERRIDE=0x06a858185b3B2ABB246128Bb9415D57e5C09aEB6 ops-scripts/enable-yield-backend.sh base-mainnet 0xD04383398dD2426297da660F9CCA3d439AF9ce1b 0x44f6D470aFb44A4221fcf27EBaA577Ff9D86f4EC

# fork test (using https://github.com/d10r/sf-test-gov-action)
scripts/run_yield_backend_test.sh base-mainnet 0xD04383398dD2426297da660F9CCA3d439AF9ce1b 0x44f6D470aFb44A4221fcf27EBaA577Ff9D86f4EC

Spark yield backend for USDCx on eth-mainnet

ops-scripts/deploy-yield-backend.sh eth-mainnet spark 0xBc65ad17c5C0a2A4D159fa5a503f4992c7B545FE 0xac808840f02c47C05507f48165d2222FF28EF4e1 216
# yielded new contract 0x818fbe37EcFee8b981dD1a2Bb2C292EEBE0AB21E
ops-scripts/gov-action.sh eth-mainnet changeSuperTokenAdmin 0x1BA8603DA702602A8657980e825A6DAa03Dee93a 0x06a858185b3B2ABB246128Bb9415D57e5C09aEB6
SUPER_TOKEN_ADMIN_OVERRIDE=0x06a858185b3B2ABB246128Bb9415D57e5C09aEB6 ops-scripts/enable-yield-backend.sh eth-mainnet 0x1BA8603DA702602A8657980e825A6DAa03Dee93a 0x818fbe37EcFee8b981dD1a2Bb2C292EEBE0AB21E

# fork test (using https://github.com/d10r/sf-test-gov-action)
scripts/run_yield_backend_test.sh eth-mainnet 0x1BA8603DA702602A8657980e825A6DAa03Dee93a 0x818fbe37EcFee8b981dD1a2Bb2C292EEBE0AB21E

More context: https://github.com/superfluid-org/protocol-monorepo/wiki/Yield-Backend

@github-actions
Copy link

Changelog Reminder

Reminder to update the CHANGELOG.md for any of the modified packages in this PR.

  • CHANGELOG.md modified
  • Double check before merge

@d10r d10r changed the title added SparkYieldBackend (sets referral when depositing) [WIP] foundry based tooling for yield backend ops Mar 17, 2026
@d10r d10r marked this pull request as ready for review March 20, 2026 11:41
@d10r d10r requested a review from hellwolf as a code owner March 20, 2026 11:41
@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants