Skip to content

Commit c68480f

Browse files
authored
feat: update deploying a contract section (#127)
## Summary by Sourcery Documentation: - Clarify how to deploy smart contracts using the Task Manager and the terminal.
1 parent 91d32be commit c68480f

20 files changed

+65
-23
lines changed

docs/using-platform/15_dev-tools/0_code-studio/1_smart-contract-sets/4_deploying-a-contract.md

Lines changed: 65 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ description: Deploying a smart contract
55

66
# Deploying a smart contract
77

8-
Deploying a smart contract in SettleMint won't be much different from doing so in your own environment.
9-
10-
There are two main ways to deploy smart contracts in SettleMint: you can either run the commands manually in your terminal or use the Task Manager.
8+
You can deploy your contracts to a network in the platform or a hardhat network running locally in the IDE.
119

1210
The typical folder structure of SettleMint's smart contract set will include:
1311

@@ -22,35 +20,79 @@ The typical folder structure of SettleMint's smart contract set will include:
2220
- **`hardhat.config`**: Hardhat configuration file.
2321
- **`subgraphs`**: Contains the indexing logic for your subgraphs, specific to your smart contract.
2422

25-
## Deploy with Task Manager
23+
The smart contract sets include all the commands you need to compile and deploy your contracts. They are available as tasks in the Task Manager. Follow these steps to access the Task Manager:
24+
25+
**Step 1**: Open the IDE
26+
27+
![Open IDE](../../../../../static/img/deploy-scs/open-ide.png)
28+
29+
**Step 2**: Click on the `Task Manager` button
30+
31+
![Task Manager](../../../../../static/img/deploy-scs/task-manager.png)
32+
33+
## Compile
34+
35+
You need to compile your contracts before you can deploy them. SettleMint's smart contract sets include both Hardhat and Foundry. You can compile using your preferred framework.
36+
37+
### Hardhat
38+
39+
To compile your contracts using Hardhat, you can run the `Hardhat - Build` task
40+
41+
![Hardhat compile task manager](../../../../../static/img/deploy-scs/hardhat-build.png)
42+
43+
### Foundry
44+
45+
To compile your contracts using Foundry, you can run the `Foundry - Build` task
46+
47+
![Foundry compile task manager](../../../../../static/img/deploy-scs/foundry-build.png)
48+
49+
## Deploy to a network in the platform
50+
51+
You can deploy your contracts to a network in the same application as the smart contract set by running the `Hardhat - Deploy to platform network` task
52+
53+
:::note
54+
55+
Ensure you have the following:
56+
57+
- A running node in the network
58+
- A private key activated on the node
59+
60+
:::
61+
62+
### Hardhat
63+
64+
**Step 1**: Log in to the platform by running the `SettleMint - Login` task
65+
66+
![SettleMint login](../../../../../static/img/deploy-scs/settlemint-login.png)
67+
68+
**Step 2**: Run the `Hardhat - Deploy to platform network` task
69+
70+
![Hardhat deploy remote task manager](../../../../../static/img/deploy-scs/hardhat-deploy-remote.png)
71+
72+
**Step 3**: Select the node you want to deploy to
73+
74+
![Hardhat deploy remote select node](../../../../../static/img/deploy-scs/hardhat-deploy-remote-select-node.png)
2675

27-
Follow these steps to deploy a contract using the Task Manager:
76+
**Step 4**: Select the private key you want to use for the deployment
2877

29-
1. Click `View in Fullscreen Mode` for a better user experience :)
30-
![Fresh IDE](../../../../../static/img/deploy-scs/full-screen-mode.png)
78+
![Hardhat deploy remote select private key](../../../../../static/img/deploy-scs/hardhat-deploy-remote-select-private-key.png)
3179

32-
2. Navigate to the `Task Manager`.
33-
![Task Manager](../../../../../static/img/deploy-scs/nav-task-mg.png)
80+
**Step 5**: Confirm the deployment
3481

35-
3. Click `Foundry - Build` or `Hardhat - Build` to compile the Smart Contract.
36-
![Press Build](../../../../../static/img/deploy-scs/task-mg-build.png)
82+
![Hardhat deploy remote success](../../../../../static/img/deploy-scs/hardhat-deploy-remote-success.png)
3783

38-
4. Then run `Hardhat - Deploy to local network` to deploy locally or `Hardhat - Deploy to platform network` to deploy to your connected network.
39-
![Press Deploy](../../../../../static/img/deploy-scs/task-mg-deploy.png)
84+
## Deploy to a local network
4085

41-
Great job! Your contract has been successfully deployed.
86+
### Hardhat
4287

43-
## Deploy with the Terminal
88+
**Step 1**: Start the local hardhat network by running the `Hardhat - Start local network` task
4489

45-
Follow these steps to deploy a contract using the terminal:
90+
![Hardhat start local network](../../../../../static/img/deploy-scs/hardhat-start-local-network.png)
4691

47-
1. Open the terminal.
48-
![Open Terminal](../../../../../static/img/deploy-scs/open-terminal.png)
92+
**Step 2**: Then, run the `Hardhat - Deploy to local network` task. Ensure you don't stop the previous task, because the hardhat network needs to be running for the contract to be deployed on it.
4993

50-
2. Run the command `forge build` or `Hardhat compile` to compile the smart contracts.
51-
![Build Terminal](../../../../../static/img/deploy-scs/terminal-build.png)
94+
![Hardhat deploy local network](../../../../../static/img/deploy-scs/hardhat-deploy-local-network.png)
5295

53-
3. Then run `npx hardhat ignition deploy IGNITION_MODULE_PATH` or forge create --rpc-url YOUR_RPC_URL --private-key YOUR_PRIVATE_KEY --constructor-args ARG1 ARG2` to deploy to your connected network.
54-
![Deploy Terminal](../../../../../static/img/deploy-scs/terminal-deploy.png)
96+
Success! The contract has been deployed to the local network.
5597

56-
Well done! You've successfully deployed your contract.
98+
![Hardhat deploy local network success](../../../../../static/img/deploy-scs/hardhat-deploy-local-success.png)
472 KB
Loading
-653 KB
Binary file not shown.
458 KB
Loading
768 KB
Loading
538 KB
Loading
471 KB
Loading
484 KB
Loading
570 KB
Loading
422 KB
Loading

0 commit comments

Comments
 (0)