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 migration page and small fixes #1776

Merged
merged 8 commits into from
Feb 22, 2024
Merged
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 40 additions & 13 deletions src/content/chainlink-automation/guides/migrate-to-v2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ If your upkeep is restricted to a single address calling it, you must give permi

The Chainlink Automation App offers a streamlined migration process for upkeeps using registry versions 1.2 and later. To migrate upkeeps with older versions, follow the [manual migration process](#migrating-older-upkeeps-manually) instead.

You can use the Chainlink Automation App to migrate one upkeep at a time, or [migrate multiple upkeeps using the block scanner](#migrating-upkeeps-using-block-scanner).

1. Navigate to the Chainlink Automation App, select the supported blockchain you're using, and connect your wallet.

<div class="remix-callout">
Expand All @@ -35,25 +33,29 @@ You can use the Chainlink Automation App to migrate one upkeep at a time, or [mi

<ClickToZoom src="/images/automation/v2-migration/landing-page.png" />

1. Select your upkeep. In the **Details** page, expand the **Actions** menu and select **Migrate upkeep**.
1. To start migrating a specific upkeep, select the upkeep. In the **Details** page, expand the **Actions** menu and select **Migrate upkeep**.

<ClickToZoom src="/images/automation/v2-migration/upkeep-details.png" />

1. Confirm the transaction in your wallet.
If you have multiple upkeeps to migrate, start the migration using the link in your upkeeps dashboard. This link displays only if you have one or more upkeeps to migrate:

<ClickToZoom src="/images/automation/v2-migration/1-bulk-migration-ui.png" />

1. Follow the prompts to approve and confirm the transactions in your wallet to migrate your upkeeps.

<ClickToZoom src="/images/automation/v2-migration/approve-migration.png" />

Upkeeps that are successfully migrated will show the following [transaction logs](https://testnet.bscscan.com/tx/0x85b3a147518719d3c9b1dd6b80e5f39d53d18c177ebc10d1bfb8890eaab8900a#eventlog):
Upkeeps that are successfully migrated will show the following [transaction logs](https://testnet.bscscan.com/tx/0x85b3a147518719d3c9b1dd6b80e5f39d53d18c177ebc10d1bfb8890eaab8900a#eventlog):

<ClickToZoom src="/images/automation/v2-migration/migration-txn.png" />
<ClickToZoom src="/images/automation/v2-migration/migration-txn.png" />

When the migration is complete:
1. If your upkeep restricts `msg.sender` to the previous registry address, [update your contract](#update-permissions) to use the new forwarder address.

- Your balance is transferred to the new registry automatically.
- The new upkeep details page shows the updated registry address and a forwarder address. The forwarder address is a new [unique forwarder](#unique-forwarder) to increase security for your upkeep. This address will be the unique `msg.sender` for your upkeep. If your upkeep is restricted to a single address calling it, you must give permission to the forwarder address. Otherwise, Automation will no longer be able to execute your function.
- Read the [migration checklist](#migration-checklist) to understand further updates you may need to make in your contracts.
After the migration is complete:

<ClickToZoom src="/images/automation/v2-migration/details-with-forwarder.png" />
- Your balance is transferred to the new registry automatically.
- The new forwarder address becomes available.
- Read the [migration checklist](#migration-checklist) to understand further updates you might need to make in your contracts.

## Migrating upkeeps using block scanner

Expand All @@ -65,10 +67,18 @@ To migrate one or more upkeeps using the scanner:

Enter a list of upkeep IDs. For example: `[99297446083125056953495436926707926113001699970195513612134585638496630959874,63026166139768298778579034679995711427803187091626268721992534052921779884688]`.

1. Enter the destination registry address, which is the latest registry address on this chain. You can find this address in the [Supported Networks](/chainlink-automation/overview/supported-networks) page, or at the top of the Chainlink Automation App with the desired chain selected.
1. Enter the destination registry address, which is the latest registry address on this chain. You can find this address on the [Supported Networks](/chainlink-automation/overview/supported-networks) page, or at the top of the Chainlink Automation App with the desired chain selected.

1. Execute the `migrateUpkeeps` function and confirm the transaction. When this transaction is confirmed, your upkeeps will be migrated to the latest registry, and each upkeep will have a [unique forwarder](#unique-forwarder) address.

1. If your upkeep restricts `msg.sender` to the previous registry address, [update your contract](#update-permissions) to use the new forwarder address.

After the migration is complete:

- Your balance is transferred to the new registry automatically.
- The new forwarder address becomes available.
- Read the [migration checklist](#migration-checklist) to understand further updates you might need to make in your contracts.

## Migrating older upkeeps manually

For upkeeps on registry versions 1.0 and 1.1, you must migrate upkeeps manually:
Expand All @@ -83,8 +93,25 @@ For upkeeps on registry versions 1.0 and 1.1, you must migrate upkeeps manually:
1. Expand the **Actions** menu and select **Cancel upkeep**.
1. Approve the transaction in your wallet. When this transaction is confirmed, you must wait 50 blocks before you can withdraw funds.
1. Return to the main [Chainlink Automation App](https://automation.chain.link/) landing page. Register a new upkeep, providing the **Upkeep address** of your old upkeep.
1. If your upkeep restricts `msg.sender` to the previous registry address, [update your contract](#update-permissions) to use the new forwarder address.

After migration, you have a new upkeep on Automation 2.0 with the same interface as your old upkeep. Future migrations are eligible for the simpler migration process.

After the migration is complete:

- Your balance is transferred to the new registry automatically.
- The new forwarder address becomes available.
- Read the [migration checklist](#migration-checklist) to understand further updates you might need to make in your contracts.

## Update permissions

Your new upkeep has a new [unique forwarder](#unique-forwarder) to increase security for your upkeep. This address will be the unique `msg.sender` for your upkeep. If your upkeep restricts `msg.sender` to the previous registry address, you must give permission to the forwarder address. Otherwise, Automation will no longer be able to execute your function.

1. The forwarder address becomes available after migrating your upkeep. You can find this in the Chainlink Automation App, within the upkeep's **Details** section:

<ClickToZoom src="/images/automation/v2-migration/forwarder-address.png" />

After migration, you have a new upkeep on Automation 2.0 with the same interface as your old upkeep. Future migrations are eligible for the simpler migration process. Read the [migration checklist](#migration-checklist) to understand further updates you may need to make in your contracts.
1. Update your contract to use the forwarder address by following the instructions on the [Forwarder](/chainlink-automation/guides/forwarder) page.

## Migration checklist

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Click the tabs below to use Chainlink Automation with each type of trigger:

1. Navigate to the [Chainlink Automation app](https://automation.chain.link/) and connect to **Arbitrum Sepolia** in the top dropdown menu.

1. Connect your cryptocurrency wallet to the app if you haven't done so already. You may also need to fetch Arbitrum Sepolia testnet LINK [here](https://automation.chain.link/arbitrum-sepolia).
1. Connect your cryptocurrency wallet to the app if you haven't done so already. You might also need to fetch LINK for the Arbitrum Sepolia testnet from [faucets.chain.link](https://faucets.chain.link/arbitrum-sepolia).

1. Click **Register new Upkeep** and select **Custom logic** trigger.

Expand All @@ -92,9 +92,9 @@ Click the tabs below to use Chainlink Automation with each type of trigger:

1. Navigate to the [Chainlink Automation app](https://automation.chain.link/) and connect to **Arbitrum Sepolia** in the top dropdown menu.

1. Connect your cryptocurrency wallet to the app if you haven't done so already. You may also need to fetch Arbitrum Sepolia testnet LINK [here](https://automation.chain.link/arbitrum-sepolia).
1. Connect your cryptocurrency wallet to the app if you haven't done so already. You might also need to fetch LINK for the Arbitrum Sepolia testnet from [faucets.chain.link](https://faucets.chain.link/arbitrum-sepolia).

1. Click **Register new Upkeep** and select **log trigger**.
1. Click **Register new Upkeep** and select **Log trigger**.

1. Under _Contract to automate_, enter <Address contractUrl="https://sepolia.arbiscan.io/address/0xe817e4A71C69C72C01B31906F9F8591FbaB6b448" />. This is a simple `iLogAutomation`-compatible example contract that increments a counter when a log is detected. View the source code [here](https://sepolia.arbiscan.io/address/0xe817e4A71C69C72C01B31906F9F8591FbaB6b448#code). Click **Next**.

Expand Down
Loading