From 4ce016a6a2be1ed4bdc2ed8835f427152406321a Mon Sep 17 00:00:00 2001 From: Avneesh Agarwal Date: Sun, 16 Jul 2023 05:16:20 +0530 Subject: [PATCH] feat(website): add deploy a contract documentation using thirdweb (#13935) Co-authored-by: d1onys1us <13951458+d1onys1us@users.noreply.github.com> --- .../build-on-taiko/deploy-a-contract.mdx | 76 ++++++++++++++----- 1 file changed, 56 insertions(+), 20 deletions(-) diff --git a/packages/website/pages/docs/guides/build-on-taiko/deploy-a-contract.mdx b/packages/website/pages/docs/guides/build-on-taiko/deploy-a-contract.mdx index 67166f1397d..1ac901f644b 100644 --- a/packages/website/pages/docs/guides/build-on-taiko/deploy-a-contract.mdx +++ b/packages/website/pages/docs/guides/build-on-taiko/deploy-a-contract.mdx @@ -10,34 +10,41 @@ This guide will help you deploy a smart contract to Taiko using Foundry or Hardh - You have [Foundry](https://book.getfoundry.sh/getting-started/installation) or [Hardhat](https://hardhat.org/hardhat-runner/docs/getting-started#quick-start) installed. - You have testnet ETH on Taiko (to pay the transaction fee for deploying the contract). - - You can [request Sepolia ETH](/docs/guides/receive-tokens#receive-sepolia-eth) from the faucet and then [use the bridge](/docs/guides/use-the-bridge) to send the testnet ETH to Taiko. + - You can [request Sepolia ETH](/docs/guides/build-on-taiko/receive-tokens#receive-sepolia-eth) from the faucet and then [use the bridge](/docs/guides/build-on-taiko/bridge-tokens) to send the testnet ETH to Taiko. - You have the private key to the account with testnet ETH on Taiko. ### Additional Remix prerequisites -- You have [configured your wallet](/docs/guides/configure-your-wallet) to connect to Taiko. + +- You have [setup your wallet](/docs/guides/build-on-taiko/setup-your-wallet) to connect to Taiko. ## Steps - + - ### Create a project with Foundry - ```sh - forge init hello_foundry && cd hello_foundry - ``` - - ### Deploy your contract - Deploy the contract located at `src/Counter.sol`. Replace `YOUR_PRIVATE_KEY` below with your private key which has some testnet ETH on Taiko. - - Use a throwaway wallet to be safe. Don't reveal the private key of a wallet with significant value! - - - ```sh - forge create --rpc-url https://rpc.test.taiko.xyz --private-key YOUR_PRIVATE_KEY src/Counter.sol:Counter - ``` - - ### View your contract - Paste the address from the output into the [Taiko block explorer](https://explorer.test.taiko.xyz) and verify that the contract was deployed. + ### Create a project with Foundry + ```sh + forge init hello_foundry && cd hello_foundry + ``` + + ### Deploy your contract + + Deploy the contract located at `src/Counter.sol`. Replace `YOUR_PRIVATE_KEY` below with your private key which has some testnet ETH on Taiko. + + {" "} + + + Use a throwaway wallet to be safe. Don't reveal the private key of a wallet + with significant value! + + + ```sh + forge create --rpc-url https://rpc.test.taiko.xyz --private-key YOUR_PRIVATE_KEY src/Counter.sol:Counter + ``` + + ### View your contract + + Paste the address from the output into the [Taiko block explorer](https://explorer.test.taiko.xyz) and verify that the contract was deployed. @@ -96,6 +103,35 @@ This guide will help you deploy a smart contract to Taiko using Foundry or Hardh ### Deploy your smart contract ![deploy your smart contract](/images/guides/deploy-remix/deploy.png) + + + + + + ### To deploy your smart contract using deploy, navigate to the root directory of your project and execute the following command: + + ```bash + npx thirdweb deploy + ``` + + Executing this command will trigger the following actions: + + - Compiling all the contracts in the current directory. + - Providing the option to select which contract(s) you wish to deploy. + - Uploading your contract source code (ABI) to IPFS. + + ### When it is completed, it will open a dashboard interface to finish filling out the parameters. + + - `_name`: contract name + - `_symbol`: symbol or "ticker" + - `_royaltyRecipient`: wallet address to receive royalties from secondary sales + - `_royaltyBps`: basis points (bps) that will be given to the royalty recipient for each secondary sale, e.g. 500 = 5% + + ### Select `Taiko (Alpha-3 Testnet)` as the network + + ### Manage additional settings on your contract’s dashboard as needed such as uploading NFTs, configuring permissions, and more. + + For additional information on Deploy, please reference [thirdweb’s documentation](https://portal.thirdweb.com/deploy?utm_source=taiko&utm_medium=docs&utm_campaign=chain_docs).