Skip to content

Commit

Permalink
GITBOOK-206: No subject
Browse files Browse the repository at this point in the history
  • Loading branch information
brunopgalvao authored and gitbook-bot committed Nov 12, 2024
1 parent eae5a4b commit 8e8fc3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 31 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 9 additions & 31 deletions pop-cli-for-smart-contracts/guides/deploy-on-pop-testnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,60 +14,38 @@ In order to deploy a smart contract on the Pop Testnet, we will need to fund the

We will need to:

1. Fund our dev account on Paseo with some PAS tokens
2. Transfer those PAS tokens from the Paseo dev account to the Pop Testnet dev account
1. Fund our account on Paseo with some PAS tokens
2. Transfer those PAS tokens from the Paseo account to the Pop Testnet account



**Fund the Paseo dev account**

Use the [Paseo faucet](https://faucet.polkadot.io/) to fund Alice's Paseo account with some PAS tokens. 
Use the [Paseo faucet](https://faucet.polkadot.io/) to fund your Paseo account with some PAS tokens. 

PAS tokens are the equivalent of DOT on Polkadot.

> Alice's account address is: `5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY`
Go to the [Paseo faucet](https://faucet.polkadot.io/) and request some PAS tokens for Alice.
Go to the [Paseo faucet](https://faucet.polkadot.io/) and request some PAS tokens for your account.



**Transfer from Paseo Relay Network to Pop Testnet**

As Pop Network uses the Relay chain's native token as its native token, we will need to transfer some of the PAS tokens from Alice's account on Paseo to Pop Network so that we can then deploy the contract.

We will need to import Alice's account to a wallet and we can do so by using Alice's secret seed: `0xe5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a`

The below examples use the [PolkadotJs Wallet extension](https://polkadot.js.org/extension).
As Pop Network uses the Relay chain's native token as its native token, we will need to transfer some of the PAS tokens from your account on Paseo to Pop Network so that we can then deploy the contract.

![](https://hackmd.io/\_uploads/HymzV9GeA.png)

> Remember this is for development purposes. In production you would already have an existing wallet to use.
Now that we have Alice's account in our wallet, we can use https://onboard.popnetwork.xyz for transferring PAS tokens to Pop Network. Make sure to authorize your wallet to connect to the site.
We can use [onboard.popnetwork.xyz](https://onboard.popnetwork.xyz) for transferring PAS tokens to Pop Network. Make sure to authorize your wallet to connect to the site.

![Screenshot 2024-04-09 at 7.13.17 PM](https://hackmd.io/\_uploads/HysR4czxA.png)

Cool! Now that you have some PAS tokens on the [Pop Testnet](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc2.paseo.popnetwork.xyz), we can deploy our smart contract.

### Deploy

Deploy the contract to Pop Network Testnet:

```shell
pop up contract --constructor new --args "false" --suri 0xe5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a --url wss://rpc1.paseo.popnetwork.xyz
```
Now that your account is funded on Pop, you can deploy your contract.

```
┌ Pop CLI : Deploy a smart contract
◐ Doing a dry run to estimate the gas... ● Gas limit Weight { ref_time: 266641786, proof_size: 16689 }
◇ Contract deployed and instantiated: The Contract Address is "5GE1BaqUsbh4ty1c6Ko1kkAp2AEZQCDhpvtKpJJ1Q3ex1xzC"
└ Deployment complete
```
Go to [contracts.onpop.io](https://contracts.onpop.io) and deploy your contract.

> Note: If you want to use your own account (not Alice) and you can deploy using [contracts.onpop.io](https://contracts.onpop.io)
<figure><img src="../.gitbook/assets/Screenshot 2024-11-12 at 11.21.58 AM.png" alt=""><figcaption></figcaption></figure>

You can now take the contract address and check the [chain state](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc2.paseo.popnetwork.xyz#/chainstate) to confirm that the contract exists. Remember to use the resulting contract address for your deployment.

Expand Down

0 comments on commit 8e8fc3c

Please sign in to comment.