up
Upload and instantiate a smart contract
Last updated
Was this helpful?
Upload and instantiate a smart contract
Last updated
Was this helpful?
To deploy (upload and instantiate) a smart contract:
Alternatively, you can use the --use-wallet
option for a more secure signing method:
ℹ️ If you don't specify a live chain,
pop
will automatically spawn a local node for testing purposes.
Some of the options available are:
Specify the contract constructor
to use, which in this example is new()
.
Specify the argument (args
) to the constructor, which in this example is false
.
Specify the account uploading and instantiating the contract with --suri
, which in this example is the default development account of //Alice
. For other accounts, the actual secret key must be provided e.g. an 0x prefixed 64 bit hex string, or the seed phrase.
Alternatively, use the --use-wallet
option to sign transactions using a browser extension wallet. This is more secure than providing your account's private key directly in the command line.
⚠️ Use
--suri
only for development: Using--suri
should only be done with development accounts. Consider using--use-wallet
for production accounts.
You also can specify the url of your node with --url ws://your-endpoint
, by default it is using ws://localhost:9944
.
For more information about the options, check .