Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Translation of "Building on Lisk" into Indonesian #264

Open
wants to merge 7 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"label": "Building on Lisk",
"label": "Membangun di atas Lisk",
"position": 3,
"link": {
"type": "generated-index",
"description": "Guides for developers wanting to build on Lisk L2."
"description": "Panduan untuk developer yang ingin membangun di Lisk L2."
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Deploying a custom token
title: Mendeploy Token Sendiri
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved
slug: /building-on-lisk/add-token-to-lisk/custom-token
description: 'Learn how to bridge your custom ERC-20 token to Lisk using the standard bridge.'
description: 'Pelajari cara memindahkan token ERC-20 Anda sendiri ke Lisk menggunakan bridge standar.'
keywords:
[
'ERC-20 contract',
Expand All @@ -16,72 +16,72 @@ keywords:
]
---

# Deploying your Custom ERC-20 token to Lisk
# Mendeploy Token ERC-20 Anda Sendiri ke Lisk
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved

{/* :::info
**This tutorial is for developers who want to bridge a new Custom ERC-20 token to Lisk Mainnet.**
If you want to bridge existing tokens, you can follow the tutorial on [Bridging ERC-20 tokens with the Optimism SDK](https://docs.optimism.io/builders/app-developers/tutorials/cross-dom-bridge-erc20).
**Tutorial ini ditujukan untuk developer yang ingin memindahkan token ERC-20 baru mereka sendiri ke Lisk Mainnet menggunakan bridge.**
Jika Anda ingin memindahkan token yang sudah ada, Anda dapat mengikuti tutorial [Memindahkan Token ERC-20 dengan Optimism SDK](https://docs.optimism.io/builders/app-developers/tutorials/cross-dom-bridge-erc20).
::: */}

In this tutorial, you will learn how to bridge a custom ERC-20 token from Ethereum or Sepolia to the Lisk or Lisk Sepolia network, respectively.
By using the [Standard Bridge system](https://docs.optimism.io/builders/dapp-developers/bridging/standard-bridge), this tutorial is meant for developers who already have an existing ERC-20 token on Ethereum and want to create a bridged representation of that token on Lisk.
Dalam tutorial ini, Anda akan belajar cara memindahkan token ERC-20 kustom dari Ethereum atau Sepolia ke jaringan Lisk atau Lisk Sepolia.
Dengan menggunakan [Sistem Bridge Standar](https://docs.optimism.io/builders/dapp-developers/bridging/standard-bridge), tutorial ini ditujukan untuk developer yang sudah memiliki token ERC-20 di Ethereum dan ingin membuat representasi token tersebut di Lisk.

Learn step-by-step how you can create a custom token that conforms to the [`IOptimismMintableERC20`](https://github.com/ethereum-optimism/optimism/blob/v1.1.4/packages/contracts-bedrock/src/universal/IOptimismMintableERC20.sol) interface so that it can be used with the Standard Bridge system.
A custom token allows you to do things like trigger extra logic whenever a token is deposited.
If you don't need extra functionality like this, consider following the tutorial on [Deploying your Standard ERC-20 token to Lisk](./standard-token) instead.
Pelajari langkah demi langkah cara membuat token kustom yang sesuai dengan interface [`IOptimismMintableERC20`](https://github.com/ethereum-optimism/optimism/blob/v1.1.4/packages/contracts-bedrock/src/universal/IOptimismMintableERC20.sol) sehingga dapat digunakan dengan Sistem Bridge Standar.
Token kustom memungkinkan Anda melakukan hal-hal seperti men-_trigger_ logika tambahan setiap kali token dideposit.
Jika Anda tidak memerlukan fungsionalitas tambahan ini, pertimbangkan untuk mengikuti tutorial [Mendeploy Token ERC-20 Standar ke Lisk](./standard-token).
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved

## Prerequisites
## Prasyarat

:::note
You can deploy your **Custom ERC-20** token on Lisk Mainnet by adopting the same process.
For deploying to mainnet, ensure that your wallet has enough ETH.
Anda dapat mendeploy **Token ERC-20 Anda Sendiri** di Lisk Mainnet dengan menggunakan proses yang sama.
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved
Untuk mendeploy ke mainnet, pastikan dompet (_wallet_) Anda memiliki ETH yang cukup.
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved

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).
Teks berikut mencakup perintah untuk Lisk dan Lisk Sepolia demi kemudahan Anda.
Untuk informasi lebih lanjut, lihat [jaringan Lisk yang tersedia](/network-info) dan [cara menghubungkan _wallet_ ke jaringan tersebut](/user/connecting-to-a-wallet).
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved
:::

### Get ETH on Sepolia and Lisk Sepolia
### Mendapatkan ETH di Sepolia dan Lisk Sepolia

You will need to get some ETH on both, Sepolia and Lisk Sepolia networks.
Anda perlu mendapatkan ETH di kedua jaringan, Sepolia dan Lisk Sepolia.

:::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.
Anda dapat menggunakan [ETH Sepolia Faucet](https://sepoliafaucet.com/) untuk mendapatkan ETH di Sepolia.
Anda dapat menggunakan [Superchain Faucet](https://app.optimism.io/faucet?utm_source=docs) untuk mendapatkan ETH di Lisk Sepolia.
:::

### Add Lisk Sepolia to Your Wallet
### Menambahkan Lisk Sepolia ke _Wallet_ Anda
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved

This tutorial uses [Remix](https://remix.ethereum.org) to deploy contracts.
You will need to add the Lisk or Lisk Sepolia network to your wallet in order to follow this tutorial.
Please follow the [How to connect Lisk to a wallet](/user/connecting-to-a-wallet) guide, to connect your wallet to Lisk or Lisk Sepolia network.
Tutorial ini menggunakan [Remix](https://remix.ethereum.org) untuk mendeploy kontrak.
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved
Anda perlu menambahkan jaringan Lisk atau Lisk Sepolia ke _wallet_ Anda untuk mengikuti tutorial ini.
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved
Silakan ikuti panduan [Cara Menghubungkan Lisk ke _Wallet_](/user/connecting-to-a-wallet) untuk menghubungkan _wallet_ Anda ke jaringan Lisk atau Lisk Sepolia.
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved

### Get an L1 ERC-20 Token Address
### Mendapatkan Alamat Token ERC-20 L1

You will need an L1 ERC-20 token for this tutorial.
If you already have an L1 ERC-20 token deployed on Ethereum Mainnet or Sepolia, you can skip this step.
For Sepolia, you can use the testing token located at [`0x5589BB8228C07c4e15558875fAf2B859f678d129`](https://sepolia.etherscan.io/address/0x5589BB8228C07c4e15558875fAf2B859f678d129) that includes a `faucet()` function that can be used to mint tokens.
Anda memerlukan token ERC-20 L1 untuk tutorial ini.
Jika Anda sudah memiliki token ERC-20 L1 yang dideploy di Ethereum Mainnet atau Sepolia, Anda dapat melewati langkah ini.
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved
Untuk Sepolia, Anda dapat menggunakan token uji coba yang terletak di [`0x5589BB8228C07c4e15558875fAf2B859f678d129`](https://sepolia.etherscan.io/address/0x5589BB8228C07c4e15558875fAf2B859f678d129) yang menyertakan fungsi `faucet()` untuk me-_mint_ token.

## Create an L2 ERC-20 Token
## Membuat Token ERC-20 L2

Once you have an L1 ERC-20 token, you can create a corresponding L2 ERC-20 token on Lisk or Lisk Sepolia network.
This tutorial uses [Remix](https://remix.ethereum.org), so you can easily deploy a token without a framework like [Hardhat](https://hardhat.org) or [Foundry](https://getfoundry.sh).
You can follow the same general process within your favorite framework if you prefer.
Setelah Anda memiliki token ERC-20 L1, Anda dapat membuat token ERC-20 L2 yang sesuai di jaringan Lisk atau Lisk Sepolia.
Tutorial ini menggunakan [Remix](https://remix.ethereum.org), sehingga Anda dapat dengan mudah mendeploy token tanpa _framework_ seperti [Hardhat](https://hardhat.org) atau [Foundry](https://getfoundry.sh).
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved
Jika Anda lebih suka, Anda dapat mengikuti proses umum yang sama dalam _framework_ pilihan Anda.
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved

In this section, you'll be creating an ERC-20 token that can be deposited but cannot be withdrawn.
This is just one example of the endless ways in which you could customize your L2 token.
Dalam bagian ini, Anda akan membuat token ERC-20 yang dapat di-_deposit_ tetapi tidak dapat di-_withdraw_.
Ini hanyalah salah satu contoh dari banyak cara untuk menyesuaikan token L2 Anda.

### 1. Open Remix
### 1. Buka Remix

Navigate to [Remix](https://remix.ethereum.org) in your browser.
Akses [Remix](https://remix.ethereum.org) di browser Anda.

### 2. Create a new file
### 2. Buat file baru

Click the 📄 ("Create new file") button to create a new empty Solidity file.
You can name this file whatever you'd like, e.g. `custom-token.sol`.
Klik tombol 📄 ("Buat file baru") untuk membuat file Solidity kosong.
Anda dapat memberi nama file ini sesuai keinginan Anda, misalnya `custom-token.sol`.

### 3. Copy the example contract
### 3. Salin kontrak contoh

Copy the following example contract into your new file:
Salin kontrak contoh berikut ke dalam file baru Anda:

<details>
<summary>custom-token.sol</summary>
Expand Down Expand Up @@ -186,15 +186,15 @@ contract MyCustomL2Token is IOptimismMintableERC20, ERC20 {
```
</details>

### 4. Review the example contract
### 4. Tinjau kontrak contoh

Take a moment to review the example contract.
It's almost the same as the standard [`OptimismMintableERC20`](https://github.com/ethereum-optimism/optimism/blob/v1.1.4/packages/contracts-bedrock/src/universal/OptimismMintableERC20.sol) contract except that the `_burn` function has been made to always revert.
Luangkan waktu untuk meninjau kontrak contoh.
Kontrak ini hampir sama dengan kontrak standar [`OptimismMintableERC20`](https://github.com/ethereum-optimism/optimism/blob/v1.1.4/packages/contracts-bedrock/src/universal/OptimismMintableERC20.sol), kecuali fungsi `_burn` telah dimodifikasi agar selalu gagal (revert).

The contract for the custom token inherits from the [`IOptimismMintableERC20`](https://github.com/ethereum-optimism/optimism/blob/v1.1.4/packages/contracts-bedrock/src/universal/IOptimismMintableERC20.sol) interface and the `ERC20` contract.
The constructor takes the address of the L2 standard bridge, the address of the corresponding L1 token, the name of the ERC20 token, and the symbol of the ERC20 token.
The `mint` function allows the bridge to mint tokens for users.
Since the bridge needs to burn tokens when users want to withdraw them to L1, this means that users will not be able to withdraw tokens from this contract, which is what we intend for this example.
Kontrak untuk token kustom ini mewarisi (_inherits_) dari interface [`IOptimismMintableERC20`](https://github.com/ethereum-optimism/optimism/blob/v1.1.4/packages/contracts-bedrock/src/universal/IOptimismMintableERC20.sol) dan kontrak `ERC20`.
Konstruktor menerima alamat dari L2 standard bridge, alamat token L1 yang sesuai, nama token ERC20, dan simbol token ERC20.
Fungsi `mint` memungkinkan bridge me-_mint_ token untuk pengguna.
Karena bridge perlu mem-_burn_ token ketika pengguna ingin me-_withdraw_-nya kembali ke L1, ini berarti pengguna tidak akan dapat me-_withdraw_ token dari kontrak ini, sesuai dengan tujuan contoh ini.

```solidity
/// @notice Prevents tokens from being withdrawn to L1.
Expand All @@ -211,16 +211,16 @@ function burn(
}
```

### 5. Compile the contract
### 5. Meng-_compile_ Kontrak
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved

Save the file to automatically compile the contract.
If you've disabled auto-compile, you'll need to manually compile the contract by clicking the "Solidity Compiler" tab (this looks like the letter "S") and pressing the blue "Compile" button.
Simpan file untuk secara otomatis mengompilasi kontrak.
Jika Anda telah menonaktifkan fitur kompilasi otomatis, Anda perlu mengompilasi kontrak secara manual dengan mengklik tab "Solidity Compiler" (ikon berbentuk huruf "S") dan menekan tombol biru "Compile".

### 6. Deploy the contract
### 6. Mendeploy Kontrak
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved

Open the deployment 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 `MyCustomL2Token` contract from the deployment dropdown and deploy it with the following parameters:
Buka tab deployment (ikon berbentuk logo Ethereum dengan panah mengarah ke kanan).
Pastikan bahwa _environment_ Anda diatur ke "Injected Provider", _wallet_ Anda terhubung ke jaringan Lisk atau Lisk Sepolia, dan Remix memiliki akses ke _wallet_ Anda.
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved
Kemudian, pilih kontrak `MyCustomL2Token` dari dropdown deployment dan deploy dengan parameter berikut:
TalhaMaliktz marked this conversation as resolved.
Show resolved Hide resolved

```text
_BRIDGE: "0x4200000000000000000000000000000000000007"
Expand All @@ -230,12 +230,12 @@ _SYMBOL: "MCL2T"
```

:::tip
If you used the testing token described in step [Get an L1 ERC-20 Token Address](#get-an-l1-erc-20-token-address), use the address `0x5589BB8228C07c4e15558875fAf2B859f678d129` for the `_REMOTETOKEN` parameter.
Jika Anda menggunakan token uji coba yang dijelaskan pada langkah [Mendapatkan Alamat Token ERC-20 L1](#mendapatkan-alamat-token-erc-20-l1), gunakan alamat `0x5589BB8228C07c4e15558875fAf2B859f678d129` untuk parameter `_REMOTETOKEN`.
:::

{/* ## Bridge Some Tokens
{/* ## Bridge Beberapa Token

Now that you have an L2 ERC-20 token, you can bridge some tokens from L1 to L2.
Check out the tutorial on [Bridging ERC-20 tokens with the Optimism SDK](https://docs.optimism.io/builders/app-developers/tutorials/cross-dom-bridge-erc20) to learn how to bridge your L1 ERC-20 to Lisk using the Optimism SDK.
Remember that the withdrawal step will *not* work for the token you just created!
This is exactly what this tutorial was meant to demonstrate. */}
Sekarang setelah Anda memiliki token ERC-20 L2, Anda dapat memindahkan beberapa token dari L1 ke L2.
Lihat tutorial [Memindahkan Token ERC-20 dengan Optimism SDK](https://docs.optimism.io/builders/app-developers/tutorials/cross-dom-bridge-erc20) untuk mempelajari cara memindahkan token ERC-20 L1 Anda ke Lisk menggunakan Optimism SDK.
Ingat bahwa langkah _withdrawal_ *tidak akan* berfungsi untuk token yang baru saja Anda buat!
Hal ini sesuai dengan tujuan yang ingin ditunjukkan oleh tutorial ini. */}
Loading