diff --git a/404.html b/404.html index 0e39a8c92..a714d15cf 100644 --- a/404.html +++ b/404.html @@ -4,7 +4,7 @@ Lisk Documentation - + diff --git a/assets/js/90210d68.69bc9bfa.js b/assets/js/90210d68.02cbb358.js similarity index 91% rename from assets/js/90210d68.69bc9bfa.js rename to assets/js/90210d68.02cbb358.js index a93e5f674..f0298f928 100644 --- a/assets/js/90210d68.69bc9bfa.js +++ b/assets/js/90210d68.02cbb358.js @@ -1 +1 @@ -"use strict";(self.webpackChunklisk_docs=self.webpackChunklisk_docs||[]).push([[240],{7681:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>h,frontMatter:()=>a,metadata:()=>s,toc:()=>l});var o=n(5893),r=n(1151);const a={title:"How to deploy a smart contract (Hardhat)",slug:"/building-on-lisk/deploying-a-smart-contract",description:"A guide on deploying a smart contract on the Lisk test network using Hardhat. Includes instructions for setting up the environment, compiling, and deploying the smart contract.",keywords:["Hardhat","smart contract","ERC-721","Lisk","Lisk test network","Lisk testnet","Node.js","Solidity","smart contract deployment","deploy a smart contract","deploying smart contracts","build on lisk","write smart contract","smart contract development"]},i="How to deploy a smart contract (Hardhat)",s={id:"building-on-lisk/deploying-a-smart-contract",title:"How to deploy a smart contract (Hardhat)",description:"A guide on deploying a smart contract on the Lisk test network using Hardhat. Includes instructions for setting up the environment, compiling, and deploying the smart contract.",source:"@site/docs/building-on-lisk/deploying-a-smart-contract.md",sourceDirName:"building-on-lisk",slug:"/building-on-lisk/deploying-a-smart-contract",permalink:"/lisk-documentation/building-on-lisk/deploying-a-smart-contract",draft:!1,unlisted:!1,editUrl:"https://github.com/LiskHQ/lisk-documentation/tree/main/docs/building-on-lisk/deploying-a-smart-contract.md",tags:[],version:"current",frontMatter:{title:"How to deploy a smart contract (Hardhat)",slug:"/building-on-lisk/deploying-a-smart-contract",description:"A guide on deploying a smart contract on the Lisk test network using Hardhat. Includes instructions for setting up the environment, compiling, and deploying the smart contract.",keywords:["Hardhat","smart contract","ERC-721","Lisk","Lisk test network","Lisk testnet","Node.js","Solidity","smart contract deployment","deploy a smart contract","deploying smart contracts","build on lisk","write smart contract","smart contract development"]},sidebar:"documentationSidebar",previous:{title:"Connecting to a wallet",permalink:"/lisk-documentation/connecting-to-a-wallet"}},c={},l=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Node v18+",id:"node-v18",level:3},{value:"Wallet funds",id:"wallet-funds",level:3},{value:"Creating a project",id:"creating-a-project",level:2},{value:"Configuring Hardhat with Lisk",id:"configuring-hardhat-with-lisk",level:2},{value:"Creating the contract",id:"creating-the-contract",level:2},{value:"Compiling the smart contract",id:"compiling-the-smart-contract",level:2},{value:"Deploying the smart contract",id:"deploying-the-smart-contract",level:2},{value:"Verifying the Smart Contract",id:"verifying-the-smart-contract",level:2},{value:"Interacting with the Smart Contract",id:"interacting-with-the-smart-contract",level:2}];function d(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.h1,{id:"how-to-deploy-a-smart-contract-hardhat",children:"How to deploy a smart contract (Hardhat)"}),"\n",(0,o.jsx)(t.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,o.jsx)(t.h3,{id:"node-v18",children:"Node v18+"}),"\n",(0,o.jsx)(t.p,{children:"This guide requires you have Node version 18+ installed."}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:["Download ",(0,o.jsx)(t.a,{href:"https://nodejs.org/en/download/",children:"Node v18+"})]}),"\n"]}),"\n",(0,o.jsxs)(t.p,{children:["If you are using ",(0,o.jsx)(t.code,{children:"nvm"})," to manage your node versions, you can just run ",(0,o.jsx)(t.code,{children:"nvm install 18"}),"."]}),"\n",(0,o.jsx)(t.h3,{id:"wallet-funds",children:"Wallet funds"}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"Deploying contracts"})," to the blockchain requires a ",(0,o.jsx)(t.strong,{children:"gas fee"}),".\nTherefore, you will need to fund your wallet with ETH to cover those gas fees."]}),"\n",(0,o.jsx)(t.p,{children:"For this guide, you will be deploying a contract to the Lisk Sepolia Testnet."}),"\n",(0,o.jsxs)(t.p,{children:["You can deposit the required tokens by using the ",(0,o.jsx)(t.a,{href:"https://sepolia-bridge.lisk.com/bridge/lisk-sepolia-testnet",children:"Lisk Bridge"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["In case your wallet doesn't hold enough ",(0,o.jsx)(t.code,{children:"SepoliaETH"}),", use one of the available faucets for the Ethereum Sepolia Testnet, like ",(0,o.jsx)(t.a,{href:"https://sepoliafaucet.com/",children:"https://sepoliafaucet.com"})," to receive free Testnet ETH."]}),"\n",(0,o.jsx)(t.h2,{id:"creating-a-project",children:"Creating a project"}),"\n",(0,o.jsx)(t.p,{children:"Before you can begin deploying smart contracts to Lisk, you need to set up your development environment by creating a Node.js project."}),"\n",(0,o.jsx)(t.p,{children:"To create a new Node.js project, run:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npm init --y\n"})}),"\n",(0,o.jsx)(t.p,{children:"Next, you will need to install Hardhat and create a new Hardhat project."}),"\n",(0,o.jsx)(t.p,{children:"To install Hardhat, run:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npm install --save-dev hardhat\n"})}),"\n",(0,o.jsx)(t.p,{children:"To create a new Hardhat project, run:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npx hardhat\n"})}),"\n",(0,o.jsxs)(t.p,{children:["Select ",(0,o.jsx)(t.code,{children:"Create a TypeScript project"})," then press ",(0,o.jsx)(t.em,{children:"Enter"})," to confirm the project root."]}),"\n",(0,o.jsxs)(t.p,{children:["Select ",(0,o.jsx)(t.code,{children:"y"})," for both adding a ",(0,o.jsx)(t.code,{children:".gitignore"})," and loading the sample project.\nOptionally, you can decide to share crash reports and usage data with HardHat."]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"\u2714 What do you want to do? \xb7 Create a TypeScript project\n\u2714 Hardhat project root: \xb7 /Users/mona/git/hardhat-test\n\u2714 Do you want to add a .gitignore? (Y/n) \xb7 y\n\u2714 Help us improve Hardhat with anonymous crash reports & basic usage data? (Y/n) \xb7 y\n\u2714 Do you want to install this sample project's dependencies with npm (@nomicfoundation/hardhat-toolbox)? (Y/n) \xb7 y\n"})}),"\n",(0,o.jsx)(t.p,{children:"It will take a moment for the project setup process to complete."}),"\n",(0,o.jsx)(t.h2,{id:"configuring-hardhat-with-lisk",children:"Configuring Hardhat with Lisk"}),"\n",(0,o.jsx)(t.p,{children:"In order to deploy smart contracts to the Lisk network, you will need to configure your Hardhat project and add the Lisk network."}),"\n",(0,o.jsxs)(t.p,{children:["This example uses ",(0,o.jsx)(t.a,{href:"https://www.npmjs.com/package/dotenv",children:"dotenv"})," to load the ",(0,o.jsx)(t.code,{children:"WALLET_KEY"})," environment variable from a ",(0,o.jsx)(t.code,{children:".env"})," file to ",(0,o.jsx)(t.code,{children:"process.env.WALLET_KEY"}),".\nYou should use a similar method to avoid hardcoding your private keys within your source code."]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npm install --save-dev dotenv\n"})}),"\n",(0,o.jsxs)(t.p,{children:["Once you have ",(0,o.jsx)(t.code,{children:"dotenv"})," installed, create a ",(0,o.jsx)(t.code,{children:".env"})," file with the following content:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"WALLET_KEY=\n"})}),"\n",(0,o.jsxs)(t.p,{children:["Substite ",(0,o.jsx)(t.code,{children:""})," with the private key for your wallet."]}),"\n",(0,o.jsx)(t.admonition,{type:"caution",children:(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.code,{children:"WALLET_KEY"})," is the private key of the wallet to use when deploying a contract.\nFollow the instructions of your wallet on how to get your private key.\nE.g. for ",(0,o.jsx)(t.strong,{children:"MetaMask"}),", please follow ",(0,o.jsx)(t.a,{href:"https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key",children:"these instructions"}),".\n",(0,o.jsx)(t.strong,{children:"It is critical that you do NOT commit this to a public repo"})]})}),"\n",(0,o.jsxs)(t.p,{children:["To configure Hardhat to use Lisk, add Lisk as a network to your project's ",(0,o.jsx)(t.code,{children:"hardhat.config.ts"})," file:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-ts",metastring:'title="hardhat.config.ts"',children:"import { HardhatUserConfig } from \"hardhat/config\";\nimport \"@nomicfoundation/hardhat-toolbox\";\n\nrequire('dotenv').config();\n\nconst config: HardhatUserConfig = {\n solidity: \"0.8.23\",\n networks: {\n // for testnet\n 'lisk-sepolia': {\n url: 'https://rpc.sepolia-api.lisk.com',\n accounts: [process.env.WALLET_KEY as string],\n gasPrice: 1000000000,\n },\n },\n};\n\nexport default config;\n"})}),"\n",(0,o.jsx)(t.h2,{id:"creating-the-contract",children:"Creating the contract"}),"\n",(0,o.jsxs)(t.p,{children:["For ease and security, we\u2019ll use the ",(0,o.jsx)(t.code,{children:"ERC721"})," interface provided by the ",(0,o.jsx)(t.a,{href:"https://docs.openzeppelin.com/contracts/5.x/",children:"OpenZeppelin Contracts library"})," to create an NFT smart contract.\nWith OpenZeppelin, we don\u2019t need to write the whole ERC-721 interface. Instead, we can import the library contract and use its functions."]}),"\n",(0,o.jsx)(t.p,{children:"To add the OpenZeppelin Contracts library to your project, run:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npm install --save @openzeppelin/contracts\n"})}),"\n",(0,o.jsxs)(t.p,{children:["In your project, delete the ",(0,o.jsx)(t.code,{children:"contracts/Lock.sol"})," contract that was generated with the project.\n(You can also delete the ",(0,o.jsx)(t.code,{children:"test/Lock.ts"})," test file, but you should add your own tests ASAP!)."]}),"\n",(0,o.jsxs)(t.p,{children:["Add the code below to a new file called ",(0,o.jsx)(t.code,{children:"contracts/NFT.sol"}),"."]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-sol",metastring:'title="contracts/NFT.sol"',children:'// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport "@openzeppelin/contracts/token/ERC721/ERC721.sol";\n\ncontract NFT is ERC721 {\n uint256 public currentTokenId;\n\n constructor() ERC721("NFT Name", "NFT") {}\n\n function mint(address recipient) public payable returns (uint256) {\n uint256 newItemId = ++currentTokenId;\n _safeMint(recipient, newItemId);\n return newItemId;\n }\n}\n'})}),"\n",(0,o.jsx)(t.h2,{id:"compiling-the-smart-contract",children:"Compiling the smart contract"}),"\n",(0,o.jsx)(t.p,{children:"To compile the contract using Hardhat, simply run:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npx hardhat compile\n"})}),"\n",(0,o.jsxs)(t.p,{children:["After successful compilation, you should see a new folder ",(0,o.jsx)(t.code,{children:"artifacts/"}),", which contains the ",(0,o.jsx)(t.a,{href:"https://hardhat.org/hardhat-runner/docs/advanced/artifacts",children:"compilation artifacts"}),"."]}),"\n",(0,o.jsx)(t.h2,{id:"deploying-the-smart-contract",children:"Deploying the smart contract"}),"\n",(0,o.jsx)(t.p,{children:"Once your contract has been successfully compiled, you can deploy the contract to the Lisk Sepolia test network."}),"\n",(0,o.jsxs)(t.p,{children:["To deploy the contract to the Lisk Sepolia test network, you'll need to modify the ",(0,o.jsx)(t.code,{children:"scripts/deploy.ts"})," in your project:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-ts",metastring:'title="scripts/deploy.ts"',children:"import { ethers } from 'hardhat';\n\nasync function main() {\n const nft = await ethers.deployContract('NFT');\n\n await nft.waitForDeployment();\n\n console.log('NFT Contract Deployed at ' + nft.target);\n}\n\n// We recommend this pattern to be able to use async/await everywhere\n// and properly handle errors.\nmain().catch((error) => {\n console.error(error);\n process.exitCode = 1;\n});\n"})}),"\n",(0,o.jsxs)(t.p,{children:["You'll also need Testnet ETH in your wallet.\nSee the ",(0,o.jsx)(t.a,{href:"#prerequisites",children:"Prerequisites"})," if you haven't done that yet.\nOtherwise, the deployment attempt will fail."]}),"\n",(0,o.jsx)(t.p,{children:"Finally, run:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npx hardhat run scripts/deploy.ts --network lisk-sepolia\n"})}),"\n",(0,o.jsx)(t.p,{children:"The contract will be deployed on the Lisk Sepolia Testnet.\nYou can view the deployment status and contract by using a block explorer and searching for the address returned by your deploy script."}),"\n",(0,o.jsx)(t.p,{children:"If you're deploying a new or modified contract, you'll need to verify it first."}),"\n",(0,o.jsx)(t.h2,{id:"verifying-the-smart-contract",children:"Verifying the Smart Contract"}),"\n",(0,o.jsx)(t.p,{children:"If you want to interact with your contract on the block explorer, you, or someone, needs to verify it first.\nThe above contract has already been verified, so you should be able to view your version on a block explorer already.\nFor the remainder of this guide, we'll walk through how to verify your contract on Lisk Sepolia testnet."}),"\n",(0,o.jsxs)(t.p,{children:["In ",(0,o.jsx)(t.code,{children:"hardhat.config.ts"}),", configure Lisk Sepolia as a custom network.\nAdd the following to your ",(0,o.jsx)(t.code,{children:"HardhatUserConfig"}),":"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-ts",metastring:'title="hardhat.config.ts"',children:'// Hardhat expects etherscan here, even if you\'re using Blockscout.\netherscan: {\n apiKey: {\n "lisk-sepolia": ""\n },\n customChains: [\n {\n network: "lisk-sepolia",\n chainId: 4202,\n urls: {\n apiURL: "https://lisk-sepolia.blockscout.com/api",\n browserURL: "https://lisk-sepolia.blockscout.com/"\n }\n }\n ]\n },\n'})}),"\n",(0,o.jsx)(t.p,{children:"Now, you can verify your contract.\nGrab the deployed address and run:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npx hardhat verify --network lisk-sepolia \n"})}),"\n",(0,o.jsx)(t.p,{children:"You should see an output similar to:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-text",children:"Successfully submitted source code for contract\ncontracts/NFT.sol:NFT at 0xC10710ac55C98f9AACdc9cD0A506411FBe0af71D\nfor verification on the block explorer. Waiting for verification result...\n\nSuccessfully verified contract NFT on the block explorer.\nhttps://lisk-sepolia.blockscout.com/address/0xC10710ac55C98f9AACdc9cD0A506411FBe0af71D#code\n"})}),"\n",(0,o.jsxs)(t.admonition,{type:"info",children:[(0,o.jsx)(t.p,{children:"You can't re-verify a contract identical to one that has already been verified.\nIf you attempt to do so, such as verifying the above contract, you'll get an error similar to:"}),(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-text",children:"Error in plugin @nomiclabs/hardhat-etherscan: The API responded with an unexpected message.\nContract verification may have succeeded and should be checked manually.\nMessage: Already Verified\n"})})]}),"\n",(0,o.jsxs)(t.p,{children:["View your contract on BlockScout, by following the ",(0,o.jsx)(t.a,{href:"https://lisk-sepolia.blockscout.com/address/0xC10710ac55C98f9AACdc9cD0A506411FBe0af71D#code",children:"link"})," displayed in the output message, to confirm that the contract is verified."]}),"\n",(0,o.jsx)(t.h2,{id:"interacting-with-the-smart-contract",children:"Interacting with the Smart Contract"}),"\n",(0,o.jsxs)(t.p,{children:["After ",(0,o.jsx)(t.a,{href:"#verifying-the-smart-contract",children:"the contract is verified"}),", you can use the ",(0,o.jsx)(t.code,{children:"Read Contract"})," and ",(0,o.jsx)(t.code,{children:"Write Contract"})," tabs to interact with the ",(0,o.jsx)(t.a,{href:"https://lisk-sepolia.blockscout.com/address/0xC10710ac55C98f9AACdc9cD0A506411FBe0af71D#code",children:"deployed contract"})," via BlockScout.\nYou'll need to connect your wallet first, by clicking the ",(0,o.jsx)(t.code,{children:"Connect Wallet"})," button."]}),"\n",(0,o.jsx)(t.hr,{})]})}function h(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>i});var o=n(7294);const r={},a=o.createContext(r);function i(e){const t=o.useContext(a);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),o.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklisk_docs=self.webpackChunklisk_docs||[]).push([[240],{7681:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>h,frontMatter:()=>a,metadata:()=>s,toc:()=>l});var o=n(5893),r=n(1151);const a={title:"How to deploy a smart contract (Hardhat)",slug:"/building-on-lisk/deploying-a-smart-contract",description:"A guide on deploying a smart contract on the Lisk test network using Hardhat. Includes instructions for setting up the environment, compiling, and deploying the smart contract.",keywords:["Hardhat","smart contract","ERC-721","Lisk","Lisk test network","Lisk testnet","Node.js","Solidity","smart contract deployment","deploy a smart contract","deploying smart contracts","build on lisk","write smart contract","smart contract development"]},i="How to deploy a smart contract (Hardhat)",s={id:"building-on-lisk/deploying-a-smart-contract",title:"How to deploy a smart contract (Hardhat)",description:"A guide on deploying a smart contract on the Lisk test network using Hardhat. Includes instructions for setting up the environment, compiling, and deploying the smart contract.",source:"@site/docs/building-on-lisk/deploying-a-smart-contract.md",sourceDirName:"building-on-lisk",slug:"/building-on-lisk/deploying-a-smart-contract",permalink:"/lisk-documentation/building-on-lisk/deploying-a-smart-contract",draft:!1,unlisted:!1,editUrl:"https://github.com/LiskHQ/lisk-documentation/tree/main/docs/building-on-lisk/deploying-a-smart-contract.md",tags:[],version:"current",frontMatter:{title:"How to deploy a smart contract (Hardhat)",slug:"/building-on-lisk/deploying-a-smart-contract",description:"A guide on deploying a smart contract on the Lisk test network using Hardhat. Includes instructions for setting up the environment, compiling, and deploying the smart contract.",keywords:["Hardhat","smart contract","ERC-721","Lisk","Lisk test network","Lisk testnet","Node.js","Solidity","smart contract deployment","deploy a smart contract","deploying smart contracts","build on lisk","write smart contract","smart contract development"]},sidebar:"documentationSidebar",previous:{title:"Connecting to a wallet",permalink:"/lisk-documentation/connecting-to-a-wallet"}},c={},l=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Node v18+",id:"node-v18",level:3},{value:"Wallet funds",id:"wallet-funds",level:3},{value:"Creating a project",id:"creating-a-project",level:2},{value:"Configuring Hardhat with Lisk",id:"configuring-hardhat-with-lisk",level:2},{value:"Creating the contract",id:"creating-the-contract",level:2},{value:"Compiling the smart contract",id:"compiling-the-smart-contract",level:2},{value:"Deploying the smart contract",id:"deploying-the-smart-contract",level:2},{value:"Verifying the Smart Contract",id:"verifying-the-smart-contract",level:2},{value:"Interacting with the Smart Contract",id:"interacting-with-the-smart-contract",level:2}];function d(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.h1,{id:"how-to-deploy-a-smart-contract-hardhat",children:"How to deploy a smart contract (Hardhat)"}),"\n",(0,o.jsx)(t.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,o.jsx)(t.h3,{id:"node-v18",children:"Node v18+"}),"\n",(0,o.jsx)(t.p,{children:"This guide requires you have Node version 18+ installed."}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:["Download ",(0,o.jsx)(t.a,{href:"https://nodejs.org/en/download/",children:"Node v18+"})]}),"\n"]}),"\n",(0,o.jsxs)(t.p,{children:["If you are using ",(0,o.jsx)(t.code,{children:"nvm"})," to manage your node versions, you can just run ",(0,o.jsx)(t.code,{children:"nvm install 18"}),"."]}),"\n",(0,o.jsx)(t.h3,{id:"wallet-funds",children:"Wallet funds"}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"Deploying contracts"})," to the blockchain requires a ",(0,o.jsx)(t.strong,{children:"gas fee"}),".\nTherefore, you will need to fund your wallet with ETH to cover those gas fees."]}),"\n",(0,o.jsx)(t.p,{children:"For this guide, you will be deploying a contract to the Lisk Sepolia Testnet."}),"\n",(0,o.jsxs)(t.p,{children:["You can deposit the required tokens by using the ",(0,o.jsx)(t.a,{href:"https://sepolia-bridge.lisk.com/bridge/lisk-sepolia-testnet",children:"Lisk Bridge"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["In case your wallet doesn't hold enough ",(0,o.jsx)(t.code,{children:"SepoliaETH"}),", use one of the available faucets for the Ethereum Sepolia Testnet, like ",(0,o.jsx)(t.a,{href:"https://sepoliafaucet.com/",children:"https://sepoliafaucet.com"})," to receive free Testnet ETH."]}),"\n",(0,o.jsx)(t.h2,{id:"creating-a-project",children:"Creating a project"}),"\n",(0,o.jsx)(t.p,{children:"Before you can begin deploying smart contracts to Lisk, you need to set up your development environment by creating a Node.js project."}),"\n",(0,o.jsx)(t.p,{children:"To create a new Node.js project, run:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npm init --y\n"})}),"\n",(0,o.jsx)(t.p,{children:"Next, you will need to install Hardhat and create a new Hardhat project."}),"\n",(0,o.jsx)(t.p,{children:"To install Hardhat, run:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npm install --save-dev hardhat\n"})}),"\n",(0,o.jsx)(t.p,{children:"To create a new Hardhat project, run:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npx hardhat\n"})}),"\n",(0,o.jsxs)(t.p,{children:["Select ",(0,o.jsx)(t.code,{children:"Create a TypeScript project"})," then press ",(0,o.jsx)(t.em,{children:"Enter"})," to confirm the project root."]}),"\n",(0,o.jsxs)(t.p,{children:["Select ",(0,o.jsx)(t.code,{children:"y"})," for both adding a ",(0,o.jsx)(t.code,{children:".gitignore"})," and loading the sample project.\nOptionally, you can decide to share crash reports and usage data with HardHat."]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"\u2714 What do you want to do? \xb7 Create a TypeScript project\n\u2714 Hardhat project root: \xb7 /Users/mona/git/hardhat-test\n\u2714 Do you want to add a .gitignore? (Y/n) \xb7 y\n\u2714 Help us improve Hardhat with anonymous crash reports & basic usage data? (Y/n) \xb7 y\n\u2714 Do you want to install this sample project's dependencies with npm (@nomicfoundation/hardhat-toolbox)? (Y/n) \xb7 y\n"})}),"\n",(0,o.jsx)(t.p,{children:"It will take a moment for the project setup process to complete."}),"\n",(0,o.jsx)(t.h2,{id:"configuring-hardhat-with-lisk",children:"Configuring Hardhat with Lisk"}),"\n",(0,o.jsx)(t.p,{children:"In order to deploy smart contracts to the Lisk network, you will need to configure your Hardhat project and add the Lisk network."}),"\n",(0,o.jsxs)(t.p,{children:["This example uses ",(0,o.jsx)(t.a,{href:"https://www.npmjs.com/package/dotenv",children:"dotenv"})," to load the ",(0,o.jsx)(t.code,{children:"WALLET_KEY"})," environment variable from a ",(0,o.jsx)(t.code,{children:".env"})," file to ",(0,o.jsx)(t.code,{children:"process.env.WALLET_KEY"}),".\nYou should use a similar method to avoid hardcoding your private keys within your source code."]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npm install --save-dev dotenv\n"})}),"\n",(0,o.jsxs)(t.p,{children:["Once you have ",(0,o.jsx)(t.code,{children:"dotenv"})," installed, create a ",(0,o.jsx)(t.code,{children:".env"})," file with the following content:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"WALLET_KEY=\n"})}),"\n",(0,o.jsxs)(t.p,{children:["Substite ",(0,o.jsx)(t.code,{children:""})," with the private key for your wallet."]}),"\n",(0,o.jsx)(t.admonition,{type:"caution",children:(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.code,{children:"WALLET_KEY"})," is the private key of the wallet to use when deploying a contract.\nFollow the instructions of your wallet on how to get your private key.\nE.g. for ",(0,o.jsx)(t.strong,{children:"MetaMask"}),", please follow ",(0,o.jsx)(t.a,{href:"https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key",children:"these instructions"}),".\n",(0,o.jsx)(t.strong,{children:"It is critical that you do NOT commit this to a public repo"})]})}),"\n",(0,o.jsxs)(t.p,{children:["To configure Hardhat to use Lisk, add Lisk as a network to your project's ",(0,o.jsx)(t.code,{children:"hardhat.config.ts"})," file:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-ts",metastring:'title="hardhat.config.ts"',children:"import { HardhatUserConfig } from \"hardhat/config\";\nimport \"@nomicfoundation/hardhat-toolbox\";\n\nrequire('dotenv').config();\n\nconst config: HardhatUserConfig = {\n solidity: \"0.8.23\",\n networks: {\n // for testnet\n 'lisk-sepolia': {\n url: 'https://rpc.sepolia-api.lisk.com',\n accounts: [process.env.WALLET_KEY as string],\n gasPrice: 1000000000,\n },\n },\n};\n\nexport default config;\n"})}),"\n",(0,o.jsx)(t.h2,{id:"creating-the-contract",children:"Creating the contract"}),"\n",(0,o.jsxs)(t.p,{children:["For ease and security, we\u2019ll use the ",(0,o.jsx)(t.code,{children:"ERC721"})," interface provided by the ",(0,o.jsx)(t.a,{href:"https://docs.openzeppelin.com/contracts/5.x/",children:"OpenZeppelin Contracts library"})," to create an NFT smart contract.\nWith OpenZeppelin, we don\u2019t need to write the whole ERC-721 interface. Instead, we can import the library contract and use its functions."]}),"\n",(0,o.jsx)(t.p,{children:"To add the OpenZeppelin Contracts library to your project, run:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npm install --save @openzeppelin/contracts\n"})}),"\n",(0,o.jsxs)(t.p,{children:["In your project, delete the ",(0,o.jsx)(t.code,{children:"contracts/Lock.sol"})," contract that was generated with the project.\n(You can also delete the ",(0,o.jsx)(t.code,{children:"test/Lock.ts"})," test file, but you should add your own tests ASAP!)."]}),"\n",(0,o.jsxs)(t.p,{children:["Add the code below to a new file called ",(0,o.jsx)(t.code,{children:"contracts/NFT.sol"}),"."]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-sol",metastring:'title="contracts/NFT.sol"',children:'// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport "@openzeppelin/contracts/token/ERC721/ERC721.sol";\n\ncontract NFT is ERC721 {\n uint256 public currentTokenId;\n\n constructor() ERC721("NFT Name", "NFT") {}\n\n function mint(address recipient) public payable returns (uint256) {\n uint256 newItemId = ++currentTokenId;\n _safeMint(recipient, newItemId);\n return newItemId;\n }\n}\n'})}),"\n",(0,o.jsx)(t.h2,{id:"compiling-the-smart-contract",children:"Compiling the smart contract"}),"\n",(0,o.jsx)(t.p,{children:"To compile the contract using Hardhat, simply run:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npx hardhat compile\n"})}),"\n",(0,o.jsxs)(t.p,{children:["After successful compilation, you should see a new folder ",(0,o.jsx)(t.code,{children:"artifacts/"}),", which contains the ",(0,o.jsx)(t.a,{href:"https://hardhat.org/hardhat-runner/docs/advanced/artifacts",children:"compilation artifacts"}),"."]}),"\n",(0,o.jsx)(t.h2,{id:"deploying-the-smart-contract",children:"Deploying the smart contract"}),"\n",(0,o.jsx)(t.p,{children:"Once your contract has been successfully compiled, you can deploy the contract to the Lisk Sepolia test network."}),"\n",(0,o.jsxs)(t.p,{children:["To deploy the contract to the Lisk Sepolia test network, you'll need to modify the ",(0,o.jsx)(t.code,{children:"scripts/deploy.ts"})," in your project:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-ts",metastring:'title="scripts/deploy.ts"',children:"import { ethers } from 'hardhat';\n\nasync function main() {\n const nft = await ethers.deployContract('NFT');\n\n await nft.waitForDeployment();\n\n console.log('NFT Contract Deployed at ' + nft.target);\n}\n\n// We recommend this pattern to be able to use async/await everywhere\n// and properly handle errors.\nmain().catch((error) => {\n console.error(error);\n process.exitCode = 1;\n});\n"})}),"\n",(0,o.jsxs)(t.p,{children:["You'll also need Testnet ETH in your wallet.\nSee the ",(0,o.jsx)(t.a,{href:"#prerequisites",children:"Prerequisites"})," if you haven't done that yet.\nOtherwise, the deployment attempt will fail."]}),"\n",(0,o.jsx)(t.p,{children:"Finally, run:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npx hardhat run scripts/deploy.ts --network lisk-sepolia\n"})}),"\n",(0,o.jsx)(t.p,{children:"The contract will be deployed on the Lisk Sepolia Testnet.\nYou can view the deployment status and contract by using a block explorer and searching for the address returned by your deploy script."}),"\n",(0,o.jsx)(t.p,{children:"If you're deploying a new or modified contract, you'll need to verify it first."}),"\n",(0,o.jsx)(t.h2,{id:"verifying-the-smart-contract",children:"Verifying the Smart Contract"}),"\n",(0,o.jsx)(t.p,{children:"If you want to interact with your contract on the block explorer, you, or someone, needs to verify it first.\nThe above contract has already been verified, so you should be able to view your version on a block explorer already.\nFor the remainder of this guide, we'll walk through how to verify your contract on Lisk Sepolia testnet."}),"\n",(0,o.jsxs)(t.p,{children:["In ",(0,o.jsx)(t.code,{children:"hardhat.config.ts"}),", configure Lisk Sepolia as a custom network.\nAdd the following to your ",(0,o.jsx)(t.code,{children:"HardhatUserConfig"}),":"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-ts",metastring:'title="hardhat.config.ts"',children:'// Hardhat expects etherscan here, even if you\'re using Blockscout.\netherscan: {\n apiKey: {\n "lisk-sepolia": ""\n },\n customChains: [\n {\n network: "lisk-sepolia",\n chainId: 4202,\n urls: {\n apiURL: "https://lisk-sepolia.blockscout.com/api",\n browserURL: "https://lisk-sepolia.blockscout.com/"\n }\n }\n ]\n },\n'})}),"\n",(0,o.jsx)(t.p,{children:"Now, you can verify your contract.\nGrab the deployed address and run:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npx hardhat verify --network lisk-sepolia \n"})}),"\n",(0,o.jsx)(t.p,{children:"You should see an output similar to:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-text",children:"Successfully submitted source code for contract\ncontracts/NFT.sol:NFT at 0xC10710ac55C98f9AACdc9cD0A506411FBe0af71D\nfor verification on the block explorer. Waiting for verification result...\n\nSuccessfully verified contract NFT on the block explorer.\nhttps://lisk-sepolia.blockscout.com/address/0xC10710ac55C98f9AACdc9cD0A506411FBe0af71D#code\n"})}),"\n",(0,o.jsxs)(t.admonition,{type:"info",children:[(0,o.jsx)(t.p,{children:"You can't re-verify a contract identical to one that has already been verified.\nIf you attempt to do so, such as verifying the above contract, you'll get an error similar to:"}),(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-text",children:"Error in plugin @nomiclabs/hardhat-etherscan: The API responded with an unexpected message.\nContract verification may have succeeded and should be checked manually.\nMessage: Already Verified\n"})})]}),"\n",(0,o.jsxs)(t.p,{children:["View your contract on BlockScout, by following the ",(0,o.jsx)(t.a,{href:"https://sepolia-blockscout.lisk.com/address/0xC10710ac55C98f9AACdc9cD0A506411FBe0af71D?tab=contract",children:"link"})," displayed in the output message, to confirm that the contract is verified."]}),"\n",(0,o.jsx)(t.h2,{id:"interacting-with-the-smart-contract",children:"Interacting with the Smart Contract"}),"\n",(0,o.jsxs)(t.p,{children:["After ",(0,o.jsx)(t.a,{href:"#verifying-the-smart-contract",children:"the contract is verified"}),", you can use the ",(0,o.jsx)(t.code,{children:"Read Contract"})," and ",(0,o.jsx)(t.code,{children:"Write Contract"})," tabs to interact with the deployed contract via ",(0,o.jsx)(t.a,{href:"https://sepolia-blockscout.lisk.com/address/0xC10710ac55C98f9AACdc9cD0A506411FBe0af71D?tab=contract",children:"BlockScout"}),".\nYou'll need to connect your wallet first, by clicking the ",(0,o.jsx)(t.code,{children:"Connect Wallet"})," button."]}),"\n",(0,o.jsx)(t.hr,{})]})}function h(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>i});var o=n(7294);const r={},a=o.createContext(r);function i(e){const t=o.useContext(a);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),o.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/bcc5765f.653951c5.js b/assets/js/bcc5765f.5e700eba.js similarity index 69% rename from assets/js/bcc5765f.653951c5.js rename to assets/js/bcc5765f.5e700eba.js index a0ae5ff78..690e88929 100644 --- a/assets/js/bcc5765f.653951c5.js +++ b/assets/js/bcc5765f.5e700eba.js @@ -1 +1 @@ -"use strict";(self.webpackChunklisk_docs=self.webpackChunklisk_docs||[]).push([[421],{1263:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>I,contentTitle:()=>S,default:()=>E,frontMatter:()=>A,metadata:()=>V,toc:()=>T});var l=n(5893),i=n(1151),a=n(7294),s=n(512),r=n(2466),o=n(6550),c=n(469),u=n(1980),d=n(7392),h=n(12);function p(e){return a.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function k(e){const{values:t,children:n}=e;return(0,a.useMemo)((()=>{const e=t??function(e){return p(e).map((e=>{let{props:{value:t,label:n,attributes:l,default:i}}=e;return{value:t,label:n,attributes:l,default:i}}))}(n);return function(e){const t=(0,d.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function m(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:n}=e;const l=(0,o.k6)(),i=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,u._X)(i),(0,a.useCallback)((e=>{if(!i)return;const t=new URLSearchParams(l.location.search);t.set(i,e),l.replace({...l.location,search:t.toString()})}),[i,l])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:l}=e,i=k(e),[s,r]=(0,a.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const l=n.find((e=>e.default))??n[0];if(!l)throw new Error("Unexpected error: 0 tabValues");return l.value}({defaultValue:t,tabValues:i}))),[o,u]=f({queryString:n,groupId:l}),[d,p]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[l,i]=(0,h.Nk)(n);return[l,(0,a.useCallback)((e=>{n&&i.set(e)}),[n,i])]}({groupId:l}),b=(()=>{const e=o??d;return m({value:e,tabValues:i})?e:null})();(0,c.Z)((()=>{b&&r(b)}),[b]);return{selectedValue:s,selectValue:(0,a.useCallback)((e=>{if(!m({value:e,tabValues:i}))throw new Error(`Can't select invalid tab value=${e}`);r(e),u(e),p(e)}),[u,p,i]),tabValues:i}}var g=n(2389);const x={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function w(e){let{className:t,block:n,selectedValue:i,selectValue:a,tabValues:o}=e;const c=[],{blockElementScrollPositionUntilNextRender:u}=(0,r.o5)(),d=e=>{const t=e.currentTarget,n=c.indexOf(t),l=o[n].value;l!==i&&(u(t),a(l))},h=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const n=c.indexOf(e.currentTarget)+1;t=c[n]??c[0];break}case"ArrowLeft":{const n=c.indexOf(e.currentTarget)-1;t=c[n]??c[c.length-1];break}}t?.focus()};return(0,l.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":n},t),children:o.map((e=>{let{value:t,label:n,attributes:a}=e;return(0,l.jsx)("li",{role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,ref:e=>c.push(e),onKeyDown:h,onClick:d,...a,className:(0,s.Z)("tabs__item",x.tabItem,a?.className,{"tabs__item--active":i===t}),children:n??t},t)}))})}function j(e){let{lazy:t,children:n,selectedValue:i}=e;const s=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===i));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return(0,l.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==i})))})}function y(e){const t=b(e);return(0,l.jsxs)("div",{className:(0,s.Z)("tabs-container",x.tabList),children:[(0,l.jsx)(w,{...e,...t}),(0,l.jsx)(j,{...e,...t})]})}function v(e){const t=(0,g.Z)();return(0,l.jsx)(y,{...e,children:p(e.children)},String(t))}const L={tabItem:"tabItem_Ymn6"};function M(e){let{children:t,hidden:n,className:i}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(L.tabItem,i),hidden:n,children:t})}const A={title:"Connecting to a wallet",sidebar_position:1,slug:"/connecting-to-a-wallet",description:"How to integrate Lisk with popular wallets like MetaMask.",keywords:["Lisk","Lisk wallet","MetaMask","EVM-compatible wallets","network configuration","Lisk testnet","Sepolia","cryptocurrency wallet setup","Lisk wallet setup","add Lisk network"]},S="How to connect Lisk to a wallet",V={id:"building-on-lisk/connecting-to-a-wallet",title:"Connecting to a wallet",description:"How to integrate Lisk with popular wallets like MetaMask.",source:"@site/docs/building-on-lisk/connecting-to-a-wallet.mdx",sourceDirName:"building-on-lisk",slug:"/connecting-to-a-wallet",permalink:"/lisk-documentation/connecting-to-a-wallet",draft:!1,unlisted:!1,editUrl:"https://github.com/LiskHQ/lisk-documentation/tree/main/docs/building-on-lisk/connecting-to-a-wallet.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{title:"Connecting to a wallet",sidebar_position:1,slug:"/connecting-to-a-wallet",description:"How to integrate Lisk with popular wallets like MetaMask.",keywords:["Lisk","Lisk wallet","MetaMask","EVM-compatible wallets","network configuration","Lisk testnet","Sepolia","cryptocurrency wallet setup","Lisk wallet setup","add Lisk network"]},sidebar:"documentationSidebar",previous:{title:"Building on Lisk",permalink:"/lisk-documentation/category/building-on-lisk"},next:{title:"How to deploy a smart contract (Hardhat)",permalink:"/lisk-documentation/building-on-lisk/deploying-a-smart-contract"}},I={},T=[{value:"Lisk Sepolia Testnet",id:"lisk-sepolia-testnet",level:2},{value:"Instructions for MetaMask",id:"instructions-for-metamask",level:3},{value:"Adding Lisk manually",id:"adding-lisk-manually",level:4},{value:"Adding Lisk with 1 click",id:"adding-lisk-with-1-click",level:4}];function C(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.a)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.h1,{id:"how-to-connect-lisk-to-a-wallet",children:"How to connect Lisk to a wallet"}),"\n",(0,l.jsx)(t.h2,{id:"lisk-sepolia-testnet",children:"Lisk Sepolia Testnet"}),"\n",(0,l.jsxs)(t.p,{children:[(0,l.jsx)(t.strong,{children:"Lisk Sepolia"})," can be ",(0,l.jsx)(t.strong,{children:"added"})," as a custom network to ",(0,l.jsx)(t.strong,{children:"any EVM-compatible wallet"})," (i.e. ",(0,l.jsx)(t.a,{href:"https://metamask.io/",children:"MetaMask"}),")."]}),"\n",(0,l.jsx)(t.h3,{id:"instructions-for-metamask",children:"Instructions for MetaMask"}),"\n",(0,l.jsxs)(v,{children:[(0,l.jsxs)(M,{value:"manual",label:"Adding Lisk manually",default:!0,children:[(0,l.jsx)(t.h4,{id:"adding-lisk-manually",children:"Adding Lisk manually"}),(0,l.jsx)(t.p,{children:"To add Lisk as a custom network to MetaMask:"}),(0,l.jsxs)(t.ol,{children:["\n",(0,l.jsx)(t.li,{children:"Open the MetaMask browser extension."}),"\n",(0,l.jsx)(t.li,{children:"Open the network selection dropdown menu by clicking the dropdown button at the top of the extension."}),"\n",(0,l.jsxs)(t.li,{children:["Click the ",(0,l.jsx)(t.strong,{children:"Add network"})," button."]}),"\n",(0,l.jsxs)(t.li,{children:["Click ",(0,l.jsx)(t.strong,{children:"Add a network manually"}),"."]}),"\n",(0,l.jsxs)(t.li,{children:["In the ",(0,l.jsx)(t.strong,{children:"Add a network manually"})," dialog that appears, enter the following information for Lisk Sepolia:"]}),"\n"]}),(0,l.jsxs)(t.table,{children:[(0,l.jsx)(t.thead,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.th,{style:{textAlign:"left"},children:"Name"}),(0,l.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,l.jsxs)(t.tbody,{children:[(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{style:{textAlign:"left"},children:"Network Name"}),(0,l.jsx)(t.td,{style:{textAlign:"left"},children:"Lisk Sepolia Testnet"})]}),(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{style:{textAlign:"left"},children:"RPC Endpoint"}),(0,l.jsx)(t.td,{style:{textAlign:"left"},children:(0,l.jsx)(t.a,{href:"https://rpc.sepolia-api.lisk.com",children:"https://rpc.sepolia-api.lisk.com"})})]}),(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{style:{textAlign:"left"},children:"Chain ID"}),(0,l.jsx)(t.td,{style:{textAlign:"left"},children:"4202"})]}),(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{style:{textAlign:"left"},children:"Currency Symbol"}),(0,l.jsx)(t.td,{style:{textAlign:"left"},children:"ETH"})]}),(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{style:{textAlign:"left"},children:"Block Explorer"}),(0,l.jsx)(t.td,{style:{textAlign:"left"},children:(0,l.jsx)(t.a,{href:"https://sepolia-blockscout.lisk.com/",children:"https://sepolia-blockscout.lisk.com"})})]})]})]}),(0,l.jsxs)(t.ol,{start:"6",children:["\n",(0,l.jsxs)(t.li,{children:["Tap the ",(0,l.jsx)(t.code,{children:"Save"})," button to save Lisk as a network."]}),"\n"]})]}),(0,l.jsxs)(M,{value:"1click",label:"1-Click solution",children:[(0,l.jsx)(t.h4,{id:"adding-lisk-with-1-click",children:"Adding Lisk with 1 click"}),(0,l.jsxs)(t.ol,{children:["\n",(0,l.jsxs)(t.li,{children:["Go to ",(0,l.jsx)(t.a,{href:"https://raas.gelato.network/rollups/details/public/lisk-sepolia-testnet",children:"Lisk Sepolia Testnet portal"})]}),"\n",(0,l.jsxs)(t.li,{children:["Click the ",(0,l.jsx)(t.strong,{children:"Add to wallet"})," button"]}),"\n",(0,l.jsxs)(t.li,{children:["The MetaMask plugin should open and have all the information required to add the network prefilled, automatically.\nReview and confirm the information by tapping the ",(0,l.jsx)(t.code,{children:"Save"})," button."]}),"\n"]})]})]}),"\n",(0,l.jsx)(t.p,{children:"You should now be able to connect to the Lisk by selecting it from the network selection dropdown menu."})]})}function E(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,l.jsx)(t,{...e,children:(0,l.jsx)(C,{...e})}):C(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>r,a:()=>s});var l=n(7294);const i={},a=l.createContext(i);function s(e){const t=l.useContext(a);return l.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),l.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklisk_docs=self.webpackChunklisk_docs||[]).push([[421],{1263:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>I,contentTitle:()=>S,default:()=>E,frontMatter:()=>A,metadata:()=>V,toc:()=>T});var l=n(5893),i=n(1151),a=n(7294),s=n(512),r=n(2466),o=n(6550),c=n(469),u=n(1980),d=n(7392),h=n(12);function p(e){return a.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function k(e){const{values:t,children:n}=e;return(0,a.useMemo)((()=>{const e=t??function(e){return p(e).map((e=>{let{props:{value:t,label:n,attributes:l,default:i}}=e;return{value:t,label:n,attributes:l,default:i}}))}(n);return function(e){const t=(0,d.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function m(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:n}=e;const l=(0,o.k6)(),i=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,u._X)(i),(0,a.useCallback)((e=>{if(!i)return;const t=new URLSearchParams(l.location.search);t.set(i,e),l.replace({...l.location,search:t.toString()})}),[i,l])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:l}=e,i=k(e),[s,r]=(0,a.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const l=n.find((e=>e.default))??n[0];if(!l)throw new Error("Unexpected error: 0 tabValues");return l.value}({defaultValue:t,tabValues:i}))),[o,u]=f({queryString:n,groupId:l}),[d,p]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[l,i]=(0,h.Nk)(n);return[l,(0,a.useCallback)((e=>{n&&i.set(e)}),[n,i])]}({groupId:l}),b=(()=>{const e=o??d;return m({value:e,tabValues:i})?e:null})();(0,c.Z)((()=>{b&&r(b)}),[b]);return{selectedValue:s,selectValue:(0,a.useCallback)((e=>{if(!m({value:e,tabValues:i}))throw new Error(`Can't select invalid tab value=${e}`);r(e),u(e),p(e)}),[u,p,i]),tabValues:i}}var x=n(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function w(e){let{className:t,block:n,selectedValue:i,selectValue:a,tabValues:o}=e;const c=[],{blockElementScrollPositionUntilNextRender:u}=(0,r.o5)(),d=e=>{const t=e.currentTarget,n=c.indexOf(t),l=o[n].value;l!==i&&(u(t),a(l))},h=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const n=c.indexOf(e.currentTarget)+1;t=c[n]??c[0];break}case"ArrowLeft":{const n=c.indexOf(e.currentTarget)-1;t=c[n]??c[c.length-1];break}}t?.focus()};return(0,l.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":n},t),children:o.map((e=>{let{value:t,label:n,attributes:a}=e;return(0,l.jsx)("li",{role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,ref:e=>c.push(e),onKeyDown:h,onClick:d,...a,className:(0,s.Z)("tabs__item",g.tabItem,a?.className,{"tabs__item--active":i===t}),children:n??t},t)}))})}function j(e){let{lazy:t,children:n,selectedValue:i}=e;const s=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===i));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return(0,l.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==i})))})}function y(e){const t=b(e);return(0,l.jsxs)("div",{className:(0,s.Z)("tabs-container",g.tabList),children:[(0,l.jsx)(w,{...e,...t}),(0,l.jsx)(j,{...e,...t})]})}function v(e){const t=(0,x.Z)();return(0,l.jsx)(y,{...e,children:p(e.children)},String(t))}const L={tabItem:"tabItem_Ymn6"};function M(e){let{children:t,hidden:n,className:i}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(L.tabItem,i),hidden:n,children:t})}const A={title:"Connecting to a wallet",sidebar_position:1,slug:"/connecting-to-a-wallet",description:"How to integrate Lisk with popular wallets like MetaMask.",keywords:["Lisk","Lisk wallet","MetaMask","EVM-compatible wallets","network configuration","Lisk testnet","Sepolia","cryptocurrency wallet setup","Lisk wallet setup","add Lisk network"]},S="How to connect Lisk to a wallet",V={id:"building-on-lisk/connecting-to-a-wallet",title:"Connecting to a wallet",description:"How to integrate Lisk with popular wallets like MetaMask.",source:"@site/docs/building-on-lisk/connecting-to-a-wallet.mdx",sourceDirName:"building-on-lisk",slug:"/connecting-to-a-wallet",permalink:"/lisk-documentation/connecting-to-a-wallet",draft:!1,unlisted:!1,editUrl:"https://github.com/LiskHQ/lisk-documentation/tree/main/docs/building-on-lisk/connecting-to-a-wallet.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{title:"Connecting to a wallet",sidebar_position:1,slug:"/connecting-to-a-wallet",description:"How to integrate Lisk with popular wallets like MetaMask.",keywords:["Lisk","Lisk wallet","MetaMask","EVM-compatible wallets","network configuration","Lisk testnet","Sepolia","cryptocurrency wallet setup","Lisk wallet setup","add Lisk network"]},sidebar:"documentationSidebar",previous:{title:"Building on Lisk",permalink:"/lisk-documentation/category/building-on-lisk"},next:{title:"How to deploy a smart contract (Hardhat)",permalink:"/lisk-documentation/building-on-lisk/deploying-a-smart-contract"}},I={},T=[{value:"Lisk Sepolia Testnet",id:"lisk-sepolia-testnet",level:2},{value:"Instructions for MetaMask",id:"instructions-for-metamask",level:3},{value:"Adding Lisk manually",id:"adding-lisk-manually",level:4},{value:"Adding Lisk with 1 click",id:"adding-lisk-with-1-click",level:4}];function C(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.a)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.h1,{id:"how-to-connect-lisk-to-a-wallet",children:"How to connect Lisk to a wallet"}),"\n",(0,l.jsx)(t.h2,{id:"lisk-sepolia-testnet",children:"Lisk Sepolia Testnet"}),"\n",(0,l.jsxs)(t.p,{children:[(0,l.jsx)(t.strong,{children:"Lisk Sepolia"})," can be ",(0,l.jsx)(t.strong,{children:"added"})," as a custom network to ",(0,l.jsx)(t.strong,{children:"any EVM-compatible wallet"})," (i.e. ",(0,l.jsx)(t.a,{href:"https://metamask.io/",children:"MetaMask"}),")."]}),"\n",(0,l.jsx)(t.h3,{id:"instructions-for-metamask",children:"Instructions for MetaMask"}),"\n",(0,l.jsxs)(v,{children:[(0,l.jsxs)(M,{value:"manual",label:"Adding Lisk manually",default:!0,children:[(0,l.jsx)(t.h4,{id:"adding-lisk-manually",children:"Adding Lisk manually"}),(0,l.jsx)(t.p,{children:"To add Lisk as a custom network to MetaMask:"}),(0,l.jsxs)(t.ol,{children:["\n",(0,l.jsx)(t.li,{children:"Open the MetaMask browser extension."}),"\n",(0,l.jsx)(t.li,{children:"Open the network selection dropdown menu by clicking the dropdown button at the top of the extension."}),"\n",(0,l.jsxs)(t.li,{children:["Click the ",(0,l.jsx)(t.code,{children:"Add network"})," button."]}),"\n",(0,l.jsxs)(t.li,{children:["Click ",(0,l.jsx)(t.code,{children:"Add a network manually"}),"."]}),"\n",(0,l.jsxs)(t.li,{children:["In the ",(0,l.jsx)(t.code,{children:"Add a network manually"})," dialog that appears, enter the following information for Lisk Sepolia:"]}),"\n"]}),(0,l.jsxs)(t.table,{children:[(0,l.jsx)(t.thead,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.th,{style:{textAlign:"left"},children:"Name"}),(0,l.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,l.jsxs)(t.tbody,{children:[(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{style:{textAlign:"left"},children:"Network Name"}),(0,l.jsx)(t.td,{style:{textAlign:"left"},children:"Lisk Sepolia Testnet"})]}),(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{style:{textAlign:"left"},children:"RPC Endpoint"}),(0,l.jsx)(t.td,{style:{textAlign:"left"},children:(0,l.jsx)(t.a,{href:"https://rpc.sepolia-api.lisk.com",children:"https://rpc.sepolia-api.lisk.com"})})]}),(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{style:{textAlign:"left"},children:"Chain ID"}),(0,l.jsx)(t.td,{style:{textAlign:"left"},children:"4202"})]}),(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{style:{textAlign:"left"},children:"Currency Symbol"}),(0,l.jsx)(t.td,{style:{textAlign:"left"},children:"ETH"})]}),(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{style:{textAlign:"left"},children:"Block Explorer"}),(0,l.jsx)(t.td,{style:{textAlign:"left"},children:(0,l.jsx)(t.a,{href:"https://sepolia-blockscout.lisk.com/",children:"https://sepolia-blockscout.lisk.com"})})]})]})]}),(0,l.jsxs)(t.ol,{start:"6",children:["\n",(0,l.jsxs)(t.li,{children:["Tap the ",(0,l.jsx)(t.code,{children:"Save"})," button to save Lisk as a network."]}),"\n"]})]}),(0,l.jsxs)(M,{value:"1click",label:"1-Click solution",children:[(0,l.jsx)(t.h4,{id:"adding-lisk-with-1-click",children:"Adding Lisk with 1 click"}),(0,l.jsxs)(t.ol,{children:["\n",(0,l.jsxs)(t.li,{children:["Go to ",(0,l.jsx)(t.a,{href:"https://raas.gelato.network/rollups/details/public/lisk-sepolia-testnet",children:"Lisk Sepolia Testnet portal"})]}),"\n",(0,l.jsxs)(t.li,{children:["Click the ",(0,l.jsx)(t.strong,{children:"Add to wallet"})," button"]}),"\n",(0,l.jsxs)(t.li,{children:["The MetaMask plugin should open and have all the information required to add the network prefilled, automatically.\nReview and confirm the information by tapping the ",(0,l.jsx)(t.code,{children:"Save"})," button."]}),"\n"]})]})]}),"\n",(0,l.jsx)(t.p,{children:"You should now be able to connect to the Lisk by selecting it from the network selection dropdown menu."})]})}function E(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,l.jsx)(t,{...e,children:(0,l.jsx)(C,{...e})}):C(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>r,a:()=>s});var l=n(7294);const i={},a=l.createContext(i);function s(e){const t=l.useContext(a);return l.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),l.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.14bd3669.js b/assets/js/runtime~main.14bd3669.js deleted file mode 100644 index e452ae2da..000000000 --- a/assets/js/runtime~main.14bd3669.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,t,r,o,a,n={},f={};function i(e){var t=f[e];if(void 0!==t)return t.exports;var r=f[e]={exports:{}};return n[e].call(r.exports,r,r.exports,i),r.exports}i.m=n,e=[],i.O=(t,r,o,a)=>{if(!r){var n=1/0;for(u=0;u=a)&&Object.keys(i.O).every((e=>i.O[e](r[c])))?r.splice(c--,1):(f=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[r,o,a]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var a=Object.create(null);i.r(a);var n={};t=t||[null,r({}),r([]),r(r)];for(var f=2&o&&e;"object"==typeof f&&!~t.indexOf(f);f=r(f))Object.getOwnPropertyNames(f).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,i.d(a,n),a},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>"assets/js/"+({53:"935f2afb",68:"0eafa1eb",85:"1f391b9e",207:"5e59c3a5",240:"90210d68",368:"a94703ab",388:"1224f3e7",414:"393be207",421:"bcc5765f",462:"f58537f1",518:"a7bd4aaa",568:"dad52d3b",661:"5e95c892",671:"0e384e19",817:"14eb3368",918:"17896441"}[e]||e)+"."+{53:"90fad16d",68:"177833dc",85:"34f79b08",207:"03659c84",240:"69bc9bfa",368:"5c7c46ba",388:"f648b06f",414:"6280be6b",421:"653951c5",462:"d7a1893e",518:"c2569488",568:"77f099aa",661:"15d8fdf1",671:"b8df6f6d",674:"5283d329",772:"7b0f19ea",817:"c8cc9442",918:"9169ebd0"}[e]+".js",i.miniCssF=e=>{},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},a="lisk-docs:",i.l=(e,t,r,n)=>{if(o[e])o[e].push(t);else{var f,c;if(void 0!==r)for(var d=document.getElementsByTagName("script"),u=0;u{f.onerror=f.onload=null,clearTimeout(b);var a=o[e];if(delete o[e],f.parentNode&&f.parentNode.removeChild(f),a&&a.forEach((e=>e(r))),t)return t(r)},b=setTimeout(s.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=s.bind(null,f.onerror),f.onload=s.bind(null,f.onload),c&&document.head.appendChild(f)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.p="/lisk-documentation/",i.gca=function(e){return e={17896441:"918","935f2afb":"53","0eafa1eb":"68","1f391b9e":"85","5e59c3a5":"207","90210d68":"240",a94703ab:"368","1224f3e7":"388","393be207":"414",bcc5765f:"421",f58537f1:"462",a7bd4aaa:"518",dad52d3b:"568","5e95c892":"661","0e384e19":"671","14eb3368":"817"}[e]||e,i.p+i.u(e)},(()=>{var e={303:0,532:0};i.f.j=(t,r)=>{var o=i.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var a=new Promise(((r,a)=>o=e[t]=[r,a]));r.push(o[2]=a);var n=i.p+i.u(t),f=new Error;i.l(n,(r=>{if(i.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var a=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;f.message="Loading chunk "+t+" failed.\n("+a+": "+n+")",f.name="ChunkLoadError",f.type=a,f.request=n,o[1](f)}}),"chunk-"+t,t)}},i.O.j=t=>0===e[t];var t=(t,r)=>{var o,a,n=r[0],f=r[1],c=r[2],d=0;if(n.some((t=>0!==e[t]))){for(o in f)i.o(f,o)&&(i.m[o]=f[o]);if(c)var u=c(i)}for(t&&t(r);d{"use strict";var e,t,r,a,o,n={},f={};function i(e){var t=f[e];if(void 0!==t)return t.exports;var r=f[e]={exports:{}};return n[e].call(r.exports,r,r.exports,i),r.exports}i.m=n,e=[],i.O=(t,r,a,o)=>{if(!r){var n=1/0;for(u=0;u=o)&&Object.keys(i.O).every((e=>i.O[e](r[d])))?r.splice(d--,1):(f=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[r,a,o]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var o=Object.create(null);i.r(o);var n={};t=t||[null,r({}),r([]),r(r)];for(var f=2&a&&e;"object"==typeof f&&!~t.indexOf(f);f=r(f))Object.getOwnPropertyNames(f).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,i.d(o,n),o},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>"assets/js/"+({53:"935f2afb",68:"0eafa1eb",85:"1f391b9e",207:"5e59c3a5",240:"90210d68",368:"a94703ab",388:"1224f3e7",414:"393be207",421:"bcc5765f",462:"f58537f1",518:"a7bd4aaa",568:"dad52d3b",661:"5e95c892",671:"0e384e19",817:"14eb3368",918:"17896441"}[e]||e)+"."+{53:"90fad16d",68:"177833dc",85:"34f79b08",207:"03659c84",240:"02cbb358",368:"5c7c46ba",388:"f648b06f",414:"6280be6b",421:"5e700eba",462:"d7a1893e",518:"c2569488",568:"77f099aa",661:"15d8fdf1",671:"b8df6f6d",674:"5283d329",772:"7b0f19ea",817:"c8cc9442",918:"9169ebd0"}[e]+".js",i.miniCssF=e=>{},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},o="lisk-docs:",i.l=(e,t,r,n)=>{if(a[e])a[e].push(t);else{var f,d;if(void 0!==r)for(var c=document.getElementsByTagName("script"),u=0;u{f.onerror=f.onload=null,clearTimeout(b);var o=a[e];if(delete a[e],f.parentNode&&f.parentNode.removeChild(f),o&&o.forEach((e=>e(r))),t)return t(r)},b=setTimeout(s.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=s.bind(null,f.onerror),f.onload=s.bind(null,f.onload),d&&document.head.appendChild(f)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.p="/lisk-documentation/",i.gca=function(e){return e={17896441:"918","935f2afb":"53","0eafa1eb":"68","1f391b9e":"85","5e59c3a5":"207","90210d68":"240",a94703ab:"368","1224f3e7":"388","393be207":"414",bcc5765f:"421",f58537f1:"462",a7bd4aaa:"518",dad52d3b:"568","5e95c892":"661","0e384e19":"671","14eb3368":"817"}[e]||e,i.p+i.u(e)},(()=>{var e={303:0,532:0};i.f.j=(t,r)=>{var a=i.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var o=new Promise(((r,o)=>a=e[t]=[r,o]));r.push(a[2]=o);var n=i.p+i.u(t),f=new Error;i.l(n,(r=>{if(i.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var o=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;f.message="Loading chunk "+t+" failed.\n("+o+": "+n+")",f.name="ChunkLoadError",f.type=o,f.request=n,a[1](f)}}),"chunk-"+t,t)}},i.O.j=t=>0===e[t];var t=(t,r)=>{var a,o,n=r[0],f=r[1],d=r[2],c=0;if(n.some((t=>0!==e[t]))){for(a in f)i.o(f,a)&&(i.m[a]=f[a]);if(d)var u=d(i)}for(t&&t(r);c How to deploy a smart contract (Hardhat) | Lisk Documentation - + @@ -89,9 +89,9 @@

Successfully submitted source code for contract
contracts/NFT.sol:NFT at 0xC10710ac55C98f9AACdc9cD0A506411FBe0af71D
for verification on the block explorer. Waiting for verification result...

Successfully verified contract NFT on the block explorer.
https://lisk-sepolia.blockscout.com/address/0xC10710ac55C98f9AACdc9cD0A506411FBe0af71D#code
info

You can't re-verify a contract identical to one that has already been verified. If you attempt to do so, such as verifying the above contract, you'll get an error similar to:

Error in plugin @nomiclabs/hardhat-etherscan: The API responded with an unexpected message.
Contract verification may have succeeded and should be checked manually.
Message: Already Verified
-

View your contract on BlockScout, by following the link displayed in the output message, to confirm that the contract is verified.

+

View your contract on BlockScout, by following the link displayed in the output message, to confirm that the contract is verified.

Interacting with the Smart Contract

-

After the contract is verified, you can use the Read Contract and Write Contract tabs to interact with the deployed contract via BlockScout. +

After the contract is verified, you can use the Read Contract and Write Contract tabs to interact with the deployed contract via BlockScout. You'll need to connect your wallet first, by clicking the Connect Wallet button.


diff --git a/category/about-lisk.html b/category/about-lisk.html index 9951084ea..b5dcbdf4b 100644 --- a/category/about-lisk.html +++ b/category/about-lisk.html @@ -4,7 +4,7 @@ About Lisk | Lisk Documentation - + diff --git a/category/building-on-lisk.html b/category/building-on-lisk.html index 92dc12354..138ff6cdd 100644 --- a/category/building-on-lisk.html +++ b/category/building-on-lisk.html @@ -4,7 +4,7 @@ Building on Lisk | Lisk Documentation - + diff --git a/connecting-to-a-wallet.html b/connecting-to-a-wallet.html index 724f2d62f..27c7078fd 100644 --- a/connecting-to-a-wallet.html +++ b/connecting-to-a-wallet.html @@ -4,7 +4,7 @@ Connecting to a wallet | Lisk Documentation - + @@ -15,9 +15,9 @@

In

Adding Lisk manually

To add Lisk as a custom network to MetaMask:

  1. Open the MetaMask browser extension.
  2. Open the network selection dropdown menu by clicking the dropdown button at the top of the extension.
  3. -
  4. Click the Add network button.
  5. -
  6. Click Add a network manually.
  7. -
  8. In the Add a network manually dialog that appears, enter the following information for Lisk Sepolia:
  9. +
  10. Click the Add network button.
  11. +
  12. Click Add a network manually.
  13. +
  14. In the Add a network manually dialog that appears, enter the following information for Lisk Sepolia:
NameValue
Network NameLisk Sepolia Testnet
RPC Endpointhttps://rpc.sepolia-api.lisk.com
Chain ID4202
Currency SymbolETH
Block Explorerhttps://sepolia-blockscout.lisk.com
  1. Tap the Save button to save Lisk as a network.