Skip to content

Commit 1f358da

Browse files
authored
fix: fix developer guide documentation regarding Factory proxy (#1314)
Signed-off-by: mamoralesiob <miguelangel@io.builders>
1 parent 9cc27b8 commit 1f358da

1 file changed

Lines changed: 17 additions & 13 deletions

File tree

packages/ats/contracts/scripts/DEVELOPER_GUIDE.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -730,23 +730,27 @@ Each environment maintains independent configuration versions.
730730

731731
---
732732

733-
## Scenario 6: Upgrading TUP Proxy Implementations (BLR/Factory)
733+
## Scenario 6: Upgrading the BLR TUP Implementation
734734

735-
**Use case:** Upgrade the implementation contracts for BLR (BusinessLogicResolver) or Factory proxies using the TransparentUpgradeableProxy (TUP) pattern.
735+
**Use case:** Upgrade the implementation contract for the BLR (BusinessLogicResolver) proxy using the TransparentUpgradeableProxy (TUP) pattern.
736736

737-
**Important distinction:** This is different from `upgradeConfigurations` (Scenario 3), which upgrades ResolverProxy (Diamond pattern) token contracts. Use `upgradeTupProxies` only for BLR/Factory infrastructure upgrades.
737+
> **Only the BLR is a TUP.** The **Factory is a `ResolverProxy` (Diamond pattern), not a TUP** — it is deployed via `new ResolverProxy(blr, { configurationId: FACTORY_CONFIG_ID, ... })` and resolves its facets from the BLR like any token. Upgrade the Factory through the configuration/registry path (Scenario 3, `upgradeConfigurations`), **not** through `ProxyAdmin.upgrade()`. The `FACTORY_PROXY` / `DEPLOY_NEW_FACTORY_IMPL` env vars that still appear in the `upgradeTupProxies` CLI are **legacy and do not apply to the current Factory design** — do not use them.
738+
739+
**Important distinction:** This is different from `upgradeConfigurations` (Scenario 3), which upgrades ResolverProxy (Diamond pattern) contracts — including token contracts **and the Factory**. Use `upgradeTupProxies` only for the BLR infrastructure upgrade.
738740

739741
### When to Use This Workflow
740742

741743
**Use `upgradeTupProxies` when:**
742744

743-
- Upgrading BLR implementation to a new version
744-
- Upgrading Factory implementation to a new version
745-
- Both BLR and Factory need to be upgraded simultaneously
745+
- Upgrading the BLR implementation to a new version
746746
- You have a tested implementation ready to deploy
747747

748748
**Use `upgradeConfigurations` instead when:**
749749

750+
- Upgrading the **Factory** (it is a ResolverProxy, not a TUP)
751+
752+
**Use `upgradeConfigurations` instead when:**
753+
750754
- Updating equity/bond token configurations
751755
- Changing facet versions for existing token contracts
752756
- Creating new configuration versions in BusinessLogicResolver
@@ -755,12 +759,12 @@ Each environment maintains independent configuration versions.
755759

756760
The ATS uses **two different proxy patterns**:
757761

758-
| Feature | TransparentUpgradeableProxy (TUP) | ResolverProxy (Diamond) |
759-
| --------------------- | --------------------------------- | ------------------------- |
760-
| **Used for** | BLR, Factory | Equity/Bond tokens |
761-
| **Upgrade mechanism** | ProxyAdmin.upgrade() | DiamondCutFacet delegates |
762-
| **What changes** | Implementation address | Facet registry pointer |
763-
| **Who controls** | ProxyAdmin contract | DEFAULT_ADMIN_ROLE |
762+
| Feature | TransparentUpgradeableProxy (TUP) | ResolverProxy (Diamond) |
763+
| --------------------- | --------------------------------- | -------------------------------- |
764+
| **Used for** | BLR only | Equity/Bond tokens **+ Factory** |
765+
| **Upgrade mechanism** | ProxyAdmin.upgrade() | DiamondCutFacet delegates |
766+
| **What changes** | Implementation address | Facet registry pointer |
767+
| **Who controls** | ProxyAdmin contract | DEFAULT_ADMIN_ROLE |
764768

765769
### Pattern A: Deploy New Implementation and Upgrade
766770

@@ -1252,7 +1256,7 @@ async function main() {
12521256
- ✅ Facet registration in BLR
12531257
- ✅ Equity configuration (version 1)
12541258
- ✅ Bond configuration (version 1)
1255-
- ✅ Factory contract with TransparentUpgradeableProxy
1259+
- ✅ Factory contract as a `ResolverProxy` (parameterized with `FACTORY_CONFIG_ID` — resolves facets from the BLR; **not** a TUP)
12561260

12571261
**Output File**: Saves `deployments/{network}/{network}-deployment-{timestamp}.json` with all addresses and Hedera contract IDs.
12581262

0 commit comments

Comments
 (0)