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

Commit

Permalink
all code for packageHash working , contracts 1.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Hammad-Mubeen committed Apr 14, 2022
1 parent 2689ef1 commit 25b2584
Show file tree
Hide file tree
Showing 26 changed files with 203 additions and 122 deletions.
94 changes: 47 additions & 47 deletions .env
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
NODE_MODE=deployed
DATABASE_URL_LOCAL=mongodb://localhost:27017/V2-graphQL
DATABASE_URL_ONLINE=mongodb+srv://admin:[email protected]/V2-graphQL-backend-forinterface1?retryWrites=true&w=majority
DATABASE_URL_ONLINE_BACKUP=mongodb+srv://admin:[email protected]/V2-graphQL-backend-forinterface1?retryWrites=true&w=majority
DATABASE_URL_ONLINE=mongodb+srv://admin:[email protected]/V2-graphQL-backend-forinterfacelatest?retryWrites=true&w=majority
COIN_MARKET_CAP_API_KEY=35a7ebf7-894d-4b67-8d57-36a2b050cbc8

FACTORY_CONTRACT=32046b7f8ca95d736e6f3fc0daa4ef636d21fc5f79cd08b5e6e4fb57df9238b9
FACTORY_CONTRACT_PACKAGE=d2cc3ac0c9c364ec0b8e969bd09eb151f9e1b57eecddb900e85abadf2332ebef
WCSPR=b761da7d5ef67f8825c30c40df8b72feca4724eb666dba556b0e3f67778143e0
LIBRARY=8818a55ed42deda94f42ecb6e9f92a0f0f03c21ddf639175bd6eb2a018b48ee6
PAIR_CONTRACT=211b738feab8d6ee556899e121974451d12555990e4563ea8a34dea7c4ae2e5b
PAIR_CONTRACT_PACKAGE=88c13c8b221a5ebb0185c1abac91a43ce56f4b5a14ee22ed131d855d9c02f3aa
CALLEE_CONTRACT=fbfeda8b97f056f526f20c2fc2b486d9bdbfb3e46b9a164527e57c0c86e68612
TOKEN0_CONTRACT=f869f4327bf21e739644001527318fccb8c14e814afa288be156af2a32eb0f2b
TOKEN0_CONTRACT_PACKAGE=904d8b11b76b59aacfd1869b7dc1f78d876e5d6ab91c3abeb501d59a1d14c705
TOKEN1_CONTRACT=1853ea67e80caaf81a8d96ff28ce3aaf105080f0299d9b7b7c0cb36064ee1fa9
TOKEN1_CONTRACT_PACKAGE=fb5a4d8da9c112c68ffac693fece6ab3b3d1526ff97f491e398382a9fe9da6c8

WCSPR_CONTRACT=b761da7d5ef67f8825c30c40df8b72feca4724eb666dba556b0e3f67778143e0
WCSPR_CONTRACT_PACKAGE=a4c27e29288ef154be20158f4049b4f150333d96070b3727e6f4ec9ef5d3f875

WISE_CONTRACT=1853ea67e80caaf81a8d96ff28ce3aaf105080f0299d9b7b7c0cb36064ee1fa9
WISE_CONTRACT_PACKAGE=fb5a4d8da9c112c68ffac693fece6ab3b3d1526ff97f491e398382a9fe9da6c8

WETH_CONTRACT=f869f4327bf21e739644001527318fccb8c14e814afa288be156af2a32eb0f2b
WETH_CONTRACT_PACKAGE=904d8b11b76b59aacfd1869b7dc1f78d876e5d6ab91c3abeb501d59a1d14c705

WCSPR_WISE_CONTRACT=53a8121f219ad2c6420f007a2016ed320c519579112b81d505cb15715404b264
WCSPR_WISE_CONTRACT_PACKAGE=26526c30383e5c02d684ac68d7845e576a87166926f7500bdaa303cdab52aea7

WCSPR_WETH_CONTRACT=be2a69ab8576257c1ddfdac0f7b8be738146ea70a8dbf407efd2c741821b5e21
WCSPR_WETH_CONTRACT_PACKAGE=f918c159eefe2e18e3720a6cc4adf90fd37c3310c907b3736482fe843c14cccc

WETH_WISE_CONTRACT=211b738feab8d6ee556899e121974451d12555990e4563ea8a34dea7c4ae2e5b
WETH_WISE_CONTRACT_PACKAGE=88c13c8b221a5ebb0185c1abac91a43ce56f4b5a14ee22ed131d855d9c02f3aa
AWS=http://casperswaplistenerbackend-env.eba-rbumbt2m.us-east-1.elasticbeanstalk.com

