Skip to content

chore: consistency and dead code cleanup - #134

Merged
natanasow merged 5 commits into
hiero-ledger:mainfrom
ValentinVPK:129-consistency-and-dead-code-cleanup
Aug 20, 2026
Merged

chore: consistency and dead code cleanup#134
natanasow merged 5 commits into
hiero-ledger:mainfrom
ValentinVPK:129-consistency-and-dead-code-cleanup

Conversation

@ValentinVPK

Copy link
Copy Markdown
Contributor

Description:

Resolve two batches of non-behavioral cleanup across the reference contracts: consistency/dead-code issues (#129) and identifier/doc typos plus one misnamed function (#128). Nothing changes on-chain behavior except the single, isolated send0x1 fix noted below. Delivered as two commits, one per issue.

#129 — consistency & dead code:

  • Remove the inaccurate /// @dev This function reverts if the call is not successful comment from the non-reverting info getters in token-service/HederaTokenService.sol and token-service-v2/HederaTokenService.sol (12 each — the wrappers return UNKNOWN, they don't revert)
  • Fix HRC1215Contract.sol license UNLICENSEDApache-2.0
  • Raise HederaScheduleService.sol pragma >=0.4.9>=0.5.0 (required by its abi.decode usage)
  • Make PrngSystemContract inherit its interface (is IPrngSystemContract + override)
  • Add payable to Airdrop.multipleNftAirdrop for parity with the other airdrop entrypoints
  • Remove the duplicate contract Sample from InternalCallee.sol and import the canonical Sample.sol (artifact-name collision)
  • Drop unused imports / inheritance: HederaTokenService from HRC755Contract; ExpiryHelper+KeyHelper from TokenQuery/TokenTransfer/TokenManagement; ExpiryHelper from TokenCreateContract/TokenCreateCustom

#128 — identifier/doc typos + misnamed function:

  • Fix enum DELEGETABLE_CONTRACT_IDDELEGATABLE_CONTRACT_ID in token-service/KeyHelper.sol and token-service-v2/KeyHelper.sol
  • Fix EDCSAECDSA in account-service/{IHRC632,HederaAccountService,IHederaAccountService}.sol
  • Fix tineycentstinycents in exchange-rate/ExchangeRateMock.sol
  • Fix receipientrecipient in token-service/AtomicHTS.sol
  • Make EcrecoverCaller.send0x1 actually use .send() (returning the success bool) instead of .transfer(), so it's genuinely distinct from transfer0x1

Related issue(s):

Fixes #129
Fixes #128

Notes for reviewer:

Verified with npx hardhat compile (clean, 64 files, no new warnings). 21 files changed across two commits. The CI lint (eslint . + prettier test) doesn't touch Solidity, so no formatting impact.

Scope / behavior notes worth a look:

  • send0x1 is the only behavioral change in either issue. .transfer() reverts on failure; .send() returns a bool and does not revert. The function now returns that bool and deliberately does not revert() on failure (that non-reverting behavior is the point of .send vs .transfer). It has no callers/tests in the repo, so nothing depends on the old behavior.
  • Enum rename is a source-level breaking change. DELEGETABLE_CONTRACT_IDDELEGATABLE_CONTRACT_ID does not change the enum's on-wire integer value, but downstream code referencing the old (misspelled) name will no longer compile.
  • Consistency issues and dead/duplicate code across several contracts #129 Item C narrowed to Prng only. The issue also listed ExchangeRateSystemContract/ExchangeRateMock and HederaAccountService, but those can't inherit their imported interface: it's the precompile's ABI (used only for .selector), and their wrappers are internal while the interface functions are external — an internal function can't satisfy an external interface, so it wouldn't compile and is semantically backwards (they're consumers, not implementations). Only PrngSystemContract is a genuine implementer.
  • Consistency issues and dead/duplicate code across several contracts #129 Item F broadened; AtomicHTS pragma dropped. TokenCreateContract/TokenCreateCustom also carried dead ExpiryHelper inheritance (they use KeyHelper, never ExpiryHelper), so those were included. ExpiryHelper.sol now has no importers but is intentionally kept — it's a published helper (part of the ExpiryHelper/FeeHelper/KeyHelper set), so deleting it would be a breaking change to the published surface. The issue's proposed AtomicHTS pragma change was dropped: there's no single project-wide pragma rule (>=0.5.0 <0.9.0 and >=0.4.9 <0.9.0 are tied within token-service/), so it would have been arbitrary rather than an alignment.

Signed-off-by: ValentinVPK <valentin.krumov@limechain.tech>
Signed-off-by: ValentinVPK <valentin.krumov@limechain.tech>
@ValentinVPK
ValentinVPK requested review from a team as code owners July 31, 2026 12:23
@ValentinVPK
ValentinVPK requested a review from andrewb1269 July 31, 2026 12:23
@ValentinVPK ValentinVPK self-assigned this Jul 31, 2026
@ValentinVPK ValentinVPK added the enhancement New feature or request label Jul 31, 2026
@ValentinVPK ValentinVPK added this to the 0.2.0 milestone Jul 31, 2026
@ValentinVPK ValentinVPK changed the title 129 consistency and dead code cleanup chore: consistency and dead code cleanup Aug 3, 2026
@ValentinVPK ValentinVPK reopened this Aug 20, 2026
…ode-cleanup

Signed-off-by: ValentinVPK <valentin.krumov@limechain.tech>
@natanasow
natanasow merged commit 44e20e3 into hiero-ledger:main Aug 20, 2026
20 of 23 checks passed
@swirlds-automation

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consistency issues and dead/duplicate code across several contracts Typos in identifiers/docs and a misnamed function across several contracts

3 participants