-
Notifications
You must be signed in to change notification settings - Fork 23
BM-462: Drop requirePayment #370
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
BM-462: Drop requirePayment #370
Conversation
🚀 Documentation Preview Deployment URL: https://boundless-documentation-iufh5k5p8-risczero.vercel.app Updated at: 2025-03-07 00:52:13 UTC |
contracts/src/BoundlessMarket.sol
Outdated
} else { | ||
emit PaymentRequirementsFailed(paymentError); | ||
} | ||
revertWith(paymentError); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this was not explained well in the issue. We actually want to always apply requirePayment = false
rather than requirePayment = true
🙈. The idea is that someone can always wrap this contract to add the behavior of reverting on payment failure, but the opposite is not true.
revertWith(paymentError); | |
emit PaymentRequirementsFailed(paymentError); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you simulate a call you only have read permissions so any event would not be available. As such I dropped the event and instead returned an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad (I wrote the issue) Sorry this wasn't clear!
contracts/src/BoundlessMarket.sol
Outdated
return abi.encodeWithSelector(RequestIsLocked.selector, RequestId.unwrap(id)); | ||
return ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to the comment above, we want to leave this line as is.
…g-requirepayment-from-fulfillment
…g-requirepayment-from-fulfillment
Here we drop the requirePayment bool. Valid fulfillments should never revert, but only return an error message (or an array of errors if batching).
As for simulating whether a prover will get paid or not would be sufficient to just call the transaction and check if returns any error.