Skip to content

Commit 7148e47

Browse files
committed
feat: made salt mandatory on ERC-7739 verifierDomain
1 parent 368dac0 commit 7148e47

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

.changeset/tame-shoes-brake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"viem": patch
3+
---
4+
5+
**Experimental (ERC-7739):** Added `salt` as a mandatory field of `verifierDomain`.

site/pages/experimental/erc7739/hashTypedData.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ Hashes [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data via [ERC-773
99
## Import
1010

1111
```ts
12-
import { hashTypedData } from 'viem/experimental/solady'
12+
import { hashTypedData } from 'viem/experimental/erc7739'
1313
```
1414

1515
## Usage
1616

1717
```ts
18-
import { hashTypedData } from 'viem/experimental/solady'
18+
import { hashTypedData } from 'viem/experimental/erc7739'
1919

2020
hashTypedData({
2121
domain: {
@@ -50,10 +50,11 @@ hashTypedData({
5050
extensions: [],
5151
fields: '0x0f',
5252
verifierDomain: {
53+
chainId: 1,
5354
name: 'Smart Account',
55+
salt: '0x0000000000000000000000000000000000000000000000000000000000000000',
5456
version: '1',
5557
verifyingContract: '0x1234567890abcdef1234567890abcdef12345678',
56-
chainId: 1,
5758
},
5859
})
5960
```

src/actions/public/getEip712Domain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export type GetEip712DomainParameters = {
2222
export type GetEip712DomainReturnType = {
2323
domain: RequiredBy<
2424
TypedDataDomain,
25-
'chainId' | 'name' | 'verifyingContract' | 'version'
25+
'chainId' | 'name' | 'verifyingContract' | 'salt' | 'version'
2626
>
2727
fields: Hex
2828
extensions: readonly bigint[]

src/experimental/erc7739/utils/hashTypedData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export type HashTypedDataParameters<
1616
> = TypedDataDefinition<typedData, primaryType, primaryTypes> & {
1717
verifierDomain: RequiredBy<
1818
TypedDataDomain,
19-
'chainId' | 'name' | 'verifyingContract' | 'version'
19+
'chainId' | 'name' | 'verifyingContract' | 'salt' | 'version'
2020
>
2121
}
2222

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
"chains/utils": ["./_types/chains/utils.d.ts"],
122122
"ens": ["./_types/ens/index.d.ts"],
123123
"experimental": ["./_types/experimental/index.d.ts"],
124-
"experimental/solady": ["./_types/experimental/solady/index.d.ts"],
124+
"experimental/erc7739": ["./_types/experimental/erc7739/index.d.ts"],
125125
"node": ["./_types/node/index.d.ts"],
126126
"op-stack": ["./_types/op-stack/index.d.ts"],
127127
"siwe": ["./_types/siwe/index.d.ts"],

0 commit comments

Comments
 (0)