-
Notifications
You must be signed in to change notification settings - Fork 13
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
UNI-1020 safe downcasting arithmetic operation. #78
UNI-1020 safe downcasting arithmetic operation. #78
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ithmetic # Conflicts: # contracts/market/UToken.sol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok, but here safecast still needs to be added:
union-v2-contracts/contracts/user/UserManager.sol
Lines 720 to 724 in 49d1a72
uint256 remaining = IAssetManager(assetManager).withdraw(stakingToken, msg.sender, amount); | |
if (uint96(remaining) > amount) { | |
revert AssetManagerWithdrawFailed(); | |
} | |
uint96 actualAmount = amount - uint96(remaining); |
uint256 remaining = IAssetManager(assetManager).withdraw(stakingToken, msg.sender, amount);
if (uint96(remaining) > amount) {
revert AssetManagerWithdrawFailed();
}
uint96 actualAmount = amount - uint96(remaining);
No description provided.