Skip to content

Commit 7e34f77

Browse files
committed
refactor(contracts): deploy only equity, bond, deposit
Clean the deploy scripts and Factory so only Equity, Bond and DepositToken are deployed, removing the Loan, LoansPortfolio, BondFixedRate and BondKpiLinkedRate deploy configurations, the Factory SecurityType entries for them, their deploy fixtures and per-type deploy tests, and renumbering the deployment workflow steps. The underlying Solidity facets are retained and still exercised by the shared AssetMock mega-asset. BBND-1882 Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
1 parent fae873b commit 7e34f77

42 files changed

Lines changed: 166 additions & 3907 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hashgraph/asset-tokenization-contracts": minor
3+
---
4+
5+
Clean the deploy scripts and Factory so only Equity, Bond and DepositToken are deployed, removing the Loan, LoansPortfolio, BondFixedRate and BondKpiLinkedRate deploy configurations and the Factory `SecurityType` entries for them.

packages/ats/contracts/.betterer.results

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,7 @@ exports[`ats contracts solhint`] = {
1818
[246, 12, 1, "gas-strict-inequalities: GC: Non strict inequality found. Try converting to a strict one", "177623"],
1919
[264, 12, 1, "gas-strict-inequalities: GC: Non strict inequality found. Try converting to a strict one", "177623"]
2020
],
21-
"contracts/domain/asset/ERC1594StorageWrapper.sol:1689167301": [
22-
[169, 4, 1, "use-natspec: Mismatch in @param count for function \'canRedeemFromByPartition\'. Expected: 5, Found: 3", "177603"],
23-
[242, 4, 1, "use-natspec: Mismatch in @param count for function \'canTransferFromByPartition\'. Expected: 6, Found: 4", "177603"]
24-
],
2521
"contracts/domain/asset/ERC20VotesStorageWrapper.sol:1439876099": [
26-
[101, 4, 1, "use-natspec: Mismatch in @param count for function \'afterTokenTransfer\'. Expected: 4, Found: 3", "177603"],
2722
[298, 12, 1, "gas-strict-inequalities: GC: Non strict inequality found. Try converting to a strict one", "177617"],
2823
[309, 12, 1, "gas-strict-inequalities: GC: Non strict inequality found. Try converting to a strict one", "177617"]
2924
],
@@ -34,8 +29,6 @@ exports[`ats contracts solhint`] = {
3429
[104, 12, 1, "gas-strict-inequalities: GC: Non strict inequality found. Try converting to a strict one", "177601"]
3530
],
3631
"contracts/domain/asset/LockStorageWrapper.sol:2572777485": [
37-
[239, 4, 1, "use-natspec: Mismatch in @param count for function \'updateLockedBalancesBeforeLock\'. Expected: 4, Found: 2", "177603"],
38-
[257, 4, 1, "use-natspec: Mismatch in @param count for function \'updateLockedBalancesBeforeRelease\'. Expected: 3, Found: 2", "177603"],
3932
[327, 15, 1, "gas-strict-inequalities: GC: Non strict inequality found. Try converting to a strict one", "177602"]
4033
],
4134
"contracts/domain/asset/ScheduledTasksStorageWrapper.sol:3874914318": [
@@ -66,9 +59,6 @@ exports[`ats contracts solhint`] = {
6659
[221, 4, 1, "gas-calldata-parameters: GC: [_operatorData] argument on Function [clearingHoldCreationCreation] could be [calldata] if it\'s not being updated", "177603"],
6760
[407, 4, 1, "function-max-lines: Function body contains 52 lines but allowed no more than 50 lines", "177603"]
6861
],
69-
"contracts/domain/orchestrator/ClearingReadOps.sol:129972878": [
70-
[158, 4, 1, "use-natspec: Mismatch in @param count for function \'checkClearingExpirationTimestamp\'. Expected: 3, Found: 2", "177603"]
71-
],
7262
"contracts/domain/orchestrator/HoldOps.sol:2308870617": [
7363
[29, 4, 1, "gas-calldata-parameters: GC: [_hold] argument on Function [createHoldByPartition] could be [calldata] if it\'s not being updated", "177603"],
7464
[29, 4, 1, "gas-calldata-parameters: GC: [_operatorData] argument on Function [createHoldByPartition] could be [calldata] if it\'s not being updated", "177603"],
@@ -258,8 +248,8 @@ exports[`ats contracts solhint`] = {
258248
[35, 4, 1, "gas-indexed-events: GC: [voteId] on Event [VotingCancelled] could be Indexed", "177600"],
259249
[40, 4, 1, "gas-indexed-events: GC: [voteId] on Event [VotingForceCancelled] could be Indexed", "177600"]
260250
],
261-
"contracts/factory/IFactory.sol:1165606848": [
262-
[115, 4, 1, "gas-struct-packing: GC: For [ EquityDetailsData ] struct, packing seems inefficient. Try rearranging to achieve 32bytes slots", "177622"]
251+
"contracts/factory/IFactory.sol:1789107471": [
252+
[121, 4, 1, "gas-struct-packing: GC: For [ EquityDetailsData ] struct, packing seems inefficient. Try rearranging to achieve 32bytes slots", "177622"]
263253
],
264254
"contracts/infrastructure/diamond/IDiamondCutManager.sol:1721314983": [
265255
[72, 4, 1, "gas-indexed-events: GC: [version] on Event [DiamondBatchConfigurationCanceled] could be Indexed", "177600"]

packages/ats/contracts/contracts/factory/IFactory.sol

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,32 @@ bytes32 constant RESOLVER_KEY_FACTORY = 0x9fc26269cc1cb994e66f269ed6b58a5bb0c344
1212
/**
1313
* @title Factory Interface
1414
* @author Asset Tokenization Studio Team
15-
* @notice Interface for deploying tokenised securities (equity, bonds, loans)
15+
* @notice Interface for deploying tokenised securities (equity, bonds, deposit tokens)
1616
* through a centralised factory that configures resolver proxies,
1717
* business-logic resolvers, and role-based access control.
1818
*/
1919
interface IFactory {
2020
/**
2121
* @notice Distinguishes the security variant being deployed.
22-
* @dev Used internally to select the correct initialisation path in the factory.
22+
* @dev Used internally to select the correct initialisation path in the factory. The
23+
* ordinal of each variant is persisted on-chain in `ERC20StorageWrapper.securityType`,
24+
* so members MUST NOT be reordered or removed — doing so would reinterpret or invalidate
25+
* the stored value of already-deployed tokens. `BondFixedRate`, `BondKpiLinkedRate` and
26+
* `Loan` are no longer deployable through the factory (BBND-1882) but are retained here
27+
* to keep their ordinals stable for tokens deployed before that change.
2328
*/
2429
enum SecurityType {
2530
/// @notice A bond whose coupon rate floats against an external index.
2631
BondVariableRate,
2732
/// @notice An equity instrument (shares).
2833
Equity,
29-
/// @notice A bond with a fixed coupon rate.
34+
/// @notice A bond with a fixed coupon rate (retained for ordinal stability; not deployable).
3035
BondFixedRate,
31-
/// @notice A bond whose coupon is tied to KPI performance metrics.
36+
/// @notice A bond whose coupon is tied to KPI performance metrics (retained; not deployable).
3237
BondKpiLinkedRate,
33-
/// @notice A loan instrument.
38+
/// @notice A loan instrument (retained for ordinal stability; not deployable).
3439
Loan,
40+
/// @notice A minimal cash-style deposit token.
3541
DepositToken
3642
}
3743

@@ -140,7 +146,7 @@ interface IFactory {
140146
/**
141147
* @notice Input data describing a bond's economic parameters.
142148
* @dev Replaces the removed `IBondRead.BondDetailsData` type. Consumed by the Factory
143-
* during `deployBond`, `deployBondFixedRate`, and `deployBondKpiLinkedRate`.
149+
* during `deployBond`.
144150
* @param currency ISO 4217 currency code encoded as `bytes3`.
145151
* @param nominalValue Face value of one unit of the bond (raw integer).
146152
* @param nominalValueDecimals Number of decimals applied to `nominalValue`.

0 commit comments

Comments
 (0)