ChainSafe / ChainSafe/open-creator-rails

Feature: Support decimal percentage for registryFeeShare in AssetRegistry

Open
#114 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Solidity
Stars
2
Forks
1
PR merge metrics
No merged PRs in 30d

Description

**What**

Add support for decimal percentages in `registryFeeShare` within `src/AssetRegistry.sol`.

Today, `registryFeeShare` behaves as integer-only percentage values. Update it to use a fixed-point style denominator (e.g. out of `10000`) so fee percentages can represent two trailing decimal places.

**Why**

Integer-only percentage handling is too coarse for fee configuration and prevents precise allocation tuning. Supporting basis-point precision improves flexibility while remaining simple and gas-efficient.

**How**

- Refactor `registryFeeShare` representation to basis points (BPS), using a denominator of `10000`.
- Update fee calculation logic to use the new denominator consistently.
- Add validation bounds (e.g. `0..10000`) and clear revert behavior for invalid values.
- Ensure storage, setters/getters, and emitted values/events are consistent with BPS semantics.
- Add/adjust tests for integer and decimal-equivalent values (e.g. 12.34% => 1234 BPS), edge bounds, and regression behavior.
- Document the new units so integrators treat `registryFeeShare` as BPS rather than whole percent.

**Acceptance Criteria**

- `registryFeeShare` supports decimal-style precision via BPS (`10000` denominator).
- Fee calculations are correct for representative fractional percentages.
- Invalid BPS inputs are rejected with expected errors.
- Existing workflows remain functional after unit migration.
- Tests and docs clearly reflect the new percentage unit.

**Estimation**

**Dependencies**

None currently identified.

Contributor guide

Open the contributing guide

Research direction

Start in src/AssetRegistry.sol and trace registryFeeShare storage, setters, getters, fee calculations, and emitted events. Review the existing tests and documentation for current whole-percent behavior, then update coverage for BPS bounds, fractional values, and regressions. Done means calculations, validation, storage, events, tests, and docs consistently use the 10000-unit BPS representation.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
blockchain
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.