Comments (6)
hi, can you share your json playload and expected signature here?
from trust-wallet-ios.
Hi,
Payload:
const payload = {
types:{
EIP712Domain:[],
Test:[
{name: "test", type: "uint64"}
],
},
primaryType:"Test",
domain: {},
message: {
test: 1,
},
};
The expected hash is 0x34091011761262618af3045f97715b4a73eb6737c9396353b85b757201e3ad9f
(produced with eth-sig-util)
from trust-wallet-ios.
it's weird, I can get exact 0x34091011761262618af3045f97715b4a73eb6737c9396353b85b757201e3ad9f
here is the test code:
func testUint64() throws {
let jsonString = """
{
"types": {
"EIP712Domain": [],
"Test": [
{"name": "test", "type": "uint64"}
],
},
"primaryType": "Test",
"domain": {},
"message": {
"test": 1
}
}
"""
let typed = try JSONDecoder().decode(EIP712TypedData.self, from: jsonString.data(using: .utf8)!)
let signhash = typed.signHash
XCTAssertEqual(signhash.hexString, "34091011761262618af3045f97715b4a73eb6737c9396353b85b757201e3ad9f")
}
put it in this file: https://github.com/TrustWallet/trust-core/blob/master/Tests/Ethereum/Solidity/EIP712/EIP712TypedDataTests.swift
from trust-wallet-ios.
from trust-wallet-ios.
Seems the second example is only failing on android. Sorry for the confusion.
This is failing on android and iOS:
const typedData = {
types:{
EIP712Domain:[
{name:"name",type:"string"},
{name:"version",type:"string"},
{name:"chainId",type:"uint256"},
{name:"verifyingContract",type:"address"}
],
Person:[
{name:"age",type:"uint64"},
{name:"name",type:"string"},
{name:"wallet",type:"address"}
],
Mail:[
{name:"from",type:"Person"},
{name:"to",type:"Person"},
{name:"contents",type:"string"},
{name: "id", type: "uint256"},
]
},
primaryType:"Mail",
domain:{name:"Ether Mail",version:"1",chainId:1,verifyingContract:"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"},
message:{
from:{age: 46,name:"Cow",wallet:"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"},
to:{age: 445711732, name:"Bob",wallet:"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"},
contents:"Hello, Bob!",
id: "18446744073709551617"}
};
The expected hash is: 0xd7452bcc4deef52ad1a3f658f4100fa870fcb849b2f8c7738c23bd8e736e6c7b
from trust-wallet-ios.
Thanks, we can reproduce this bug, and it will be fixed in future releases
from trust-wallet-ios.
Related Issues (20)
- Activate keyboard and cursor in input field
- make bootstrap fails when Installing TrezorCrypto
- Pending transaction state not being updated on the app side (parity ethereum node)
- copy ref link not working HOT 1
- How can I add kovan testnet?
- Hasher
- eth_sign sometimes produces invalid signature. HOT 2
- Use of undeclared type 'Coin' ?
- trus ios HOT 2
- ether stolen HOT 1
- Can't build HOT 3
- Use of undeclared type 'Coin' HOT 2
- I hope to restore the previous node server setup feature
- Incoming transactions marked as Sent causing negative amount on Non Multi-Coin wallets HOT 5
- Xcode 10 不能跑起来这个项目error: SWIFT_VERSION '3.0' is unsupported, supported versions are: 4.0, 4.2, 5.0. (in target 'JSONRPCKit')
- Can you provide support for TRX HOT 1
- Error installing RealmSwift
- Coin在新版的怎么处理,你们的Demo 是TrustCore (0.0.7) 我下载下来就是0.2.2 已经没有Coin
- personal_sign fails to sign 32 byte hex payload in iOS HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trust-wallet-ios.