Skip to content

Commit 2d5ff74

Browse files
committed
[Portal] added agglayer and erc-20 guide (#6492)
CORE-0000 <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on enhancing the documentation for deploying ERC-20 and Agglayer module contracts, providing step-by-step guides and visual aids for users. ### Detailed summary - Added a new section for "Tutorials" in the `sidebar` with a link to "Deploy ERC-20 Core." - Introduced a tutorial on deploying an ERC-20 Core contract, including steps and images. - Created a guide for adding the Agglayer module to modular contracts, detailing prerequisites and steps. - Included images for each step in both tutorials for better understanding. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent cbc3bf1 commit 2d5ff74

File tree

13 files changed

+145
-1
lines changed

13 files changed

+145
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
import { Step, Steps, DocImage, OpenSourceCard, Callout } from "@doc";
2+
import RestrictTransfer from './assets/restrict-transfers.png';
3+
import ApproveFunction from './assets/approve-function.png';
4+
import AgglayerModule from './assets/agglayer-module.png';
5+
import GrantMinter from './assets/grant-minter.png';
6+
import MintTokens from './assets/mint-tokens.png';
7+
8+
# Agglayer Module Contract
9+
10+
We created a module which leverages Agglayer, an interoperability protocol. This module may be added to any ERC-20 modular contract to construct a cross-chain
11+
interoperable smart contract for trustless and secure transfers across any chain. [Learn more about Agglayer.](https://github.com/AggLayer)
12+
13+
<OpenSourceCard title="Agglayer Module Contract" href="https://thirdweb.com/thirdweb.eth/AgglayerCrossChain" />
14+
15+
## Get Started
16+
17+
Learn how to add the Agglayer module to your modular contract and enable cross-chain transfers.
18+
19+
### Prerequisites
20+
21+
- [Deployed ERC-20 Base Contract](/contracts/modular-contracts/tutorials/deploy-erc20-core)
22+
23+
<Steps>
24+
25+
<Step title="Add Agglayer module">
26+
27+
On your deployed contract dashboard, navigate to the Modules section to add the Agglayer module. Paste the following parameters then select Install.
28+
1. Publisher: `0xdd99b75f095d0c4d5112aCe938e4e6ed962fb024`
29+
2. Module Name: `AgglayerCrossChain`
30+
3. Module Version: `Latest`
31+
4. Router: `0x2311BFA86Ae27FC10E1ad3f805A2F9d22Fc8a6a1`
32+
33+
<DocImage src={AgglayerModule} alt="Agglayer Module" />
34+
35+
When completed, you will see your module under the installed modules section.
36+
37+
</Step>
38+
39+
<Step title="Grant minter role">
40+
Next, navigate to the Explorer tab and locate grantRoles under the Write functions to grant your wallet the minter role then select Execute.
41+
1. User: `your-wallet-address`
42+
2. Roles: `1`
43+
3. Native Token Value: `0`
44+
<DocImage src={GrantMinter} alt="Grant Minter Role" />
45+
46+
<Callout variant="info" title="Modular Contract Roles">
47+
Non-admin roles are disabled by default on modular contracts and must be enabled through the contract.
48+
</Callout>
49+
</Step>
50+
51+
<Step title="Mint tokens">
52+
Navigate back to the modules section and mint tokens to your wallet or a recipient's wallet using the mintable module.
53+
54+
<DocImage src={MintTokens} alt="Mint Tokens" />
55+
</Step>
56+
57+
<Step title="Approve transfers on contract">
58+
Navigate back to Explorer and find the Approve write function. Paste in the following parameters and select Execute.
59+
1. Spender: `your-contract-address`
60+
2. Amount: `your-desired-amount`
61+
62+
<DocImage src={ApproveFunction} alt="Approve Function" />
63+
64+
<Callout variant="info" title="Modular Contract Approvals">
65+
This step enables the contract to have approval to transfer user's tokens to the bridge.
66+
</Callout>
67+
</Step>
68+
69+
<Step title="Approve transfers on module">
70+
Navigate back to the modules view and disable Restrict Transfers on the TransferableERC20 module to allow any token holders to transfer tokens. Select Update to confirm.
71+
72+
<DocImage src={RestrictTransfer} alt="Restrict Transfer" />
73+
</Step>
74+
75+
<Step title="Bridge tokens">
76+
Navigate back to Explorer and locate the `bridgeTokens` function. Select Execute to confirm the transaction.
77+
1. Destination Network: `chain-to-send`
78+
2. Call Address: `your-wallet-address`
79+
3. Amount: `amount-of-tokens`
80+
81+
82+
83+
</Step>
84+
85+
</Steps>
86+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import {Steps, Step, DocImage} from "@doc";
2+
import ModularContracts from './assets/modular-contracts.png';
3+
import ERC20Base from './assets/erc-20-base.png';
4+
import ContractMetadata from './assets/contract-metadata.png';
5+
import DeployedContract from './assets/deployed-contract.png';
6+
7+
# Deploy ERC-20 Core Contract
8+
9+
Learn how to deploy an ERC-20 Core Contract. This contract serves as the foundation for creating a modular contract with additional features and functionalities.
10+
11+
<Steps>
12+
<Step title="Navigate to Explore">
13+
Navigate to the Explore section of your dashboard. This is where you can find and deploy various contracts.
14+
<DocImage src={ModularContracts} alt="Modular Contracts" />
15+
</Step>
16+
17+
<Step title="Select ERC-20 Core">
18+
Select the ERC-20 Core contract from the list of available contracts. This contract will serve as the base for your modular contract.
19+
20+
<DocImage src={ERC20Base} alt="ERC-20 Base" />
21+
</Step>
22+
23+
<Step title="Contract Metadata">
24+
Fill out the contract metadata and parameters to your desired preference.
25+
26+
<DocImage src={ContractMetadata} alt="Contract Metadata" />
27+
</Step>
28+
29+
<Step title="Deploy Contract">
30+
Optionally, you may add your contract to an existing project. Select a chain then select Deploy Now.
31+
32+
</Step>
33+
34+
<Step title="Manage Contract">
35+
Once deployed, select View Contract to be redirected to your contract’s management dashboard.
36+
37+
<DocImage src={DeployedContract} alt="Deployed Contract" />
38+
39+
</Step>
40+
41+
</Steps>

apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc721-core/page.mdx

Whitespace-only changes.

apps/portal/src/app/contracts/sidebar.tsx

+18-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ export const sidebar: SideBar = {
237237

238238
{ separator: true },
239239
// modular contracts
240-
241240
{
242241
name: "Modular Contract Framework",
243242
isCollapsible: false,
@@ -268,6 +267,15 @@ export const sidebar: SideBar = {
268267
},
269268
],
270269
},
270+
{
271+
name: "Tutorials",
272+
links: [
273+
{
274+
name: "Deploy ERC-20 Core",
275+
href: `${modularContractsSlug}/tutorials/deploy-erc20-core`,
276+
},
277+
],
278+
},
271279
// core contracts
272280
{
273281
name: "Core Contracts",
@@ -413,6 +421,15 @@ export const sidebar: SideBar = {
413421
},
414422
],
415423
},
424+
{
425+
name: "Cross-Chain",
426+
links: [
427+
{
428+
name: "Agglayer",
429+
href: `${modulesContractsSlug}/cross-chain/agglayer`,
430+
},
431+
],
432+
},
416433
],
417434
},
418435
],

0 commit comments

Comments
 (0)