You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. In the Remix editor, paste in the following **simple smart contract** code.
76
69
77
70
```solidity
@@ -95,14 +88,18 @@ Remix is a browser-based Solidity development environment. Using MetaMask and Re
95
88
```
96
89
97
90
The **simple contract** declares a state variable named **balance**. There are two functions defined. The **add** function adds a number to **balance**. The **get** function returns the value of **balance**.
98
-
99
-
1. To compile the contract, select the **Compile > Start to compile**. If successful, a green box with contract name is displayed.
91
+
1. To compile the contract, first select the Solidity compiler pane then select the **Compile simple.sol**.
100
92
101
93

102
94
103
-
1. To execute the contract, select the **Run** tab. Select the **simple** contract then **Deploy**.
95
+
1. Select the **Deploy & Run** pane then set the **Environment** to **Injected Web3** to connect through MetaMask to your blockchain member.
1. A MetaMask notification is displayed alerting you of insufficient funds to perform the transaction.
108
105
@@ -121,13 +118,13 @@ Remix is a browser-based Solidity development environment. Using MetaMask and Re
121
118
122
119
There are two actions **add** and **get** that map to the functions defined in the contract.
123
120
124
-
1. To perform an **add** transaction on the blockchain, enter a number to add then select **add**.
121
+
1. To perform an **add** transaction on the blockchain, enter a number to add then select **add**. You may get a gas estimation failure message from Remix. You are sending the transaction to a private blockchain that does not require gas. Select **Send Transaction** to force the transaction.
125
122
1. Similar to when you deployed the contract, a MetaMask notification is displayed alerting you of insufficient funds to perform the transaction.
126
123
127
124
Since this is a private network in a consortium, we can set gas price to zero.
128
125
129
126
1. Select **Gas Fee > Edit > Advanced**, set the **Gas Price** to 0, and select **Save**.
130
-
1. Select **Confirm** to perform the transaction on the blockchain.
127
+
1. Select **Confirm** to send the transaction to the blockchain.
131
128
1. Select **get** action. This is a call to query node data. A transaction isn't needed.
132
129
1. In the debug pane of Remix, you can see details about the transactions on the blockchain.
0 commit comments