镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[Draft] Use something closer to fixed18 for units - #1234

Draft
jshufro wants to merge 3 commits into
rocket-pool:masterfrom
jshufro:jms/fixed18-pr
Draft

jshufro wants to merge 3 commits into
rocket-pool:masterfrom
jshufro:jms/fixed18-pr

Conversation

@jshufro

@jshufro jshufro commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

The math module used floats, which suffer from precision errors, so that's obviously bad.

In the Ethereum universe, though, everything is generally some fixed decimal size, with fixed18 being the predominant unit (1 eth).

This PR was heavily assisted by AI. It attempts to remove all the float logic and replace it with a new module called units. That module is a facade around shopspring/decimal.

The conflicts are vaguely to be expected- this is a large PR that touches a lot of code.

My agent wants me to call your attention to the changes in bindings/rocketpool/contract.go and bindings/utils/multicall/multicaller.go, where we convert units.Wei to big.Int and vice versa, as needed.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant