diff --git a/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/assets/agglayer-module.png b/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/assets/agglayer-module.png new file mode 100644 index 00000000000..de97d848d98 Binary files /dev/null and b/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/assets/agglayer-module.png differ diff --git a/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/assets/approve-function.png b/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/assets/approve-function.png new file mode 100644 index 00000000000..f602e27d96d Binary files /dev/null and b/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/assets/approve-function.png differ diff --git a/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/assets/grant-minter.png b/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/assets/grant-minter.png new file mode 100644 index 00000000000..18f4179e98d Binary files /dev/null and b/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/assets/grant-minter.png differ diff --git a/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/assets/mint-tokens.png b/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/assets/mint-tokens.png new file mode 100644 index 00000000000..d96317192fd Binary files /dev/null and b/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/assets/mint-tokens.png differ diff --git a/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/assets/restrict-transfers.png b/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/assets/restrict-transfers.png new file mode 100644 index 00000000000..6cb811f17ee Binary files /dev/null and b/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/assets/restrict-transfers.png differ diff --git a/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/page.mdx b/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/page.mdx new file mode 100644 index 00000000000..49fe427e08b --- /dev/null +++ b/apps/portal/src/app/contracts/modular-contracts/module-contracts/cross-chain/agglayer/page.mdx @@ -0,0 +1,86 @@ +import { Step, Steps, DocImage, OpenSourceCard, Callout } from "@doc"; +import RestrictTransfer from './assets/restrict-transfers.png'; +import ApproveFunction from './assets/approve-function.png'; +import AgglayerModule from './assets/agglayer-module.png'; +import GrantMinter from './assets/grant-minter.png'; +import MintTokens from './assets/mint-tokens.png'; + +# Agglayer Module Contract + +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 +interoperable smart contract for trustless and secure transfers across any chain. [Learn more about Agglayer.](https://github.com/AggLayer) + + + +## Get Started + +Learn how to add the Agglayer module to your modular contract and enable cross-chain transfers. + +### Prerequisites + +- [Deployed ERC-20 Base Contract](/contracts/modular-contracts/tutorials/deploy-erc20-core) + + + + + +On your deployed contract dashboard, navigate to the Modules section to add the Agglayer module. Paste the following parameters then select Install. +1. Publisher: `0xdd99b75f095d0c4d5112aCe938e4e6ed962fb024` +2. Module Name: `AgglayerCrossChain` +3. Module Version: `Latest` +4. Router: `0x2311BFA86Ae27FC10E1ad3f805A2F9d22Fc8a6a1` + + + +When completed, you will see your module under the installed modules section. + + + + +Next, navigate to the Explorer tab and locate grantRoles under the Write functions to grant your wallet the minter role then select Execute. +1. User: `your-wallet-address` +2. Roles: `1` +3. Native Token Value: `0` + + + +Non-admin roles are disabled by default on modular contracts and must be enabled through the contract. + + + + +Navigate back to the modules section and mint tokens to your wallet or a recipient's wallet using the mintable module. + + + + + +Navigate back to Explorer and find the Approve write function. Paste in the following parameters and select Execute. +1. Spender: `your-contract-address` +2. Amount: `your-desired-amount` + + + + +This step enables the contract to have approval to transfer user's tokens to the bridge. + + + + +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. + + + + + +Navigate back to Explorer and locate the `bridgeTokens` function. Select Execute to confirm the transaction. +1. Destination Network: `chain-to-send` +2. Call Address: `your-wallet-address` +3. Amount: `amount-of-tokens` + + + + + + + diff --git a/apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc20-core/assets/contract-metadata.png b/apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc20-core/assets/contract-metadata.png new file mode 100644 index 00000000000..90986043352 Binary files /dev/null and b/apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc20-core/assets/contract-metadata.png differ diff --git a/apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc20-core/assets/deployed-contract.png b/apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc20-core/assets/deployed-contract.png new file mode 100644 index 00000000000..c0bfe1f54aa Binary files /dev/null and b/apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc20-core/assets/deployed-contract.png differ diff --git a/apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc20-core/assets/erc-20-base.png b/apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc20-core/assets/erc-20-base.png new file mode 100644 index 00000000000..44381496c58 Binary files /dev/null and b/apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc20-core/assets/erc-20-base.png differ diff --git a/apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc20-core/assets/modular-contracts.png b/apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc20-core/assets/modular-contracts.png new file mode 100644 index 00000000000..42f4ea68698 Binary files /dev/null and b/apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc20-core/assets/modular-contracts.png differ diff --git a/apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc20-core/page.mdx b/apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc20-core/page.mdx new file mode 100644 index 00000000000..63b26bf858b --- /dev/null +++ b/apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc20-core/page.mdx @@ -0,0 +1,41 @@ +import {Steps, Step, DocImage} from "@doc"; +import ModularContracts from './assets/modular-contracts.png'; +import ERC20Base from './assets/erc-20-base.png'; +import ContractMetadata from './assets/contract-metadata.png'; +import DeployedContract from './assets/deployed-contract.png'; + +# Deploy ERC-20 Core Contract + +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. + + + +Navigate to the Explore section of your dashboard. This is where you can find and deploy various contracts. + + + + +Select the ERC-20 Core contract from the list of available contracts. This contract will serve as the base for your modular contract. + + + + + +Fill out the contract metadata and parameters to your desired preference. + + + + + +Optionally, you may add your contract to an existing project. Select a chain then select Deploy Now. + + + + +Once deployed, select View Contract to be redirected to your contract’s management dashboard. + + + + + + \ No newline at end of file diff --git a/apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc721-core/page.mdx b/apps/portal/src/app/contracts/modular-contracts/tutorials/deploy-erc721-core/page.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/apps/portal/src/app/contracts/sidebar.tsx b/apps/portal/src/app/contracts/sidebar.tsx index 825c18122fe..7d3d1b52fad 100644 --- a/apps/portal/src/app/contracts/sidebar.tsx +++ b/apps/portal/src/app/contracts/sidebar.tsx @@ -237,7 +237,6 @@ export const sidebar: SideBar = { { separator: true }, // modular contracts - { name: "Modular Contract Framework", isCollapsible: false, @@ -268,6 +267,15 @@ export const sidebar: SideBar = { }, ], }, + { + name: "Tutorials", + links: [ + { + name: "Deploy ERC-20 Core", + href: `${modularContractsSlug}/tutorials/deploy-erc20-core`, + }, + ], + }, // core contracts { name: "Core Contracts", @@ -413,6 +421,15 @@ export const sidebar: SideBar = { }, ], }, + { + name: "Cross-Chain", + links: [ + { + name: "Agglayer", + href: `${modulesContractsSlug}/cross-chain/agglayer`, + }, + ], + }, ], }, ],