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

Commit 84053c6

Browse files
committed
keys successfully removed and added to .gitignore
now, to do deployment first create keys, fund them then add them to scripts ERC20, FACTORY, PAIR and ROUTER folders etherwise runn scripts command would throw errors. See all script commands from readme
1 parent a7f84f5 commit 84053c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+700
-1325
lines changed

.env

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ NODE_ADDRESS=http://159.65.118.250:7777/rpc
5050
EVENT_STREAM_ADDRESS=http://159.65.118.250:9999/events/main
5151
RECEIVER_ACCOUNT_ONE=017e82abcc9539a01cfd9d63ae8c9c8b3a752a6f75ba1ab148714eea03e9be69a7
5252

53-
ERC20_WASM_PATH=JsClients/ERC20/wasm/erc20-token.wasm
54-
FACTORY_WASM_PATH=JsClients/FACTORY/wasm/factory.wasm
55-
PAIR_WASM_PATH=JsClients/PAIR/wasm/pair-token.wasm
56-
WASM_PATH=JsClients/ROUTER/wasm/uniswap-v2-router.wasm
53+
ERC20_WASM_PATH=Scripts/ERC20/wasm/erc20-token.wasm
54+
FACTORY_WASM_PATH=Scripts/FACTORY/wasm/factory.wasm
55+
PAIR_WASM_PATH=Scripts/PAIR/wasm/pair-token.wasm
56+
WASM_PATH=Scripts/ROUTER/wasm/uniswap-v2-router.wasm
5757

58-
ERC20_MASTER_KEY_PAIR_PATH=JsClients/ERC20/keys/
59-
FACTORY_MASTER_KEY_PAIR_PATH=JsClients/FACTORY/keys/
60-
PAIR_MASTER_KEY_PAIR_PATH=JsClients/PAIR/keys/
61-
MASTER_KEY_PAIR_PATH=JsClients/ROUTER/keys/
58+
ERC20_MASTER_KEY_PAIR_PATH=Scripts/ERC20/keys/
59+
FACTORY_MASTER_KEY_PAIR_PATH=Scripts/FACTORY/keys/
60+
PAIR_MASTER_KEY_PAIR_PATH=Scripts/PAIR/keys/
61+
MASTER_KEY_PAIR_PATH=Scripts/ROUTER/keys/
6262

6363
ERC20_CONTRACT_NAME=Wrapper Ether1
6464
ERC20_TOKEN_NAME=Wrapper Ether
@@ -124,8 +124,8 @@ TOKEN_SYMBOL=DRAG
124124
TOKEN_META=origin fire,lifetime infinite
125125
CONTRACT_NAME=UniSwapRouter1
126126

127-
CONTRACT_HASH=2bd3b33f9d0a137a5790ebf0091d6bb5e0f47df6b7ca783989df8490c35875c7
128-
PACKAGE_HASH=ea048572fa8c13b56b58d512d9f3757823e42b74ad3273812ead895df6474d9d
127+
ROUTER_CONTRACT_HASH=2bd3b33f9d0a137a5790ebf0091d6bb5e0f47df6b7ca783989df8490c35875c7
128+
ROUTER_PACKAGE_HASH=ea048572fa8c13b56b58d512d9f3757823e42b74ad3273812ead895df6474d9d
129129
INSTALL_PAYMENT_AMOUNT=300000000000
130130
MINT_ONE_PAYMENT_AMOUNT=2000000000
131131
MINT_COPIES_PAYMENT_AMOUNT=100000000000

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/node_modules
2-
# /JsClients/ERC20/keys
3-
# /JsClients/FACTORY/keys
4-
# /JsClients/PAIR/keys
5-
# /JsClients/ROUTER/keys
2+
/Scripts/ERC20/keys
3+
/Scripts/FACTORY/keys
4+
/Scripts/PAIR/keys
5+
/Scripts/ROUTER/keys
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import { config } from "dotenv";
2+
config();
3+
import { ERC20Client} from "../src";
4+
5+
const {
6+
NODE_ADDRESS,
7+
EVENT_STREAM_ADDRESS,
8+
CHAIN_NAME
9+
} = process.env;
10+
11+
const erc20 = new ERC20Client(
12+
NODE_ADDRESS!,
13+
CHAIN_NAME!,
14+
EVENT_STREAM_ADDRESS!
15+
);
16+
17+
export const getName = async (contractHash:string) => {
18+
19+
// We don't need hash- prefix so i'm removing it
20+
await erc20.setContractHash(contractHash);
21+
22+
//name
23+
const name = await erc20.name();
24+
console.log(contractHash +` =... Contract name: ${name}`);
25+
26+
return name;
27+
28+
};
29+
30+
export const getSymbol = async (contractHash:string) => {
31+
32+
// We don't need hash- prefix so i'm removing it
33+
await erc20.setContractHash(contractHash);
34+
35+
//symbol
36+
const symbol = await erc20.symbol();
37+
console.log(contractHash +` =... Contract symbol: ${symbol}`);
38+
39+
return symbol;
40+
41+
};
42+
43+
export const getDecimals = async (contractHash:string) => {
44+
45+
// We don't need hash- prefix so i'm removing it
46+
await erc20.setContractHash(contractHash);
47+
48+
//decimal
49+
const decimal = await erc20.decimal();
50+
console.log(contractHash +" =... Contract decimal: ", decimal);
51+
52+
return decimal;
53+
54+
};
55+
56+
export const getTotalSupply = async (contractHash:string) => {
57+
58+
// We don't need hash- prefix so i'm removing it
59+
await erc20.setContractHash(contractHash);
60+
61+
//totalsupply
62+
let totalSupply = await erc20.totalSupply();
63+
console.log(contractHash +` = ... Total supply: ${totalSupply}`);
64+
65+
return totalSupply;
66+
67+
};
68+
69+
export const balanceOf = async (contractHash:string, key:string) => {
70+
71+
console.log(`... Contract Hash: ${contractHash}`);
72+
73+
// We don't need hash- prefix so i'm removing it
74+
await erc20.setContractHash(contractHash);
75+
76+
//balanceof
77+
let balance = await erc20.balanceOf(key);
78+
79+
console.log(`... Balance: ${balance}`);
80+
81+
return balance;
82+
83+
};
84+
85+
export const allowance = async (contractHash:string, ownerkey:string, spenderkey:string) => {
86+
87+
console.log(`... Contract Hash: ${contractHash}`);
88+
89+
// We don't need hash- prefix so i'm removing it
90+
await erc20.setContractHash(contractHash);
91+
92+
let allowance = await erc20.allowance(ownerkey,spenderkey);
93+
94+
console.log(`... Allowance: ${allowance}`);
95+
96+
return allowance;
97+
98+
};

JsClients/ERC20/keys/public_key.pem

Lines changed: 0 additions & 3 deletions
This file was deleted.

JsClients/ERC20/keys/public_key_hex

Lines changed: 0 additions & 1 deletion
This file was deleted.

JsClients/ERC20/keys/secret_key.pem

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)