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

Adding plugin for ZKsync Era #906

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

arose00
Copy link

@arose00 arose00 commented Dec 7, 2024

Relates to:

N/A

Risks

Low.

Main implementation risk is that the Plugin doesn't work correctly.

Background

What does this PR do?

ZKsync Era is one of the most established ZK rollups on Ethereum. This PR implements a plugin for agents to be able to interact with Era.

In this first version, only the transfer function is supported. Further work will extend this functionality.

Many more L2s are being build w/ the ZK Stack (the open source framework used to build ZKsync Era), and this work can be extended/modified to support these as they come online.

What kind of change is this?

Features (non-breaking change which adds functionality)

Why are we doing this? Any context or related work?

We're seeing a huge proliferation of AI agents being able to manage value on-chain. This is similar conceptually to these plugins (e.g. plugin-solana and others)

Documentation changes needed?

This plugin follows the standards set by other crypto integrations, including things like the SEND_TOKENS action. Changes to the overall project documentation don't seem to be required.

Testing

Where should a reviewer start?

Most of the changes are in plugin-zksync-era

Detailed testing steps

  1. In .env you should set the value for ZKSYNC_ADDRESS (this is the public address for the agent account) and ZKSYNC_PRIVATE_KEY (private key for the same account).
  2. To test the transfer function properly, this address needs tokens. Coinbase can be used to send ZK directly to an address on ZKsync Era, but I am also happy to provide tokens for reviewers (I'll send ZK tokens to reviewers that need it).
  3. Run the agent and prompt it with: "send 0.5 ZK to " - e.g. "send 1 ZK to 0xee0c40F86544a8b0616BC827728f714a8B4cEeE7"
  4. Assuming you had 1 ZK to send, the agent will confirm and respond with the tx hash, e.g. Transfer completed successfully! "tx: 0x45759cf3e76d26610154a094c87572fbd7f5ef909f62c4ea13f7defb0d87cf0b"
  5. The tx hash can be checked on the ZKsync block explorer at https://explorer.zksync.io, e.g. https://explorer.zksync.io/tx/0x45759cf3e76d26610154a094c87572fbd7f5ef909f62c4ea13f7defb0d87cf0b

Discord username

anthonykrose

@arose00
Copy link
Author

arose00 commented Dec 7, 2024

@cygaar added ZKsync plugin w/ support so far just for a transfer function, following conventions from other blockchain plugins.

Will extend to add other actions assuming general approach is consistent w/ what is expected.

@cygaar
Copy link
Collaborator

cygaar commented Dec 8, 2024

@arose00 can you fix the merge conflict and adjust the pr title?

@odilitime odilitime added the Plugin_new Mark PRs that are a new plugin label Dec 10, 2024
@lalalune lalalune changed the base branch from main to main-3 December 14, 2024 10:56
@lalalune lalalune merged commit a8aa112 into elizaOS:main-3 Dec 14, 2024
2 checks passed
@arose00 arose00 deleted the add_zksync_era_support branch December 19, 2024 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Plugin_new Mark PRs that are a new plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants