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

Update MATIC ticker to POL #279

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions docs/deploying.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Once you have tested your bot locally, you are ready to deploy it to the Forta n
2. registering it in the Bot Registry smart contract
3. staking 100 FORT tokens on your bot

## Acquiring Polygon MATIC tokens
## Acquiring Polygon POL tokens

The Bot Registry smart contract currently lives on Polygon mainnet, so you will need **MATIC tokens on Polygon mainnet** in order to deploy your bot. You can acquire some MATIC tokens by following [this guide](matic.md).
The Bot Registry smart contract currently lives on Polygon mainnet, so you will need **POL tokens on Polygon mainnet** in order to deploy your bot. You can acquire some POL tokens by following [this guide](matic.md).

## Using Forta App vs CLI

Expand Down
2 changes: 1 addition & 1 deletion docs/hardhat.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Once you are happy with the bot behaviour, you can deploy this bot to the produc
npx hardhat forta:publish
```

You may be prompted to select a specific bot if you have multiple. This command builds a Docker image for the bot and pushes it to a public repository. The image will then be registered in the Bot Registry smart contract. This step requires having MATIC tokens on Polygon mainnet (see [here](matic.md) on how to acquire MATIC tokens).
You may be prompted to select a specific bot if you have multiple. This command builds a Docker image for the bot and pushes it to a public repository. The image will then be registered in the Bot Registry smart contract. This step requires having POL tokens on Polygon mainnet (see [here](matic.md) on how to acquire POL tokens).

Another way to deploy your bot is using the [Forta App](https://app.forta.network/). To learn more about deploying bots (including how to enable logging), check out [this section](deploying.md).

Expand Down
2 changes: 1 addition & 1 deletion docs/intro-to-bot-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ As mentioned earlier, Forta provides easy to use SDKs for detection bot developm

A second development workflow involves the use of the [Forta Hardhat plugin](https://www.npmjs.com/package/hardhat-forta) to create detection bots for your existing smart contract project. Hardhat is a smart contract development framework with a powerful plugin ecosystem. Using the Forta plugin, you can initialize detection bots right into your project. Also, you can choose from a set of low-code templates to setup detection bots for your project quickly.

To deploy your bot to the Forta Network you can use the CLI or the [Forta App](https://app.forta.network/), which provides a convenient UI to deploy and manage your detection bots. Deploying a bot involves making a transaction to the Bot Registry contract on the Polygon blockchain. This requires having MATIC tokens in order to pay the small transaction fee (in the order of a few cents). Developers just need to ensure they have enough MATIC tokens, and the CLI or Forta App will take care of executing the transaction. Once a detection bot is deployed to the Forta Network, users can subscribe to the alerts generated by the bot or consume them through the Forta API.
To deploy your bot to the Forta Network you can use the CLI or the [Forta App](https://app.forta.network/), which provides a convenient UI to deploy and manage your detection bots. Deploying a bot involves making a transaction to the Bot Registry contract on the Polygon blockchain. This requires having POL tokens in order to pay the small transaction fee (in the order of a few cents). Developers just need to ensure they have enough POL tokens, and the CLI or Forta App will take care of executing the transaction. Once a detection bot is deployed to the Forta Network, users can subscribe to the alerts generated by the bot or consume them through the Forta API.

## Great! How do I begin?

Expand Down
6 changes: 3 additions & 3 deletions docs/maintaining.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ You can also use the [CLI command](cli.md#logs) `npm run logs` to see recent log

If you will not be using the alerts your bot generates (i.e. you were just testing out Forta, which we encourage), we ask that you please disable the bot. You can use [Forta App](https://app.forta.network/) or the CLI to enable or disable your bot. In Forta App, go to the Detection Bots page (from the menu at the top right) and click on the options menu to the right of your bot. From the options menu, you can choose to disable or enable your bot.

You can also use the CLI command `npm run disable`. Just make sure to set the `agentId` property in your **project folder's** forta.config.json before running the command (you should create the forta.config.json if it doesn't exist). You will also need to ensure you have Polygon MATIC tokens in your keyfile address to execute the disable transaction (you can get the keyfile address using `npm run keyfile`). See [this guide](matic.md) on how to acquire Polygon MATIC tokens. Similarly, you can re-enable a disabled bot using `npm run enable`.
You can also use the CLI command `npm run disable`. Just make sure to set the `agentId` property in your **project folder's** forta.config.json before running the command (you should create the forta.config.json if it doesn't exist). You will also need to ensure you have Polygon POL tokens in your keyfile address to execute the disable transaction (you can get the keyfile address using `npm run keyfile`). See [this guide](matic.md) on how to acquire Polygon POL tokens. Similarly, you can re-enable a disabled bot using `npm run enable`.


## Updating your bot

You may want to update the code for your bot from time to time (e.g. if you found a bug, or there is a new scenario you want to detect). You can use [Forta App](https://app.forta.network/) or the CLI to update your bot. In Forta App, go to the Detection Bots page (from the menu at the top right) and click on the options menu to the right of your bot. From the options menu, you can choose to edit your bot.

You can also use the CLI command `npm run publish` to update your bot. If you have already deployed a bot, the CLI will know to update the existing bot. Ensure that the keyfile used for updating is the same one you used for creating the bot. Make sure to set the `agentId` property in your **project folder's** forta.config.json before running the command (you should create the forta.config.json if it doesn't exist). You will also need to ensure you have Polygon MATIC tokens in your keyfile address to execute the update transaction (you can get the keyfile address using `npm run keyfile`). See [this guide](matic.md) on how to acquire Polygon MATIC tokens.
You can also use the CLI command `npm run publish` to update your bot. If you have already deployed a bot, the CLI will know to update the existing bot. Ensure that the keyfile used for updating is the same one you used for creating the bot. Make sure to set the `agentId` property in your **project folder's** forta.config.json before running the command (you should create the forta.config.json if it doesn't exist). You will also need to ensure you have Polygon POL tokens in your keyfile address to execute the update transaction (you can get the keyfile address using `npm run keyfile`). See [this guide](matic.md) on how to acquire Polygon POL tokens.

## Viewing the state of your bot

If you want to inspect the current or historic state of your bot, for example checking the last time your bot was updated, you can use the [CLI command](cli.md#info) `npm run info`.
If you want to inspect the current or historic state of your bot, for example checking the last time your bot was updated, you can use the [CLI command](cli.md#info) `npm run info`.
18 changes: 9 additions & 9 deletions docs/matic.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Acquiring Polygon MATIC
# Acquiring Polygon POL

As of October 18th 2021, Forta smart contracts (including the Bot Registry) have been moved to Polygon, a blockchain scaling solution that enables faster and cheaper transactions. You will need [MATIC](https://coinmarketcap.com/currencies/polygon/) tokens in order to pay gas fees on Polygon when deploying your bot. This guide will walk you through converting your ETH (on Ethereum mainnet) to MATIC (on Polygon mainnet). To learn more about Polygon, visit their [website](https://polygon.technology/).
As of October 18th 2021, Forta smart contracts (including the Bot Registry) have been moved to Polygon, a blockchain scaling solution that enables faster and cheaper transactions. You will need [POL](https://coinmarketcap.com/currencies/polygon/) tokens in order to pay gas fees on Polygon when deploying your bot. This guide will walk you through converting your ETH (on Ethereum mainnet) to POL (on Polygon mainnet). To learn more about Polygon, visit their [website](https://polygon.technology/).

**If you already have MATIC tokens on Ethereum mainnet, you can transfer them over to Polygon using the bridge in step 3.**
**If you already have POL tokens on Ethereum mainnet, you can transfer them over to Polygon using the bridge in step 3.**

## 1. Import your keyfile into Metamask

Expand All @@ -21,7 +21,7 @@ Your keyfile should now be in Metamask. **Make sure there is some ETH in this ac
- Network Name: `Polygon Mainnet`
- RPC URL: `https://polygon-rpc.com/`
- Chain ID: `137`
- Currency Symbol: `MATIC`
- Currency Symbol: `POL`
- Explorer URL: `https://polygonscan.com/`
3. Click the Save button