FACTORY_CONTRACT=a0f8026f753c60e540ba08f02621fb9027582285d871dde0f3daa5e84462f9b9
FACTORY_CONTRACT_PACKAGE=f329330b99110d9f8589b8a94f0e5b3c4cd5e1710fb443d04472682ae9b212d0
WCSPR=238834bc76aed9e18ad0260e65d2ef751999c97c13da92dee83bd511e31e2d2d
WCSPR_PACKAGE=afcaa550ebb63266fb2752b58ecd7e8fcd78e0a75777ecd57045213a013d9813
LIBRARY=a9513934697269b8448dec4c6dbd4841387e87b9b5bbf251a259bea474f5dc12
LIBRARY_PACKAGE=75a21a01e8c8d0f789e35b00efb9979b449f9d16941bd3ad846db8163310b717
PAIR_CONTRACT=3625d9882afe51423c8cee562feb4123a3583f2e6b91a4557d2d607a030ef1a9
PAIR_CONTRACT_PACKAGE=c956ddec09b725a217ac5480fc9cef2411c73b6aaac2e6215ca7255d20f77485
CALLEE_CONTRACT=c981f2165686f3fa8ab77f89b3ac364987325e48a038f6fbdfd6bb46123f0e3c
CALLEE_PACKAGE=dec17bf68eeb83be7e96e5974981c64772a2f48e402fe95b63877bf50df7854e
TOKEN0_CONTRACT=5240db456a1a2cb63cabcdebb86a5177d0e9ceddab7a737b3bd90caeae33e80e
TOKEN0_CONTRACT_PACKAGE=bdcd8c9844cd2f98c81b3f98ce806f20c5a625f954d7b29bf70626fef060ff1f
TOKEN1_CONTRACT=9aef66efbac45daf71f92f3446422a00fd3adaaf206a1c29d80f26bc513c105d
TOKEN1_CONTRACT_PACKAGE=03e3e09b28dc4d41a4507b38073e7a1641becc0b40e79beb72733d2fb022defa

DAI_CONTRACT=1fe0d3e12e456b482f0f82a86b914d34cc4f4e51fd021316f3702906aacd0943
DAI_PACKAGE=58d6f4bfc63ab3d16685d576e4ecce3d6ab0f4bcf5c553b8c398a3c34ebc7e86

WCSPR_CONTRACT=238834bc76aed9e18ad0260e65d2ef751999c97c13da92dee83bd511e31e2d2d
WCSPR_CONTRACT_PACKAGE=afcaa550ebb63266fb2752b58ecd7e8fcd78e0a75777ecd57045213a013d9813

WISE_CONTRACT=5240db456a1a2cb63cabcdebb86a5177d0e9ceddab7a737b3bd90caeae33e80e
WISE_CONTRACT_PACKAGE=bdcd8c9844cd2f98c81b3f98ce806f20c5a625f954d7b29bf70626fef060ff1f

WETH_CONTRACT=9aef66efbac45daf71f92f3446422a00fd3adaaf206a1c29d80f26bc513c105d
WETH_CONTRACT_PACKAGE=03e3e09b28dc4d41a4507b38073e7a1641becc0b40e79beb72733d2fb022defa

WISE_WETH_CONTRACT=3625d9882afe51423c8cee562feb4123a3583f2e6b91a4557d2d607a030ef1a9
WISE_WETH_CONTRACT_PACKAGE=c956ddec09b725a217ac5480fc9cef2411c73b6aaac2e6215ca7255d20f77485

GRAPHQL=https://casper-uniswap-v2-graphql.herokuapp.com/graphql
CHAIN_NAME=casper-test
Expand All @@ -49,15 +51,15 @@ FACTORY_MASTER_KEY_PAIR_PATH=JsClients/FACTORY/keys/
PAIR_MASTER_KEY_PAIR_PATH=JsClients/PAIR/keys/
MASTER_KEY_PAIR_PATH=JsClients/ROUTER/keys/

ERC20_CONTRACT_NAME=erc20
ERC20_TOKEN_NAME=WETH
ERC20_CONTRACT_NAME=Wrapper Ether1
ERC20_TOKEN_NAME=Wrapper Ether
ERC20_TOKEN_SYMBOL=WETH
ERC20_DECIMALS=9
ERC20_TOTAL_SUPPLY=0

