chore: rename token to FOLD#1602
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
✅ Files skipped from review due to trivial changes (6)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughRenames the protocol bonding token from INTF to FOLD and the ticket token from ITK to tFOLD across Solidity contracts, Rust crates, TypeScript scripts/tasks/tests, SDK, and documentation. Simultaneously replaces the mutable ChangesINTF→FOLD token rename and enableE3Program→registerE3Program refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/pages/tutorials/manage-tickets.mdx (1)
40-56:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winRename
etkBalancein the formula to match the new token terminology.After updating the section to tFOLD (Line 40 and Line 50), the example formula still uses
etkBalanceon Line 55. Please align this variable name (for example,tFoldBalanceorticketTokenBalance) to avoid mixed legacy terminology.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/pages/tutorials/manage-tickets.mdx` around lines 40 - 56, The example formula in the ticket management documentation uses the legacy variable name `etkBalance` which is inconsistent with the updated terminology that now uses tFOLD throughout the section. Replace the variable name `etkBalance` in the formula with a new name that aligns with the current token terminology, such as `tFoldBalance` or `ticketTokenBalance`, to maintain consistent naming throughout the documentation.
🧹 Nitpick comments (1)
examples/CRISP/server/src/cli/commands.rs (1)
197-206: ⚡ Quick winPropagate non-benign
register_e3_programfailures instead of logging and continuing.Both call sites swallow registration failures and continue to
request_e3, which obscures root-cause errors (e.g., auth/config issues) and can lead to confusing downstream failures.
examples/CRISP/server/src/cli/commands.rs#L197-L206: afterregister_e3_programfails, return an error unless a follow-up check confirms the program is already registered.examples/CRISP/server/src/server/routes/rounds.rs#L186-L193: apply the same pattern; avoid continuing silently after a failed registration attempt.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@examples/CRISP/server/src/cli/commands.rs` around lines 197 - 206, In examples/CRISP/server/src/cli/commands.rs at lines 197-206, when the `register_e3_program` call fails in the `Err(e)` branch, do not simply log the error and continue. Instead, return an error unless a follow-up check with `contract.is_e3_program_enabled(e3_program)` confirms the program is already registered. Apply the identical error-handling pattern in examples/CRISP/server/src/server/routes/rounds.rs at lines 186-193 where the same `register_e3_program` call is made; replace the silent logging of failures with proper error propagation or verification that the desired state is already in place.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/pages/ciphernode-operators/registration.mdx`:
- Around line 42-43: The ticketPrice parameter in the status examples uses an
incorrect unit denomination. In docs/pages/ciphernode-operators/registration.mdx
at lines 42-43 (anchor location) and line 110 (sibling location), replace tFOLD
with the correct fee-token unit denomination (such as USDC) for the ticketPrice
values. This change aligns ticketPrice with the fee-token denomination described
later in the document around line 175, ensuring consistency throughout the
documentation where ticketPrice represents a fee-token amount while tFOLD
represents the minted ticket balance token.
In `@examples/CRISP/interfold.config.yaml`:
- Around line 16-21: The interfold.config.yaml file contains a duplicate
bonding_registry mapping key declared at lines 16-17 and again at lines 19-20
with identical values. Remove the duplicate bonding_registry entry (either the
first or second occurrence) to ensure the YAML configuration is valid and avoids
ambiguous key behavior. Keep only a single bonding_registry definition with its
address and deploy_block values.
In
`@packages/interfold-contracts/artifacts/contracts/interfaces/IInterfold.sol/IInterfold.json`:
- Around line 604-605: The InterfoldEventData interface references non-existent
keys E3_PROGRAM_ENABLED and E3_PROGRAM_DISABLED which no longer match the
updated InterfoldEventType enum. Locate the InterfoldEventData interface
definition and replace the references to E3_PROGRAM_ENABLED and
E3_PROGRAM_DISABLED with E3_PROGRAM_REGISTERED to ensure consistency with the
enum that now defines only E3_PROGRAM_REGISTERED.
In `@packages/interfold-contracts/contracts/Interfold.sol`:
- Around line 683-690: The registerE3Program function currently lacks access
control and allows any external account to register E3 programs to the protocol,
which is a security vulnerability. Add an owner-only access control modifier
(such as onlyOwner) to the registerE3Program function to restrict this
capability to the contract owner only, ensuring that only authorized governance
can mutate the E3-program allow-list.
In `@packages/interfold-contracts/test/Interfold.spec.ts`:
- Around line 362-369: The test "registers E3 Program correctly" is validating
fixture state rather than the actual registration flow. It uses e3Program which
is already registered in the fixture setup, so the test passes without
exercising the registerE3Program method. Replace the test to use a fresh,
unregistered program address, call the registerE3Program method with that new
address, and then assert that e3Programs returns true for the newly registered
program to properly validate the registration path.
In `@packages/interfold-sdk/src/events/types.ts`:
- Line 13: In the InterfoldEventData interface, add a new type mapping for the
E3_PROGRAM_REGISTERED enum member that includes an e3Program property (of type
address/string) corresponding to the Solidity event parameter. Additionally,
locate and remove the stale E3_PROGRAM_ENABLED and E3_PROGRAM_DISABLED type
mappings from the InterfoldEventData interface (around lines 109-110) since
these enum members no longer exist in the InterfoldEventType enum, which is
causing TypeScript compilation errors.
---
Outside diff comments:
In `@docs/pages/tutorials/manage-tickets.mdx`:
- Around line 40-56: The example formula in the ticket management documentation
uses the legacy variable name `etkBalance` which is inconsistent with the
updated terminology that now uses tFOLD throughout the section. Replace the
variable name `etkBalance` in the formula with a new name that aligns with the
current token terminology, such as `tFoldBalance` or `ticketTokenBalance`, to
maintain consistent naming throughout the documentation.
---
Nitpick comments:
In `@examples/CRISP/server/src/cli/commands.rs`:
- Around line 197-206: In examples/CRISP/server/src/cli/commands.rs at lines
197-206, when the `register_e3_program` call fails in the `Err(e)` branch, do
not simply log the error and continue. Instead, return an error unless a
follow-up check with `contract.is_e3_program_enabled(e3_program)` confirms the
program is already registered. Apply the identical error-handling pattern in
examples/CRISP/server/src/server/routes/rounds.rs at lines 186-193 where the
same `register_e3_program` call is made; replace the silent logging of failures
with proper error propagation or verification that the desired state is already
in place.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4748edb1-749e-4538-9c43-87f87df909df
📒 Files selected for processing (43)
crates/cli/src/ciphernode/license.rscrates/cli/src/ciphernode/lifecycle.rscrates/cli/src/ciphernode/mod.rscrates/cli/src/main.rscrates/evm-helpers/src/contracts.rscrates/sortition/Readme.mddocs/pages/architecture-overview.mdxdocs/pages/ciphernode-operators/exits-and-slashing.mdxdocs/pages/ciphernode-operators/index.mdxdocs/pages/ciphernode-operators/registration.mdxdocs/pages/ciphernode-operators/running.mdxdocs/pages/ciphernode-operators/tickets-and-sortition.mdxdocs/pages/tutorials/deploy-to-testnet.mdxdocs/pages/tutorials/manage-tickets.mdxdocs/pages/tutorials/using-the-dashboard.mdxexamples/CRISP/interfold.config.yamlexamples/CRISP/packages/crisp-contracts/deploy/crisp.tsexamples/CRISP/packages/crisp-contracts/deployed_contracts.jsonexamples/CRISP/server/src/cli/commands.rsexamples/CRISP/server/src/server/routes/rounds.rspackages/interfold-contracts/README.mdpackages/interfold-contracts/artifacts/contracts/interfaces/IBondingRegistry.sol/IBondingRegistry.jsonpackages/interfold-contracts/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/ICiphernodeRegistry.jsonpackages/interfold-contracts/artifacts/contracts/interfaces/IInterfold.sol/IInterfold.jsonpackages/interfold-contracts/artifacts/contracts/interfaces/ISlashingManager.sol/ISlashingManager.jsonpackages/interfold-contracts/contracts/E3RefundManager.solpackages/interfold-contracts/contracts/Interfold.solpackages/interfold-contracts/contracts/interfaces/IBondingRegistry.solpackages/interfold-contracts/contracts/interfaces/IInterfold.solpackages/interfold-contracts/contracts/registry/BondingRegistry.solpackages/interfold-contracts/contracts/token/InterfoldTicketToken.solpackages/interfold-contracts/contracts/token/InterfoldToken.solpackages/interfold-contracts/scripts/deployInterfold.tspackages/interfold-contracts/tasks/ciphernode.tspackages/interfold-contracts/tasks/interfold.tspackages/interfold-contracts/test/E3Lifecycle/E3Integration.spec.tspackages/interfold-contracts/test/Interfold.spec.tspackages/interfold-contracts/test/Registry/BondingRegistry.spec.tspackages/interfold-contracts/test/Slashing/CommitteeExpulsion.spec.tspackages/interfold-contracts/test/Token/InterfoldToken.spec.tspackages/interfold-contracts/test/fixtures/system.tspackages/interfold-sdk/src/events/types.tstemplates/default/deploy/default.ts
💤 Files with no reviewable changes (1)
- packages/interfold-contracts/contracts/E3RefundManager.sol
Summary by CodeRabbit
Release Notes
Documentation
Smart Contracts
CLI & Configuration