Skip to content

Commit e3a6d3b

Browse files
Merge remote-tracking branch 'origin/develop' into feat/CounponInterestRates
Signed-off-by: Alberto Molina <alberto@io.builders>
2 parents 13a5aa3 + 4a6d0fb commit e3a6d3b

File tree

13 files changed

+93
-28
lines changed

13 files changed

+93
-28
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
"@hashgraph/asset-tokenization-contracts": minor
3+
---
4+
5+
feat: export missing utilities and enhance deployment tracking
6+
7+
Export missing infrastructure and domain utilities from scripts index:
8+
9+
- Export Hedera utilities (`fetchHederaContractId`, `getMirrorNodeUrl`, `isHederaNetwork`) for mirror node integration
10+
- Export deployment file utilities (`loadDeployment`, `findLatestDeployment`, `listDeploymentFiles`) for deployment management
11+
- Export verification utilities (`verifyContract`, `verifyContractCode`, `verifyContractInterface`) for post-deployment validation
12+
- Export selector utility (`getSelector`) for function selector generation
13+
- Export transparent proxy deployment operation (`deployTransparentProxy`)
14+
- Export bond token deployment from factory (`deployBondFromFactory`)
15+
16+
Enhance deployment workflows with better tracking:
17+
18+
- Add optional `existingBlrImplementation` parameter to track BLR implementation address when using existing BLR
19+
- Replace ambiguous `contractId` field with explicit `implementationContractId` and `proxyContractId` fields for proxied contracts (BLR, Factory)
20+
- Improve deployment documentation and upgrade history tracking
21+
- Better integration with Hedera tooling requiring explicit contract IDs
22+
23+
These changes improve the public API consistency and provide better deployment documentation for downstream consumers like GBP.

.changeset/silver-taxes-kiss.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hashgraph/asset-tokenization-contracts": patch
3+
---
4+
5+
fix base implementation in TotalBalanceStorageWrapper

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"clean:deps:full": "npm run clean:deps && rimraf package-lock.json packages/*/dist packages/*/*/dist apps/*/dist apps/*/*/dist packages/*/build packages/*/*/build apps/*/build apps/*/*/build && echo '\\n✅ All dependency files have been cleaned (including package-lock.json)'",
3636
"clean:full": "npm run clean:workspaces && npm run clean:deps:full && npm run clean:root && echo '\\n✅ Complete cleanup finished — workspaces, dependencies, and root junk removed'",
3737
"lint:staged:js": "eslint --cache",
38-
"lint:staged:sol": "solhint --config packages/ats/contracts/.solhint.json",
38+
"lint:staged:sol": "solhint --config packages/ats/contracts/solhint.config.js",
3939
"format:staged": "prettier --write",
4040
"format:staged:check": "prettier --check",
4141
"pre-commit": "lint-staged",
@@ -58,7 +58,7 @@
5858
"ats:test:ci": "npm run ats:contracts:test:ci && npm run ats:sdk:test:ci && npm run ats:web:test:ci",
5959
"ats:lint": "npm run ats:lint:js && npm run ats:lint:sol",
6060
"ats:lint:js": "eslint '*.{js,mjs,cjs,ts,tsx,mts,json}' 'packages/ats/**/*' 'apps/ats/**/*' --cache",
61-
"ats:lint:sol": "solhint 'packages/ats/contracts/contracts/**/*.sol' --config packages/ats/contracts/.solhint.json",
61+
"ats:lint:sol": "solhint 'packages/ats/contracts/contracts/**/*.sol' --config packages/ats/contracts/solhint.config.js",
6262
"ats:lint:fix": "eslint '*.{js,mjs,cjs,ts,tsx,mts,json}' 'packages/ats/**/*' 'apps/ats/**/*' --fix && npm run ats:format",
6363
"ats:format": "prettier --write '*.{js,mjs,cjs,ts,tsx,mts,json,md,yml,yaml}' 'packages/ats/**/*.{js,mjs,cjs,ts,tsx,mts,json,md,yml,yaml,sol}' 'apps/ats/**/*.{js,mjs,cjs,ts,tsx,mts,json,md,yml,yaml}' --cache",
6464
"ats:format:check": "prettier --check '*.{js,mjs,cjs,ts,tsx,mts,json,md,yml,yaml}' 'packages/ats/**/*.{js,mjs,cjs,ts,tsx,mts,json,md,yml,yaml,sol}' 'apps/ats/**/*.{js,mjs,cjs,ts,tsx,mts,json,md,yml,yaml}' --cache",

