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(svm): N-05 Ambiguous Parameter Usage for fill_deadline #844

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

md0x
Copy link
Contributor

@md0x md0x commented Jan 7, 2025

Changes proposed in this PR:

  • Fixes the following issue identified by Open Zeppelin:

The deposit_v3 and deposit_v3_now functions use the same parameter name, fill_deadline, with differing semantics. In deposit_v3, it is an absolute timestamp, whereas in deposit_v3_now, it is an offset added to the current time.

The documentation lacks clarity about this distinction, increasing the likelihood of errors. Users might mistakenly pass an absolute timestamp to deposit_v3_now, leading to a computed deadline (current_time + fill_deadline_offset) that exceeds current_time + state.fill_deadline_buffer. This results in failed transactions.

Consider renaming fill_deadline in deposit_v3_now to fill_deadline_offset for clarity. Alternatively, consider improving the documentation to explicitly state the difference in semantics, including examples.

Copy link

linear bot commented Jan 7, 2025

@md0x md0x marked this pull request as ready for review January 7, 2025 10:39
Copy link
Member

@chrismaree chrismaree left a comment

Choose a reason for hiding this comment

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

you'll need to update the comment block above for fill_deadline

Signed-off-by: Pablo Maldonado <[email protected]>
@md0x md0x force-pushed the pablo/acx-3594-n-05-ambiguous-parameter-usage-for-fill_deadline branch from e86fc68 to 31ed468 Compare January 8, 2025 14:15
@md0x
Copy link
Contributor Author

md0x commented Jan 8, 2025

you'll need to update the comment block above for fill_deadline

Comment updated

@md0x md0x requested a review from chrismaree January 8, 2025 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants