Skip to content

Commit 9f47b49

Browse files
Merge remote-tracking branch 'origin/development' into feat/snapshot-facet
# Conflicts: # packages/ats/contracts/contracts/domain/asset/nominalValue/NominalValueStorageWrapper.sol # packages/ats/contracts/scripts/domain/atsRegistry.data.ts Signed-off-by: Mario Francia <mariofranciarius@gmail.com>
2 parents 8f32a07 + 3d79ea1 commit 9f47b49

112 files changed

Lines changed: 4854 additions & 2935 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
"@hashgraph/asset-tokenization-contracts": minor
3+
---
4+
5+
# BalanceTrackerAdjustedFacet split
6+
7+
Extract `balanceOfAt` from `ERC1410ReadFacet` into a dedicated `BalanceTrackerAdjustedFacet` registered under `_BALANCE_TRACKER_ADJUSTED_RESOLVER_KEY`.
8+
9+
## Changes
10+
11+
- Added `contracts/facets/balanceTrackerAdjusted/IBalanceTrackerAdjusted.sol`, `BalanceTrackerAdjusted.sol`, `BalanceTrackerAdjustedFacet.sol`.
12+
- Added `_BALANCE_TRACKER_ADJUSTED_RESOLVER_KEY` constant in `resolverKeys.sol`.
13+
- Removed `balanceOfAt` from `ERC1410Read.sol`, `IERC1410Read.sol`, and `ERC1410ReadFacet.sol`; selector count drops from 9 to 8. Also migrated `ERC1410ReadFacet` selector registration to the `--selectorIndex`/`unchecked` pattern.
14+
- `IAsset` now exposes `balanceOfAt` via `IBalanceTrackerAdjusted`.
15+
- Updated `Configuration.ts`, `orchestratorLibraries.ts` and all 7 `createConfiguration.ts` scripts to include `BalanceTrackerAdjustedFacet`.
16+
- Added `test/contracts/integration/balanceTrackerAdjusted/balanceTrackerAdjusted.test.ts` covering: balance at current time, zero balance, timestamp 0, single scheduled adjustment before/after, and multiple chained adjustments.
17+
18+
## Non-breaking
19+
20+
The 4-byte selector of `balanceOfAt` is unchanged. Any call to `asset.balanceOfAt(...)` through `IAsset` continues to work without modification.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"@hashgraph/asset-tokenization-contracts": major
3+
---
4+
5+
feat(ats-contracts): add BalanceTrackerByPartitionFacet and remove TotalBalanceFacet
6+
7+
Introduces `BalanceTrackerByPartitionFacet` with three partition-scoped read functions:
8+
9+
- `balanceOfByPartition` (moved from `ERC1410ReadFacet`)
10+
- `totalSupplyByPartition` (moved from `ERC1410ReadFacet`)
11+
- `getTotalBalanceForByPartition` (moved from `TotalBalanceFacet`, which is removed)
12+
13+
**Breaking changes:**
14+
15+
- `IERC1410Read` no longer declares `balanceOfByPartition` or `totalSupplyByPartition`; these are now on `IBalanceTrackerByPartition`. This changes `IERC1410.interfaceId` (ERC-165).
16+
- `TotalBalanceFacet` and its interface `ITotalBalance` are deleted. Use `BalanceTrackerByPartitionFacet` instead.
17+
- All token configurations updated to replace `TotalBalanceFacet` with `BalanceTrackerByPartitionFacet`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hashgraph/asset-tokenization-contracts": major
3+
---
4+
5+
Refactor `operatorClearingCreateHoldByPartition` from `ClearingHoldCreation` contract into a new `OperatorClearingHoldByPartition` facet, registered under `_OPERATOR_CLEARING_HOLDBYPARTITION_RESOLVER_KEY`.

