We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Geth version: 1.10.25 OS & Version: Ubuntu 20.04.5 LTS
1.10.25
Typed Data providing int/uint types that differ from the primitive golang types are not supported while being valid Solidity types.
int
uint
According to EIP-712 atomic types of type int/uint can be a size ranging between 8 - 256 bits
Should be able to successfully encode typed data with valid int/uint types between 8 - 256.
Encoding fails due to unknown primitive type.
package main import ( "github.com/ethereum/go-ethereum/common/math" "github.com/ethersphere/bee/pkg/crypto/eip712" ) func main() { typedData := eip712.TypedData{ Domain: eip712.TypedDataDomain{ Name: "ABC", Version: "0.0.1", ChainId: math.NewHexOrDecimal256(1), }, Types: eip712.Types{ "EIP712Domain": { {Name: "name", Type: "string"}, {Name: "version", Type: "string"}, {Name: "chainId", Type: "uint256"}, {Name: "verifyingContract", Type: "address"}, }, "MainType": { {Name: "number1", Type: "int160"}, // missing valid Solidity type. {Name: "number2", Type: "int24"}, // missing valid Solidity type. }, }, PrimaryType: "MainType", Message: eip712.TypedDataMessage{ "number1": "13", "number2": "13", }, } _, err := typedData.HashStruct("EIP712Domain", typedData.Domain.Map()) if err != nil { panic(err) } _, err = typedData.HashStruct(typedData.PrimaryType, typedData.Message) if err != nil { panic(err) } }
unknown type "int160" unknown type "int24"
P.S. Issue was raised here as suggested by the go-ethereum community (ethereum/go-ethereum#25932)
The text was updated successfully, but these errors were encountered:
Resolved here ethereum/go-ethereum#26770
Sorry, something went wrong.
No branches or pull requests
System information
Geth version:
1.10.25
OS & Version: Ubuntu 20.04.5 LTS
Description
Typed Data providing
int
/uint
types that differ from the primitive golang types are not supported while being valid Solidity types.According to EIP-712 atomic types of type
int
/uint
can be a size ranging between 8 - 256 bitsExpected behaviour
Should be able to successfully encode typed data with valid
int
/uint
types between 8 - 256.Actual behaviour
Encoding fails due to unknown primitive type.
Steps to reproduce the behaviour
Error
P.S. Issue was raised here as suggested by the go-ethereum community (ethereum/go-ethereum#25932)
The text was updated successfully, but these errors were encountered: