Skip to content

New archiver smart contract - #59

Open
nicolas-assouad-spiko wants to merge 1 commit into
mainfrom
implement-archiver-contract
Open

New archiver smart contract#59
nicolas-assouad-spiko wants to merge 1 commit into
mainfrom
implement-archiver-contract

Conversation

@nicolas-assouad-spiko

Copy link
Copy Markdown

No description provided.

@nicolas-assouad-spiko nicolas-assouad-spiko self-assigned this Jul 17, 2026
Copilot AI review requested due to automatic review settings July 17, 2026 09:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.js to deploy and verify the new Archiver contract.
  • Add test/archiver.test.js and refactor test fixture setup into test/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 thread test/fixtures.js
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 }
);
Comment thread package.json
"@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 thread scripts/migrate.js
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
nicolas-assouad-spiko force-pushed the implement-archiver-contract branch from da30d4a to bd3e7b1 Compare July 17, 2026 13:06
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.

3 participants