feat: KEEP-578 add Frax Ether V2 protocol plugin#1287
Merged
Conversation
Add Frax Ether V2 as a new protocol plugin exposing the V2 minter contract. First protocol added under the iterative /add-protocol workflow (KEEP-577). Surface: - protocols/frax-ether-v2.ts uses defineAbiProtocol with one contract (the V2 minter at 0x7Bc6bad540453360F744666D625fec0ee1320cA3) on Ethereum mainnet. - 4 actions: mint (payable), mint-and-give (payable, recipient), mint-and-stake (payable, recipient, returns sfrxETH shares), mint-paused (read). - protocols/abis/frax-ether-v2.json: reduced V2 ABI, functions only. Version isolation: V2 explicit. V1 minter used submit(); V2 uses mintFrxEth(). Picking the wrong version's ABI produces INVALID_ARGUMENT on first call. Slug is frax-ether-v2 per the protocol-version-branding rule. Tests: - tests/unit/protocol-frax-ether-v2.test.ts: 17 shape and override integrity assertions; pass. - tests/integration/protocol-frax-ether-v2-onchain.test.ts: 4 on-chain calldata validation tests gated on INTEGRATION_TEST_MAINNET_RPC_URL. All 4 pass against a real mainnet RPC. Docs: - docs/plugins/frax-ether-v2.md with per-action sections. - docs/plugins/_meta.ts nav entry (between curve and lido). - docs/plugins/overview.md table row (between Curve and Lido). Out of scope (deferred): - FraxEtherRedemptionQueueV2 surface (queue-based redemption, separate contract). - sfrxETH ERC4626 vault surface (addressable via erc4626VaultActions()). - L2 token-read surface for frxETH/sfrxETH on Arbitrum/Base/Optimism.
Restructure the helper that drove the 3 biome warnings the file shipped with: - Hoist the `/^0x/` regex literal to a module-scope constant (TX_RESULT_HEX_PREFIX). Clears `useTopLevelRegex`. - Move the helper inside the describe block AND switch it from expect-based to throw-based. The helper no longer contains expect() calls; instead it rethrows any error class that is not CALL_EXCEPTION, and call sites assert with `expect(...).resolves.toBeUndefined()`. Clears the two `noMisplacedAssertion` warnings. Net effect: helper conveys intent through type signature + exceptions (Promise<void> resolves iff calldata was accepted by the bytecode); each it() block contains an explicit assertion; biome check on the file is clean. Matches aave-v4-onchain.test.ts in structure but improves on its lint status. Same refactor pattern is available for aave-v4, rocket-pool, uniswap, and wrapped if their helpers are extracted to a shared module in a follow-up. Verified: pnpm exec biome check is clean on this file; pnpm type-check passes; integration test still passes 4/4 against a mainnet RPC.
…nit test
The "minter contract is deployed on Ethereum mainnet only" test asserted
toEqual(["1"]) followed by toContain("1") and four not.toContain checks.
The toEqual already proves the array is exactly ["1"]; the other five
assertions are subsumed.
Drop the redundant lines. 17 unit tests still pass.
PR Environment DeployedYour PR environment has been deployed! Environment Details:
Components:
The environment will be automatically cleaned up when this PR is closed or merged. |
This was referenced May 19, 2026
- public/protocols/frax-ether.png: brand asset for the path declared at protocols/frax-ether-v2.ts:24. - scripts/frax-ether-v2-fork-test.ts: tsx smoke test that broadcasts mintFrxEth against a local anvil mainnet fork and asserts the 1:1 frxETH mint. Verified end-to-end against an anvil fork. - docs/plugins/frax-ether-v2.md: "Testing Without Risking Real ETH" section. Documents why there is no testnet entry (Frax did not deploy V2 to any public testnet) and the fork pattern as the supported substitute.
PR Environment DeployedYour PR environment has been deployed! Environment Details:
Components:
The environment will be automatically cleaned up when this PR is closed or merged. |
🧹 PR Environment Cleaned UpThe PR environment has been successfully deleted. Deleted Resources:
All resources have been cleaned up and will no longer incur costs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Add Frax Ether V2 as a new protocol plugin exposing the V2 minter. First protocol added under the iterative
/add-protocolworkflow (KEEP-577) - tests the new 5-phase loop end-to-end.Closes KEEP-578.
Surface
protocols/frax-ether-v2.ts(defineAbiProtocol, single contract, mainnet only)protocols/abis/frax-ether-v2.json(reduced V2 ABI, 4 functions)mint,mint-and-give,mint-and-stake,mint-pausedtests/unit/protocol-frax-ether-v2.test.ts(17 assertions, all pass)tests/integration/protocol-frax-ether-v2-onchain.test.ts(mainnet, gated onINTEGRATION_TEST_MAINNET_RPC_URL, all 4 pass)docs/plugins/frax-ether-v2.md,_meta.tsandoverview.mdupdatesVersion isolation
V2 only. V1 minter used
submit(); V2 renamed tomintFrxEth(). A V1 ABI against V2 bytecode producesINVALID_ARGUMENTon first call - this is exactly the failure mode KEEP-577's research-phase gate was designed to catch. Confirmed against the verified V2 contract at0x7Bc6bad540453360F744666D625fec0ee1320cA3.Slug
frax-ether-v2follows the protocol-version-branding rule from.claude/commands/add-protocol.md(Frax themselves brand it as V2).Out of scope (file follow-ups when wanted)
FraxEtherRedemptionQueueV2at0xfDC69e6BE352BD5644C438302DE4E311AAD5565b(queue-based redemption, separate surface from instant unwrap)0xac3E018457B222d93114458476f3E3416Abbe38F(already addressable viaerc4626VaultActions())Test plan
pnpm test tests/unit/protocol-frax-ether-v2.test.ts)INTEGRATION_TEST_MAINNET_RPC_URL=<mainnet-rpc> pnpm test tests/integration/protocol-frax-ether-v2-onchain.test.ts)pnpm discover-pluginsregisters the protocol and regeneratesprotocols/index.ts+lib/types/integration.tspnpm type-checkpasses