Skip to content

Commit cf7dd56

Browse files
Fix indents
1 parent feddfb0 commit cf7dd56

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

pages/stack/interop/tutorials/message-passing.mdx

+41-41
Original file line numberDiff line numberDiff line change
@@ -155,49 +155,49 @@ For development purposes, we'll first use autorelay mode to handle message execu
155155
GREETER_B_ADDR=`forge create --rpc-url $RPC_B --private-key $PRIV_KEY Greeter --broadcast | awk '/Deployed to:/ {print $3}'`
156156
```
157157

158-
<details>
159-
<summary>Explanation</summary>
158+
<details>
159+
<summary>Explanation</summary>
160160

161-
The command that deploys the contract is:
161+
The command that deploys the contract is:
162162

163-
```sh
164-
forge create --rpc-url $RPC_B --private-key $PRIV_KEY Greeter --broadcast
165-
```
163+
```sh
164+
forge create --rpc-url $RPC_B --private-key $PRIV_KEY Greeter --broadcast
165+
```
166166

167-
The command output gives us the deployer address, the address of the new contract, and the transaction hash:
167+
The command output gives us the deployer address, the address of the new contract, and the transaction hash:
168168

169-
```
170-
Deployer: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
171-
Deployed to: 0x5FC8d32690cc91D4c39d9d3abcBD16989F875707
172-
Transaction hash: 0xf155d360ec70ee10fe0e02d99c16fa5d6dc2a0e79b005fec6cbf7925ff547dbf
173-
```
169+
```
170+
Deployer: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
171+
Deployed to: 0x5FC8d32690cc91D4c39d9d3abcBD16989F875707
172+
Transaction hash: 0xf155d360ec70ee10fe0e02d99c16fa5d6dc2a0e79b005fec6cbf7925ff547dbf
173+
```
174174

175-
The [`awk`](https://www.tutorialspoint.com/awk/index.htm) command looks for the line that has `Deployed to:` and writes the third word in that line, which is the address.
175+
The [`awk`](https://www.tutorialspoint.com/awk/index.htm) command looks for the line that has `Deployed to:` and writes the third word in that line, which is the address.
176176

177-
```sh
178-
awk '/Deployed to:/ {print $3}'
179-
```
177+
```sh
178+
awk '/Deployed to:/ {print $3}'
179+
```
180180

181-
Finally, in UNIX (including Linux and macOS) the when the command line includes backticks (\`\`\`), the shell executes the code between the backticks and puts the output, in this case the contract address, in the command.
182-
So we get.
181+
Finally, in UNIX (including Linux and macOS) the when the command line includes backticks (\`\`\`), the shell executes the code between the backticks and puts the output, in this case the contract address, in the command.
182+
So we get.
183183

184-
```sh
185-
GREETER_B_ADDR=<the address>
186-
```
187-
</details>
184+
```sh
185+
GREETER_B_ADDR=<the address>
186+
```
187+
</details>
188188

189-
<details>
190-
<summary>Sanity check</summary>
189+
<details>
190+
<summary>Sanity check</summary>
191191

192-
Run these commands to verify the contract works.
193-
The first and third commands retrieve the current greeting, while the second command updates it.
192+
Run these commands to verify the contract works.
193+
The first and third commands retrieve the current greeting, while the second command updates it.
194194

195-
```sh
196-
cast call --rpc-url $RPC_B $GREETER_B_ADDR "greet()" | cast --to-ascii
197-
cast send --private-key $PRIV_KEY --rpc-url $RPC_B $GREETER_B_ADDR "setGreeting(string)" Hello
198-
cast call --rpc-url $RPC_B $GREETER_B_ADDR "greet()" | cast --to-ascii
199-
```
200-
</details>
195+
```sh
196+
cast call --rpc-url $RPC_B $GREETER_B_ADDR "greet()" | cast --to-ascii
197+
cast send --private-key $PRIV_KEY --rpc-url $RPC_B $GREETER_B_ADDR "setGreeting(string)" Hello
198+
cast call --rpc-url $RPC_B $GREETER_B_ADDR "greet()" | cast --to-ascii
199+
```
200+
</details>
201201

202202
4. Install the Optimism Solidity libraries into the project.
203203

@@ -222,18 +222,18 @@ For development purposes, we'll first use autorelay mode to handle message execu
222222
```solidity file=<rootDir>/public/tutorials/GreetingSender.sol#L1-L28 hash=75d197d1e1da112421785c2160f6a55a
223223
```
224224

225-
<details>
226-
<summary>Explanation</summary>
225+
<details>
226+
<summary>Explanation</summary>
227227

228-
```solidity file=<rootDir>/public/tutorials/GreetingSender.sol#L21-L27 hash=6c27ebcf4916e5aa2325d30f99c65436
229-
```
228+
```solidity file=<rootDir>/public/tutorials/GreetingSender.sol#L21-L27 hash=6c27ebcf4916e5aa2325d30f99c65436
229+
```
230230

231-
This function encodes a call to `setGreeting` and sends it to a contract on another chain.
232-
`abi.encodeCall(Greeter.setGreeting, (greeting))` constructs the [calldata](https://docs.soliditylang.org/en/latest/internals/layout_in_calldata.html) by encoding the function selector and parameters.
233-
The encoded message is then passed to `messenger.sendMessage`, which forwards it to the destination contract (`greeterAddress`) on the specified chain (`greeterChainId`).
231+
This function encodes a call to `setGreeting` and sends it to a contract on another chain.
232+
`abi.encodeCall(Greeter.setGreeting, (greeting))` constructs the [calldata](https://docs.soliditylang.org/en/latest/internals/layout_in_calldata.html) by encoding the function selector and parameters.
233+
The encoded message is then passed to `messenger.sendMessage`, which forwards it to the destination contract (`greeterAddress`) on the specified chain (`greeterChainId`).
234234

235-
This ensures that `setGreeting` is executed remotely with the provided `greeting` value (as long as there is an executing message to relay it).
236-
</details>
235+
This ensures that `setGreeting` is executed remotely with the provided `greeting` value (as long as there is an executing message to relay it).
236+
</details>
237237

238238
7. Deploy `GreetingSender` to chain A.
239239

0 commit comments

Comments
 (0)