Skip to content

Commit

Permalink
fix verifyingContract to be a valid evm hex address (using cosmos a…
Browse files Browse the repository at this point in the history
…s hex address) (#9)
  • Loading branch information
randy75828 authored Sep 9, 2024
1 parent 533205d commit 1877433
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ethereum/eip712/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,22 @@
package eip712

import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/signer/core/apitypes"
)

// createEIP712Domain creates the typed data domain for the given chainID.
func createEIP712Domain(chainID uint64) apitypes.TypedDataDomain {
contractStr := "cosmos"
contractAddr := common.BytesToAddress([]byte(contractStr))
domain := apitypes.TypedDataDomain{
Name: "Carbon",
Version: "1.0.0",
ChainId: math.NewHexOrDecimal256(int64(chainID)),
VerifyingContract: "cosmos",
VerifyingContract: contractAddr.Hex(),
Salt: "1",
}

return domain
}

0 comments on commit 1877433

Please sign in to comment.