-
Notifications
You must be signed in to change notification settings - Fork 2
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
refactor: no need to check requester service Id #86
Conversation
// Buy back burner address | ||
address public immutable buyBackBurner; |
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.
Drainer is a better name - it's generic.
@@ -204,14 +204,12 @@ contract MechMarketplace is IErrorsMarketplace { | |||
/// @notice The request is going to be registered for a specified priority mech. | |||
/// @param requestDatas Set of self-descriptive opaque request data-blobs. | |||
/// @param priorityMechServiceId Priority mech service Id. | |||
/// @param requesterServiceId Requester service Id, or zero if EOA. |
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.
This came out as a parameter that can always be equal to zero, and it passes all the checks. So checks on requesters become obsolete.
@@ -237,9 +235,6 @@ contract MechMarketplace is IErrorsMarketplace { | |||
revert ZeroAddress(); | |||
} | |||
|
|||
// Check requester | |||
checkRequester(msg.sender, requesterServiceId); |
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.
checkRequester()
ultimately becomes obsolete as well.
@@ -260,7 +255,7 @@ contract MechMarketplace is IErrorsMarketplace { | |||
} | |||
|
|||
// Calculate request Id | |||
requestIds[i] = getRequestId(msg.sender, requestDatas[i], nonce); | |||
requestIds[i] = getRequestId(msg.sender, requestDatas[i], deliveryRate, nonce); |
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.
Adding deliveryRate into the requestId is required as this is the part of the request the requester signs on, and it becomes the only verifiable part of hash when requesting off-chain
…try-mech into requester_service_id
requestId()
;