diff --git a/packages/nextjs/contracts/deployedContracts.ts b/packages/nextjs/contracts/deployedContracts.ts index 64f8ceb..f820415 100644 --- a/packages/nextjs/contracts/deployedContracts.ts +++ b/packages/nextjs/contracts/deployedContracts.ts @@ -125,6 +125,8 @@ const deployedContracts = { }, sepolia: { SchemaRegistry: { + address: + "0x00293748ea7a6e2005464040b08063bbff5f1cdde3373c4bc6ebcbc7b0c1a6ff", abi: [ { type: "impl", diff --git a/packages/snfoundry/contracts/src/lib.cairo b/packages/snfoundry/contracts/src/lib.cairo index eb58d8f..0fd8dab 100644 --- a/packages/snfoundry/contracts/src/lib.cairo +++ b/packages/snfoundry/contracts/src/lib.cairo @@ -1,4 +1,3 @@ -mod YourContract; mod SchemaRegistry; #[cfg(test)] mod test { diff --git a/packages/snfoundry/scripts-ts/deploy-contract.ts b/packages/snfoundry/scripts-ts/deploy-contract.ts index 1ba3ea3..46edb7f 100644 --- a/packages/snfoundry/scripts-ts/deploy-contract.ts +++ b/packages/snfoundry/scripts-ts/deploy-contract.ts @@ -98,44 +98,43 @@ const deployContract = async ( try { // CHANGED THIS SCRIPT HERE - const declare = await deployer.declare({ - contract: compiledContractSierra, - casm: compiledContractCasm, - }); - await provider.waitForTransaction(declare.transaction_hash); - console.log("Declared contract txn", declare.transaction_hash); - console.log("Declared contract class hash", declare.class_hash); - - const deploy = await deployer.deployContract({ - classHash: precomputedClassHash, - salt: stark.randomAddress(), - }); + // const declare = await deployer.declare({ + // contract: compiledContractSierra, + // casm: compiledContractCasm, + // }); + // await provider.waitForTransaction(declare.transaction_hash); + // console.log("Declared contract txn", declare.transaction_hash); + // console.log("Declared contract class hash", declare.class_hash); + + // const deploy = await deployer.deployContract({ + // classHash: precomputedClassHash, + // salt: stark.randomAddress(), + // }); - await provider.waitForTransaction(deploy.transaction_hash); - console.log("Deployed contract txn", deploy.transaction_hash); - console.log("Deployed contract address", deploy.contract_address); - console.log("Deployed contract deployer", deploy.deployer); - - contractAddress = deploy.contract_address; + // await provider.waitForTransaction(deploy.transaction_hash); + // console.log("Deployed contract txn", deploy.transaction_hash); + // console.log("Deployed contract address", deploy.contract_address); + // console.log("Deployed contract deployer", deploy.deployer); + // contractAddress = deploy.contract_address; // ORIGINAL SCRIPT - // const tryDeclareAndDeploy = await deployer.declareAndDeploy( - // { - // contract: compiledContractSierra, - // casm: compiledContractCasm, - // constructorCalldata, - // }, - // { - // maxFee: totalFee, - // } - // ); - // if (!tryDeclareAndDeploy.deploy.contract_address) { - // throw new Error( - // "Failed to deploy contract, try setting up a manual fee on deployContract, set maxFee to 0.001 ETH in WEI and increase it if needed." - // ); - // } - // contractAddress = - // "0x" + tryDeclareAndDeploy.deploy.address.slice(2).padStart(64, "0"); + const tryDeclareAndDeploy = await deployer.declareAndDeploy( + { + contract: compiledContractSierra, + casm: compiledContractCasm, + constructorCalldata, + }, + { + maxFee: totalFee, + } + ); + if (!tryDeclareAndDeploy.deploy.contract_address) { + throw new Error( + "Failed to deploy contract, try setting up a manual fee on deployContract, set maxFee to 0.001 ETH in WEI and increase it if needed." + ); + } + contractAddress = + "0x" + tryDeclareAndDeploy.deploy.address.slice(2).padStart(64, "0"); } catch (e) { console.log("catch block of declareAndDeploy"); console.log("Error", e);