-
Notifications
You must be signed in to change notification settings - Fork 38
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
[PoC] Downcasting from u256 to u128 #212
Comments
Which downcasting are you talking about? Can you provide a link or more context? |
I believe this refers explicitly to the require statement at the bottom of the following function dex-contracts/contracts/StablecoinConverter.sol Lines 260 to 277 in 4667388
I have opened a PR in OpenZeppelin repo that circumvents having to do this in a much simpler way. Take a look here! |
The decision for this sprint was to determine what the best approach is here while waiting for the next release (since OpenZeppelin.SafeCast wont appear till v2.5). |
I think we suggested to use OpenZeppelin as a npm git dependency (https://docs.npmjs.com/files/package.json#git-urls-as-dependencies) pinned to a tag/commit that includes the new SafeCast library. |
Closes #212 - by using specific commit hash of OpenZeppelin dependency and using its new SafeCast security tool! TestPlan: checkout this branch, run `npm install` followed by `truffle test` (with an instance of ganache–cli running).
Currently this downcasting could corrupt the numbers. We need to make sure that this is not happening.
@bh2smith is currently writing a library for it
The text was updated successfully, but these errors were encountered: