Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
kobzistiy committed Nov 3, 2022
1 parent 6d4dbf1 commit 315e5aa
Show file tree
Hide file tree
Showing 7 changed files with 10,250 additions and 5,341 deletions.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"router": "0:d81e560d90942794b081f30618c7d689e319d84232b3662be28c5fc4e6db1e63"
"router": "0:319cff1d2a3669d599291d270cfb475b8de644e88c418a93ad03cad09519a557"
}
136 changes: 68 additions & 68 deletions contracts/build/Cell.code
Original file line number Diff line number Diff line change
Expand Up @@ -1964,6 +1964,41 @@ CALLREF {
}
THROW 60

.globl console_with_obj_log_41304fac
.type console_with_obj_log_41304fac, @function
CALL $console_with_obj_log_41304fac_macro$

.macro console_with_obj_log_41304fac_macro
.loc ../node_modules/locklift/src/console.sol, 10
DUP
PUSHREFSLICE {
.blob xc600fffffffffffffffffffffffffffffffffffffffffffffffffe2468acf13579bc0000000000000000000000000903f4294_
}
NEWC
STSLICE
STREF
ENDC
PUSHINT 0
SENDRAWMSG
.loc ../node_modules/locklift/src/console.sol, 0

.globl console_no_obj_log_41304fac
.type console_no_obj_log_41304fac, @function
CALL $console_no_obj_log_41304fac_macro$

.macro console_no_obj_log_41304fac_macro
.loc ../node_modules/locklift/src/console.sol, 10
PUSHREFSLICE {
.blob xc600fffffffffffffffffffffffffffffffffffffffffffffffffe2468acf13579bc0000000000000000000000000903f4294_
}
NEWC
STSLICE
STREF
ENDC
PUSHINT 0
SENDRAWMSG
.loc ../node_modules/locklift/src/console.sol, 0

