Remove a check for a valid nonce from StakerProxy.stake()
In the context of OSTComposer functionality, we've already checked the validity of a provided nonce within OSTComposer::requestStake() function (to make sure that OSTComposer::acceptStakeRequest() would not fail because of an invalid nonce).
In the context of StakerProxy::stake() function this check is not needed as a call to gateway stack function would assure this.
Replace StakerProxy's own implementation of a mutex by inheriting from Mutex contract.
Remove mutex from OSTComposer::acceptStakeRequest function.
We can safely remove a mutex from OSTComposer::acceptStakeRequest and execute the following statements after the first require statement in the function:
Remove mutex from OSTComposer::revokeStakeRequest and OSTComposer::rejectStakeRequest
We can safely remove mutex from OSTComposer::revokeStakeRequest and OSTComposer::rejectStakeRequest as the following statements in function OSTComposer::removeStakeRequest (called within above-mentioned functions) protects against reentrancy:
In the context of OSTComposer functionality, we've already checked the validity of a provided nonce within OSTComposer::requestStake() function (to make sure that OSTComposer::acceptStakeRequest() would not fail because of an invalid nonce).
In the context of StakerProxy::stake() function this check is not needed as a call to gateway stack function would assure this.
We can safely remove a mutex from OSTComposer::acceptStakeRequest and execute the following statements after the first require statement in the function:
We can safely remove mutex from
OSTComposer::revokeStakeRequest
andOSTComposer::rejectStakeRequest
as the following statements in functionOSTComposer::removeStakeRequest
(called within above-mentioned functions) protects against reentrancy: