Skip to content

Commit

Permalink
SchemaRegistry deployed to Sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
KohliSuraj committed Jun 22, 2024
1 parent bb700f9 commit cb9236e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
2 changes: 2 additions & 0 deletions packages/nextjs/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ const deployedContracts = {
},
sepolia: {
SchemaRegistry: {
address:
"0x00293748ea7a6e2005464040b08063bbff5f1cdde3373c4bc6ebcbc7b0c1a6ff",
abi: [
{
type: "impl",
Expand Down
1 change: 0 additions & 1 deletion packages/snfoundry/contracts/src/lib.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
mod YourContract;
mod SchemaRegistry;
#[cfg(test)]
mod test {
Expand Down
69 changes: 34 additions & 35 deletions packages/snfoundry/scripts-ts/deploy-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cb9236e

Please sign in to comment.