packages/ats/contracts/contracts/layer_0/lock/LockStorageWrapper1.sol

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,13 @@ abstract contract LockStorageWrapper1 is CapStorageWrapper1 {
109109
address _tokenHolder,
110110
uint256 _timestamp
111111
) internal view virtual override returns (uint256) {
112-
return _getLockedAmountForAdjustedAt(_tokenHolder, _timestamp);
112+
return
113+
super._getTotalBalanceForAdjustedAt(_tokenHolder, _timestamp) +
114+
_getLockedAmountForAdjustedAt(_tokenHolder, _timestamp);
113115
}
114116

115117
function _getTotalBalance(address _tokenHolder) internal view virtual override returns (uint256) {
116-
return _getLockedAmountForAdjustedAt(_tokenHolder, _blockTimestamp());
118+
return super._getTotalBalance(_tokenHolder) + _getLockedAmountForAdjustedAt(_tokenHolder, _blockTimestamp());
117119
}
118120

119121
function _getLockedAmountForByPartitionAdjusted(

packages/ats/contracts/contracts/layer_0/proceedRecipients/ProceedRecipientsStorageWrapper.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: Apache-2.0
22
pragma solidity >=0.8.0 <0.9.0;
33

4-
import { TotalBalancesStorageWrapper } from "../totalBalances/totalBalancesStorageWrapper.sol";
4+
import { TotalBalancesStorageWrapper } from "../totalBalances/TotalBalancesStorageWrapper.sol";
55
import {
66
_PROCEED_RECIPIENTS_STORAGE_POSITION,
77
_PROCEED_RECIPIENTS_DATA_STORAGE_POSITION

packages/ats/contracts/contracts/layer_0/totalBalances/totalBalancesStorageWrapper.sol renamed to packages/ats/contracts/contracts/layer_0/totalBalances/TotalBalancesStorageWrapper.sol

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ pragma solidity >=0.8.0 <0.9.0;
44
import { FixedRateStorageWrapper } from "../interestRates/fixedRate/FixedRateStorageWrapper.sol";
55

66
abstract contract TotalBalancesStorageWrapper is FixedRateStorageWrapper {
7-
function _getTotalBalance(address _tokenHolder) internal view virtual returns (uint256 totalBalance);
7+
function _getTotalBalance(address /*_tokenHolder*/) internal view virtual returns (uint256 totalBalance) {
8+
return 0;
9+
}
810

911
function _getTotalBalanceForAdjustedAt(
10-
address tokenHolder,
11-
uint256 timestamp
12-
) internal view virtual returns (uint256 totalBalance);
12+
address /*_tokenHolder*/,
13+
uint256 /*_timestamp*/
14+
) internal view virtual returns (uint256 totalBalance) {
15+
return 0;
16+
}
1317

1418
function _getTotalBalanceForByPartitionAdjusted(
1519
bytes32 partition,

packages/ats/contracts/scripts/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export * from "./infrastructure/networkConfig";
4343
// Infrastructure operations
4444
export * from "./infrastructure/operations/deployContract";
4545
export * from "./infrastructure/operations/deployProxy";
46+
export * from "./infrastructure/operations/transparentProxyDeployment";
4647
export * from "./infrastructure/operations/upgradeProxy";
4748
export * from "./infrastructure/operations/registerFacets";
4849
export * from "./infrastructure/operations/registerAdditionalFacets";
@@ -55,9 +56,13 @@ export * from "./infrastructure/operations/generateRegistryPipeline";
5556

5657
// Infrastructure utilities
5758
export * from "./infrastructure/utils/validation";
59+
export * from "./infrastructure/utils/deploymentFiles";
60+
export * from "./infrastructure/utils/verification";
5861
export * from "./infrastructure/utils/transaction";
5962
export * from "./infrastructure/utils/logging";
6063
export * from "./infrastructure/utils/naming";
64+
export * from "./infrastructure/utils/hedera";
65+
export * from "./infrastructure/utils/selector";
6166
export * from "./infrastructure/utils/time";
6267

6368
// Infrastructure checkpoint system (deployment resumability)
@@ -112,6 +117,7 @@ export * from "./domain/factory/deploy";
112117

113118
// Token deployment from factory
114119
export * from "./domain/factory/deployEquityToken";
120+
export * from "./domain/factory/deployBondToken";
115121

116122
// ========================================
117123
// Workflows

packages/ats/contracts/scripts/infrastructure/checkpoint/utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,15 @@ export function checkpointToDeploymentOutput(checkpoint: DeploymentCheckpoint):
8282
},
8383
blr: {
8484
implementation: steps.blr.implementation,
85+
implementationContractId: steps.blr.implementationContractId,
8586
proxy: steps.blr.proxy,
86-
contractId: steps.blr.contractId,
87+
proxyContractId: steps.blr.proxyContractId,
8788
},
8889
factory: {
8990
implementation: steps.factory.implementation,
91+
implementationContractId: steps.factory.implementationContractId,
9092
proxy: steps.factory.proxy,
91-
contractId: steps.factory.contractId,
93+
proxyContractId: steps.factory.proxyContractId,
9294
},
9395
},
9496

packages/ats/contracts/scripts/infrastructure/types/checkpoint.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,12 @@ export interface DeploymentCheckpoint {
114114
blr?: DeployedContract & {
115115
/** Implementation address */
116116
implementation: string;
117+
/** Hedera Contract ID for implementation (if deployed on Hedera network) */
118+
implementationContractId?: string;
117119
/** Proxy address */
118120
proxy: string;
121+
/** Hedera Contract ID for proxy (if deployed on Hedera network) */
122+
proxyContractId?: string;
119123
/** Whether BLR is external (existingBlr workflow) */
120124
isExternal?: boolean;
121125
};
@@ -143,8 +147,12 @@ export interface DeploymentCheckpoint {
143147
factory?: DeployedContract & {
144148
/** Implementation address */
145149
implementation: string;
150+
/** Hedera Contract ID for implementation (if deployed on Hedera network) */
151+
implementationContractId?: string;
146152
/** Proxy address */
147153
proxy: string;
154+
/** Hedera Contract ID for proxy (if deployed on Hedera network) */
155+
proxyContractId?: string;
148156
};
149157
};
150158

packages/ats/contracts/scripts/workflows/deploySystemWithExistingBlr.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,16 @@ export interface DeploymentWithExistingBlrOutput {
7070
};
7171
blr: {
7272
implementation: string;
73+
implementationContractId?: string;
7374
proxy: string;
74-
contractId?: string;
75+
proxyContractId?: string;
7576
isExternal: true; // Marker to indicate BLR was not deployed here
7677
};
7778
factory: {
7879
implementation: string;
80+
implementationContractId?: string;
7981
proxy: string;
80-
contractId?: string;
82+
proxyContractId?: string;
8183
};
8284
};
8385

@@ -171,6 +173,9 @@ export interface DeploySystemWithExistingBlrOptions extends ResumeOptions {
171173

172174
/** Enable post-deployment bytecode verification (default: from network config) */
173175
verifyDeployment?: boolean;
176+
177+
/** Existing BLR implementation address (optional, for documentation) */
178+
existingBlrImplementation?: string;
174179
}
175180

176181
/**
@@ -367,7 +372,7 @@ export async function deploySystemWithExistingBlr(
367372
if (!checkpoint.steps.blr) {
368373
checkpoint.steps.blr = {
369374
address: blrAddress,
370-
implementation: "N/A (External BLR)",
375+
implementation: options.existingBlrImplementation || "N/A (External BLR)",
371376
proxy: blrAddress,
372377
txHash: "",
373378
deployedAt: new Date().toISOString(),
@@ -767,16 +772,20 @@ export async function deploySystemWithExistingBlr(
767772
contractId: await getContractId(proxyAdmin.address),
768773
},
769774
blr: {
770-
implementation: "N/A (External BLR)",
775+
implementation: options.existingBlrImplementation || "N/A (External BLR)",
776+
implementationContractId: options.existingBlrImplementation
777+
? await getContractId(options.existingBlrImplementation)
778+
: undefined,
771779
proxy: blrAddress,
772-
contractId: await getContractId(blrAddress),
780+
proxyContractId: await getContractId(blrAddress),
773781
isExternal: true,
774782
},
775783
factory: factoryResult
776784
? {
777785
implementation: factoryResult.implementationAddress,
786+
implementationContractId: await getContractId(factoryResult.implementationAddress),
778787
proxy: factoryResult.factoryAddress,
779-
contractId: await getContractId(factoryResult.factoryAddress),
788+
proxyContractId: await getContractId(factoryResult.factoryAddress),
780789
}
781790
: {
782791
implementation: "N/A (Not deployed)",

0 commit comments

Comments
 (0)