Skip to content

fix: correct FeeHelper.createFixedFeesForToken to store both fees - #133

Merged
natanasow merged 3 commits into
hiero-ledger:mainfrom
ValentinVPK:122-feehelper-fixed-fees-index-bug
Aug 20, 2026
Merged

fix: correct FeeHelper.createFixedFeesForToken to store both fees#133
natanasow merged 3 commits into
hiero-ledger:mainfrom
ValentinVPK:122-feehelper-fixed-fees-index-bug

Conversation

@ValentinVPK

Copy link
Copy Markdown
Contributor

Description:

Fix FeeHelper.createFixedFeesForToken, which allocated a 1-element array and wrote both fees to index [0], silently discarding the first fee. A token created with it would charge only the second collector.

  • Allocate the array with length 2 instead of 1
  • Write the second fee to index [1] instead of overwriting [0]
  • Apply the fix to both token-service and token-service-v2

Related issue(s):

Fixes #122

Notes for reviewer:

Bug-fix only — no signature change. Verified with npx hardhat compile (clean). The function is an unused internal helper (no callers in contracts/ or test/), so no acceptance tests exercise it and none regress; the fixedFees references in the test suite are independent JS-side fixtures. The issue's step 2 (an N-fee builder) was intentionally dropped — an N-of-identical-fees helper has no real use case, mirrors an already-unused sibling, and would be scope creep on a bug fix.

Signed-off-by: ValentinVPK <valentin.krumov@limechain.tech>
@ValentinVPK
ValentinVPK requested review from a team as code owners July 31, 2026 10:15
@ValentinVPK
ValentinVPK requested a review from rbarker-dev July 31, 2026 10:15
@ValentinVPK ValentinVPK self-assigned this Jul 31, 2026
@ValentinVPK ValentinVPK added the bug Something isn't working label Jul 31, 2026
@ValentinVPK ValentinVPK added this to the 0.2.0 milestone Jul 31, 2026
@natanasow
natanasow merged commit 038f155 into hiero-ledger:main Aug 20, 2026
22 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

bug Something isn't working released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FeeHelper.createFixedFeesForToken writes both fees to index [0], silently discarding the first fee

3 participants