PAIR_CONTRACT_NAME=pair
PAIR_TOKEN_NAME=PAIR
PAIR_TOKEN_SYMBOL=pair
PAIR_CONTRACT_NAME=WISER-WrappedEther1
PAIR_TOKEN_NAME=WISE-WETH
PAIR_TOKEN_SYMBOL=WISE-WETH
PAIR_DECIMALS=9
PAIR_TOTAL_SUPPLY=0

Expand All @@ -68,7 +70,7 @@ FACTORY_INSTALL_PAYMENT_AMOUNT=150000000000
PAIR_INSTALL_PAYMENT_AMOUNT=300000000000

MINT_PAYMENT_AMOUNT=5000000000
MINT_AMOUNT=105425240000000000000
MINT_AMOUNT=100000000000000000000

BURN_PAYMENT_AMOUNT=5000000000
BURN_AMOUNT=5
Expand Down Expand Up @@ -96,15 +98,13 @@ SET_FEE_TO_PAYMENT_AMOUNT=5000000000
SET_FEE_TO_SETTER_PAYMENT_AMOUNT=5000000000
CREATE_PAIR_PAYMENT_AMOUNT=5000000000



TOKEN_NAME=uniswap-router
TOKEN_SYMBOL=DRAG
TOKEN_META=origin fire,lifetime infinite
CONTRACT_NAME=UniSwapRouter
CONTRACT_NAME=UniSwapRouter1

CONTRACT_HASH=493fc8e66c2f1049b28fa661c65a2668c4e9e9e023447349fc9145c82304a65a
PACKAGE_HASH=3de805e07efbc2cd9c5d323ab4fe5f2f0c1c5da33aec527d73de34a1fc9d3735
CONTRACT_HASH=2bd3b33f9d0a137a5790ebf0091d6bb5e0f47df6b7ca783989df8490c35875c7
PACKAGE_HASH=ea048572fa8c13b56b58d512d9f3757823e42b74ad3273812ead895df6474d9d
INSTALL_PAYMENT_AMOUNT=300000000000
MINT_ONE_PAYMENT_AMOUNT=2000000000
MINT_COPIES_PAYMENT_AMOUNT=100000000000
Expand All @@ -115,15 +115,15 @@ MINT_COPIES_COUNT=20
MINT_MANY_META_SIZE=5
MINT_MANY_META_COUNT=5

TO = 8b217a09296d5ce360847a7d20f623476157c5f022333c4e988a464035cadd80
TO = df245f53215c2e747c2db7a99d6dd4e20f6b30194565ab3ccc4d83bb73ac89f9
DEADLINE = 1739598100811
# add_liquidity

TOKEN_A = f869f4327bf21e739644001527318fccb8c14e814afa288be156af2a32eb0f2b
TOKEN_B = 1853ea67e80caaf81a8d96ff28ce3aaf105080f0299d9b7b7c0cb36064ee1fa9
TOKEN_A = bdcd8c9844cd2f98c81b3f98ce806f20c5a625f954d7b29bf70626fef060ff1f
TOKEN_B = 03e3e09b28dc4d41a4507b38073e7a1641becc0b40e79beb72733d2fb022defa

AMOUNT_A_DESIRED = 1000000000
AMOUNT_B_DESIRED = 105425240000000
AMOUNT_A_DESIRED = 10000000000
AMOUNT_B_DESIRED = 1000000000
AMOUNT_A_MIN = 100000
AMOUNT_B_MIN = 100000

Expand Down
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-----
MCowBQYDK2VwAyEAWltK4eH/EP1hDH1jI9PDMUOKge73vNOqR4P28mT6OqQ=
MCowBQYDK2VwAyEA1kpz9asuezN1wGCk2kH+2Vopt7dIq7TRrYPxYJUuUpw=
-----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 @@
015a5b4ae1e1ff10fd610c7d6323d3c331438a81eef7bcd3aa4783f6f264fa3aa4
01d64a73f5ab2e7b3375c060a4da41fed95a29b7b748abb4d1ad83f160952e529c
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-----
MC4CAQAwBQYDK2VwBCIEIPoXHj1Ln9iB/pbHoB1DGVc0f11S422kDfAH5XD67EUa
MC4CAQAwBQYDK2VwBCIEIJ213TqwJjUU6Uv9cHuK3fGyxRnGANjLygW2FaoUdrNI
-----END PRIVATE KEY-----
2 changes: 1 addition & 1 deletion JsClients/ERC20/test/installed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ const test = async () => {
};


// test();
//test();

