diff --git a/docs/about-lisk/fees.md b/docs/about-lisk/fees.md index 42ba7823c..13ab87195 100644 --- a/docs/about-lisk/fees.md +++ b/docs/about-lisk/fees.md @@ -127,8 +127,8 @@ The [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) parameters used by the L | Parameter | Lisk Mainnet value | Ethereum value (for reference) | | ------------------------------------- | ---------------: | -----------------------------: | -| Block gas limit | 30,000,000 gas | 30,000,000 gas | -| Block gas target | 1,500,000 gas | 15,000,000 gas | +| Block gas limit | 60,000,000 gas | 30,000,000 gas | +| Block gas target | 3,000,000 gas | 15,000,000 gas | | EIP-1559 elasticity multiplier | 20 | 2 | | EIP-1559 denominator | 1,000 | 8 | | Maximum base fee increase (per block) | 1.9% | 12.5% | diff --git a/docs/about-lisk/network-info.md b/docs/about-lisk/network-info.md index 712af24c5..acb2ac19c 100644 --- a/docs/about-lisk/network-info.md +++ b/docs/about-lisk/network-info.md @@ -36,15 +36,15 @@ The Lisk L2 is available on the following network: ### Lisk Sepolia Testnet -| Name | Value | -| :-------------- | :-------------------------------------------------------------------------- | -| **Network Name** | Lisk Sepolia Testnet | -| **HTTP RPC Endpoint** | [https://rpc.sepolia-api.lisk.com](https://rpc.sepolia-api.lisk.com) | -| **WS RPC Endpoint** | [wss://ws.sepolia-api.lisk.com](wss://ws.sepolia-api.lisk.com) | -| **Chain ID** | 4202 | -| **Currency Symbol** | ETH | -| **Block Explorer** | https://sepolia-blockscout.lisk.com | -| **Block Explorer API** | https://sepolia-blockscout.lisk.com/api | -| **Lisk Testnet Bridge** | https://sepolia-bridge.lisk.com | -| **Lisk Testnet Faucet** (Grants LSK) | https://sepolia-faucet.lisk.com/ | -| **Superchain Testnet Faucet** (Grants ETH ) | https://app.optimism.io/faucet | \ No newline at end of file +| Name | Value | +| :-------------- | :-------------------------------------------------------------------- | +| **Network Name** | Lisk Sepolia Testnet | +| **HTTP RPC Endpoint** | [https://rpc.sepolia-api.lisk.com](https://rpc.sepolia-api.lisk.com) | +| **WS RPC Endpoint** | [wss://ws.sepolia-api.lisk.com](wss://ws.sepolia-api.lisk.com) | +| **Chain ID** | 4202 | +| **Currency Symbol** | ETH | +| **Block Explorer** | https://sepolia-blockscout.lisk.com | +| **Block Explorer API** | https://sepolia-blockscout.lisk.com/api | +| **Lisk Testnet Bridge** | https://sepolia-bridge.lisk.com | +| **Lisk Testnet Faucet** (Grants LSK) | https://sepolia-faucet.lisk.com/ | +| **Superchain Testnet Faucet** (Grants ETH ) | https://console.optimism.io/faucet | \ No newline at end of file diff --git a/docs/building-on-lisk/add-token-to-lisk/custom-token.mdx b/docs/building-on-lisk/add-token-to-lisk/custom-token.mdx index 092afceeb..79fb3d932 100644 --- a/docs/building-on-lisk/add-token-to-lisk/custom-token.mdx +++ b/docs/building-on-lisk/add-token-to-lisk/custom-token.mdx @@ -46,7 +46,7 @@ You will need to get some ETH on both, Sepolia and Lisk Sepolia networks. :::info You can use [ETH Sepolia Faucet](https://sepoliafaucet.com/) to get ETH on Sepolia. -You can use the [Superchain Faucet](https://app.optimism.io/faucet?utm_source=docs) to get ETH on Lisk Sepolia. +You can use the [Superchain Faucet](https://console.optimism.io/faucet) to get ETH on Lisk Sepolia. ::: ### Add Lisk Sepolia to Your Wallet diff --git a/docs/building-on-lisk/add-token-to-lisk/index.md b/docs/building-on-lisk/add-token-to-lisk/index.md index 7216a502b..8757561d6 100644 --- a/docs/building-on-lisk/add-token-to-lisk/index.md +++ b/docs/building-on-lisk/add-token-to-lisk/index.md @@ -72,7 +72,7 @@ To add your token to the list, perform the following steps. ### Step 1: Deploy your token on Lisk Select your preferred bridging framework and use it to deploy an ERC-20 for your token on Lisk. -We recommend you use the framework provided by Lisk's [standard bridge](#the-standard-bridge) contracts and, furthermore, deploy your token using the [OptimismMintableERC20Factory](https://docs.lisk.com/contracts#lisk-network-l2). +We recommend you use the framework provided by Lisk's [standard bridge](#the-standard-bridge) contracts and, furthermore, deploy your token using the [OptimismMintableERC20Factory](../contracts.mdx#lisk-network-l2). Deploying your token on Lisk in this manner provides us with guarantees that will smooth the approval process. If you choose a different bridging framework, its interface must be compatible with that of the standard bridge. Otherwise, it may be difficult for us to support them. diff --git a/docs/building-on-lisk/add-token-to-lisk/standard-token.md b/docs/building-on-lisk/add-token-to-lisk/standard-token.md index 826c29ba6..107fafa33 100644 --- a/docs/building-on-lisk/add-token-to-lisk/standard-token.md +++ b/docs/building-on-lisk/add-token-to-lisk/standard-token.md @@ -53,7 +53,7 @@ You will need to get some ETH on both of these testnets. :::info You can use [ETH Sepolia Faucet](https://sepoliafaucet.com/) to get ETH on Sepolia. -You can use the [Superchain Faucet](https://app.optimism.io/faucet?utm_source=docs) to get ETH on Lisk Sepolia. +You can use the [Superchain Faucet](https://console.optimism.io/faucet) to get ETH on Lisk Sepolia. ::: ### Get an L1 ERC-20 Token Address diff --git a/docs/building-on-lisk/deploying-smart-contract/with-Foundry.md b/docs/building-on-lisk/deploying-smart-contract/with-Foundry.md index 7e25e2d2a..1a8254064 100644 --- a/docs/building-on-lisk/deploying-smart-contract/with-Foundry.md +++ b/docs/building-on-lisk/deploying-smart-contract/with-Foundry.md @@ -1,7 +1,7 @@ --- title: ... with Foundry slug: /building-on-lisk/deploying-smart-contract/with-Foundry -description: "A guide on deploying a smart contract on the Lisk test network using Foundry. Includes instructions for setting up the environment, compiling, and deploying the smart contract." +description: "A guide on deploying a smart contract on the Lisk network using Foundry. Includes instructions for setting up the environment, compiling, and deploying the smart contract." keywords: [ "Foundry", "smart contract", diff --git a/docs/building-on-lisk/deploying-smart-contract/with-Hardhat.md b/docs/building-on-lisk/deploying-smart-contract/with-Hardhat.md index 45f556283..c154b1c40 100644 --- a/docs/building-on-lisk/deploying-smart-contract/with-Hardhat.md +++ b/docs/building-on-lisk/deploying-smart-contract/with-Hardhat.md @@ -1,7 +1,7 @@ --- title: ... with Hardhat slug: /building-on-lisk/deploying-smart-contract/with-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." +description: "A guide on deploying a smart contract on the Lisk network using Hardhat. Includes instructions for setting up the environment, compiling, and deploying the smart contract." keywords: [ "Hardhat", "smart contract", @@ -23,6 +23,9 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; # Deploying a smart contract with Hardhat + +On this page, you will learn how to create, deploy and verify a smart contract with HardHat to the **Lisk Sepolia** testnet. + ## Prerequisites ### Node v18+ @@ -47,7 +50,7 @@ Then, use the aforementioned Lisk Bridge to send tokens from the **Ethereum Sepo :::note You can deploy a contract on Lisk Mainnet by adopting the same process. -For deploying to mainnet, ensure that your wallet has enough ETH. +For deploying to Mainnet, ensure that your wallet has enough ETH. The subsequent text contains commands for both Lisk and Lisk Sepolia for your ease. For more information, see the [available Lisk networks](/network-info) and [how to connect a wallet with them](/user/connecting-to-a-wallet). @@ -116,7 +119,7 @@ Substitute `` with the private key for your wallet. `WALLET_KEY` is the private key of the wallet to use when deploying a contract. Follow the instructions of your wallet on how to get your private key. -E.g. for **MetaMask**, please follow [these instructions](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key). +E.g. for **MetaMask**, please follow [these instructions](https://support.metamask.io/configure/accounts/how-to-export-an-accounts-private-key/). **It is critical that you do NOT commit this to a public repo** ::: diff --git a/docs/building-on-lisk/deploying-smart-contract/with-Remix.mdx b/docs/building-on-lisk/deploying-smart-contract/with-Remix.mdx new file mode 100644 index 000000000..2408dad6d --- /dev/null +++ b/docs/building-on-lisk/deploying-smart-contract/with-Remix.mdx @@ -0,0 +1,55 @@ +--- +title: ... with Remix +slug: /building-on-lisk/deploying-smart-contract/with-Remix +description: "A guide on deploying a smart contract on the Lisk network using Remix. Includes instructions for setting up the environment, compiling, deploying and verifying the smart contract." +keywords: [ + "Remix", + "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" + ] +--- +import PartialExample from '../../partials/_remix-deploy-example.mdx'; + +# Deploying a smart contract with Remix + +On this page, you will learn how to create, deploy and verify a smart contract with the Remix IDE to the **Lisk Sepolia** testnet. + +Remix Online IDE is a powerful toolset for developing, deploying, debugging, and testing Ethereum and EVM-compatible smart contracts. +It requires no setup and can be accessed directly through the browser under https://remix.ethereum.org/. + +## Prerequisites + +### Wallet funds + +**Deploying contracts** to the blockchain requires a **gas fee**. +Therefore, you will need to fund your wallet with ETH to cover those gas fees. + +For this guide, you will be deploying a contract to the Lisk Sepolia Testnet. + +You can deposit the required tokens by using the [Lisk Bridge](https://sepolia-bridge.lisk.com/bridge/lisk-sepolia-testnet). + +In case your wallet doesn't hold enough `SepoliaETH`, use one of the available faucets for the **Ethereum Sepolia** Testnet like [https://sepoliafaucet.com](https://sepoliafaucet.com/) to receive free Testnet ETH. +Then, use the aforementioned Lisk Bridge to send tokens from the **Ethereum Sepolia Testnet** to the **Lisk Sepolia Testnet**. + +:::note +You can deploy a contract on Lisk Mainnet by adopting the same process. +Before deploying to Mainnet, ensure that your wallet has enough ETH. +::: + + + +## Interacting with the Smart Contract + +After [the contract is verified](#6-verify-the-contract), you can use the `Read Contract` and `Write Contract` tabs to interact with the deployed contract via Blockscout: https://sepolia-blockscout.lisk.com/address/0x73e7a94dD5760d862F6FD9f8ea5D4245Bb143446?tab=contract. +Don't forget to update the contract address in the Blockscout URL. +You'll also need to connect your wallet first, by clicking the `Connect Wallet` button. \ No newline at end of file diff --git a/docs/building-on-lisk/deploying-smart-contract/with-thirdweb.mdx b/docs/building-on-lisk/deploying-smart-contract/with-thirdweb.mdx index 845ba748b..371c244ec 100644 --- a/docs/building-on-lisk/deploying-smart-contract/with-thirdweb.mdx +++ b/docs/building-on-lisk/deploying-smart-contract/with-thirdweb.mdx @@ -1,7 +1,7 @@ --- title: ... with thirdweb slug: /building-on-lisk/deploying-smart-contract/with-thirdweb -description: "A guide on deploying a smart contract on the Lisk test network using thirdweb. Includes instructions for setting up the environment, compiling, and deploying the smart contract." +description: "A guide on deploying a smart contract on the Lisk network using thirdweb. Includes instructions for setting up the environment, compiling, and deploying the smart contract." keywords: [ "thirdweb", "smart contract", @@ -24,6 +24,9 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; # Deploying a smart contract with thirdweb + +On this page, you will learn how to create, deploy and verify a smart contract with thirdweb to the **Lisk Sepolia** testnet. + [thirdweb](https://thirdweb.com/) is an end-to-end framework for smart contract development and deployment. It enables developers to deploy, standard contracts such as ERC-20, ERC-721, or ERC-1155, etc. without writing a line of code. diff --git a/docs/building-on-lisk/token-development/deploy-erc-20.md b/docs/building-on-lisk/token-development/deploy-erc-20.md deleted file mode 100644 index 80a81ad36..000000000 --- a/docs/building-on-lisk/token-development/deploy-erc-20.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: 'Deploying a new ERC-20 token on Lisk' -description: 'A guide on how to deploy a new ERC-20 token on Lisk.' -keywords: - [ - 'Lisk', - 'Token development', - 'Deploy token', - 'ERC', - 'EIP', - 'ERC-20', - 'Fungible token', - ] ---- - -# How to deploy a new ERC-20 token on Lisk - -This guide explains how to deploy a new ERC-20 token to Lisk. -In case you want to bridge an existing token from Ethereum, please refer to the guide [Bridging an L1 token to Lisk](../add-token-to-lisk). - -:::note -We will use Remix IDE for smart contract development in this guide, but feel free to choose a [smart contract development framework](/category/building-on-lisk/deploying-smart-contract) of your choice to implement your token contract. -::: - -## 1. Open Remix - -Navigate to [Remix](https://remix.ethereum.org) in your browser. - -## 2. Create a new file - -Inside the `contracts` folder, click the 📄 ("Create new file") button to create a new empty Solidity file. -You can name this file whatever you'd like, e.g., `MyToken.sol`. - -## 3. Copy the example contract - -Copy the following example contract into your new file: - -```solidity -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.28; - -import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; - -contract MyToken is ERC20 { - constructor(string memory _name, string memory _symbol, uint256 initialSupply) ERC20(_name, _symbol) { - _mint(msg.sender, initialSupply); - } - -} -``` - -## 4. Compile the contract - -Please double-check that the compiler version of the Remix IDE is matching with the compiler version mentioned in the smart contract: `pragma solidity ^0.8.28;`. - -Press the green play button at the top to compile the contract. - -## 5. Deploy the contract - -Open the `Deploy & run transactions` tab (this looks like an Ethereum logo with an arrow pointing right). -Make sure that your environment is set to "Injected Provider", your wallet is connected to the Lisk or Lisk Sepolia network, and Remix has access to your wallet. -Then, select the `MyToken` contract from the deployment dropdown and deploy it with the parameters of your choice, for example: - -- Name: MyToken -- Symbol: MYT -- InitalSupply: 1000000000000000000000 - -Click on the orange `transact` button to deploy the contract. -Finally, confirm the contract deployment in your connected wallet. - -Check the Remix log messages; they should include the contract address. -Paste this address in BlockScout, to see the contract in the Lisk blockchain explorer: https://sepolia-blockscout.lisk.com/address/0x6e8fF2E042c1637a2Da9563763c62362a3bbD712 - -In case you chose to deploy on the Lisk Mainnet, you need to paste the address on https://blockscout.lisk.com instead. - -## 6. Verify the contract - -If you want to interact with your contract on the block explorer, you, or someone else needs to verify it first. -The above contract has already been verified, so you should be able to view your version on a block explorer already. -For the remainder of this guide, we'll walk through how to verify your contract with Remix on the Lisk Sepolia Testnet. - -You can apply the same steps for verifying a contract on Lisk Mainnet in case you deployed it there in the previous step, just use https://blockscout.lisk.com instead of https://sepolia-blockscout.lisk.com in step 2. - -1. In Remix, rightlick on the contract you wish to verify and select `Flatten`. - This will create a new file `MyToken_flattened.sol`. -2. Now, switch to your [newly deployed contract](https://sepolia-blockscout.lisk.com/address/0x6e8fF2E042c1637a2Da9563763c62362a3bbD712) on https://sepolia-blockscout.lisk.com/ -3. Go to the contract tab and click on the blue `Verify and Publish` button. - - (Optional) Set a license for your contract. - - Choose `Solidity (Single file)` as the verification method. - - Choose the fitting compiler version for your contract. - - Disable code optimization. - - Copy the flattened source code from Remix and paste it into the `Enter the Solidity Contract Code` field. -4. Check that all info is correct and click the `Verify and Publish` button, to verify your contract. - - Once verified, the code tab will include the ✅ icon, and the source code will be viewable. diff --git a/docs/building-on-lisk/token-development/deploy-erc-20.mdx b/docs/building-on-lisk/token-development/deploy-erc-20.mdx new file mode 100644 index 000000000..83a3ec493 --- /dev/null +++ b/docs/building-on-lisk/token-development/deploy-erc-20.mdx @@ -0,0 +1,26 @@ +--- +title: 'Deploying a new ERC-20 token on Lisk' +description: 'A guide on how to deploy a new ERC-20 token on Lisk.' +keywords: + [ + 'Lisk', + 'Token development', + 'Deploy token', + 'ERC', + 'EIP', + 'ERC-20', + 'Fungible token', + ] +--- +import PartialExample from '../../partials/_remix-deploy-example.mdx'; + +# How to deploy a new ERC-20 token on Lisk + +This guide explains how to deploy a new ERC-20 token to Lisk. +In case you want to bridge an existing token from Ethereum, please refer to the guide [Bridging an L1 token to Lisk](../add-token-to-lisk). + +:::note +We will use Remix IDE for smart contract development in this guide, but feel free to choose a [smart contract development framework](/category/building-on-lisk/deploying-smart-contract) of your choice to implement your token contract. +::: + + diff --git a/docs/building-on-lisk/token-development/overview.md b/docs/building-on-lisk/token-development/overview.md index 3a9b7a381..00133c2ee 100644 --- a/docs/building-on-lisk/token-development/overview.md +++ b/docs/building-on-lisk/token-development/overview.md @@ -51,7 +51,7 @@ Any token is exactly equal to any other token; no tokens have special rights or This makes [ERC-20](https://eips.ethereum.org/EIPS/eip-20) tokens useful for things like a medium of exchange currency, voting rights, staking, and more. ### Guides -[How to deploy a new ERC-20 token on Lisk](deploy-erc-20.md) +[How to deploy a new ERC-20 token on Lisk](deploy-erc-20.mdx) ### Further reading - [Understand the ERC-20 token smart contract](https://ethereum.org/en/developers/tutorials/understand-the-erc-20-token-smart-contract/) diff --git a/docs/building-on-lisk/web3-app-development.mdx b/docs/building-on-lisk/web3-app-development.mdx index c83ecdc4b..8e06fd007 100644 --- a/docs/building-on-lisk/web3-app-development.mdx +++ b/docs/building-on-lisk/web3-app-development.mdx @@ -55,7 +55,7 @@ To describe important steps in this innovation, websites, and apps are generally Many of these applications and services became important pillars of the internet and people's lives, and even society as a whole. However, the more relevant these applications became, the more obvious and relevant their limitations became, as users had to trust the companies behind them with their data and privacy. -
Web2 limitations
+ ##### Web2 limitations Though Web 2.0 revolutionized how people positively used the web, a few of its characteristics led to certain disadvantages for users interacting with Web2 applications. For example: @@ -137,6 +137,8 @@ To interact with the blockchain, there are various libraries and frameworks avai ## Getting started with Web3 app development +### Platforms + To get started with the actual development of a Web3 app, you need to be clear about the right **platform(s)** to build your Web3 app on. The following sections will give you an overview of the different platforms you can choose from to build your Web3 app on, including further resources and guides to get you started with the app development. @@ -150,7 +152,6 @@ Last but not least, mobile apps allow users to access your app on the go, which - [Build Web3 Mobile Apps with React Native on Lisk with thirdweb](https://blog.thirdweb.com/web3-mobile-apps/build-web3-mobile-apps-with-reactive-native-on-lisk/) - [Video tutorial: How to Build a Web3 Mobile App](https://www.youtube.com/watch?v=PRAsc_ocVtk) *by thirdweb* - [Building a mobile dApp with Flutter](https://medium.com/dash-community/building-a-mobile-dapp-with-flutter-be945c80315a) -- [How to pay gas fees with LSK](https://blog.thirdweb.com/changelog/ts-tokenpaymasters-pay-for-gas-with-lisk-lsk-base-usdc-or-celo-cusd/) *by thirdweb* ### Web3 Web Apps The main advantage of web applications is that they are platform-independent and can be accessed from any device with a web browser. @@ -181,4 +182,101 @@ Similar to mobile apps, they are platform dependent. Desktop apps make it difficult for users to access them on the go, as you need a computer to use them. On the other side, desktop apps shine with their performance and the ability to use the full power of the computer they are running on, and they are typically build for larger screens allowing more complex user interfaces. So if you application requires a lot of computing power, and/or a very complex UI that might not be fitting for a mobile screen, a desktop app can be the right choice. - */} \ No newline at end of file + */} + +### Testing and Deployment +When it comes to testing and deployment of Web3 apps, there are some additional aspects to consider compared to Web2 apps. +The intrinsic vulnerabilities of smart contracts, the immutability of blockchain data and interacting with a decentralized network call for specific testing and security measures. +Gladly, there are already many tools available to help developers ensure the security and reliability of their Web3 apps. +The list below provides a selection of popular tools and services used to test Web3 apps: + +#### General test suites +- Foundry +- HardHat +- Remix +- [Waffle](https://getwaffle.io/) + +#### Smart contract analysis +- Slither +- [Etheno](https://github.com/crytic/etheno) +- Securify +- Mythx +- Smart contract audits + +#### Blockchain simulators / local devnets +- Ganache +- MoonBeam + +#### Testnets +##### Public Testnets +- Lisk Sepolia +##### Virtual testnets +- [Tenderly](https://blog.tenderly.co/how-virtual-testnets-replace-public-testnets/) + +#### E2E testing +- [Synpress](https://synpress.io/) + +#### Automated Testing and Continuous Integration (CI) +- k6 +- Artillery + +#### Monitoring +- Prometheus & Grafana +- Elastic Stack (ELK) + +### Best practices + +- Proxy contracts: +Smart contracts are immutable, meaning that once they are deployed, they cannot be changed. +However, to fix bugs or add new features to an already deployed smart contract, proxy contracts can be used to upgrade smart contracts without changing the contract address. +- Gas Optimization: +- secure key management +- Bug bounty programs +- handling user data + +### Onboarding Web2 users to Web3 + +A major challenge of Web3 applications is to provide a seamless user experience for users, similar to what they are used to from Web2 applications. + +To onboard Web2 users to Web3, apps need to simplify the way how users interact with the app, in a way that feels natural and intuitive to them, while still providing the benefits of Web3 in a secure way. +To aim for a smooth user experience, there are several strategies and design patterns that can be utilized: + +#### Account abstraction and smart accounts + +Account abstraction is a concept that introduces an additional layer over the blockchain, which delegates most of the complexity of interacting with the blockchain away from the user to smart contracts. +It has the potential to significantly enhance the user experience of Web3 applications, as it allows users to interact with the app in a more user-friendly and secure way. +Account abstraction is also sometimes referred to as "smart accounts" or "smart wallets", because it puts most of the logic of handling transactions and user interactions into smart contracts. + +This unlocks a range of features that significantly enhance user experience: + +- **Signature Abstraction**: Users no longer need to manually sign transactions with private keys. +Instead, smart contracts handle the signing logic, eliminating the risk of user error and phishing attacks. +- **Enhanced Security**: Multi-signature wallets, social recovery mechanisms, and custom access controls can be implemented within the smart contract, mitigating single points of failure and theft risks. +- **Customizable Transactions**: Smart contracts can be programmed to include spending limits, time-locked transactions, and dApp-specific controls. +This allows to automate transactions and tailoring the user experience to specific needs. +- **Fee Abstraction**: Transaction fees can be dynamically managed through smart contracts, enabling features like custom gas tokens and gasless transactions for specific use cases, see [Gasless transactions and fee management](#gasless-transactions-and-fee-management). + +On the technical side, account abstraction is implemented by the [ERC-4337 standard](https://eips.ethereum.org/EIPS/eip-4337), which defines a set of interfaces and functions that smart contracts can use to interact with the blockchain on behalf of users. + +It comprises the following fundamental components: + +- **UserOperation**: a structure that describes a transaction to be sent on behalf of a user. +To avoid confusion, it is not named “transaction”. +Like a transaction, it contains “sender”, “to”, “calldata”, “maxFeePerGas”, “maxPriorityFee”, “signature”, “nonce”. +Unlike a transaction the “signature” field usage is not defined by the protocol, but by each account implementation. +Also, it contains several other fields, described in detail in ERC-4337. +- **Account Contract**: the user's smart account sending a user operation. +- **EntryPoint**: a singleton contract to execute bundles of UserOperations. +It manages the verification and execution logic for UserOperations, ensuring they are processed correctly. +- **Bundler**: Bundlers are contracts that package UserOperations from a mempool and send them to the EntryPoint. +Bundling is the process where a node/bundler collects multiple UserOperations and creates a single transaction to submit onchain. +- **Account Factory**: When using a wallet for the first time, this contract specifies the creation of the smart contract wallet. +- **Paymaster**(optional): a helper contract that agrees to pay for the transaction, instead of the sender itself. +Paymasters can cover gas costs for users, sponsor specific transactions, or implement custom fee models, opening doors for novel use cases. + +##### Further reading +- [Account abstraction: A complete overview](https://blaize.tech/blog/account-abstraction-guide/) *by Blaize* +- [What is Account Abstraction? ERC-4337 Explained](https://blog.thirdweb.com/account-abstraction-erc4337/) *by thirdweb* +- [How to pay gas fees with LSK](https://blog.thirdweb.com/changelog/ts-tokenpaymasters-pay-for-gas-with-lisk-lsk-base-usdc-or-celo-cusd/) *by thirdweb* +- [How to create a Web3 mobile app with gasless transactions on Lisk](https://blog.thirdweb.com/web3-mobile-apps/build-web3-mobile-apps-with-reactive-native-on-lisk/) *by thirdweb* + diff --git a/docs/docs-user/intro-user.mdx b/docs/docs-user/intro-user.mdx index a31680bd3..e06912338 100644 --- a/docs/docs-user/intro-user.mdx +++ b/docs/docs-user/intro-user.mdx @@ -17,6 +17,6 @@ In this section, we will walk you through various ways of interacting with Lisk' # Highlights - Connect with your preferred wallet by following the [Connecting to a Wallet](/user/connecting-to-a-wallet) guide. -- Get ready to kickstart your testnet accounts with the amazing [Superchain Faucet](https://app.optimism.io/faucet?utm_source=docs) – the ultimate integrated solution for seeding testnet accounts! +- Get ready to kickstart your testnet accounts with the amazing [Superchain Faucet](https://console.optimism.io/faucet) – the ultimate integrated solution for seeding testnet accounts! - Discover [Lisk's governance model](/governance/overview) and play a part in shaping the future of Lisk. {/* - Got questions? You can easily find the answers in our FAQ section! */} \ No newline at end of file diff --git a/docs/lisk-tools/faucets.md b/docs/lisk-tools/faucets.md index c62d888c0..aa24001e1 100644 --- a/docs/lisk-tools/faucets.md +++ b/docs/lisk-tools/faucets.md @@ -32,7 +32,7 @@ Enter your account address or ENS name to receive 1 test LSK per request. ## Superchain Faucet Grants Testnet **ETH** on Lisk Sepolia. -The Superchain faucet is available here: https://app.optimism.io/faucet +The Superchain faucet is available here: https://console.optimism.io/faucet There are two different options to acquire free Testnet ETH: diff --git a/docs/partials/_remix-deploy-example.mdx b/docs/partials/_remix-deploy-example.mdx new file mode 100644 index 000000000..6be33a701 --- /dev/null +++ b/docs/partials/_remix-deploy-example.mdx @@ -0,0 +1,69 @@ +## 1. Open Remix + +Navigate to [Remix](https://remix.ethereum.org) in your browser. + +## 2. Create a new file + +Inside the `contracts` folder, click the 📄 ("Create new file") button to create a new empty Solidity file. +You can name this file whatever you'd like, e.g., `MyNFT.sol`. + +## 3. Copy the example contract + +Copy the following example contract into your new file to deploy a simple NFT contract, or replace it with your own contract you wish to deploy: + +```solidity +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.28; + +import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; + +contract MyNFT is ERC721 { + uint256 public currentTokenId; + + constructor() ERC721("My NFT", "MNFT") {} + + function mint(address recipient) public returns (uint256) { + uint256 newItemId = ++currentTokenId; + _safeMint(recipient, newItemId); + return newItemId; + } +} +``` + +## 4. Compile the contract + +Please double-check that the compiler version of the Remix IDE matches the compiler version mentioned in the smart contract: `pragma solidity ^0.8.28;`. + +Press the green play button at the top to compile the contract. + +## 5. Deploy the contract + +Open the `Deploy & run transactions` tab (this looks like an Ethereum logo with an arrow pointing right). +Make sure that your environment is set to "Injected Provider", your wallet is connected to Lisk or Lisk Sepolia network, and Remix has access to your wallet. +Then, select the `MyNFT` contract from the deployment dropdown and click the orange `Deploy` button to deploy the contract and confirm the contract deployment in your connected wallet. + +Check the Remix log messages; they should include the contract address. +Paste this address in Blockscout, to see the contract in the Lisk blockchain explorer: https://sepolia-blockscout.lisk.com/address/0x73e7a94dD5760d862F6FD9f8ea5D4245Bb143446. + +In case you chose to deploy on the Lisk Mainnet, you need to paste the address on https://blockscout.lisk.com instead. + +## 6. Verify the contract + +If you want to interact with your contract on the block explorer, you first need to verify it. +The above contract has already been verified, so you should be able to view your version on a block explorer already. +For the remainder of this guide, we'll walk through how to verify your contract with Remix on the Lisk Sepolia Testnet. + +You can apply the same steps for verifying a contract on Lisk Mainnet, in case you deployed it there in the previous step, just use https://blockscout.lisk.com instead of https://sepolia-blockscout.lisk.com in step 2. + + - In Remix, right-click on the contract you wish to verify and select `Flatten`. + This will create a new file `MyNFT_flattened.sol`. + - Now, switch to your [newly deployed contract](https://sepolia-blockscout.lisk.com/address/0x73e7a94dD5760d862F6FD9f8ea5D4245Bb143446) on https://sepolia-blockscout.lisk.com/ + - Go to the contract tab and click on the blue `Verify and Publish` button. + - (Optional) Set a license for your contract. + - Choose `Solidity (Single file)` as the verification method. + - Choose the compiler version that fits your contract. + - Disable code optimization. + - Copy the flattened source code from Remix and paste it into the `Enter the Solidity Contract Code` field. + - Check that all info is correct and click the `Verify and Publish` button, to verify your contract. + + Once verified, the code tab will include the ✅ icon, and the source code will be viewable. diff --git a/i18n/ind/docusaurus-plugin-content-docs/current/about-lisk/fees.md b/i18n/ind/docusaurus-plugin-content-docs/current/about-lisk/fees.md index eacd04cfe..13ab87195 100644 --- a/i18n/ind/docusaurus-plugin-content-docs/current/about-lisk/fees.md +++ b/i18n/ind/docusaurus-plugin-content-docs/current/about-lisk/fees.md @@ -46,7 +46,7 @@ transaction_fee = l2_execution_fee + l1_data_fee :::note Lisk's fee calculation is based on the fee system of OP Mainnet, using the latest **Fjord** upgrade. -Check the [Fees page](https://docs.optimism.io/stack/transactions/fees#fjord) in the Optmism documentation, to learn more about how the fee system works in detail. +Check the [Fees page](https://docs.optimism.io/stack/transactions/fees#fjord) in the Optimism documentation, to learn more about how the fee system works in detail. ::: ### L2 Execution Fee @@ -108,8 +108,8 @@ weighted_gas_price = 16*base_fee_scalar*base_fee + blob_base_fee_scalar*blob_bas The current values for the scalars are: - - `base_fee_scalar` = 0.020698 - - `blob_base_fee_scalar` = 1.364961 + - `base_fee_scalar` = 0.024740 + - `blob_base_fee_scalar` = 0.801328 They can be adjusted depending on network conditions, to mitigate spikes in the transaction fees. @@ -127,8 +127,8 @@ The [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) parameters used by the L | Parameter | Lisk Mainnet value | Ethereum value (for reference) | | ------------------------------------- | ---------------: | -----------------------------: | -| Block gas limit | 30,000,000 gas | 30,000,000 gas | -| Block gas target | 1,500,000 gas | 15,000,000 gas | +| Block gas limit | 60,000,000 gas | 30,000,000 gas | +| Block gas target | 3,000,000 gas | 15,000,000 gas | | EIP-1559 elasticity multiplier | 20 | 2 | | EIP-1559 denominator | 1,000 | 8 | | Maximum base fee increase (per block) | 1.9% | 12.5% | diff --git a/i18n/ind/docusaurus-plugin-content-docs/current/about-lisk/network-info.md b/i18n/ind/docusaurus-plugin-content-docs/current/about-lisk/network-info.md index 712af24c5..acb2ac19c 100644 --- a/i18n/ind/docusaurus-plugin-content-docs/current/about-lisk/network-info.md +++ b/i18n/ind/docusaurus-plugin-content-docs/current/about-lisk/network-info.md @@ -36,15 +36,15 @@ The Lisk L2 is available on the following network: ### Lisk Sepolia Testnet -| Name | Value | -| :-------------- | :-------------------------------------------------------------------------- | -| **Network Name** | Lisk Sepolia Testnet | -| **HTTP RPC Endpoint** | [https://rpc.sepolia-api.lisk.com](https://rpc.sepolia-api.lisk.com) | -| **WS RPC Endpoint** | [wss://ws.sepolia-api.lisk.com](wss://ws.sepolia-api.lisk.com) | -| **Chain ID** | 4202 | -| **Currency Symbol** | ETH | -| **Block Explorer** | https://sepolia-blockscout.lisk.com | -| **Block Explorer API** | https://sepolia-blockscout.lisk.com/api | -| **Lisk Testnet Bridge** | https://sepolia-bridge.lisk.com | -| **Lisk Testnet Faucet** (Grants LSK) | https://sepolia-faucet.lisk.com/ | -| **Superchain Testnet Faucet** (Grants ETH ) | https://app.optimism.io/faucet | \ No newline at end of file +| Name | Value | +| :-------------- | :-------------------------------------------------------------------- | +| **Network Name** | Lisk Sepolia Testnet | +| **HTTP RPC Endpoint** | [https://rpc.sepolia-api.lisk.com](https://rpc.sepolia-api.lisk.com) | +| **WS RPC Endpoint** | [wss://ws.sepolia-api.lisk.com](wss://ws.sepolia-api.lisk.com) | +| **Chain ID** | 4202 | +| **Currency Symbol** | ETH | +| **Block Explorer** | https://sepolia-blockscout.lisk.com | +| **Block Explorer API** | https://sepolia-blockscout.lisk.com/api | +| **Lisk Testnet Bridge** | https://sepolia-bridge.lisk.com | +| **Lisk Testnet Faucet** (Grants LSK) | https://sepolia-faucet.lisk.com/ | +| **Superchain Testnet Faucet** (Grants ETH ) | https://console.optimism.io/faucet | \ No newline at end of file diff --git a/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/add-token-to-lisk/custom-token.mdx b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/add-token-to-lisk/custom-token.mdx index 092afceeb..79fb3d932 100644 --- a/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/add-token-to-lisk/custom-token.mdx +++ b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/add-token-to-lisk/custom-token.mdx @@ -46,7 +46,7 @@ You will need to get some ETH on both, Sepolia and Lisk Sepolia networks. :::info You can use [ETH Sepolia Faucet](https://sepoliafaucet.com/) to get ETH on Sepolia. -You can use the [Superchain Faucet](https://app.optimism.io/faucet?utm_source=docs) to get ETH on Lisk Sepolia. +You can use the [Superchain Faucet](https://console.optimism.io/faucet) to get ETH on Lisk Sepolia. ::: ### Add Lisk Sepolia to Your Wallet diff --git a/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/add-token-to-lisk/index.md b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/add-token-to-lisk/index.md index 2b0a9a0fb..8757561d6 100644 --- a/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/add-token-to-lisk/index.md +++ b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/add-token-to-lisk/index.md @@ -18,6 +18,7 @@ keywords: # Bridging an L1 token to Lisk This page is intended for token issuers who already have an ERC-20 contract deployed on Ethereum and would like to submit their token for bridging between Ethereum and Lisk. Lisk uses the Superchain Token List as a reference for tokens that have been deployed on Lisk. +In case you want to create a new token on Lisk, please refer to the page [Token development](../token-development/overview.md). ## Superchain Token List The [Superchain Token List](https://github.com/ethereum-optimism/ethereum-optimism.github.io) exists to help users discover the correct bridged token addresses for any given native token. @@ -71,7 +72,7 @@ To add your token to the list, perform the following steps. ### Step 1: Deploy your token on Lisk Select your preferred bridging framework and use it to deploy an ERC-20 for your token on Lisk. -We recommend you use the framework provided by Lisk's [standard bridge](#the-standard-bridge) contracts and, furthermore, deploy your token using the [OptimismMintableERC20Factory](https://docs.lisk.com/contracts#lisk-network-l2). +We recommend you use the framework provided by Lisk's [standard bridge](#the-standard-bridge) contracts and, furthermore, deploy your token using the [OptimismMintableERC20Factory](../contracts.mdx#lisk-network-l2). Deploying your token on Lisk in this manner provides us with guarantees that will smooth the approval process. If you choose a different bridging framework, its interface must be compatible with that of the standard bridge. Otherwise, it may be difficult for us to support them. @@ -83,6 +84,7 @@ For step-by-step instructions on how to deploy ERC-20 tokens on Lisk, check the ### Step 2: Submit details of your token Follow the instructions in the [GitHub repository](https://github.com/ethereum-optimism/ethereum-optimism.github.io) and submit a PR containing the required details for your token. +Especially, follow the Lisk-specific instructions detailed in the section [Specifying chains](https://github.com/ethereum-optimism/ethereum-optimism.github.io?tab=readme-ov-file#specifying-chains). **Important:** You must specify in your token's `data.json` file a section for `lisk-sepolia` and/or `lisk`. @@ -92,3 +94,10 @@ For example, [this PR](https://github.com/ethereum-optimism/ethereum-optimism.gi ### Step 3: Await final approval Reviews are regularly conducted by the Lisk team and you should receive a reply within 24-72 hours (depending on if the PR is opened on a weekday, weekend or holiday). + +## Step 4 : Add token to Gelato Bridge +To add your token to the [Gelato Bridge](https://bridge.lisk.com/), reach out to the Lisk team on [Lisk Discord](https://lisk.chat) with the details of the token: + +- Go to the `#lisk-dev` channel. +- Tag a moderator, ask them to add your token to the Gelato Bridge, and share the link to your PR from [step 2: token details](#step-2-submit-details-of-your-token). +- The Lisk team will then coordinate with Gelato to get the token added to the Gelato Bridge. \ No newline at end of file diff --git a/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/add-token-to-lisk/standard-token.md b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/add-token-to-lisk/standard-token.md index 826c29ba6..107fafa33 100644 --- a/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/add-token-to-lisk/standard-token.md +++ b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/add-token-to-lisk/standard-token.md @@ -53,7 +53,7 @@ You will need to get some ETH on both of these testnets. :::info You can use [ETH Sepolia Faucet](https://sepoliafaucet.com/) to get ETH on Sepolia. -You can use the [Superchain Faucet](https://app.optimism.io/faucet?utm_source=docs) to get ETH on Lisk Sepolia. +You can use the [Superchain Faucet](https://console.optimism.io/faucet) to get ETH on Lisk Sepolia. ::: ### Get an L1 ERC-20 Token Address diff --git a/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/deploying-smart-contract/with-Hardhat.md b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/deploying-smart-contract/with-Hardhat.md index 45f556283..4d37c0149 100644 --- a/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/deploying-smart-contract/with-Hardhat.md +++ b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/deploying-smart-contract/with-Hardhat.md @@ -116,7 +116,7 @@ Substitute `` with the private key for your wallet. `WALLET_KEY` is the private key of the wallet to use when deploying a contract. Follow the instructions of your wallet on how to get your private key. -E.g. for **MetaMask**, please follow [these instructions](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key). +E.g. for **MetaMask**, please follow [these instructions](https://support.metamask.io/configure/accounts/how-to-export-an-accounts-private-key/). **It is critical that you do NOT commit this to a public repo** ::: diff --git a/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/deploying-smart-contract/with-Remix.mdx b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/deploying-smart-contract/with-Remix.mdx new file mode 100644 index 000000000..2408dad6d --- /dev/null +++ b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/deploying-smart-contract/with-Remix.mdx @@ -0,0 +1,55 @@ +--- +title: ... with Remix +slug: /building-on-lisk/deploying-smart-contract/with-Remix +description: "A guide on deploying a smart contract on the Lisk network using Remix. Includes instructions for setting up the environment, compiling, deploying and verifying the smart contract." +keywords: [ + "Remix", + "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" + ] +--- +import PartialExample from '../../partials/_remix-deploy-example.mdx'; + +# Deploying a smart contract with Remix + +On this page, you will learn how to create, deploy and verify a smart contract with the Remix IDE to the **Lisk Sepolia** testnet. + +Remix Online IDE is a powerful toolset for developing, deploying, debugging, and testing Ethereum and EVM-compatible smart contracts. +It requires no setup and can be accessed directly through the browser under https://remix.ethereum.org/. + +## Prerequisites + +### Wallet funds + +**Deploying contracts** to the blockchain requires a **gas fee**. +Therefore, you will need to fund your wallet with ETH to cover those gas fees. + +For this guide, you will be deploying a contract to the Lisk Sepolia Testnet. + +You can deposit the required tokens by using the [Lisk Bridge](https://sepolia-bridge.lisk.com/bridge/lisk-sepolia-testnet). + +In case your wallet doesn't hold enough `SepoliaETH`, use one of the available faucets for the **Ethereum Sepolia** Testnet like [https://sepoliafaucet.com](https://sepoliafaucet.com/) to receive free Testnet ETH. +Then, use the aforementioned Lisk Bridge to send tokens from the **Ethereum Sepolia Testnet** to the **Lisk Sepolia Testnet**. + +:::note +You can deploy a contract on Lisk Mainnet by adopting the same process. +Before deploying to Mainnet, ensure that your wallet has enough ETH. +::: + + + +## Interacting with the Smart Contract + +After [the contract is verified](#6-verify-the-contract), you can use the `Read Contract` and `Write Contract` tabs to interact with the deployed contract via Blockscout: https://sepolia-blockscout.lisk.com/address/0x73e7a94dD5760d862F6FD9f8ea5D4245Bb143446?tab=contract. +Don't forget to update the contract address in the Blockscout URL. +You'll also need to connect your wallet first, by clicking the `Connect Wallet` button. \ No newline at end of file diff --git a/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/interacting-with-the-blockchain/viem.mdx b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/interacting-with-the-blockchain/viem.mdx index 145b7ce6c..6a4268460 100644 --- a/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/interacting-with-the-blockchain/viem.mdx +++ b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/interacting-with-the-blockchain/viem.mdx @@ -1,6 +1,6 @@ --- title: ...with viem -slug: /building-on-lisk/interacting-with-blockchain/viem +slug: /building-on-lisk/interacting-with-the-blockchain/viem description: Documentation for using Viem, a TypeScript interface for EVM-compatible blockchains. This page covers installation, setup, and various functionalities such as reading and writing blockchain data and interacting with smart contracts on Lisk. keywords: [ diff --git a/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/token-development/deploy-erc-20.mdx b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/token-development/deploy-erc-20.mdx new file mode 100644 index 000000000..83a3ec493 --- /dev/null +++ b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/token-development/deploy-erc-20.mdx @@ -0,0 +1,26 @@ +--- +title: 'Deploying a new ERC-20 token on Lisk' +description: 'A guide on how to deploy a new ERC-20 token on Lisk.' +keywords: + [ + 'Lisk', + 'Token development', + 'Deploy token', + 'ERC', + 'EIP', + 'ERC-20', + 'Fungible token', + ] +--- +import PartialExample from '../../partials/_remix-deploy-example.mdx'; + +# How to deploy a new ERC-20 token on Lisk + +This guide explains how to deploy a new ERC-20 token to Lisk. +In case you want to bridge an existing token from Ethereum, please refer to the guide [Bridging an L1 token to Lisk](../add-token-to-lisk). + +:::note +We will use Remix IDE for smart contract development in this guide, but feel free to choose a [smart contract development framework](/category/building-on-lisk/deploying-smart-contract) of your choice to implement your token contract. +::: + + diff --git a/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/token-development/overview.md b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/token-development/overview.md index 3a9b7a381..00133c2ee 100644 --- a/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/token-development/overview.md +++ b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/token-development/overview.md @@ -51,7 +51,7 @@ Any token is exactly equal to any other token; no tokens have special rights or This makes [ERC-20](https://eips.ethereum.org/EIPS/eip-20) tokens useful for things like a medium of exchange currency, voting rights, staking, and more. ### Guides -[How to deploy a new ERC-20 token on Lisk](deploy-erc-20.md) +[How to deploy a new ERC-20 token on Lisk](deploy-erc-20.mdx) ### Further reading - [Understand the ERC-20 token smart contract](https://ethereum.org/en/developers/tutorials/understand-the-erc-20-token-smart-contract/) diff --git a/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/using-oracle-data/redstone-push.md b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/using-oracle-data/redstone-push.md index e269c8c54..c81374335 100644 --- a/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/using-oracle-data/redstone-push.md +++ b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/using-oracle-data/redstone-push.md @@ -31,7 +31,7 @@ RedStone data feeds are compatible with Chainlink's [AggregatorV3Interface](http - **Aggregator contract**: An aggregator is a contract that receives periodic data updates from the oracle network. Aggregators store aggregated data onchain so that consumers can retrieve it and act upon it within the same transaction. -These contracts are already deployed on the Lisk network and can be directly used by Consumers. +These contracts have already been deployed on the Lisk network and can be directly used by consumers. - **Consumer**: A consumer is an onchain or offchain application that uses Data Feeds. Consumer contracts use the `AggregatorV3Interface` to call functions on the proxy contract[^1] of the Aggregator to retrieve oracle data. @@ -52,7 +52,7 @@ The following Aggregators are available on Lisk Mainnet for RedStone Push: - [WBTC/USD L2PriceFeedWithoutRounds](https://blockscout.lisk.com/address/0x13da43eA89fB692bdB6666F053FeE70aC61A53cd) - address: `0x13da43eA89fB692bdB6666F053FeE70aC61A53cd` -In this guide, we will develop a Consumer contract that will request the latest spot prices from the ETH, LSK and USDT data feeds. +In this guide, we will develop a Consumer contract that requests the latest spot prices from the ETH, LSK, and USDT data feeds. :::note RedStone Push is only fully available on Lisk Mainnet, so please make sure to deploy your Consumer contract on Lisk Mainnet as well. @@ -62,14 +62,14 @@ In case you wish to deploy on Lisk Sepolia Testnet, check the [Tellor](./tellor. ## Import -To use the RedStone data inside your contract, import the [AggregatorV3Interface](https://docs.chain.link/data-feeds/using-data-feeds#solidity) from Chainlink like shown in the example contract below. +To use the RedStone data inside your contract, import the [AggregatorV3Interface](https://docs.chain.link/data-feeds/using-data-feeds#solidity) from Chainlink, as shown in the example contract below. -For every data feed you like to store, create a new constant with type `AggregatorV3Interface`. +Create a new constant with the type `AggregatorV3Interface` for every data feed you want to store. -In the constructor, set the above defined constants to point to the respective data feeds: -Use the `AggregatorV3Interface()` function and pass the address of the respective data feed contract as parameter. +In the constructor, set the above-defined constants to point to the respective data feeds. +Use the `AggregatorV3Interface()` function and pass the address of the respective data feed contract as a parameter. -```solidity +```solidity title="Importing the AggregatorV3Interface" // SPDX-License-Identifier: MIT pragma solidity ^0.8.28; @@ -116,7 +116,7 @@ To read the data of the price feeds, we define the following functions in the co - `getRedStoneLSKDataFeedLatestAnswer()` - `getRedStoneUSDTDataFeedLatestAnswer()` -Inside of the functions, call the [latestRoundData](https://docs.chain.link/data-feeds/api-reference#latestrounddata) on the respective data feeds to receive the latest spot prices for the respective token. +Inside the functions, call the [latestRoundData](https://docs.chain.link/data-feeds/api-reference#latestrounddata) on the respective data feeds to receive the latest spot prices for the respective token. The `latestRoundData()` function returns the following values: @@ -132,17 +132,15 @@ In this example, we will only use `answer` and `updatedAt`. The `updatedAt` value should be used to make sure that the `answer` is recent enough for your application to use it. You can compare `updatedAt` to the latest block time (`uint256 currentTime = block.timestamp;`) to ensure you are only using the latest oracle data in your application. -```solidity +:::caution +This is an example contract that uses un-audited code. +Do not use this code in production. +::: + +```solidity title="Reading data feeds" // SPDX-License-Identifier: MIT pragma solidity ^0.8.28; -/** - * THIS IS AN EXAMPLE CONTRACT THAT USES HARDCODED - * VALUES FOR CLARITY. - * THIS IS AN EXAMPLE CONTRACT THAT USES UN-AUDITED CODE. - * DO NOT USE THIS CODE IN PRODUCTION. - */ - import {AggregatorV3Interface} from "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol"; contract RedStoneDataConsumer { diff --git a/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/web3-app-development.mdx b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/web3-app-development.mdx new file mode 100644 index 000000000..594e231d7 --- /dev/null +++ b/i18n/ind/docusaurus-plugin-content-docs/current/building-on-lisk/web3-app-development.mdx @@ -0,0 +1,184 @@ +--- +title: Web3 App Development +slug: /web3-app-development +description: 'An introduction into Web3 application development on Lisk.' +keywords: + [ + 'Lisk', + 'Web3 apps', + 'Web3 app', + 'Web3 application', + 'Web3 app development', + 'Web3 mobile app', + 'Web3 PWA', + 'dApp development', + 'Mobile dApp development', + 'Mobile app development', + 'Lisk apps', + 'Lisk dApps', + ] +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Web3 App Development + +On this page, you will learn what Web3 applications are, how they differ from Web 2.0 apps, and how to get started with Web3 app development on Lisk. + +## What are Web3 applications? + +### Evolution of the Web + +Since the internet was born, there has been constant innovation in how people use the internet to communicate and interact with each other. +To describe important steps in this innovation, websites, and apps are generally categorized into different Web "versions": + + + + Web 1.0 is the first "version" of the Web, i.e., the first generation of websites that occurred when the Internet became available to the broader public around 1990. + Web 1.0 is often referred to as the "static" or "read-only" web, consisting mainly of simple static HTML pages with limited interactivity. + + However, some Web 2.0 capabilities were present in the days of Web 1.0 but were implemented differently. + For example, a Web 1.0 site may have had a guestbook page for visitor comments, instead of a comment section at the end of each page (typical of Web 2.0). + + + + In the late 1990s the transition to [Web 2.0](https://en.wikipedia.org/wiki/Web_2.0) started, when some Web 1.0 sites introduced dynamic HTML with social features, allowing users to interact with web pages in a much more fluent way. + + :::info + The term "Web 2.0" was coined by Darcy DiNucci, an information architecture consultant, in her January 1999 article [Fragmented Future](http://darcyd.com/fragmented_future.pdf). + ::: + + Web 2.0 is the era where social media, [web applications](https://en.wikipedia.org/wiki/Web_application), and mobile apps came to the rise. + Because of the new social features and improved user experience that Web 2.0 apps offered, the number of users interacting with the web increased significantly, leading to the creation of many new web services and applications. + Some of the most popular examples of Web 2.0 applications are Facebook, X, Amazon, and YouTube. + + Many of these applications and services became important pillars of the internet and people's lives, and even society as a whole. + However, the more relevant these applications became, the more obvious and relevant their limitations became, as users had to trust the companies behind them with their data and privacy. + + ##### Web2 limitations + + Though Web 2.0 revolutionized how people positively used the web, a few of its characteristics led to certain disadvantages for users interacting with Web2 applications. For example: + + - Censorship + - Lack of transparency + - Limited privacy + - Limited interoperability + + + Web3 (also known as Web 3.0) is the next step in the evolution of the Web, aiming to address the [limitations of Web 2.0](./web3-app-development.mdx?web-version=web2#web2-limitations). + Web3 is based on the idea of a decentralized internet, where users are in control over their data. + + :::info + The term "Web3" was coined by Polkadot founder and Ethereum co-founder Gavin Wood in 2014, referring to a [decentralized online ecosystem based on the blockchain](https://www.wired.com/story/web3-gavin-wood-interview/). + ::: + + 2015 marked the beginning of the Web3 era when Ethereum launched as the world's first programmable blockchain. + Web3 applications are decentralized applications (also known as "dApps") that run on a blockchain, allowing users to interact with each other and the blockchain in a trustless way. + This puts users in control of their data and privacy, removing the need to trust a central authority. + + Web3 apps are built on top of blockchain technology, which allows users greater ownership and control over their data. + This provides new features and allows services that are not feasible in the Web2 world. + Often, Web3 apps combine other cutting-edge technologies like AI to provide unique and new user experiences. + + New types of Web3 apps include: + + - DeFi (Decentralized Finance), for example: + - DEXs (Decentralized Exchanges) + - GameFi (Gaming Finance) + - Staking and yield farming platforms + - Decentralized crowdfunding and investing platforms + - Decentralized lending and borrowing + - Prediction markets + - Asset / RWA tokenization platforms + - DAOs (Decentralized Autonomous Organizations) + - [DeSoc](https://onchain.org/magazine/decentralized-social-media-business-opportunities-are-they-real/) (Decentralized Social Media) + - [DeSci](https://onchain.org/magazine/not-only-the-best-desci-crypto-projects-an-overview/) (Decentralized Science) + - [DePIN](https://onchain.org/magazine/how-depin-web3-projects-are-connecting-the-world-to-crypto/) (Decentralized Physical Infrastructure Networks) + + Web3 is a promise to bring back the original vision of the internet, where users are in control of their data and privacy, and where the internet is a place for free speech and innovation. + However, how blockchain technology is implemented and used in apps can vary greatly, and not all Web3 apps are equally decentralized and trustless. + + + +### Web2 vs Web3 app development +#### Languages +Concerning frontend app development, there aren't many differences between Web2 and Web3 apps when it comes to programming languages. +All languages that are typically used for Web2 app development can also be used for Web3 app development. +In the end, Web3 apps can even look and feel exactly like Web2 apps for users, because their frontend is built with the same technologies. + +However, the backend of Web3 apps is quite different, as it interacts with the blockchain through smart contracts. +Smart contracts are written in [Solidity](https://soliditylang.org/), therefore Web3 developers need to know Solidity to build the smart contracts they require for their app. +Luckily, for many use cases, there are already audited smart contracts available(see [OpenZeppelin](https://www.openzeppelin.com/solidity-contracts) or [thirdweb](https://thirdweb.com/explore)) that can be used, so developers don't need to write all of their smart contracts from scratch. + +#### Tech stack +As mentioned above, the Web2 and Web3 app frontend development is very similar. +Theoretically, you could build a Web3 app with nearly the same tech stack as a Web2 app, like Next.js, Vite, etc. +The only thing you need to add is a way for your application to interact with the blockchain, see [Data access](#data-access). + +To support developers, many blockchain platforms offer their own SDKs and tools to interact with their blockchain, which can make development easier and more efficient. +There are also SDKs for Web3 app development that provide a complete tech stack, like [thirdweb](https://thirdweb.com/) or [Alchemy](https://www.alchemy.com/), which take away most of the complexity of blockchain development and provide a smooth developer experience. +thirdweb supports [Lisk](https://thirdweb.com/lisk) and many other EVM-compatible blockchains. + +#### Data storage +In Web2 apps, data is typically stored in a centralized database. +In Web3 apps, some data is stored on the blockchain, i.e., a decentralized database. +How the data is stored is defined inside of smart contracts. +However, not all data should always be stored on the blockchain, as it is quite expensive and slow to store large amounts of data onchain. +Therefore, Web3 apps sometimes use a combination of onchain storage and offchain storage. + +#### Data access +In Web2 apps, data from the database is accessed through APIs. +In Web3 apps, blockchain data is accessed through smart contracts. +They usually expose public functions that can be called by the app frontend to read and/or write data from/to the blockchain, similar to a classical API. +To interact with the blockchain, there are various libraries and frameworks available, like [viem](https://viem.sh/), [web3.js](https://web3js.readthedocs.io), or [ethers.js](https://docs.ethers.io). + +### Further regarding +- [Introduction to Web3](https://ethereum.org/en/web3/) *by Ethereum* + +## Getting started with Web3 app development + +To get started with the actual development of a Web3 app, you need to be clear about the right **platform(s)** to build your Web3 app on. +The following sections will give you an overview of the different platforms you can choose from to build your Web3 app on, including further resources and guides to get you started with the app development. + +### Web3 Mobile Apps +Mobile applications are generally a great way to reach a large audience, as most people have a smartphone and use it to access the internet. +Mobile apps can use the integrated features of handheld devices and are typically faster and more user-friendly than websites. +This can provide a more immersive experience for users. +Last but not least, mobile apps allow users to access your app on the go, which can be a big advantage for many use cases. + +#### Development resources +- [Build Web3 Mobile Apps with React Native on Lisk with thirdweb](https://blog.thirdweb.com/web3-mobile-apps/build-web3-mobile-apps-with-reactive-native-on-lisk/) +- [Video tutorial: How to Build a Web3 Mobile App](https://www.youtube.com/watch?v=PRAsc_ocVtk) *by thirdweb* +- [Building a mobile dApp with Flutter](https://medium.com/dash-community/building-a-mobile-dapp-with-flutter-be945c80315a) +- [How to pay gas fees with LSK](https://blog.thirdweb.com/changelog/ts-tokenpaymasters-pay-for-gas-with-lisk-lsk-base-usdc-or-celo-cusd/) *by thirdweb* + +### Web3 Web Apps +The main advantage of web applications is that they are platform-independent and can be accessed from any device with a web browser. +Additionally, they don't need to be installed by the user and can be used directly in the browser. + +#### Development resources +- [How to Build an NFT Minting dApp](https://blog.thirdweb.com/guides/build-nft-minting-dapp-with-thirdweb-guide/) *by thirdweb* + +### Web3 PWAs +A Progressive Web App (PWA) allows users to install a web app on their devices. +They appear as native apps on desktop or mobile devices and offer features like offline support and push notifications. +This way, PWAs allow the development of an application that can be used via a browser[^1], mobile, or desktop application alike. +Therefore, PWAs are a great choice for reaching users on different platforms simultaneously. + +Additionally, PWAs allow a user to directly install the app through your web app without the need to visit an app store. +This allows you to serve the app directly to the users, without bothering about restrictions of app stores on what is allowed for blockchain applications. +In-app purchase fees can also be avoided because users no longer need to go through the app store. + +[^1]: Only supported in PWA-compatible browsers (most Chromium-based browsers should work). + +#### Development resources +- [How to Create a Web3 PWA](https://blog.thirdweb.com/guides/how-to-create-a-web3-pwa/) *by thirdweb* +- [Video tutorial: Build a Web3 PWA](https://www.youtube.com/watch?v=VU8i-dn2_GE) *by thirdweb* + +{/* ### Web3 Desktop apps +Desktop apps are native applications that are installed on a user's computer. +Similar to mobile apps, they are platform dependent. +Desktop apps make it difficult for users to access them on the go, as you need a computer to use them. +On the other side, desktop apps shine with their performance and the ability to use the full power of the computer they are running on, and they are typically build for larger screens allowing more complex user interfaces. +So if you application requires a lot of computing power, and/or a very complex UI that might not be fitting for a mobile screen, a desktop app can be the right choice. + */} \ No newline at end of file diff --git a/i18n/ind/docusaurus-plugin-content-docs/current/docs-user/exchanges.md b/i18n/ind/docusaurus-plugin-content-docs/current/docs-user/exchanges.md index b35a514db..f2c3ee58b 100644 --- a/i18n/ind/docusaurus-plugin-content-docs/current/docs-user/exchanges.md +++ b/i18n/ind/docusaurus-plugin-content-docs/current/docs-user/exchanges.md @@ -33,9 +33,10 @@ Lisk (LSK) is available for trading on various