Expand All @@ -32,24 +32,24 @@ You can now interact with the Polygon network using your Metamask.
1. Navigate to the [Polygon bridge](https://wallet.polygon.technology)
2. Connect your Metamask wallet if needed (you will be prompted to sign a message)
3. Select Ether from the dropdown as the token to transfer
4. Enter how much ETH you want to transfer (for reference, 1 [MATIC](https://coinmarketcap.com/currencies/polygon/) will allow you to publish ~80 bots)
4. Enter how much ETH you want to transfer (for reference, 1 [POL](https://coinmarketcap.com/currencies/polygon/) will allow you to publish ~80 bots)
5. Click the Transfer button, then click Continue on the following dialogs
6. In the Metamask transaction dialog, review the gas fees and click Confirm
7. Wait for the transaction to complete on Ethereum mainnet
8. Verify your account balance on Polygon mainnet using the [Polygon block explorer](https://polygonscan.com/). You should have received **WETH** as an ERC-20 transfer (may take a few minutes to complete)

You have now transferred ETH from Ethereum mainnet over to Polygon mainnet.

## 4. Swap ETH for MATIC using the swap tool
## 4. Swap ETH for POL using the swap tool

1. Navigate to the [Polygon swap tool](https://wallet.polygon.technology/swap/)
2. Connect your Metamask wallet if needed (you will be prompted to sign a message)
3. Select how much MATIC you want to receive (for reference, 1 [MATIC](https://coinmarketcap.com/currencies/polygon/) will allow you to publish ~80 bots)
3. Select how much POL you want to receive (for reference, 1 [POL](https://coinmarketcap.com/currencies/polygon/) will allow you to publish ~80 bots)
4. Select WETH as the token to swap (will be labelled "Ether (PoS-WETH)")
5. Click the Approve button
6. Click the Swap button
7. Wait for the transaction to complete on Polyon mainnet
8. Verify your account balance on Polygon mainnet using the [Polygon block explorer](https://polygonscan.com/). You should have received the specified amount of **MATIC**
8. Verify your account balance on Polygon mainnet using the [Polygon block explorer](https://polygonscan.com/). You should have received the specified amount of **POL**

You should now have MATIC tokens on Polygon mainnet in order to pay gas fees! You can now continue [deploying your bot](deploying.md).
You should now have POL tokens on Polygon mainnet in order to pay gas fees! You can now continue [deploying your bot](deploying.md).

2 changes: 1 addition & 1 deletion docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Before you start, please make sure you have the following:
- [Python v3.10+](https://www.python.org/) (only if you want to build Python detection bots)
- [Docker Desktop v4.16+](https://docs.docker.com/desktop)
- Basic understanding of [Ethereum](https://ethereum.org/) and smart contracts
- MATIC tokens for deploying your bot (see [this guide](matic.md))
- POL tokens for deploying your bot (see [this guide](matic.md))

## Initializing a project

Expand Down