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

fix(purity): remove submitDirectly #20

Merged
merged 2 commits into from
Jan 19, 2024
Merged

Conversation

Sabnock01
Copy link
Member

@Sabnock01 Sabnock01 commented Dec 19, 2023

This PR depends on #19

Overview

For the first curta-golf course, it was possible for solvers to get a block's PREVRANDAO value in the same transaction that they submit their solution by using submitDirectly. Therefore, this PR will deprecate the function in which all solvers will need to use the commit-reveal scheme provided by commit + submit. This is not vulnerable to the above method since any call to submit will check that block.timestamp has been increased by at least 60 before calls to submit succeed, ensuring that a solver's call to submit cannot come in the same block as the call to commit.

Fixes

ICurtaGolf.sol

  • Removes the submitDirectly function signature.

CurtaGolf.sol

  • Removes the submitDirectly function.

CurtaGolf.t.sol

  • Removes the tests for submitDirectly.
  • Modifies the test test_tokenURI_MintedToken_Succeeds to use commit + submit.

PrintKingArt.s.sol

  • setUp has been modified to use the commit + submit method instead of submitDirectly.
  • This file was also missing the RECIPIENT constant present in PrintParArt.s.sol and has been added.

PrintParArt.s.sol

  • setUp has been modified to use the commit + submit method instead of submitDirectly.

@Sabnock01 Sabnock01 marked this pull request as ready for review December 19, 2023 11:03
@Sabnock01 Sabnock01 marked this pull request as draft December 19, 2023 11:06
@Sabnock01 Sabnock01 marked this pull request as ready for review December 19, 2023 17:20
@Sabnock01 Sabnock01 merged commit 7d61639 into main Jan 19, 2024
1 check passed
@fiveoutofnine fiveoutofnine deleted the sabnock/remove-submitDirectly branch February 22, 2024 23:46
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