-
Notifications
You must be signed in to change notification settings - Fork 0
Add proofcast adapter #1
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
base: feat/v0.2.0
Are you sure you want to change the base?
Conversation
| if (yahos[domain] == address(0)) revert UnsupportedChainId(domain); | ||
|
|
||
| offset += 32; // skip the event id (32 bytes) | ||
| bytes memory eventBytes = statement[offset:]; |
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.
From the statement format, you should have the event id at this offset.
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.
isn't it skipped on line 95?
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 overlooked offset += 32 at line 91.
Resolving this and the other comment, which was also tied to the fact that I didn't spot the event id skipping.
|
|
||
| // MessageDispatched event parsing | ||
| address yahoAddress = RLPReader.toAddress(eventContent[0]); | ||
| if (yahoAddress != yahos[domain]) revert InvalidYahoAddress(); |
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.
There's no test for this revert.
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 is my last comment, everything else LGTM!
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.
Good catch, thank you, I'll sort it out in the afternoon
a69d98f to
7244cd9
Compare
| error InvalidMessageId(uint256 actual, uint256 expected); | ||
| error InvalidDestinationChainId(uint256 chainId); | ||
| error GracePeriodNotElapsed(); | ||
| error InvalidNewTeeSigner(); |
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.
Out of completeness you could include a test for this new error type as well, although it is not necessary, as applyNewTeeSigner is very straight forward.
| error UnsupportedProtocolId(bytes1 protocolId); | ||
| error UnsupportedChainId(uint256 chainId); | ||
| error UnexpectedEventTopic(bytes32 topic); | ||
| error InvalidSender(); |
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.
Unused, can be remove.
| error UnexpectedEventTopic(bytes32 topic); | ||
| error InvalidSender(); | ||
| error InvalidMessageId(uint256 actual, uint256 expected); | ||
| error InvalidDestinationChainId(uint256 chainId); |
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.
Unused, can be remove.
| import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; | ||
| import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; | ||
| import { RLPReader } from "solidity-rlp/contracts/RLPReader.sol"; | ||
| import { IERC777Recipient } from "@openzeppelin/contracts/interfaces/IERC777Recipient.sol"; |
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.
Unused, can be remove.
| import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; | ||
| import { RLPReader } from "solidity-rlp/contracts/RLPReader.sol"; | ||
| import { IERC777Recipient } from "@openzeppelin/contracts/interfaces/IERC777Recipient.sol"; | ||
| import { IERC1820RegistryUpgradeable } from "@openzeppelin/contracts-upgradeable/interfaces/IERC1820RegistryUpgradeable.sol"; |
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.
Unused, can be remove.
What to look:
ProofcastAdapter.soltest/adapters/Proofcasttest/adapters/Proofcast/EventAttestator.ts