Created
December 16, 2023 17:02
-
-
Save kaksv/b6e014dd1f81e59af0fcf41663f9f98f to your computer and use it in GitHub Desktop.
Deploying a smart contract on starknet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #[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); | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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