export const getName = async (contractHash:string) => {

Expand Down
Binary file modified JsClients/ERC20/wasm/erc20-token.wasm
Binary file not shown.
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-----
MCowBQYDK2VwAyEAtWGFIJ0gO1SctlvGB+BubT+DMZLEdOnO66/hVBUpspI=
MCowBQYDK2VwAyEA1kpz9asuezN1wGCk2kH+2Vopt7dIq7TRrYPxYJUuUpw=
-----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 @@
01b56185209d203b549cb65bc607e06e6d3f833192c474e9ceebafe1541529b292
01d64a73f5ab2e7b3375c060a4da41fed95a29b7b748abb4d1ad83f160952e529c
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-----
MC4CAQAwBQYDK2VwBCIEIAfQJZLsmOUr6dRXZIrSLw2xDjcokM3vNuArKhbM+eES
MC4CAQAwBQYDK2VwBCIEIJ213TqwJjUU6Uv9cHuK3fGyxRnGANjLygW2FaoUdrNI
-----END PRIVATE KEY-----
22 changes: 11 additions & 11 deletions JsClients/FACTORY/test/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ const test = async () => {
EVENT_STREAM_ADDRESS!
);

// const installDeployHash = await factory.install(
// KEYS,
// FACTORY_CONTRACT_NAME!,
// KEYS.publicKey!,
// // KEYS.publicKey,
// FACTORY_INSTALL_PAYMENT_AMOUNT!,
// FACTORY_WASM_PATH!
// );
const installDeployHash = await factory.install(
KEYS,
FACTORY_CONTRACT_NAME!,
KEYS.publicKey!,
// KEYS.publicKey,
FACTORY_INSTALL_PAYMENT_AMOUNT!,
FACTORY_WASM_PATH!
);

// console.log(`... Contract installation deployHash: ${installDeployHash}`);
console.log(`... Contract installation deployHash: ${installDeployHash}`);

// await getDeploy(NODE_ADDRESS!, installDeployHash);
await getDeploy(NODE_ADDRESS!, installDeployHash);

// console.log(`... Contract installed successfully.`);
console.log(`... Contract installed successfully.`);

let accountInfo = await utils.getAccountInfo(NODE_ADDRESS!, KEYS.publicKey);

Expand Down
Binary file modified JsClients/FACTORY/wasm/factory.wasm
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-----
MCowBQYDK2VwAyEAkiDYds03hKjSdfJng8iSp3bx4V/aEbDAYJt6Ny+cz9Q=
MCowBQYDK2VwAyEA1kpz9asuezN1wGCk2kH+2Vopt7dIq7TRrYPxYJUuUpw=
-----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 @@
019220d876cd3784a8d275f26783c892a776f1e15fda11b0c0609b7a372f9ccfd4
01d64a73f5ab2e7b3375c060a4da41fed95a29b7b748abb4d1ad83f160952e529c
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-----
MC4CAQAwBQYDK2VwBCIEINn5R/VQW1MUs0NC5XmmN7SBAgZIx9v4ModUIPb6Pc64
MC4CAQAwBQYDK2VwBCIEIJ213TqwJjUU6Uv9cHuK3fGyxRnGANjLygW2FaoUdrNI
-----END PRIVATE KEY-----
2 changes: 1 addition & 1 deletion JsClients/PAIR/src/pair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class PAIRClient {
decimals: CLValueBuilder.u8(decimals),
initial_supply: CLValueBuilder.u256(totalSupply),
factory_hash: CLValueBuilder.key(_factoryContractHash),
callee_contract_hash: CLValueBuilder.key(_calleeContractHash),
callee_package_hash: CLValueBuilder.key(_calleeContractHash),
});

