New archiver smart contract - #59
Open
nicolas-assouad-spiko wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new upgradeable Archiver smart contract (backed by @spiko/erc-cross-chain-event-archive) and wires it into the deployment/migration flow, along with a dedicated test suite and shared test fixture refactor.
Changes:
- Add
contracts/archiver/Archiver.sol(UUPS + PermissionManager-restricted writer/amender wrapper). - Extend
scripts/migrate.jsto deploy and verify the new Archiver contract. - Add
test/archiver.test.jsand refactor test fixture setup intotest/fixtures.js.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
contracts/archiver/Archiver.sol |
New permissioned Archiver contract exposing archiveEvent/amendEvent, UUPS upgrade authorization, ERC165 support. |
scripts/migrate.js |
Deploys + verifies Archiver; adds new archiver role constant (affects config sanity checking). |
test/fixtures.js |
New shared fixture; introduces accounts.archiver and archiver role membership. |
test/main.test.js |
Switches to shared fixture/helpers from test/fixtures.js. |
test/archiver.test.js |
New test coverage for Archiver permissions, archiving/amending behavior, ERC165, multicall. |
package.json |
Adds @spiko/erc-cross-chain-event-archive dependency. |
pnpm-lock.yaml |
Lockfile updates to include the new dependency resolution. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+18
to
+35
| const { contracts, config, roles } = await migrate( | ||
| { | ||
| deployer: accounts.admin, | ||
| roles: { | ||
| admin: { members: [accounts.admin].map(getAddress) }, | ||
| 'operator-exceptional': { members: [accounts.operator].map(getAddress) }, | ||
| 'operator-daily': { members: [accounts.operator, 'minter'].map(getAddress) }, | ||
| 'operator-oracle': { members: [accounts.operator].map(getAddress) }, | ||
| burner: { members: ['redemption'].map(getAddress) }, | ||
| whitelister: { members: [accounts.whitelister].map(getAddress) }, | ||
| whitelisted: { members: [accounts.alice, accounts.bruce, 'redemption'].map(getAddress) }, | ||
| 'mint-initiator': { members: [accounts.operator].map(getAddress) }, | ||
| 'mint-approver': { members: [accounts.admin].map(getAddress) }, | ||
| archiver: { members: [accounts.archiver].map(getAddress) }, | ||
| }, | ||
| }, | ||
| { noCache: true, noConfirm: true } | ||
| ); |
| "@chainlink/contracts": "^0.8.0", | ||
| "@openzeppelin/contracts": "^5.4.0", | ||
| "@openzeppelin/contracts-upgradeable": "^5.4.0", | ||
| "@spiko/erc-cross-chain-event-archive": "github:spiko-tech/erc-cross-chain-event-archive#v0.1.0", |
Comment on lines
83
to
87
| RedemptionExecutor: 'redemption-executor', | ||
| MintInitiator: 'mint-initiator', | ||
| MintApprover: 'mint-approver', | ||
| Archiver: 'archiver', | ||
| }; |
Implement a new upgradeable archiver smart contract that stores cross-chain event archives with amendment support. The contract integrates EventArchiveAmendable for versioned event storage, implements IEventArchiveWriter interface, uses permission-based access control via PermissionManaged, and supports batch operations through Multicall. Dependencies include @spiko/erc-cross-chain-event-archive package and OpenZeppelin upgradeable contracts. Migration script updated to deploy archiver with UUPS proxy pattern and configure archiver role permissions. Comprehensive test suite added covering archiveEvent, amendEvent, authorization, ERC165 interface support, and multicall functionality. Test fixtures refactored into separate module to enable reuse across test suites.
nicolas-assouad-spiko
force-pushed
the
implement-archiver-contract
branch
from
July 17, 2026 13:06
da30d4a to
bd3e7b1
Compare
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.
No description provided.