Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit 87fb140

Browse files
committed
router wasm changed
1 parent d1892f0 commit 87fb140

File tree

5 files changed

+25
-27
lines changed

5 files changed

+25
-27
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ TOKEN_SYMBOL=DRAG
101101
TOKEN_META=origin fire,lifetime infinite
102102
CONTRACT_NAME=UniSwapRouter
103103

104-
CONTRACT_HASH=9ead9647794274c32a54c40ef51e80b5be856851ea039a6f07a165806d240999
105-
PACKAGE_HASH=8a74e1ae230936013f3b544182b8011435f4a457d9444fa879ab483fdf829dc8
104+
CONTRACT_HASH=d94bf4c60244f127821ff12fe1f56299215d7056be3739e6c42c917768540a93
105+
PACKAGE_HASH=3de805e07efbc2cd9c5d323ab4fe5f2f0c1c5da33aec527d73de34a1fc9d3735
106106
INSTALL_PAYMENT_AMOUNT=200000000000
107107
MINT_ONE_PAYMENT_AMOUNT=2000000000
108108
MINT_COPIES_PAYMENT_AMOUNT=100000000000

JsClients/PAIR/src/pair.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,25 +260,24 @@ class PAIRClient {
260260
const _spender = new CLByteArray(
261261
Uint8Array.from(Buffer.from(spender, "hex"))
262262
);
263-
263+
264264
const keyOwner=new CLKey(new CLAccountHash(Uint8Array.from(Buffer.from(owner, "hex"))));
265265
const keySpender = createRecipientAddress(_spender);
266266
const finalBytes = concat([CLValueParsers.toBytes(keyOwner).unwrap(), CLValueParsers.toBytes(keySpender).unwrap()]);
267267
const blaked = blake.blake2b(finalBytes, undefined, 32);
268268
const encodedBytes = Buffer.from(blaked).toString("hex");
269-
269+
270270
const result = await utils.contractDictionaryGetter(
271271
this.nodeAddress,
272272
encodedBytes,
273273
this.namedKeys.allowances
274274
);
275-
276275
const maybeValue = result.value().unwrap();
277276
return maybeValue.value().toString();
278277
} catch (error) {
279278
return "0";
280279
}
281-
280+
282281
}
283282

284283

JsClients/PAIR/src/utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ export const contractDictionaryGetter = async (
109109
seedUref
110110
);
111111

112-
console.log(" storedValue: ", storedValue);
113112
if (storedValue && storedValue.CLValue instanceof CLValue) {
114113
return storedValue.CLValue!;
115114
} else {

JsClients/ROUTER/test/install.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,26 +57,26 @@ const test = async () => {
5757
EVENT_STREAM_ADDRESS!
5858
);
5959

60-
// const installDeployHash = await uniswapRouter.install(
61-
// KEYS,
62-
// FACTORY_CONTRACT!,
63-
// WCSPR!,
64-
// LIBRARY!,
65-
// 'UniSwapRouter',
66-
// INSTALL_PAYMENT_AMOUNT!,
67-
// WASM_PATH!
68-
// );
69-
70-
// console.log("Passed Parameters: \nfactory: \t", FACTORY_CONTRACT,
71-
// "\nwcspr: \t", WCSPR,
72-
// "\nlibrary: \t", LIBRARY,
73-
// "\ncontract_name: \t", CONTRACT_NAME, "\n");
74-
75-
// console.log(`... Contract installation deployHash: ${installDeployHash}\n`);
76-
77-
// await getDeploy(NODE_ADDRESS!, installDeployHash);
78-
79-
// console.log(`... Contract installed successfully.`);
60+
const installDeployHash = await uniswapRouter.install(
61+
KEYS,
62+
FACTORY_CONTRACT!,
63+
WCSPR!,
64+
LIBRARY!,
65+
'UniSwapRouter',
66+
INSTALL_PAYMENT_AMOUNT!,
67+
WASM_PATH!
68+
);
69+
70+
console.log("Passed Parameters: \nfactory: \t", FACTORY_CONTRACT,
71+
"\nwcspr: \t", WCSPR,
72+
"\nlibrary: \t", LIBRARY,
73+
"\ncontract_name: \t", CONTRACT_NAME, "\n");
74+
75+
console.log(`... Contract installation deployHash: ${installDeployHash}\n`);
76+
77+
await getDeploy(NODE_ADDRESS!, installDeployHash);
78+
79+
console.log(`... Contract installed successfully.`);
8080

8181

8282
let accountInfo = await utils.getAccountInfo(NODE_ADDRESS!, KEYS.publicKey);
12 KB
Binary file not shown.

0 commit comments

Comments
 (0)