Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

少数を含む返済で全額返済ができなくなってしまうケースがある #109

Closed
fortunecrypto opened this issue Nov 5, 2021 · 2 comments · Fixed by #111
Labels
issue: bug バグ / Something isn't working v1 milestone

Comments

@fortunecrypto
Copy link
Collaborator

fortunecrypto commented Nov 5, 2021

現象の種類

A 動作の問題

見つかった現象及び動作

ごく小さい数値の返済を行うと、返済実行時に入力した数値とは異なる返済数量が実行されてしまい、UI上から完済することが不可なくらい最小単位での返済となってしまう。
コントラクトを直呼び出しする事で完済は可能

通常の使い方ではないので優先度は低いが、入力ミスなどで一度これに嵌ってしまうと完済ができなくてすっきりしない可能性あり。

問題のTxn Hash

https://rinkeby.etherscan.io/tx/0x6b79efe1e798c9591d280e94a499e7451fffff1955d08254dab48acd337f5654

検証環境:ブラウザ種別

Chrome

Web3 インターフェース

Metamask

再現性について

再現できる

再現手順

  1. 返済に少数第8以下のごく少数な数値を入力する、(0.00000009 を返済)
  2. 入力した数値とは異なる返済額になる (0.000000003486784401)
  3. UIからは細かい正確な数字を返済できないため、完済が不可となる =預け入れETHを完全には引き出すことはできなくなる

詳細説明、考察、備考など

UI側で扱える少数の精度限界?
貸出は整数、返済は少数第3位までに条件を付けてしまって良いか

@fortunecrypto fortunecrypto added the issue: bug バグ / Something isn't working label Nov 5, 2021
@ghost ghost added the needs triage 精査前 / This issue needs to classify. label Nov 6, 2021
@ghost ghost self-assigned this Nov 7, 2021
@ghost ghost added v1 milestone and removed needs triage 精査前 / This issue needs to classify. labels Nov 7, 2021
@ghost
Copy link

ghost commented Nov 7, 2021

#73 による二次災害。
ethersが指数表記(e形式)に対応しないことが根本にあるし、そうする理由も納得である。他に浮動小数点数の問題もある。

そのためwei入力をがんばるなら、eth単位の入力フォームとは別にwei単位の専用入力フォームを用意するなどが現実的である。

@ghost
Copy link

ghost commented Nov 7, 2021

今回のパターンには対応しました。0.00000009のままで処理できます。

@ghost ghost closed this as completed in #111 Nov 7, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug バグ / Something isn't working v1 milestone
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant