Closed thegostep closed 4 years ago
I am trying to understand this. Regarding: https://github.com/erasureprotocol/erasure-protocol/blob/c716c17a080ac7817312ab57ec4b1c60aa867f19/contracts/escrows/CountdownGriefingEscrow.sol
The scenario here is:
CountdownGriefingEscrow
contract and initializes with:
seller
= address(0)
operator
≠ address(0)
depositStake
seller
not already set, make msg.sender
the seller
"seller
is not changedseller
which is still address(0)
address(0)
Design issues:
Design questions:
Is this a vulnerability?:
Remediation:
seller
at a time after contract initialization, then this must be added as a new public function.@fulldecent went for remediation num 4.
The rationale is that operator serves as a blanket bypass of all access control to the public functions of the contract. This allows for composability since I can delegate the permissions to a separate contract that only implements the desired functionality.
Hopefully the documentation makes clear that the operator is always a trusted party if used.
The fix includes the ability to set an arbitrary seller / buyer instead of inferring it from msg.sender. Do you think this is a good pattern?
Looks great. Very clear and safe. Good pattern.
The escrow contract can lead to stuck tokens if the operator deposits the stake when there is no staker set. The tokens become stuck once the tokens are transfered to the agreement contract since the zero address is set as the staker.