feat: interfold token vesting escrow [skip-line-limit]#1557
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds BondingRegistry.totalBonded and reentrancy hardening; implements EnclaveToken pooled lock schedules, LOCK_MANAGER_ROLE, and locked-floor invariant tied to bonding credit; updates deployEnclave TGE resolution; updates flow-trace docs; refreshes tests, examples, and deployment artifacts. ChangesLicense Bonding Accounting and Token-Level Locking
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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
🤖 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 `@examples/CRISP/server/.env.example`:
- Around line 18-20: The remaining contract address envs in .env.example are out
of sync: update CRISP_VOTING_TOKEN and all MOCK_* variables so they match the
current localhost deployment manifest (so the example is self-consistent with
ENCLAVE_ADDRESS, FEE_TOKEN_ADDRESS, E3_PROGRAM_ADDRESS); locate the
CRISP_VOTING_TOKEN and MOCK_* entries in the file and replace their values with
the corresponding addresses from the latest localhost deployment manifest,
ensuring the format and hex checksums match the other entries.
In `@packages/enclave-contracts/contracts/registry/BondingRegistry.sol`:
- Around line 1184-1191: _liveLicenseSourceCount currently adds all pending
entries including those before _pendingLicenseHead that have zero amounts;
update _liveLicenseSourceCount to compute the pending portion by iterating from
_pendingLicenseHead[operator] to _pendingLicenseSources[operator].length and
count only entries whose pending amount field is non-zero (e.g.,
_pendingLicenseSources[operator][i].amount or similar), then add that count to
_licenseSources[operator].length; use the existing mappings/arrays
(_licenseSources, _pendingLicenseSources, _pendingLicenseHead) and avoid
changing external storage layout.
In `@packages/enclave-contracts/scripts/deployEnclave.ts`:
- Around line 106-109: The code reads saved TGE args using raw networkName which
can differ from the deployment key; change the call that computes
preDeployedTgeTimestamp to use the deployment-chain key returned by
getDeploymentChain(hre) instead of networkName — i.e., call
readDeploymentArgs("InterfoldVestingEscrow", getDeploymentChain(hre))
(referencing preDeployedTgeTimestamp, readDeploymentArgs, getDeploymentChain,
hre, and InterfoldVestingEscrow) so persisted tgeTimestamp is found even when
network aliases differ.
In `@packages/enclave-sdk/src/circuits/assert-micro-circuits.ts`:
- Around line 51-53: resolveActivePresetPath() is not defined/imported (causing
runtime failure) and the code checks the global ACTIVE_PRESET_PATH instead of
the call result; import or implement the resolver (resolveActivePresetPath) and
replace the global check with a null/undefined check against the returned value
(activePresetPath) so the initialization uses the runtime-resolved path.
In `@templates/default/deployed_contracts.json`:
- Around line 98-100: Top-level manifest address fields (e.g., Enclave.address
and E3RefundManager.address) are inconsistent with their corresponding proxy
records; update the manifest so each contract's top-level "address" equals its
proxyRecords.proxyAddress value (for example, set Enclave.address =
proxyRecords.Enclave.proxyAddress and E3RefundManager.address =
proxyRecords.E3RefundManager.proxyAddress) and repeat the same fix for the other
occurrence noted (lines ~114-119) so all
proxyAddress/implementationAddress/proxyAdminAddress groupings remain internally
consistent.
In `@templates/default/enclave.config.yaml`:
- Around line 6-7: The template's contract entries (notably the e3_program
address and deploy_block fields) are out of sync with the canonical deployment
manifest; update each mismatched template config entry so the e3_program value
and its deploy_block (and the other entries flagged: lines with deploy_block at
positions 10, 13, 16, 22) exactly match the corresponding values in the current
deployed_contracts.json manifest, ensuring addresses and numeric deploy_block
values are copied verbatim and preserving YAML formatting.
🪄 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: 6a85e8d2-d93c-4ea2-afa1-3debf19cde6f
📒 Files selected for processing (23)
agent/flow-trace/02_TOKENS_AND_ACTIVATION.mdagent/flow-trace/05_FAILURE_REFUND_SLASHING.mdagent/flow-trace/06_DEACTIVATION_AND_COMPLETION.mdexamples/CRISP/enclave.config.yamlexamples/CRISP/packages/crisp-contracts/deployed_contracts.jsonexamples/CRISP/packages/crisp-contracts/hardhat.config.tsexamples/CRISP/server/.env.examplepackages/enclave-contracts/README.mdpackages/enclave-contracts/artifacts/contracts/interfaces/IBondingRegistry.sol/IBondingRegistry.jsonpackages/enclave-contracts/contracts/interfaces/IBondingRegistry.solpackages/enclave-contracts/contracts/interfaces/IInterfoldVestingEscrow.solpackages/enclave-contracts/contracts/interfaces/ILicenseBondReceiver.solpackages/enclave-contracts/contracts/registry/BondingRegistry.solpackages/enclave-contracts/contracts/token/InterfoldVestingEscrow.solpackages/enclave-contracts/scripts/deployAndSave/interfoldVestingEscrow.tspackages/enclave-contracts/scripts/deployEnclave.tspackages/enclave-contracts/scripts/index.tspackages/enclave-contracts/test/Registry/BondingRegistry.spec.tspackages/enclave-contracts/test/Token/InterfoldVestingEscrow.spec.tspackages/enclave-sdk/src/circuits/assert-micro-circuits.tstemplates/default/deployed_contracts.jsontemplates/default/enclave.config.yamltemplates/default/hardhat.config.ts
|
Actionable comments posted: 0 |
Co-authored-by: Cristóvão <cristovaoth@users.noreply.github.com>
Summary by CodeRabbit
New Features
Documentation
Chores