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(contracts/core): add additional actions to inbox #2360

Merged
merged 6 commits into from
Nov 4, 2024

Conversation

Zodomo
Copy link
Contributor

@Zodomo Zodomo commented Nov 1, 2024

Replaced OpenZeppelin libs with gas-optimized Solady alternatives. Expanded solve Inbox to include accept, reject, and cancel logic. Also implemented tests for these flows.

issue: #2355

@Zodomo Zodomo self-assigned this Nov 1, 2024
@Zodomo Zodomo requested a review from kevinhalliday as a code owner November 1, 2024 21:49
Copy link
Contributor

@kevinhalliday kevinhalliday left a comment

Choose a reason for hiding this comment

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

Can we change pr title (which will be commit message) to a feat(contracts/core): ...
We are adding to Inbox, not just adding tests

  • Let's make all methods nonReentrant. But definitely cancel. Otherwise we could have some malicious cancellations while opening a request.
  • Thinking we actually do keep requests around for now, and just change status (see my comment below). Think the view function will be helpful. We can switch later if we don't need it

Also, can you move the function tests cases to their own files.

Inbox_accept.t.sol
Inbox_reject.t.sol
Inbox_cancel.t.sol

Hlps keeps tests files a bit smaller

Sol artifacts changed because adding solady import changed metadata

contracts/core/src/solve/Solve.sol Show resolved Hide resolved
contracts/core/test/solve/Inbox_request.t.sol Outdated Show resolved Hide resolved
contracts/core/src/solve/Inbox.sol Outdated Show resolved Hide resolved
contracts/core/src/solve/Inbox.sol Outdated Show resolved Hide resolved
@corverroos corverroos changed the title test(contracts/core): expand inbox and add additional tests test(contracts/solve): expand inbox and add additional tests Nov 4, 2024
@Zodomo Zodomo changed the title test(contracts/solve): expand inbox and add additional tests feat(contracts/core): add additional actions to inbox Nov 4, 2024
Copy link
Contributor

@kevinhalliday kevinhalliday left a comment

Choose a reason for hiding this comment

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

Approving.

Let's switch to new state names tho from adr Open -> Pending and Cancelled -> Reverted

@Zodomo Zodomo merged commit 099b967 into main Nov 4, 2024
18 checks passed
@Zodomo Zodomo deleted the zodomo/solve-inbox branch November 4, 2024 15:52
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