-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fix EIP712 chain ID handling #51
Labels
Comments
reading the chain ID from within a contract at run-time is not possible currently. it will be possible once this EIP is implemented https://eips.ethereum.org/EIPS/eip-1344 |
ok, here is an update:
uint256 chain_id;
assembly {
chain_id := chainid()
} |
ganache CHAINID opcode currently is buggy: https://github.com/trufflesuite/ganache/issues/1643 |
so above is now fixed. chain ID is dynamically read, as well as exposed on XBRNetwork:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
EIP712 contains the chain ID in signed typed data to prohibit cross-chain replay attacks.
We should run-time read the chain ID from within Solidity in the channel contract - currently, its hard-coded:
https://github.com/crossbario/xbr-protocol/blob/bf7edc0e45b180f88b4076774ce89f08f3709a92/contracts/XBRChannel.sol#L192
The text was updated successfully, but these errors were encountered: