Contract Deployment

Note: This feature is still under construction due to time limit in hackathon but here's the overall idea of this feature that we will be implementing in future.

Declaring & Deploy on Starknet -> Could write bot for this.

Run this command to declare your contract using the default Starknet Sequencer’s Gateway:

starkli declare ./target/dev/ownable_starknet_ownable.contract_class.json

To deploy a smart contract, you’ll need to instantiate it on Starknet’s testnet. This process involves executing a command that requires two main components:

  1. The class hash of your smart contract.

  2. Any constructor arguments that the contract expects.

The command would look like this:

starkli deploy \
    <CLASS_HASH> \
    <CONSTRUCTOR_INPUTS>

Deploying on EVM Chain -> Another Bash

require("@nomicfoundation/hardhat-toolbox");

// Ensure your configuration variables are set before executing the script
const { vars } = require("hardhat/config");

// Go to https://infura.io, sign up, create a new API key
// in its dashboard, and add it to the configuration variables
const INFURA_API_KEY = vars.get("INFURA_API_KEY");

// Add your Sepolia account private key to the configuration variables
// To export your private key from Coinbase Wallet, go to
// Settings > Developer Settings > Show private key
// To export your private key from Metamask, open Metamask and
// go to Account Details > Export Private Key
// Beware: NEVER put real Ether into testing accounts
const SEPOLIA_PRIVATE_KEY = vars.get("SEPOLIA_PRIVATE_KEY");

module.exports = {
  solidity: "0.8.24",
  networks: {
    sepolia: {
      url: `https://sepolia.infura.io/v3/${INFURA_API_KEY}`,
      accounts: [SEPOLIA_PRIVATE_KEY],
    },
  },
};

Last updated