LedgerHQ/app-ethereum

EIP712 sign message need support uint

CaiJiJi opened this issue · 2 comments

demo code

    const signature = await eth.signEIP712Message("44'/60'/0'/0/0", {
        domain: {
            chainId: 69,
            name: "Da Domain",
            verifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC",
            version: "1"
        },
        types: {
            "EIP712Domain": [
                { name: "name", type: "string" },
                { name: "version", type: "string" },
                { name: "chainId", type: "uint256" },
                { name: "verifyingContract", type: "address" }
            ],
            "Test": [
                { name: "contents", type: "string" }
            ]
        },
        primaryType: "Test",
        message: {contents: "Hello, Bob!"},
    })

ledger sign eip712 message success

but

    const signature = await eth.signEIP712Message("44'/60'/0'/0/0", {
        domain: {
            chainId: 69,
            name: "Da Domain",
            verifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC",
            version: "1"
        },
        types: {
            "EIP712Domain": [
                { name: "name", type: "string" },
                { name: "version", type: "string" },
                { name: "chainId", type: "uint" },
                { name: "verifyingContract", type: "address" }
            ],
            "Test": [
                { name: "contents", type: "string" }
            ]
        },
        primaryType: "Test",
        message: {contents: "Hello, Bob!"},
    })

ledger sign eip712 message error

solidity support type uint/uint256/uint128 .....

Ledger ethereum-app will support?

Hello @CaiJiJi, the standard states that there are no such type aliases for EIP-712 :

The atomic types are bytes1 to bytes32, uint8 to uint256, int8 to int256, bool and address. These correspond to their definition in Solidity. Note that there are no aliases uint and int.

Closing because tests are now in ragger.