.changeset/maf-split-burn.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@hashgraph/asset-tokenization-contracts": major
3+
"@hashgraph/asset-tokenization-sdk": patch
4+
---
5+
6+
Split a new Burn Facet. ERC3643OperationsFacet is empty so is deleted
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hashgraph/asset-tokenization-contracts": major
3+
---
4+
5+
Refactor `controllerCreateHoldByPartition` function from `HoldManagement` contract into a new `controllerHoldByPartition` facet.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
name: solidity-natspec
3+
description: Produce and validate comprehensive NatSpec documentation on Solidity files. Use whenever a `.sol` file is created or modified — contracts, interfaces, libraries, facets under `packages/ats/contracts/**`. Ensures every contract element (contract/interface/library, enums, structs, events, custom errors, state variables, modifiers, functions) carries audit-ready NatSpec in the project's house style (British English, ≤100-char lines, intent-focused). Also use on explicit request (`/solidity-natspec`) to document or re-document an existing `.sol` file.
4+
---
5+
6+
# Solidity NatSpec Documentation
7+
8+
Produce audit-ready NatSpec on every element the edit touches. Document **intent, behaviour,
9+
constraints, and structure** — never restate what the code already says. Audience: auditors,
10+
maintainers, analysis tools.
11+
12+
When editing an existing file, document new or modified elements only. On `/solidity-natspec [path]`,
13+
do a full pass on the file.
14+
15+
## Templates
16+
17+
Place each block immediately above the element. Declaration order inside a contract:
18+
enums → structs → events → custom errors → state vars → modifiers → functions
19+
(`external`/`public` first, then `internal`/`private`).
20+
21+
For contract / interface / library headers, `@title`, `@author` and `@notice` are **mandatory**
22+
solhint's `use-natspec` rule flags each missing tag. Use
23+
`@author Asset Tokenization Studio Team` unless the file is clearly a fork of upstream code
24+
(OpenZeppelin, ERC references).
25+
26+
```solidity
27+
/**
28+
* @title <name>
29+
* @author Asset Tokenization Studio Team
30+
* @notice <high-level purpose>
31+
* @dev <design notes, patterns, assumptions, invariants>
32+
*/
33+
```
34+
35+
For every other element, include `@notice` (what and why), `@dev` when non-obvious, and one
36+
`@param`/`@return` per named parameter/return with matching names. Functions, events, and errors
37+
that omit `@notice` or mismatch `@param`/`@return` names fail solhint.
38+
39+
For interface implementations, use `@inheritdoc IFoo` on the concrete function (plus a `@dev` only
40+
if the implementation introduces behaviour the interface doesn't describe — e.g. a pause gate, a
41+
facet-specific guard, a snapshot side-effect). Don't duplicate the interface block; it drifts.
42+
43+
## Style
44+
45+
- **British English**: _decentralised_, _behaviour_, _initialised_, _optimise_, _authorised_,
46+
_organisation_, _serialise_, _analyse_, _licence_ (noun). Never American spelling.
47+
- **≤100 chars per line** in comment bodies.
48+
- **Present tense** for descriptions ("Transfers tokens…", not "Will transfer…").
49+
- **Precise smart-contract terminology**: reentrancy, invariant, storage slot, delegatecall,
50+
selector, EIP-xxx, diamond facet.
51+
52+
## What to cover when relevant
53+
54+
Access control (roles, modifiers) · state mutations · invariants · gas hazards (unbounded loops,
55+
cold SLOADs, storage packing) · initialisation / upgrade order · events emitted · errors raised
56+
· side effects (external calls, transfers, mint/burn) · cross-contract interactions · pre/post
57+
conditions · reentrancy posture.
58+
59+
## What to avoid
60+
61+
Explaining Solidity itself ("this is a mapping…"). Narrating self-explanatory code ("getter that
62+
returns the value"). Inventing behaviour not in the code — read the implementation first.
63+
Referencing the current task/PR/commit — NatSpec lives with the code. Duplicating interface
64+
NatSpec on the implementation.
65+
66+
## Validate before finishing
67+
68+
For each touched file:
69+
70+
1. **Coverage script** (heuristic, enforces the tags solhint's `use-natspec` rule flags):
71+
72+
```bash
73+
node .claude/skills/solidity-natspec/scripts/check_natspec.mjs <path/to/file.sol>
74+
```
75+
76+
Contract/interface/library need `@title` + `@author` + `@notice`. Functions/events/errors need
77+
`@notice` and one `@param`/`@return` per named parameter/return with matching names. Elements
78+
carrying `@inheritdoc X` pass without further tag checks. State variables are intentionally
79+
not scanned — verify those by eye against "what to cover". Exit 0 means the required tags
80+
exist; content quality still needs review.
81+
82+
2. **Solhint** on the touched file(s):
83+
84+
```bash
85+
cd packages/ats/contracts && npx solhint <relative/path/to/file.sol>
86+
```
87+
88+
Any `use-natspec` warning must be resolved before reporting done. `ordering`, `gas-*`,
89+
`no-unused-import` warnings are outside this skill's scope — flag them to the user instead of
90+
silently editing.
91+
92+
Insert the NatSpec directly with Edit/Write. Only emit a separate report if the user asks for a
93+
review-only pass.

0 commit comments

Comments
 (0)