From 443a475cd69d8ca1476e0f3bc9329b003788cbf0 Mon Sep 17 00:00:00 2001 From: Scott Piriou <30843220+pscott@users.noreply.github.com> Date: Thu, 4 Jul 2024 14:51:32 +0200 Subject: [PATCH] remove verifyingContract from domain --- .../clients/starknet/starknet-sig/index.ts | 29 ++++--------------- .../clients/starknet/starknet-sig/types.ts | 1 - 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/packages/sx.js/src/clients/starknet/starknet-sig/index.ts b/packages/sx.js/src/clients/starknet/starknet-sig/index.ts index 24d55cfba..dd231fb0d 100644 --- a/packages/sx.js/src/clients/starknet/starknet-sig/index.ts +++ b/packages/sx.js/src/clients/starknet/starknet-sig/index.ts @@ -55,17 +55,10 @@ export class StarknetSig { | StarknetEIP712ProposeMessage | StarknetEIP712UpdateProposalMessage | StarknetEIP712VoteMessage - >( - signer: Account, - verifyingContract: string, - message: T, - types: any, - primaryType: string - ): Promise { + >(signer: Account, message: T, types: any, primaryType: string): Promise { const domain = { ...baseDomain, - chainId: this.config.networkConfig.eip712ChainId, - verifyingContract + chainId: this.config.networkConfig.eip712ChainId }; const data: typedData.TypedData = { @@ -120,13 +113,7 @@ export class StarknetSig { salt: this.generateSalt() }; - const signatureData = await this.sign( - signer, - data.authenticator, - message, - proposeTypes, - 'Propose' - ); + const signatureData = await this.sign(signer, message, proposeTypes, 'Propose'); return { signatureData, @@ -157,13 +144,7 @@ export class StarknetSig { salt: this.generateSalt() }; - const signatureData = await this.sign( - signer, - data.authenticator, - message, - updateProposalTypes, - 'UpdateProposal' - ); + const signatureData = await this.sign(signer, message, updateProposalTypes, 'UpdateProposal'); return { signatureData, @@ -191,7 +172,7 @@ export class StarknetSig { metadataUri: shortString.splitLongString('').map(str => shortString.encodeShortString(str)) }; - const signatureData = await this.sign(signer, data.authenticator, message, voteTypes, 'Vote'); + const signatureData = await this.sign(signer, message, voteTypes, 'Vote'); return { signatureData, diff --git a/packages/sx.js/src/clients/starknet/starknet-sig/types.ts b/packages/sx.js/src/clients/starknet/starknet-sig/types.ts index 1ae6bfa17..f1c7bd12b 100644 --- a/packages/sx.js/src/clients/starknet/starknet-sig/types.ts +++ b/packages/sx.js/src/clients/starknet/starknet-sig/types.ts @@ -8,7 +8,6 @@ export const domainTypes = { { name: 'name', type: 'felt252' }, { name: 'version', type: 'felt252' }, { name: 'chainId', type: 'felt252' }, - { name: 'verifyingContract', type: 'ContractAddress' } ] };