-
Notifications
You must be signed in to change notification settings - Fork 2
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/cross chain eip712 #10
Feat/cross chain eip712 #10
Conversation
ethereum/eip712/encoding.go
Outdated
if len(signedChainSplit) != 2 || len(carbonChainSplit) != 2 { | ||
return apitypes.TypedData{}, errors.New("invalid memo") | ||
} | ||
aminoDoc.ChainID = signedChainSplit[1] |
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.
i think we can shift the replay attack guard here, since the chainId is just a static variable initialised in Makefile.
import the evm keeper:
evmkeeper "github.com/evmos/ethermint/x/evm/keeper"
// Check the carbon chain ID to prevent replay attack
if carbonChainSplit[1] != evmkeeper.EvmChainId {
return apitypes.TypedData{}, fmt.Errorf("invalid chainId, expected %v, got %v", evmkeeper.EvmChainId, carbonChainSplit[1])
}
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.
Done in 113d5d6
* fix verifyingContract to be a valid evm hex address (using `cosmos` as hex address) * Add logs to decodeAminoSignDoc * Only use 2 logs * Add chainID logs * Add draft memo processing to change typedData * Update signedChainId processing * Move memo processing above parsingchainId * Remove unused domainID and other variables * Remove logs * Add memo processing chain id in protobug doc * Add logs for protobuf signdoc * move memo processing in protobuf below signBytes * Fix proto signing doc * Refactor getChainIDFromMemo and add carbon chain check --------- Co-authored-by: Randy <randy75828@gmail.com>
Cross chain EIP712 to do processing of eip712 structure in ethermint
For https://github.com/Switcheo/carbon/pull/966