@@ -85,7 +85,7 @@ export const useExchange = () => {
8585 try {
8686 setLoading ( true ) ;
8787 setError ( null ) ;
88-
88+ console . log ( 'openPosition' , tokenAmount , exchangeRate , bitcoinAddresses , deadline , owner , chainId ) ;
8989 const contractManager = await ContractManager . getInstance ( ) ;
9090 const contractAddress = CONTRACTS_ADDRESS [
9191 chainId as keyof typeof CONTRACTS_ADDRESS
@@ -101,18 +101,20 @@ export const useExchange = () => {
101101 tokenAddress
102102 ) ;
103103
104+ console . log ( 'tokenName' , tokenName ) ;
104105 const nonce = await contractManager . readContract (
105106 'ERC20BitSnark' ,
106107 'nonces' ,
107108 [ owner ] ,
108109 tokenAddress
109110 ) ;
111+ console . log ( 'nonce' , nonce ) ;
110112 const domain = {
111113 name : tokenName ,
112114 version : '1' ,
113115 verifyingContract : tokenAddress ,
114116 } ;
115-
117+ console . log ( 'domain' , domain ) ;
116118 const types = {
117119 Permit : [
118120 { name : 'owner' , type : 'address' } ,
@@ -122,25 +124,25 @@ export const useExchange = () => {
122124 { name : 'deadline' , type : 'uint256' } ,
123125 ] ,
124126 } ;
125-
127+ console . log ( 'types' , types ) ;
126128 const message = {
127129 owner,
128130 spender : contractAddress ,
129131 value : tokenAmount ,
130132 nonce,
131133 deadline,
132134 } ;
133-
135+ console . log ( 'message' , message ) ;
134136 const signature = await contractManager . signTypedData ( {
135137 domain,
136138 types,
137139 primaryType : 'Permit' ,
138140 message,
139141 } ) ;
140-
142+ console . log ( 'signature' , signature ) ;
141143 const { r, s, v } = contractManager . getRSV ( signature ) ;
142144 const bytes32 = bech32ToBytes32 ( bitcoinAddresses ) ;
143-
145+ console . log ( 'bytes32' , bytes32 ) ;
144146 const { hash, wait } = await contractManager . writeContract (
145147 'AMMExchange' ,
146148 'openPosition' ,
0 commit comments