From b1a6118e0ece5bd6f8a2a4b2978dbd0153c05235 Mon Sep 17 00:00:00 2001 From: aelmanaa Date: Thu, 17 Sep 2026 09:10:19 +0100 Subject: [PATCH] feat: SiloedLockReleaseTokenPool support, lock box tooling and migration --- Makefile | 22 +- docs/config-schema.md | 3 + docs/deployed-addresses.md | 8 +- docs/enabling-existing-token.md | 9 +- docs/guides/index.md | 1 + docs/guides/migrate-pool-v1-to-v2.md | 3 + docs/guides/migrate-siloed-pool.md | 44 ++++ docs/guides/preflight-a-transfer.md | 4 +- docs/operations/chains.md | 1 + docs/operations/liquidity.md | 59 +++++ docs/operations/pools.md | 22 ++ docs/pool-versions.md | 20 +- docs/primitives/catalog.json | 139 +++++++++- .../config-plane/ForgetDeployment.md | 28 ++ docs/primitives/deploy/DeployERC20LockBox.md | 1 + .../DeploySiloedLockReleaseTokenPool.md | 31 +++ docs/primitives/index.md | 11 + docs/primitives/siloed/ConfigureLockBoxes.md | 30 +++ docs/primitives/siloed/GetSiloedPoolState.md | 28 ++ .../siloed/ProvideSiloedLiquidity.md | 31 +++ docs/primitives/siloed/SetSiloRebalancer.md | 31 +++ .../siloed/UpdateSiloDesignations.md | 32 +++ .../siloed/WithdrawSiloedLiquidity.md | 31 +++ docs/production-checklist.md | 3 + docs/reference/ccip-api.md | 6 + docs/reference/pool-behavior-matrix.md | 20 +- foundry.toml | 8 + package-lock.json | 242 ++++++++++++++++++ package.json | 2 + remappings.txt | 4 + script/config/AdoptToken.s.sol | 106 +++++++- script/config/ForgetDeployment.s.sol | 138 ++++++++++ script/config/VerifyChain.s.sol | 144 +++++++++++ script/config/discover-tokens.sh | 37 ++- script/config/dotenv-get.sh | 19 +- script/config/preflight-transfer.sh | 34 ++- script/config/test-tooling.sh | 64 +++++ .../liquidity/WithdrawLiquidity.s.sol | 7 +- .../configure/remote-chains/RemoveChain.s.sol | 4 +- .../configure/siloed/ConfigureLockBoxes.s.sol | 113 ++++++++ .../configure/siloed/GetSiloedPoolState.s.sol | 156 +++++++++++ .../siloed/ProvideSiloedLiquidity.s.sol | 66 +++++ .../configure/siloed/SetSiloRebalancer.s.sol | 49 ++++ script/configure/siloed/SiloedBase.s.sol | 51 ++++ .../siloed/UpdateSiloDesignations.s.sol | 75 ++++++ .../siloed/WithdrawSiloedLiquidity.s.sol | 66 +++++ script/deploy/DeployERC20LockBox.s.sol | 29 ++- .../DeploySiloedLockReleaseTokenPool.s.sol | 124 +++++++++ script/docs/gen-primitives.mjs | 2 + script/setup/ApplyChainUpdates.s.sol | 38 ++- script/utils/DeploymentRecorder.s.sol | 20 ++ script/utils/PoolVersion.s.sol | 60 ++++- src/PoolVersions.sol | 18 +- src/actions/CctActions.sol | 75 ++++++ src/roles/RolesAuditor.sol | 84 +++++- src/roles/RolesProbes.sol | 37 +++ src/roles/RolesSnapshot.sol | 23 ++ src/utils/RegistryWriter.sol | 61 +++++ test/actions/PoolVersionDispatch.t.sol | 74 ++++-- test/config/AdoptToken.t.sol | 2 +- test/config/AdoptTokenLockBoxes.t.sol | 58 +++++ test/config/ForgetDeployment.t.sol | 155 +++++++++++ test/config/VerifyChainSiloedLockBoxes.t.sol | 198 ++++++++++++++ test/configure/SiloedLockRelease.t.sol | 177 +++++++++++++ test/fixtures/legacy/DeployLegacyPool.s.sol | 50 ++++ test/fixtures/legacy/LegacyPools.sol | 29 +++ 66 files changed, 3215 insertions(+), 102 deletions(-) create mode 100644 docs/guides/migrate-siloed-pool.md create mode 100644 docs/primitives/config-plane/ForgetDeployment.md create mode 100644 docs/primitives/deploy/DeploySiloedLockReleaseTokenPool.md create mode 100644 docs/primitives/siloed/ConfigureLockBoxes.md create mode 100644 docs/primitives/siloed/GetSiloedPoolState.md create mode 100644 docs/primitives/siloed/ProvideSiloedLiquidity.md create mode 100644 docs/primitives/siloed/SetSiloRebalancer.md create mode 100644 docs/primitives/siloed/UpdateSiloDesignations.md create mode 100644 docs/primitives/siloed/WithdrawSiloedLiquidity.md create mode 100644 script/config/ForgetDeployment.s.sol create mode 100644 script/configure/siloed/ConfigureLockBoxes.s.sol create mode 100644 script/configure/siloed/GetSiloedPoolState.s.sol create mode 100644 script/configure/siloed/ProvideSiloedLiquidity.s.sol create mode 100644 script/configure/siloed/SetSiloRebalancer.s.sol create mode 100644 script/configure/siloed/SiloedBase.s.sol create mode 100644 script/configure/siloed/UpdateSiloDesignations.s.sol create mode 100644 script/configure/siloed/WithdrawSiloedLiquidity.s.sol create mode 100644 script/deploy/DeploySiloedLockReleaseTokenPool.s.sol create mode 100644 test/config/AdoptTokenLockBoxes.t.sol create mode 100644 test/config/ForgetDeployment.t.sol create mode 100644 test/config/VerifyChainSiloedLockBoxes.t.sol create mode 100644 test/configure/SiloedLockRelease.t.sol create mode 100644 test/fixtures/legacy/DeployLegacyPool.s.sol create mode 100644 test/fixtures/legacy/LegacyPools.sol diff --git a/Makefile b/Makefile index 888163d..8188490 100644 --- a/Makefile +++ b/Makefile @@ -38,12 +38,12 @@ evm-version-flag = --evm-version $(call evm-version,$(1)) # (project//.json); unset is the flat default (project/.json). It # threads to the scripts as PROJECT_GROUP; GROUP_DIR locates the same file for the jq repair steps here. # Honored by the project targets (add-lane, remove-lane, adopt-token, snapshot-chain, doctor, -# roles-check) and the deploy targets (deploy-token/pool/lockbox/lockrelease-pool, deploy-new-chain); the +# roles-check) and the deploy targets (deploy-token/pool/lockbox/lockrelease-pool/siloed-pool, deploy-new-chain); the # chain-facts targets (add-chain, sync*) ignore it (config/chains is group-independent). GROUP_DIR := $(if $(GROUP),$(GROUP)/,) .DEFAULT_GOAL := help -.PHONY: probe-chain adopt-token help tools discover discover-tokens add-chain add-lane remove-lane sync sync-preview sync-all sync-check doctor fmt-config clean-scratch snapshot-chain roles-check roles-check-all deploy-token deploy-pool deploy-lockbox deploy-lockrelease-pool deploy-new-chain preflight verify verify-args verify-execution +.PHONY: probe-chain adopt-token forget-deployment help tools discover discover-tokens add-chain add-lane remove-lane sync sync-preview sync-all sync-check doctor fmt-config clean-scratch snapshot-chain roles-check roles-check-all deploy-token deploy-pool deploy-lockbox deploy-lockrelease-pool deploy-siloed-pool deploy-new-chain preflight verify verify-args verify-execution # Deploy-time parameters are read by the forge scripts from the environment (vm.env*). Forward a value # passed on the make command line (make deploy-token TOKEN_NAME=...) to the forge subprocess; a value @@ -57,7 +57,7 @@ GROUP_DIR := $(if $(GROUP),$(GROUP)/,) # still apply. DEPLOY_VARS := TOKEN_NAME TOKEN_SYMBOL TOKEN_DECIMALS TOKEN_MAX_SUPPLY TOKEN_PRE_MINT \ TOKEN_PRE_MINT_RECIPIENT CCIP_ADMIN_ADDRESS ROLES_RECIPIENT TOKEN TOKEN_POOL LOCK_BOX DECIMALS \ - POOL_HOOKS AUTHORIZED_CALLERS FORCE_REDEPLOY REANCHOR + POOL_HOOKS AUTHORIZED_CALLERS FORCE_REDEPLOY REANCHOR SILO $(foreach v,$(DEPLOY_VARS),$(if $(strip $($(v))),$(eval export $(v)))) # Recipe-time guard: the CHAIN's config file must exist (helpful list + add-chain hint on a miss). @@ -131,8 +131,8 @@ tools: ## Check the required tools are installed (forge, curl, jq; CHAIN= adds t discover: tools ## List the CCIP API chain catalog vs local configs, both planes (FILTER= narrows; ENVIRONMENT= narrows the plane) @FILTER="$(FILTER)" ENVIRONMENT="$(ENVIRONMENT)" bash script/config/sync-discover.sh -discover-tokens: tools ## List the CCIP API token catalog for an operator (ADMIN=, SYMBOL=, CHAIN_SELECTOR=, ENVIRONMENT= all narrow; unreviewed tokens included) - @ADMIN="$(ADMIN)" SYMBOL="$(SYMBOL)" CHAIN_SELECTOR="$(CHAIN_SELECTOR)" ENVIRONMENT="$(ENVIRONMENT)" bash script/config/discover-tokens.sh +discover-tokens: tools ## List the CCIP API token catalog for an operator (ADMIN=, SYMBOL=, CHAIN_SELECTOR=, ENVIRONMENT= all narrow; unreviewed tokens included; POOL=1 adds the pool, its API type and version, one request per row) + @ADMIN="$(ADMIN)" SYMBOL="$(SYMBOL)" CHAIN_SELECTOR="$(CHAIN_SELECTOR)" ENVIRONMENT="$(ENVIRONMENT)" POOL="$(POOL)" bash script/config/discover-tokens.sh add-chain: tools ## Generate config/chains/.json from the live API (CHAIN= and SELECTOR= required) $(if $(CHAIN),,$(error CHAIN is required: make add-chain CHAIN= SELECTOR= - both from the make discover API NAME + SELECTOR columns)) @@ -203,6 +203,12 @@ else @FOUNDRY_PROFILE=sync PROJECT_GROUP="$(GROUP)" bash script/config/forge-fork.sh "$(CHAIN)" -- forge script script/config/AdoptToken.s.sol $(call evm-version-flag,$(CHAIN)) --sig "run(string,address,address)" "$(CHAIN)" "$(TOKEN)" "$(or $(TOKEN_POOL),0x0000000000000000000000000000000000000000)" endif +forget-deployment: tools ## Remove a retired entry from project/[/].json deployments{} (CHAIN= NAME= required; refuses an active, registered, still-laned or funded artifact; PREVIEW=1 changes nothing; local edit, nothing sent) + $(if $(CHAIN),,$(error CHAIN is required: make forget-deployment CHAIN= NAME=)) + $(if $(NAME),,$(error NAME is required - the addresses.deployments key to remove, e.g. WBTC_BurnMintTokenPool_1.5.1)) + $(require-chain-config) + @FOUNDRY_PROFILE=sync PROJECT_GROUP="$(GROUP)" forge script script/config/ForgetDeployment.s.sol $(call evm-version-flag,$(CHAIN)) --sig "run(string,string,bool)" "$(CHAIN)" "$(NAME)" $(if $(PREVIEW),true,false) + sync: tools ## Refresh 's ccip{} block from the live API (CHAIN= required) $(if $(CHAIN),,$(error CHAIN is required: make sync CHAIN=)) $(require-chain-config) @@ -347,6 +353,12 @@ deploy-lockrelease-pool: tools ## Deploy a LockRelease token pool on (CH $(call require-evm-chain,$(CHAIN),$(NON_EVM_DEPLOY_HINT)) $(call run-deploy,script/deploy/DeployLockReleaseTokenPool.s.sol) +deploy-siloed-pool: tools ## Deploy a SiloedLockRelease token pool on , no lock box (CHAIN= + KEYSTORE_NAME= required; token from the registry, else TOKEN=; opt POOL_HOOKS=; VERIFY=1; FORCE_REDEPLOY=1; GROUP=). Then deploy-lockbox SILO=