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

Feat/price update over time #203

Merged
merged 5 commits into from
Jan 17, 2025
Merged

Feat/price update over time #203

merged 5 commits into from
Jan 17, 2025

Conversation

RedVeil
Copy link
Contributor

@RedVeil RedVeil commented Jan 16, 2025

No description provided.

Copy link

openzeppelin-code bot commented Jan 16, 2025

Feat/price update over time

Generated at commit: b119c738a61868e84b7dc000cdd52610f98c6929

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
2
0
9
40
53
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

Copy link
Contributor

@Andreadinenno Andreadinenno left a comment

Choose a reason for hiding this comment

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

Looks good to me - just left 3 minor comments

// Check for price jump or drawdown
if (
// Check if the changePerBlock is too large
changePerBlock > lastPrice.mulDivDown(1e18 + limit.jump, 1e18)
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this check is effective given that the owner can change limits instantly

changePerBlock > lastPrice.mulDivDown(1e18 + limit.jump, 1e18)
) {
// Pause the vault if it is not already paused
if (!Pausable(priceUpdate.vault).paused()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use the pause cached above. Also, should we check the vault is not paused at all before updating?

uint256 y = 100e18;
uint256 z = 100e18;
console2.log(x.mulDivUp(y, z));
emit LogBytes(
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of scope?

@RedVeil RedVeil merged commit c7679ec into main Jan 17, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants