Comments (4)
We're checking not only for the underflow, but also for the user error. What kind of error would the user see if we remove the check?
from contracts.
The user would see a math underflow revert reason. A user who doesn't understand why, should not interact directly with the smart contract, thus we can assume that the user who does (and doesn't use the interface) know and understand their way around.
from contracts.
There's a small chance user might get this if they had another tx pending and wallet didn't simulate everything, and we could better handle custom Error in the frontend... my feeling is to leave the custom error.
from contracts.
The FE could see the reason for the revert and infer what happened (revert, reason underflow). We should not add gas cost to the users to enable a FE feature that can be achieved without said check.
That being said, I am closing it as ACK.
from contracts.
Related Issues (20)
- [GAS OPTIMIZATION] Override OZ default functions HOT 4
- [INF] lastSettlementTime() can be removed HOT 1
- [INF] _price can be public and deprecate the getter function HOT 1
- [MEDIUM] Orb can be made impossible to be bought in a grieving attack HOT 1
- Remove 1 year requirement from bidding HOT 3
- [GAS OPTIMIZATION] trigger cleartext and hash is not required to be stored HOT 2
- [INFO] onlyHolder and onlyHolderSolvent can be unified
- [INF] Remove `onlyHolderHeld`
- [GAS OPTIMIZATION] setPrice doesn't need to check that newPrice is non-zero HOT 1
- [GAS OPTIMIZATION] Use calldata argument instead of storage variable in purchase() HOT 1
- [LOW] CEI pattern is not followed in purchase HOT 2
- [INF] Unify modifiers HOT 1
- [INF] foreclosureTime does not need to be internal HOT 2
- [LOW] `flagResponse` can be issued for a prior invocation of the Orb HOT 3
- [GAS OPTIMIZATION] triggerExists can use triggerCount HOT 1
- Remove `onlyHolderHeld` if `onlyHolder` AND `external` are in the same function: `setPrice`, `exit`, `flagResponse`. If it's external, it can't be called by the contract itself. HOT 1
- [INF] use weth instead of Ether HOT 1
- [INF] Duplicate codepath in _settle() HOT 2
- [LOW] The repository does not have a CI/CD pipeline HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from contracts.