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

Commit

Permalink
keys added
Browse files Browse the repository at this point in the history
  • Loading branch information
Hammad-Mubeen committed Nov 3, 2021
1 parent 309429c commit 6a8dc0e
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 32 deletions.
20 changes: 10 additions & 10 deletions .env
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
NODE_MODE=developement
DATABASE_URL_LOCAL=mongodb://localhost:27017/V2-graphQL
DATABASE_URL_ONLINE=mongodb+srv://admin:[email protected]/V2-graphQL?retryWrites=true&w=majority
FACTORY_ADDRESS=eed67f1280bec8429fea0fe7dab38624f0721d0d623ffce6dd0c8647d8cf440e
token0=16aba5b7c0f5d5da614524b0c06f8f07e3c48040ccd0afaafaac32ea3e0d6ca1
token1=d9157da9a14332fcdf0bf03b5e131112ce3c4f1fa4fa30c462c44d3d8c504115
pair=d9685083521ad03c0f649d0d33e243762573538896f9b8b72955b26000889079
FACTORY_ADDRESS=9b3ea6e98ccc08d427b1803242f55cef11468a887498380170284436fc9ae245
token0=ed4cd910aa2ee3d8df3512fa715e499cb737867770e2cbce458a4af805dd14c4
token1=7df2fb64e16a464fd97052401984eaadb2c7c7f20deed4b721e6ad8eefec27e4
pair=d607981f8acc74d69ebce1ebf0cb76b74891b777c51fae2b833e916c811b0afb

GRAPHQL=http://localhost:3000/graphql
CHAIN_NAME=casper-test
Expand All @@ -22,7 +22,7 @@ PAIR_MASTER_KEY_PAIR_PATH=JsClients/PAIR/keys/


ERC20_CONTRACT_NAME=erc20
ERC20_TOKEN_NAME=token3
ERC20_TOKEN_NAME=token1
ERC20_TOKEN_SYMBOL=erc
ERC20_DECIMALS=18
ERC20_TOTAL_SUPPLY=1000
Expand All @@ -35,7 +35,7 @@ PAIR_TOTAL_SUPPLY=1000

FACTORY_CONTRACT_NAME=Factory

INSTALL_PAYMENT_AMOUNT=170000000000
INSTALL_PAYMENT_AMOUNT=235000000000

MINT_PAYMENT_AMOUNT=5000000000
MINT_AMOUNT=50
Expand Down Expand Up @@ -66,8 +66,8 @@ SET_FEE_TO_PAYMENT_AMOUNT=5000000000
SET_FEE_TO_SETTER_PAYMENT_AMOUNT=5000000000
CREATE_PAIR_PAYMENT_AMOUNT=5000000000

FACTORY_CONTRACT=eed67f1280bec8429fea0fe7dab38624f0721d0d623ffce6dd0c8647d8cf440e
PAIR_CONTRACT=d9685083521ad03c0f649d0d33e243762573538896f9b8b72955b26000889079
FACTORY_CONTRACT=9b3ea6e98ccc08d427b1803242f55cef11468a887498380170284436fc9ae245
PAIR_CONTRACT=d607981f8acc74d69ebce1ebf0cb76b74891b777c51fae2b833e916c811b0afb
CALLEE_CONTRACT=fbfeda8b97f056f526f20c2fc2b486d9bdbfb3e46b9a164527e57c0c86e68612
TOKEN0_CONTRACT=16aba5b7c0f5d5da614524b0c06f8f07e3c48040ccd0afaafaac32ea3e0d6ca1
TOKEN1_CONTRACT=d9157da9a14332fcdf0bf03b5e131112ce3c4f1fa4fa30c462c44d3d8c504115
TOKEN0_CONTRACT=40ce47cab39c3b5629b551876f63c88b8142814be6823b2cc789a8d3780783bb
TOKEN1_CONTRACT=0a2e5c7c70431fafcf624f5f99ceaecb07cdc6f290019e1da956361e5cb3ccae
2 changes: 1 addition & 1 deletion JsClients/ERC20/keys/public_key.pem
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAkULIvEz/bjrjEeUuTGaHy7rxT+rOtdHw/HefJcpygsU=
MCowBQYDK2VwAyEAjizGZCcsy4nEFJIEgGJyzz3gz3a1QQV9A8pu/qUUfMA=
-----END PUBLIC KEY-----
2 changes: 1 addition & 1 deletion JsClients/ERC20/keys/public_key_hex
Original file line number Diff line number Diff line change
@@ -1 +1 @@
019142c8bc4cff6e3ae311e52e4c6687cbbaf14feaceb5d1f0fc779f25ca7282c5
018e2cc664272ccb89c4149204806272cf3de0cf76b541057d03ca6efea5147cc0
2 changes: 1 addition & 1 deletion JsClients/ERC20/keys/secret_key.pem
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIHCHw1pJnsTA+YQono8c0ruL+CQ7zx3verD6vKuVdf26
MC4CAQAwBQYDK2VwBCIEIOO917lkyr8iYYAE9fP3A53fWkMk85SHKgwxBoiCEaNd
-----END PRIVATE KEY-----
Empty file modified JsClients/ERC20/wasm/erc20-token.wasm
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion JsClients/FACTORY/keys/public_key.pem
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAzBXFldMWQP8mB9wug4T2PeMoqZiK4IlsriYFy+dMGCQ=
MCowBQYDK2VwAyEARrB0WI8th0JcT45BaWBbZj/HShL7W5EvHvanmwix/eM=
-----END PUBLIC KEY-----
2 changes: 1 addition & 1 deletion JsClients/FACTORY/keys/public_key_hex
Original file line number Diff line number Diff line change
@@ -1 +1 @@
01cc15c595d31640ff2607dc2e8384f63de328a9988ae0896cae2605cbe74c1824
0146b074588f2d87425c4f8e4169605b663fc74a12fb5b912f1ef6a79b08b1fde3
2 changes: 1 addition & 1 deletion JsClients/FACTORY/keys/secret_key.pem
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIEdBvTt7jYWwgCbUJDLPl5EYfSOR35tzsxU1h/Bwo1zq
MC4CAQAwBQYDK2VwBCIEIOr0z7ZEPoZOevO07B6opAKs9Y9wQUariizlAzTZ7X+3
-----END PRIVATE KEY-----
2 changes: 1 addition & 1 deletion JsClients/FACTORY/test/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ const test = async () => {
console.log(`... Contract Hash: ${contractHash}`);
};