.globl HexUtils_with_obj_isNeighborCoord_8b5853ae
.type HexUtils_with_obj_isNeighborCoord_8b5853ae, @function
CALL $HexUtils_with_obj_isNeighborCoord_8b5853ae_macro$
Expand All @@ -1989,44 +2024,6 @@ CALLREF {
EQINT 1
.loc ../contracts/utils/HexUtils.sol, 0

.globl HexUtils_with_obj_isCorrectCoord_3e33fe95
.type HexUtils_with_obj_isCorrectCoord_3e33fe95, @function
CALL $HexUtils_with_obj_isCorrectCoord_3e33fe95_macro$

.macro HexUtils_with_obj_isCorrectCoord_3e33fe95_macro
.loc ../contracts/utils/HexUtils.sol, 44
DUP
FIRST
OVER
SECOND
ADD
FITS 64
OVER
THIRD
ADD
FITS 64
EQINT 0
.loc ../contracts/utils/HexUtils.sol, 0

.globl HexUtils_no_obj_isCorrectCoord_3e33fe95
.type HexUtils_no_obj_isCorrectCoord_3e33fe95, @function
CALL $HexUtils_no_obj_isCorrectCoord_3e33fe95_macro$

.macro HexUtils_no_obj_isCorrectCoord_3e33fe95_macro
.loc ../contracts/utils/HexUtils.sol, 44
DUP
FIRST
OVER
SECOND
ADD
FITS 64
SWAP
THIRD
ADD
FITS 64
EQINT 0
.loc ../contracts/utils/HexUtils.sol, 0

.globl HexUtils_with_obj_cube_distance_527ce867
.type HexUtils_with_obj_cube_distance_527ce867, @function
CALL $HexUtils_with_obj_cube_distance_527ce867_macro$
Expand Down Expand Up @@ -2095,40 +2092,43 @@ MAX
MAX
.loc ../contracts/utils/HexUtils.sol, 0

.globl console_with_obj_log_41304fac
.type console_with_obj_log_41304fac, @function
CALL $console_with_obj_log_41304fac_macro$
.globl HexUtils_with_obj_isCorrectCoord_3e33fe95
.type HexUtils_with_obj_isCorrectCoord_3e33fe95, @function
CALL $HexUtils_with_obj_isCorrectCoord_3e33fe95_macro$

.macro console_with_obj_log_41304fac_macro
.loc ../node_modules/locklift/src/console.sol, 10
.macro HexUtils_with_obj_isCorrectCoord_3e33fe95_macro
.loc ../contracts/utils/HexUtils.sol, 44
DUP
PUSHREFSLICE {
.blob xc600fffffffffffffffffffffffffffffffffffffffffffffffffe2468acf13579bc0000000000000000000000000903f4294_
}
NEWC
STSLICE
STREF
ENDC
PUSHINT 0
SENDRAWMSG
.loc ../node_modules/locklift/src/console.sol, 0
FIRST
OVER
SECOND
ADD
FITS 64
OVER
THIRD
ADD
FITS 64
EQINT 0
.loc ../contracts/utils/HexUtils.sol, 0

.globl console_no_obj_log_41304fac
.type console_no_obj_log_41304fac, @function
CALL $console_no_obj_log_41304fac_macro$
.globl HexUtils_no_obj_isCorrectCoord_3e33fe95
.type HexUtils_no_obj_isCorrectCoord_3e33fe95, @function
CALL $HexUtils_no_obj_isCorrectCoord_3e33fe95_macro$

.macro console_no_obj_log_41304fac_macro
.loc ../node_modules/locklift/src/console.sol, 10
PUSHREFSLICE {
.blob xc600fffffffffffffffffffffffffffffffffffffffffffffffffe2468acf13579bc0000000000000000000000000903f4294_
}
NEWC
STSLICE
STREF
ENDC
PUSHINT 0
SENDRAWMSG
.loc ../node_modules/locklift/src/console.sol, 0
.macro HexUtils_no_obj_isCorrectCoord_3e33fe95_macro
.loc ../contracts/utils/HexUtils.sol, 44
DUP
FIRST
OVER
SECOND
ADD
FITS 64
SWAP
THIRD
ADD
FITS 64
EQINT 0
.loc ../contracts/utils/HexUtils.sol, 0

.macro inline_array_line_25_column_35_ast_id_48
PUSHINT 3000
Expand Down
76 changes: 38 additions & 38 deletions contracts/build/Router.code
Original file line number Diff line number Diff line change
Expand Up @@ -1280,44 +1280,6 @@ CALLREF {
}
THROW 60

.globl HexUtils_with_obj_isCorrectCoord_3e33fe95
.type HexUtils_with_obj_isCorrectCoord_3e33fe95, @function
CALL $HexUtils_with_obj_isCorrectCoord_3e33fe95_macro$

.macro HexUtils_with_obj_isCorrectCoord_3e33fe95_macro
.loc ../contracts/utils/HexUtils.sol, 44
DUP
FIRST
OVER
SECOND
ADD
FITS 64
OVER
THIRD
ADD
FITS 64
EQINT 0
.loc ../contracts/utils/HexUtils.sol, 0

.globl HexUtils_no_obj_isCorrectCoord_3e33fe95
.type HexUtils_no_obj_isCorrectCoord_3e33fe95, @function
CALL $HexUtils_no_obj_isCorrectCoord_3e33fe95_macro$

.macro HexUtils_no_obj_isCorrectCoord_3e33fe95_macro
.loc ../contracts/utils/HexUtils.sol, 44
DUP
FIRST
OVER
SECOND
ADD
FITS 64
SWAP
THIRD
ADD
FITS 64
EQINT 0
.loc ../contracts/utils/HexUtils.sol, 0

.globl HexUtils_with_obj_isNeighborCoord_8b5853ae
.type HexUtils_with_obj_isNeighborCoord_8b5853ae, @function
CALL $HexUtils_with_obj_isNeighborCoord_8b5853ae_macro$
Expand Down Expand Up @@ -1411,6 +1373,44 @@ MAX
MAX
.loc ../contracts/utils/HexUtils.sol, 0

.globl HexUtils_with_obj_isCorrectCoord_3e33fe95
.type HexUtils_with_obj_isCorrectCoord_3e33fe95, @function
CALL $HexUtils_with_obj_isCorrectCoord_3e33fe95_macro$

.macro HexUtils_with_obj_isCorrectCoord_3e33fe95_macro
.loc ../contracts/utils/HexUtils.sol, 44
DUP
FIRST
OVER
SECOND
ADD
FITS 64
OVER
THIRD
ADD
FITS 64
EQINT 0
.loc ../contracts/utils/HexUtils.sol, 0

.globl HexUtils_no_obj_isCorrectCoord_3e33fe95
.type HexUtils_no_obj_isCorrectCoord_3e33fe95, @function
CALL $HexUtils_no_obj_isCorrectCoord_3e33fe95_macro$

.macro HexUtils_no_obj_isCorrectCoord_3e33fe95_macro
.loc ../contracts/utils/HexUtils.sol, 44
DUP
FIRST
OVER
SECOND
ADD
FITS 64
SWAP
THIRD
ADD
FITS 64
EQINT 0
.loc ../contracts/utils/HexUtils.sol, 0

.globl console_with_obj_log_41304fac
.type console_with_obj_log_41304fac, @function
CALL $console_with_obj_log_41304fac_macro$
Expand Down
29 changes: 29 additions & 0 deletions contracts/locklift.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,35 @@ const config: LockliftConfig = {
amount: 20,
},
},
devnet: {
// Specify connection settings for https://github.com/broxus/everscale-standalone-client/
connection: {
id: 1,
group: "dev",
type: "graphql",
data: {
endpoints: ['https://devnet-sandbox.evercloud.dev/graphql'],
latencyDetectionInterval: 1000,
local: false,
},
},
// This giver is default Wallet
giver: {
// Check if you need provide custom giver
giverFactory: (ever, keyPair, address) => new GiverWallet(ever, keyPair, address),
// address: "0:08beb8d49e0312a5ef466d81cc37fe94e8f4e575fce884236f1227235c38f933",
// key: "08c88a120e81897fa3c08a34aa6366294cb1225a359a741e154b7c18787f8f31",
address: "0:643d0fb053652ae024c970a20302ca8d5d06e4ee6fa4d3848a1d2031d810f9d0",
phrase: "wet marine air vague urban history fish virtual mandate future charge busy",
accountId: 0
},
keys: {
// Use everdev to generate your phrase
// !!! Never commit it in your repos !!!
phrase: "action inject penalty envelope rabbit element slim tornado dinner pizza off blood",
amount: 20,
},
},
},
mocha: {
timeout: 2000000,
Expand Down
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"scripts": {
"test": "npx locklift test --network local",
"brox": "npx locklift run --network mainnet --disable-build --script scripts/brox.ts"
"dev": "npx locklift test --network devnet",
},
"author": "",
"license": "ISC",
Expand Down
68 changes: 38 additions & 30 deletions contracts/test/1-game-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,43 +33,51 @@ describe(`Test Router contract (BASE)`, async function() {
signer = (await locklift.keystore.getSigner("0"));
console.log('signer publicKey', signer)
console.log('_randomNonce', _randomNonce)
const { account: _owner } = await locklift.factory.accounts.addNewAccount({
// const { account: _owner } = await locklift.factory.accounts.addNewAccount({
// publicKey: signer.publicKey,
// type: WalletTypes.WalletV3,
// value: toNano(100),
// });
const _owner = await locklift.factory.accounts.addExistingAccount({
publicKey: signer.publicKey,
type: WalletTypes.WalletV3,
value: toNano(100),
});
owner = _owner;
console.log(`Owner: ${owner.publicKey.toString(16)}`);
console.log(`Owner address: ${owner.address.toString()}`);
console.log(`Owner pubkey: ${owner.publicKey.toString(16)}`);
});

it('Deploy router', async () => {

const Cell = await locklift.factory.getContractArtifacts("Cell");
let { contract: _router } = await locklift.factory.deployContract({
contract: "Router",
publicKey: signer.publicKey,
initParams: {
_nonce: _randomNonce,
},
constructorParams: {
codeCell: Cell.code,
ownerPubkey: `0x${signer.publicKey}`,
},
value: toNano(2),
});
router = _router;
console.log(`Router deployed at: ${router.address.toString()}`);

let details
details = await router.methods.getDetails().call();
console.log('getDetails router', details);
expect(details.nonce)
.to.be.equal(_randomNonce, 'Wrong nonce');
expect(BigNumber(details.owner).toString(16).padStart("0", 64))
.to.be.equal(signer.publicKey, 'Wrong public Key');
let conf = Config.readConf();
conf.router = router.address.toString()
Config.saveConf(conf)
try {
const Cell = await locklift.factory.getContractArtifacts("Cell");
let { contract: _router } = await locklift.factory.deployContract({
contract: "Router",
publicKey: signer.publicKey,
initParams: {
_nonce: _randomNonce,
},
constructorParams: {
codeCell: Cell.code,
ownerPubkey: `0x${signer.publicKey}`,
},
value: toNano(2),
});
router = _router;
console.log(`Router deployed at: ${router.address.toString()}`);

let details
details = await router.methods.getDetails().call();
console.log('getDetails router', details);
expect(details.nonce)
.to.be.equal(_randomNonce, 'Wrong nonce');
expect(BigNumber(details.owner).toString(16).padStart("0", 64))
.to.be.equal(signer.publicKey, 'Wrong public Key');
let conf = Config.readConf();
conf.router = router.address.toString()
Config.saveConf(conf)
} catch(err) {
console.log('error', err);
}
});

});
Expand Down
Loading

0 comments on commit 315e5aa

Please sign in to comment.