Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update code snippets #29

Merged
merged 1 commit into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions src/data/code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export const menu: {
title: "Deploy ExampleReceiverDapp",
description:
"Deploy a receiver contract on the target chain to receive messages. (for example purposes only)",
code: `// SPDX-License-Identifier: MIT
code: `
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "https://github.com/msgport/msgport/blob/main/src/user/Application.sol";
Expand Down Expand Up @@ -82,7 +83,8 @@ export const menu: {
{
title: "Encode Calldata",
description: "Build the remote call data as the message payload.",
code: `import { ethers } from 'ethers';
code: `
import { ethers } from 'ethers';

const privateKey = process.env.PRIVATE_KEY;
const providerUrl = <Your RPC provider URL>;
Expand Down Expand Up @@ -116,7 +118,8 @@ export const menu: {
{
title: "Get Fee And Params From Msgport API",
description: "Estimate fee and get adaptation params from Msgport API.",
code: `import axios from 'axios';
code: `
import axios from 'axios';

async function getFeeParams() {
const requestBody = {
Expand All @@ -139,7 +142,9 @@ export const menu: {
title: "Sending Message",
description:
"Sending massage via Msgport to dapp on target chain using encoded message data and params provided in previous steps.",
code: `pragma solidity ^0.8.17;
code: `
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "https://github.com/msgport/msgport/blob/main/src/interfaces/IMessagePort.sol";

Expand All @@ -163,7 +168,9 @@ export const menu: {
{
title: "XAccount",
description: "",
code: `pragma solidity ^0.8.0;
code: `
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract ExampleXAccount {
// XAccountFactory address
Expand Down Expand Up @@ -206,8 +213,8 @@ export const menu: {
{
title: "Order Clearing",
description: "",
code: `// SPDX-License-Identifier: MIT

code: `
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

contract MsglineMessager is Application, AccessController {
Expand Down
Loading