Skip to content

Instantly share code, notes, and snippets.

@kaksv
Created December 16, 2023 17:02
Show Gist options
  • Select an option

  • Save kaksv/b6e014dd1f81e59af0fcf41663f9f98f to your computer and use it in GitHub Desktop.

Select an option

Save kaksv/b6e014dd1f81e59af0fcf41663f9f98f to your computer and use it in GitHub Desktop.
Deploying a smart contract on starknet
#[starknet::contract]
mod hello {
#[storage]
struct Storage {
name: felt252,
}
#[constructor]
fn constructor(ref self: ContractState, name: felt252) {
self.name.write(name);
}
#[external(v0)]
fn set_name(ref self: ContractState, name: felt252) {
let previous = self.name.read();
self.name.write(name);
}
}
@kaksv
Copy link
Author

kaksv commented Dec 16, 2023

This is the sample contract I am trying to deploy on starknet. I have been succesful in declaring the contract but i have not succeeded on deploying its instance on the goerli testnet for starknet.

Please provide a complete command wiith all its attributes in order to deploy the contract on testnet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment