Skip to content

Safe Math#37

Merged
Joeysantoro merged 1 commit intoPOZ-Fixesfrom
POZ-Safe-Math
Feb 6, 2021
Merged

Safe Math#37
Joeysantoro merged 1 commit intoPOZ-Fixesfrom
POZ-Safe-Math

Conversation

@Joeysantoro
Copy link
Contributor

Resolves OpenZeppelin audit issues L06, L10, N23 (partially, only for Pool.sol), and N27

@Joeysantoro Joeysantoro added the OZ Fix New A PR dedicated to fix an OpenZeppelin issue label Feb 6, 2021
@Joeysantoro Joeysantoro merged commit 956af03 into POZ-Fixes Feb 6, 2021

uint32 deltaTimestamp = currentTimestamp - priorTimestamp;
if(currentTimestamp <= priorTimestamp || deltaTimestamp < duration) {
uint32 deltaTimestamp = currentTimestamp - priorTimestamp; // allowing underflow per Uniswap Oracle spec
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolves L10


/// @notice the total amount of rewards previously claimed
/// @return the total
function claimedRewards() external view returns(uint128);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolves N23


/// @notice the total amount of staked tokens in the contract
/// @return the total
function totalStaked() external view returns(uint128);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolves N23

return Decimal.zero();
}
Decimal.D256 memory delta = price.sub(peg, "UniRef: price exceeds peg"); // Should never error
Decimal.D256 memory delta = price.sub(peg, "Impossible underflow");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolves N27

using Decimal for Decimal.D256;
using SafeMath32 for uint32;
using SafeMath for uint;
using SafeMathCopy for uint;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prevent collisions from UniRef

Joeysantoro added a commit that referenced this pull request Jul 9, 2021
@xklob xklob deleted the POZ-Safe-Math branch September 19, 2021 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OZ Fix New A PR dedicated to fix an OpenZeppelin issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments