Skip to content

Commit 3c9c8cd

Browse files
Merge pull request 0xPolygon#184 from 0xPolygon/km/tools
Dev tools a few updates
2 parents 374482b + 3d85139 commit 3c9c8cd

File tree

18 files changed

+68
-68
lines changed

18 files changed

+68
-68
lines changed

docs/cdk/get-started/deploy-rollup/prerequisites.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The commands on the [install dependencies page](install-dependencies.md) fulfill
2222

2323
## Miscellaneous requirements
2424

25-
- `INFURA_API_KEY`: [Infura](https://www.infura.io/) API key
25+
- `INFURA_API_KEY`: [Infura](https://infura.io/) API key
2626
- `ETHERSCAN_API_KEY`: [Etherscan](https://etherscan.io/) API key
2727
- Goërli node RPC URL: e.g. https://goerli.infura.io/v3/YOUR-INFURA-API-KEY
2828
- Goërli account address holding minimum 0.5 GoërliETH

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ hide:
216216
</a>
217217
</div>
218218
<div class="flexbox items-4">
219-
<a href="pos/how-to/smart-contracts/" class="home-feature-card w-inline-block"><img src="img/home/polygon-icon.svg" loading="lazy" alt="" class="feature-icon">
219+
<a href="pos/how-to/bridging/" class="home-feature-card w-inline-block"><img src="img/home/polygon-icon.svg" loading="lazy" alt="" class="feature-icon">
220220
<div class="feature-content-wrapper">
221221
<div class="feature-content-name">Polygon PoS: Deploy an existing contract</div>
222222
<div class="arrow-embed w-embed"><svg xmlns="http://www.w3.org/2000/svg" display="block" width="100%" height="auto" viewbox="0 0 16 17" fill="none">

docs/tools/smart-contracts/hardhat.md renamed to docs/tools/dApp-development/common-tools/hardhat.md

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,38 @@
11
## Overview
22

3-
Hardhat is an Ethereum development environment that provides an easy way to deploy smart contracts, run tests and debug Solidity code locally.
3+
Hardhat is an Ethereum development environment for deploying smart contracts, running tests, and debugging Solidity code locally.
44

5-
In this tutorial, you will learn how to set up Hardhat and use it to build, test and deploy a simple smart contract.
5+
In this tutorial, you will learn how to set up Hardhat and use it to build, test, and deploy a simple smart contract.
66

7-
### What you will do
7+
## Set up
88

9-
- Set up Hardhat.
10-
- Create a simple smart contract.
11-
- Compile the contract.
12-
- Test the contract.
13-
- Deploy the contract.
9+
1. Ensure you have installed the following:
1410

15-
## Setting up the development environment
11+
- [Node.js v10+ LTS and npm](https://nodejs.org/en/).
12+
- [Git](https://git-scm.com/).
1613

17-
There are a few technical requirements before we start. Please install the following:
14+
2. Create an npm project
1815

19-
- [Node.js v10+ LTS and npm](https://nodejs.org/en/) (comes with Node)
20-
- [Git](https://git-scm.com/)
16+
```sh
17+
mkdir hardhat-test
18+
cd hardhat-test/
19+
npm init
20+
```
2121

22-
Once we have those installed, you need to create an npm project by going to an empty folder, running `npm init`, and following its instructions to install Hardhat. Once your project is ready, you should run:
22+
3. Now install Hardhat.
2323

24-
```bash
24+
```sh
2525
npm install --save-dev hardhat
2626
```
2727

28-
To create your Hardhat project, run `npx hardhat` in your project folder.
29-
Let’s create the sample project and go through these steps to try out a sample task and compile, test and deploy the sample contract.
30-
3128
!!! note
3229
The sample project used here comes from the [Hardhat Quickstart guide](https://hardhat.org/getting-started/#quick-start), as well as its instructions.
3330

3431
## Creating a project
3532

3633
To create a sample project, run `npx hardhat` in your project folder. You should see the following prompt:
3734

38-
![img](../../img/tools/hardhat/quickstart.png)
35+
![img](../../../img/tools/hardhat/quickstart.png)
3936

4037
Choose the JavaScript project and go through these steps to compile, test and deploy the sample contract.
4138

@@ -148,7 +145,7 @@ npx hardhat test
148145

149146
And this is an expected output:
150147

151-
![img](../../img/tools/hardhat/test.png)
148+
![img](../../../img/tools/hardhat/test.png)
152149

153150
### Deploying on Polygon network
154151

docs/tools/smart-contracts/remix.md renamed to docs/tools/dApp-development/common-tools/remix.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This tutorial guides you to implement a Hello World dApp which echoes a message
1919

2020
Remix is a Ethereum-focused IDE: an online platform to develop and deploy smart contracts. To start building a smart contract, click on **New File** and name it `HelloWorld.sol`.
2121

22-
![](../../img/tools/remix/new-file.png)
22+
![](../../../img/tools/remix/new-file.png)
2323

2424
## Smart contract
2525

@@ -75,7 +75,7 @@ The `update` function is another public function that is similar to the constr
7575

7676
Now, we have to deploy our smart contract on Mumbai, Polygon Network's Testnet. Not only does it cost money (e.g., gas fees) to deploy a smart contract on Polygon Mainnet, but also, the contract is immutable and can't be changed once deployed. Therefore, it's best to first deploy your smart contract to the Testnet first.
7777

78-
To deploy to the Mumbai testnet, we have to connect to the Web3 world which can be accomplished by using any of the services like Metamask, Brave, Portis, etc. We will be using MetaMask in this tutorial. Please follow this [guide to set up a MetaMask Account](../wallets/metamask/index.md).
78+
To deploy to the Mumbai testnet, we have to connect to the Web3 world which can be accomplished by using any of the services like Metamask, Brave, Portis, etc. We will be using MetaMask in this tutorial. Please follow this [guide to set up a MetaMask Account](../../wallets/metamask/index.md).
7979

8080
- Open Metamask. Click on the network dropdown menu (set to **Ethereum Mainnet** by default) and click on the **Add Network** button. MaticVigil provides a public endpoint and is rate-limited. Therefore, most developers use a free blockchain provider like [Alchemy](https://docs.alchemy.com/docs/how-to-add-polygon-to-metamask) or [Quicknode](https://www.quicknode.com/guides/smart-contract-development/how-to-deploy-a-smart-contract-on-maticpolygon#setting-up-metamask-with-polygon-node) to have a dedicated RPC endpoint with faster throughput AKA computing units per second (CUPs). You need to create a free account to get your private API key from one of these providers to put into the dedicated RPC endpoint URL below.
8181

@@ -122,13 +122,13 @@ In both Testnet and Mainnet, you do the below to deploy your smart contract usin
122122

123123
- Select **Injected Provider** MetaMask in the **Environment** dropdown and your contract
124124

125-
![RemixIDE_Step1](../../img/tools/remix/injected-provider.png)
125+
![RemixIDE_Step1](../../../img/tools/remix/injected-provider.png)
126126

127127
- Accept the **Connect** request received in MetaMask. If the popup doesn't open by default, you can also try manually launching the MetaMask extension
128128

129129
- Once MetaMask is connected to Remix, the `Deploy` transaction would generate another MetaMask popup that requires transaction confirmation. Simply confirm the transaction!
130130

131-
![RemixIDE_Step1](../../img/tools/remix/confirm_tx.png)
131+
![RemixIDE_Step1](../../../img/tools/remix/confirm_tx.png)
132132
<br/>
133133

134134
Congratulations! You have successfully deployed the HelloWorld smart contract to the Polygon Mumbai Testnet. You can start interacting with your smart contract. Check the deployment status at <https://mumbai.polygonscan.com/>.
@@ -149,7 +149,7 @@ sol-merger \"./contracts/*.sol\" ./build
149149

150150
- Navigate to your contract's Polygonscan page and click on **Verify and Publish**.
151151

152-
![RemixIDE_Step1](../../img/tools/remix/verify-publish.png)
152+
![RemixIDE_Step1](../../../img/tools/remix/verify-publish.png)
153153

154154
- Select **Solidity (Single File)** in compiler type
155155

docs/tools/smart-contracts/replit.md renamed to docs/tools/dApp-development/common-tools/replit.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ You need a browser-based Web3 wallet to interact with the Polygon Mumbai Testnet
2525
You must set up all of the following prerequisites to be able to deploy your solidity smart contract on Polygon:
2626

2727
1. [Create a Replit account](https://replit.com/signup).
28-
2. [Download MetaMask wallet](../wallets/metamask/index.md).
29-
3. [Configure Polygon on MetaMask](../wallets/metamask/add-polygon-network.md).
28+
2. [Download MetaMask wallet](../../wallets/metamask/index.md).
29+
3. [Configure Polygon on MetaMask](../../wallets/metamask/add-polygon-network.md).
3030
4. [Get testnet tokens](https://faucet.polygon.technology).
3131

3232
## Working with a Repl
@@ -35,11 +35,11 @@ Every Repl that you create is a fully functional development and production envi
3535

3636
1. [Log in](https://replit.com/login) or [create an account](https://replit.com/signup). After creating your account, your home screen will include a dashboard where you can view, create projects, and manage your account.
3737

38-
![img](../../img/tools/replit/dashboard.png)
38+
![img](../../../img/tools/replit/dashboard.png)
3939

4040
2. Once logged in, create a Solidity starter repl, Select **+ Create Repl** from the left panel or **+** in the top right corner of the screen.
4141

42-
![img](../../img/tools/replit/solidity.png)
42+
![img](../../../img/tools/replit/solidity.png)
4343

4444
3. Select the [**Solidity starter (beta)**](https://replit.com/@replit/Solidity-starter-beta?v=1) template and give your project a title.
4545

@@ -55,13 +55,13 @@ Make sure that you have followed the list of [prerequisites](#prerequisites) abo
5555

5656
1. Click on **Run** (at the top) to install all relevant packages and start up the contract deployment UI.
5757

58-
2. Connect your MetaMask wallet to the web interface and switch to the [Mumbai Testnet](../wallets/metamask/add-polygon-network.md).
58+
2. Connect your MetaMask wallet to the web interface and switch to the [Mumbai Testnet](../../wallets/metamask/add-polygon-network.md).
5959

60-
![img](../../img/tools/replit/connect.png)
60+
![img](../../../img/tools/replit/connect.png)
6161

6262
3. Click on **Connect wallet**, select your account, then choose **Connect**.
6363

64-
![img](../../img/tools/replit/deploy-list.png)
64+
![img](../../../img/tools/replit/deploy-list.png)
6565

6666
4. From the dropdown list, select the contract that you want to deploy. Click on **Deploy**.
6767

docs/tools/smart-contracts/truffle.md renamed to docs/tools/dApp-development/common-tools/truffle.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ You can run Solidity and Javascript tests.
104104
105105
You should see the following output:
106106
107-
![img](../../img/tools/truffle/test1.png)
107+
![img](../../../img/tools/truffle/test1.png)
108108
109109
2. Run the JavaScript test:
110110
@@ -114,7 +114,7 @@ You can run Solidity and Javascript tests.
114114
115115
You should see the following output:
116116
117-
![img](../../img/tools/truffle/test2.png)
117+
![img](../../../img/tools/truffle/test2.png)
118118
119119
### Compiling the contract
120120
@@ -126,7 +126,7 @@ truffle compile
126126
127127
You will see the following output:
128128
129-
![img](../../img/tools/truffle/compile.png)
129+
![img](../../../img/tools/truffle/compile.png)
130130
131131
### Configuring the smart contract
132132
@@ -180,7 +180,7 @@ truffle compile
180180
truffle deploy --network matic
181181
```
182182
183-
![img](../../img/tools/truffle/deployed-contract.png)
183+
![img](../../../img/tools/truffle/deployed-contract.png)
184184
185185
!!! note
186186
Remember your `address`, `transaction_hash` and other details provided would differ. Above is just to provide an idea of the structure.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- In progress -->
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)