Skip to content

Commit

Permalink
Merge branch 'Quantum3-Labs:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
0xquantum3labs authored Apr 16, 2024
2 parents b20201d + bf3aea7 commit f9b8a70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
13 changes: 2 additions & 11 deletions packages/snfoundry/scripts_js/deploy.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
const fs = require("fs");
const path = require("path");
const networks = require("./helpers/networks");
const argv = require("yargs/yargs")(process.argv.slice(2)).argv;

const { TransactionStatus } = require("starknet");
const { hash } = require("starknet");

const { CallData } = require("starknet-dev");
const deployContract = require("./deploy_contract");
const { deployContract } = require("./deploy_contract");

const deployScript = async () => {
// const {
Expand All @@ -27,7 +18,7 @@ const deployScript = async () => {
owner:
"0x4b3f4ba8c00a02b66142a4b1dd41a4dfab4f92650922a3280977b0f03c75ee1",
}, // last account in devnet accounts
"Challenge0",
"Challenge0"
);

// await deployContract(
Expand Down
15 changes: 10 additions & 5 deletions packages/snfoundry/scripts_js/deploy_contract.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
const fs = require("fs");
const path = require("path");
const networks = require("./helpers/networks");
const {hash, CallData, TransactionStatus} = require("starknet");
const argv = require("yargs/yargs")(process.argv.slice(2)).argv;
const { hash, TransactionStatus } = require("starknet");
const { CallData } = require("starknet-dev");

const networkName = argv.network;

const {provider, deployer} = networks[networkName];
const { provider, deployer } = networks[networkName];
const deployContract = async (
constructorArgs,
contractName,
Expand Down Expand Up @@ -48,7 +51,7 @@ const deployContract = async (
let totalFee = 0n;

try {
const {suggestedMaxFee: estimatedFeeDeclare} =
const { suggestedMaxFee: estimatedFeeDeclare } =
await deployer.estimateDeclareFee(
{
contract: compiledContractSierra,
Expand All @@ -58,7 +61,7 @@ const deployContract = async (
);
totalFee = estimatedFeeDeclare * 2n;
} catch (e) {
const {suggestedMaxFee: estimatedFeeDeploy} =
const { suggestedMaxFee: estimatedFeeDeploy } =
await deployer.estimateDeployFee({
classHash: precomputedClassHash,
constructorCalldata,
Expand Down Expand Up @@ -118,4 +121,6 @@ const deployContract = async (
};
};

export default deployContract
module.exports = {
deployContract,
};

0 comments on commit f9b8a70

Please sign in to comment.