This repository was archived by the owner on Mar 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +21
-14
lines changed Expand file tree Collapse file tree 3 files changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -369,7 +369,6 @@ class ERC20Client {
369
369
// amount: CLValueBuilder.u256(amount)
370
370
// });
371
371
372
-
373
372
// const deployHash = await contractCall({
374
373
// chainName: this.chainName,
375
374
// contractHash: this.contractHash,
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ const erc20 = new ERC20Client(
70
70
71
71
const test = async ( ) => {
72
72
73
- await erc20 . setContractHash ( TOKEN1_CONTRACT ! ) ;
73
+ await erc20 . setContractHash ( TOKEN0_CONTRACT ! ) ;
74
74
//getTotalSupply(TOKEN1_CONTRACT!);
75
75
// // //name
76
76
// // const name = await erc20.name();
@@ -133,16 +133,16 @@ const test = async () => {
133
133
// // console.log(`... Total supply: ${totalSupply}`);
134
134
135
135
//approve
136
- const approveDeployHash = await erc20 . approve (
137
- ROUTERKEYS ,
138
- PACKAGE_HASH ! ,
139
- AMOUNT_B_DESIRED ! ,
140
- APPROVE_PAYMENT_AMOUNT !
141
- ) ;
142
- console . log ( "... Approve deploy hash: " , approveDeployHash ) ;
143
-
144
- await getDeploy ( NODE_ADDRESS ! , approveDeployHash ) ;
145
- console . log ( "... Token approved successfully" ) ;
136
+ // const approveDeployHash = await erc20.approve(
137
+ // ROUTERKEYS,
138
+ // PACKAGE_HASH!,
139
+ // AMOUNT_B_DESIRED!,
140
+ // APPROVE_PAYMENT_AMOUNT!
141
+ // );
142
+ // console.log("... Approve deploy hash: ", approveDeployHash);
143
+
144
+ // await getDeploy(NODE_ADDRESS!, approveDeployHash);
145
+ // console.log("... Token approved successfully");
146
146
147
147
// // //transfer
148
148
// // const transferDeployHash = await erc20.transfer(
Original file line number Diff line number Diff line change @@ -70,9 +70,17 @@ router
70
70
message : "spender not found in request body" ,
71
71
} ) ;
72
72
}
73
-
73
+ let data = await AllcontractsData . findOne ( {
74
+ packageHash : req . body . contractHash ,
75
+ } ) ;
76
+ if ( data == null ) {
77
+ return res . status ( 400 ) . json ( {
78
+ success : false ,
79
+ message : "pair not found against this package hash " ,
80
+ } ) ;
81
+ }
74
82
let allowance = await pair . allowance (
75
- req . body . contractHash ,
83
+ data . contractHash ,
76
84
req . body . owner ,
77
85
req . body . spender
78
86
) ;
You can’t perform that action at this time.
0 commit comments