//test();
test();
39 changes: 27 additions & 12 deletions JsClients/FACTORY/test/installed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ const factory = new FACTORYClient(
EVENT_STREAM_ADDRESS!
);

function splitdata(data:string)
{
var temp=data.split('(');
var result=temp[1].split(')');
return result[0];
}

const test = async () => {

const listener = factory.onEvent(
Expand All @@ -53,7 +60,7 @@ const test = async () => {
const [timestamp,block_hash]= await getDeploy(NODE_ADDRESS!, deploy.deployHash);
console.log("... Timestamp: ", timestamp);
console.log("... Block hash: ", block_hash);

console.log("result.value(): ", result.value());
let newData = JSON.parse(JSON.stringify(result.value()));

console.log(eventName+ " Event result: ");
Expand All @@ -64,18 +71,26 @@ const test = async () => {
console.log(newData[4][0].data + " = " + newData[4][1].data);
console.log(newData[5][0].data + " = " + newData[5][1].data);

// (newData[2][1].data);
// var token0=(newData[2][1].data).split(')');
// request(GRAPHQL!,
// `mutation handleNewPair( $token0: String!, $token1: String!, $pair: String!, $all_pairs_length: Int!, $timeStamp: Int!, $blockHash: String!){
// handleNewPair( token0: $token0, token1: $token1, pair: $pair, all_pairs_length: $all_pairs_length, timeStamp: $timeStamp, blockHash: $blockHash) {
// result
// }
var allpairslength=parseInt(newData[0][1].data);
var pair=splitdata(newData[3][1].data);
var token0=splitdata(newData[4][1].data);
var token1=splitdata(newData[5][1].data);

console.log("allpairslength: ", allpairslength);
console.log("pair splited: ", pair);
console.log("token0 splited: ", token0);
console.log("token1 splited: ", token1);

request(GRAPHQL!,
`mutation handleNewPair( $token0: String!, $token1: String!, $pair: String!, $all_pairs_length: Int!, $timeStamp: Int!, $blockHash: String!){
handleNewPair( token0: $token0, token1: $token1, pair: $pair, all_pairs_length: $all_pairs_length, timeStamp: $timeStamp, blockHash: $blockHash) {
result
}
// }`,
// {token0:newData[2][1].data, token1: newData[3][1].data, pair: newData[4][1].data, all_pairs_length: newData[5][1].data, timeStamp:timestamp, blockHash:block_hash})
// .then(data => console.log(data))
// .catch(error => console.error(error));
}`,
{token0:token0, token1:token1, pair: pair, all_pairs_length: allpairslength, timeStamp:timestamp, blockHash:block_hash})
.then(data => console.log(data))
.catch(error => console.error(error));

} else {
console.log(`Failed deploy of ${eventName}, deployHash: ${deploy.deployHash}`);
Expand Down
Binary file modified JsClients/FACTORY/wasm/factory.wasm
100644 → 100755
Binary file not shown.
2 changes: 1 addition & 1 deletion JsClients/PAIR/keys/public_key.pem
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAMXHwIBQCqJCyGQ+tcbBS6jH1XiQNJ4BXR5NwJRByUbM=
MCowBQYDK2VwAyEAPVHw9EEgdN6yJ95ih/fgL+ypTItvpQFxSDd0MtQKy4s=
-----END PUBLIC KEY-----
2 changes: 1 addition & 1 deletion JsClients/PAIR/keys/public_key_hex
Original file line number Diff line number Diff line change
@@ -1 +1 @@
013171f0201402a890b2190fad71b052ea31f55e240d27805747937025107251b3
013d51f0f4412074deb227de6287f7e02feca94c8b6fa5017148377432d40acb8b
2 changes: 1 addition & 1 deletion JsClients/PAIR/keys/secret_key.pem
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEILtdFGfuUGR3lDEHOYGCoznprN4pnSB/P0QL6HfKo5lx
MC4CAQAwBQYDK2VwBCIEIG/YMcbuTy9PwihNuTEEIvsfELG9sfZKqWhLc1oymVP5
-----END PRIVATE KEY-----
Empty file modified JsClients/PAIR/wasm/pair-token.wasm
100644 → 100755
Empty file.

0 comments on commit 6a8dc0e

Please sign in to comment.