-
Notifications
You must be signed in to change notification settings - Fork 157
feat: Disputes #164
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: Disputes #164
Conversation
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.
Mostly just small changes, but I was unable to get the tests running. I was getting this error:
Error: web3@1.2.1 detected, incompatible with requirement of web3@1.0.0-beta.37
Any ideas how to get past it?
I'm pushing some fixes based on the review. I fixed web3 problems by bumping version of openzeppelin/test-helpers library and others. |
- remove unnecessary cast - check empty arbitrator + test - improve error messages - use "Dispute memory dispute" when possible - add comments
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.
The updates look good, I approve, but I see you still have a few unchecked boxes. Up to you if you want to include these in this PR, or we just merge this and go forward
) | ||
} | ||
|
||
function createAttestationHash(attestation) { |
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.
Is this right? This doesn't quite match up with how I interpret the spec here: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#definition-of-hashstruct
hashStruct(s : 𝕊) = keccak256(typeHash ‖ encodeData(s)) where typeHash = keccak256(encodeType(typeOf(s)))
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.
The function that is performing that is this one:
function createAttestationHash(attestation) {
const attestationTypeHash = web3.utils.sha3(
'Attestation(IpfsHash requestCID,IpfsHash responseCID,uint256 gasUsed,uint256 responseNumBytes)IpfsHash(bytes32 hash,uint16 hashFunction)',
)
// ABI encoded
return web3.utils.sha3(
web3.eth.abi.encodeParameters(
['bytes32', 'bytes'],
[attestationTypeHash, attestation],
),
)
}
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.
Got it, thanks for clarifying 👍
This PR implements Disputes on a different contract that interacts with the Staking contract.
Spec:
https://www.notion.so/thegraph/Disputes-51960724e8464c119ce4b249c7c1f425
Tasks:
x dispute deposit below what is required
x two exactly equal disputes should be rejected
x reject dispute
x ignore dispute
x accept dispute
x dispute manager not allowed to slash