feat: Add ai generated example for Arbitrum deployment - #7
Closed
lucas-manuel wants to merge 1 commit into
Closed
lucas-manuel wants to merge 1 commit into
lucas-manuel wants to merge 1 commit into
Conversation
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.
What is on the branch
Two scripts, a shared library, inputs, tests and Makefile targets in spark-pau-deploy on add-ai-example-arbitrum. Nothing is committed yet.
src/ParallelPAULib.sol holds both production steps. deploy creates Beacon, CCTPFacet (wired as CCTP_FACET), PAUFactory, AdministeredAgentFactory, then AccessControls, RateLimits, Controller against the existing ALMProxy, and one AdministeredAgent, all with the deployer as admin. configure adds agent actors, grantor and revoker, grants ALLOCATOR_ROLE to the agent and CONTROLLER on the new RateLimits to the controller, syncs CCTP_FACET, sets the Ethereum domain parameters, then hands every admin role to the Spark Executor and revokes the deployer. checkConfigured reverts on any deviation, so a bad input aborts in simulation.
src/CCTPFacetWiring.sol is the canonical ten-wire selector set.
script/parallel-controller/DeploySparkPAUParallel.s.sol and ConfigureSparkPAUParallel.s.sol are thin wrappers that read the input JSON, pin it to the address registry (proxy, USDC, TokenMessengerV2, Spark Executor, Ethereum ALMProxy), and call the library.
Inputs in script/input/42161/, a deployments/arbitrum-production.json template, and Makefile targets deploy-arbitrum-parallel-production, configure-arbitrum-parallel-production, plus simulate-* and test targets.
Nothing touches the ALMProxy. The CONTROLLER grant and rate limits are left to the spell, as you specified.
Verification
Fork end-to-end test (test/parallel-controller/arbitrum/E2E.t.sol) runs the library as the deployer on an Arbitrum fork, asserts the end state, then simulates the spell as the Spark Executor and pushes a real 1M USDC burn through Circle's TokenMessengerV2 via the relayer. It also checks the kill switch, that the deployer keeps no authority, and that unset limits fail closed. 11 of 11 pass.
Wiring diff confirms the Arbitrum wiring is identical, wire for wire, to the CCTP_FACET integration on the Spark Ethereum Beacon.
Forge simulation of the deploy script with the production input completed against the live fork and exported the address file.
Post-deploy test (PostDeployTests.t.sol) asserts state and Arbiscan event logs once the deployments file is filled in. It skips until then.
The OZ submodule issue did not appear; Beacon, facets and factories compile here as is. I did not remove spark-vaults-v2.
Before you broadcast
Deployer address. Both input files use the mainnet deployer 0xC758…136f. Change it if Arbitrum uses a different key. The deploy script refuses any other sender.
Grantor. Set to 0x4B61…C514, which exists at the same address on Arbitrum. Confirm that is the intended Safe.
After deploy, paste controller and administeredAgent from the output file into the config input, then run configure. Then fill deployments/arbitrum-production.json and run make test-postdeploy-arbitrum-parallel.
Env: ARBITRUM_ONE_RPC_URL, ARBISCAN_API_KEY for --verify, ETHERSCAN_API_KEY for the event tests.
Run order:
Say the word and I will commit and open the PR.