OriginProtocol / OriginProtocol/origin-dollar

Rounding issue on small amounts

Open
#1,418 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

contracts OETH P2
Dominant language
Solidity
Stars
152
Forks
115
Avg merge
3d 20h
Merged PRs (30d)
17

Description

While investigating ousd_analytics, I found a small issue with small numbers:

The user deposited E 0.001 and got OETH 0.000999999999999999
https://etherscan.io/tx/0x9b005270a8ea48d6ea28f9f72550ba814dd579d73c81596eeaa82296ec5544b3

Image

Funny enough, etherscan rounds it up.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the linked Etherscan transaction and the reported ousd_analytics result for the 0.001 E deposit. Trace where the OETH amount is calculated and identify the intended precision and rounding behavior; the issue is complete when the small-amount conversion no longer loses the reported precision.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.