const deployHash = await installWasmFile({
Expand Down
16 changes: 8 additions & 8 deletions JsClients/PAIR/test/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const {
PAIR_TOKEN_SYMBOL,
PAIR_DECIMALS,
PAIR_TOTAL_SUPPLY,
FACTORY_CONTRACT,
CALLEE_CONTRACT,
FACTORY_CONTRACT_PACKAGE,
CALLEE_PACKAGE,
PAIR_CONTRACT_NAME,
} = process.env;

Expand All @@ -43,8 +43,8 @@ const test = async () => {
PAIR_TOKEN_SYMBOL!,
PAIR_DECIMALS!,
PAIR_TOTAL_SUPPLY!,
FACTORY_CONTRACT!,
CALLEE_CONTRACT!,
FACTORY_CONTRACT_PACKAGE!,
CALLEE_PACKAGE!,
// KEYS.publicKey,
// KEYS.publicKey,
PAIR_INSTALL_PAYMENT_AMOUNT!,
Expand Down Expand Up @@ -78,8 +78,8 @@ const test = async () => {
};

export const makedeploypaircontract = async (
FACTORY_CONTRACT: string,
CALLEE_CONTRACT: string,
FACTORY_CONTRACT_PACKAGE: string,
CALLEE_PACKAGE: string,
signerkey:string,
) => {

Expand All @@ -90,8 +90,8 @@ export const makedeploypaircontract = async (
PAIR_TOKEN_SYMBOL!,
PAIR_DECIMALS!,
PAIR_TOTAL_SUPPLY!,
FACTORY_CONTRACT,
CALLEE_CONTRACT,
FACTORY_CONTRACT_PACKAGE!,
CALLEE_PACKAGE!,
PAIR_INSTALL_PAYMENT_AMOUNT!,
PAIR_WASM_PATH!
);
Expand Down
Binary file modified JsClients/PAIR/wasm/pair-token.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion JsClients/ROUTER/keys/public_key.pem
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAkiDYds03hKjSdfJng8iSp3bx4V/aEbDAYJt6Ny+cz9Q=
MCowBQYDK2VwAyEA1kpz9asuezN1wGCk2kH+2Vopt7dIq7TRrYPxYJUuUpw=
-----END PUBLIC KEY-----
2 changes: 1 addition & 1 deletion JsClients/ROUTER/keys/public_key_hex
Original file line number Diff line number Diff line change
@@ -1 +1 @@
019220d876cd3784a8d275f26783c892a776f1e15fda11b0c0609b7a372f9ccfd4
01d64a73f5ab2e7b3375c060a4da41fed95a29b7b748abb4d1ad83f160952e529c
2 changes: 1 addition & 1 deletion JsClients/ROUTER/keys/secret_key.pem
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEINn5R/VQW1MUs0NC5XmmN7SBAgZIx9v4ModUIPb6Pc64
MC4CAQAwBQYDK2VwBCIEIJ213TqwJjUU6Uv9cHuK3fGyxRnGANjLygW2FaoUdrNI
-----END PRIVATE KEY-----
20 changes: 10 additions & 10 deletions JsClients/ROUTER/test/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ const {
MASTER_KEY_PAIR_PATH,
TOKEN_NAME,
TOKEN_SYMBOL,
FACTORY_CONTRACT,
WCSPR,
LIBRARY,
FACTORY_CONTRACT_PACKAGE,
WCSPR_PACKAGE,
LIBRARY_PACKAGE,
CONTRACT_NAME,
CONTRACT_HASH,
INSTALL_PAYMENT_AMOUNT,
Expand Down Expand Up @@ -59,17 +59,17 @@ const test = async () => {

const installDeployHash = await uniswapRouter.install(
KEYS,
FACTORY_CONTRACT!,
WCSPR!,
LIBRARY!,
'UniSwapRouter',
FACTORY_CONTRACT_PACKAGE!,
WCSPR_PACKAGE!,
LIBRARY_PACKAGE!,
'UniSwapRouter1',
INSTALL_PAYMENT_AMOUNT!,
WASM_PATH!
);

console.log("Passed Parameters: \nfactory: \t", FACTORY_CONTRACT,
"\nwcspr: \t", WCSPR,
"\nlibrary: \t", LIBRARY,
console.log("Passed Parameters: \nfactory: \t", FACTORY_CONTRACT_PACKAGE,
"\nwcspr: \t", WCSPR_PACKAGE,
"\nlibrary: \t", LIBRARY_PACKAGE,
"\ncontract_name: \t", CONTRACT_NAME, "\n");

console.log(`... Contract installation deployHash: ${installDeployHash}\n`);
Expand Down
3 changes: 2 additions & 1 deletion JsClients/ROUTER/test/installed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const {
CONTRACT_HASH,
INSTALL_PAYMENT_AMOUNT,
PAIR_CONTRACT,
PAIR_CONTRACT_PACKAGE,
TO,
DEADLINE,

Expand Down Expand Up @@ -275,7 +276,7 @@ const add_liquidity_test = async (uniswapRouter: UniswapRouterClient) => {
AMOUNT_B_MIN!,
TO!,
DEADLINE!,
PAIR_CONTRACT!,
PAIR_CONTRACT_PACKAGE!,
ADD_LIQUIDITY_PAYMENT_AMOUNT!
);
};
Expand Down
Binary file modified JsClients/ROUTER/wasm/uniswap-v2-router.wasm
Binary file not shown.
Loading

0 comments on commit 25b2584

Please sign in to comment.