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 Hello and Swap to authenticated calls #218

Draft
wants to merge 37 commits into
base: main
Choose a base branch
from

Conversation

fadeev
Copy link
Member

@fadeev fadeev commented Nov 8, 2024

Call

npx hardhat compile --force

npx hardhat deploy --name Universal --gateway 0x6c533f7fe93fae114d0954697069df33c9b74fd7 --network zeta_testnet

# 🚀 Successfully deployed "Universal" contract on zeta_testnet.
# 📜 Contract address: 0x08FF475cB40EB19D34Bdc4Df13222c2BEE36753E

npx hardhat deploy --name Connected --gateway 0x0c487a766110c85d301d96e33579c5b317fa4995 --network base_sepolia

# 🚀 Successfully deployed "Connected" contract on base_sepolia.
# 📜 Contract address: 0xe821FB1D6103E74086F4B43986ed34764ce5e69f
 npx hardhat connected-call \
  --contract 0xe821FB1D6103E74086F4B43986ed34764ce5e69f \
  --receiver 0x08FF475cB40EB19D34Bdc4Df13222c2BEE36753E \
  --network base_sepolia \
  --types '["string"]' alice

https://sepolia.basescan.org/tx/0xc96e056b0df550809f723b5267aaeb8cb4604cfbcccd44100fa9e2543a086b13

https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0xc96e056b0df550809f723b5267aaeb8cb4604cfbcccd44100fa9e2543a086b13

npx hardhat universal-call \
  --contract 0x08FF475cB40EB19D34Bdc4Df13222c2BEE36753E \
  --receiver 0xe821FB1D6103E74086F4B43986ed34764ce5e69f \
  --zrc20 0x05BA149A7bd6dC1F937fA9046A9e05C05f3b18b0 \
  --function "hello(string)" \
  --network zeta_testnet \
  --types '["string"]' alice

https://zetachain-testnet.blockscout.com/tx/0x869fabbdc3b8b1a92dc2b23106d89afdcd86917dfee35532bd135d49bdcb21c2

https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0x869fabbdc3b8b1a92dc2b23106d89afdcd86917dfee35532bd135d49bdcb21c2

npx hardhat universal-withdraw-and-call \
  --contract 0x08FF475cB40EB19D34Bdc4Df13222c2BEE36753E \
  --receiver 0xe821FB1D6103E74086F4B43986ed34764ce5e69f \
  --zrc20 0x05BA149A7bd6dC1F937fA9046A9e05C05f3b18b0 \
  --function "hello(string)" \
  --amount 0.0001 \
  --call-options-is-arbitrary-call \
  --network zeta_testnet \
  --types '["string"]' hello

https://zetachain-testnet.blockscout.com/tx/0x78a6898bdb988719d312b91f709b489b4c82d9ac83228c75032b2d3d19c3fc4b

https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0x78a6898bdb988719d312b91f709b489b4c82d9ac83228c75032b2d3d19c3fc4b

Swap

npx hardhat compile --force 

npx hardhat deploy --name Swap --gateway 0x6c533f7fe93fae114d0954697069df33c9b74fd7 --system-contract 0xEdf1c3275d13489aCdC6cD6eD246E72458B8795B --network zeta_testnet

🚀 Successfully deployed contract on zeta_testnet.
📜 Contract address: 0xf4fE3154c6dBb5492D3A4BbcF6A68878DF61C8A0
npx hardhat evm-deposit-and-call \
  --receiver 0xf4fE3154c6dBb5492D3A4BbcF6A68878DF61C8A0 \
  --amount 0.01 \
  --network bsc_testnet \
  --gateway-evm 0x0c487a766110c85d301d96e33579c5b317fa4995 \
  --types '["address", "bytes"]' 0x05BA149A7bd6dC1F937fA9046A9e05C05f3b18b0 0x4955a3F38ff86ae92A914445099caa8eA2B9bA32

https://testnet.bscscan.com/tx/0x0d944bbfd5c9f3a9ffba14d342c30808a0e61e9cd6e7889ea6e557a266f3527d

https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0x0d944bbfd5c9f3a9ffba14d342c30808a0e61e9cd6e7889ea6e557a266f3527d

https://sepolia.basescan.org/tx/0x990d2f4c9dcbb96f0b61f6a9d06d6680e45cbdc6f4af9ab4fff2ba0207c9a199

https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0x990d2f4c9dcbb96f0b61f6a9d06d6680e45cbdc6f4af9ab4fff2ba0207c9a199

https://amoy.polygonscan.com/tx/0xb162f4a9a2414a7fd63ef3e7d34a113af14d325a97cab1cc8036d7d958eafae9

https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0xb162f4a9a2414a7fd63ef3e7d34a113af14d325a97cab1cc8036d7d958eafae9

NFT

npx hardhat compile --force

npx hardhat deploy --gateway 0x6c533f7fe93fae114d0954697069df33c9b74fd7 --network zeta_testnet --gas-limit 500000 --name Universal

🚀 Successfully deployed "Universal" contract on zeta_testnet.
📜 Contract address: 0xCD58653a854817692079efd8ef0f6928aA66F628

npx hardhat deploy --gateway 0x0c487a766110c85d301d96e33579c5b317fa4995 --network bsc_testnet --name Connected

🚀 Successfully deployed "Connected" contract on bsc_testnet.
📜 Contract address: 0x31F76a088dF9802A283088cC8976f2395944712A

npx hardhat deploy --gateway 0x0c487a766110c85d301d96e33579c5b317fa4995 --network base_sepolia --name Connected

🚀 Successfully deployed "Connected" contract on base_sepolia.
📜 Contract address: 0xe36eA381567Ac954D3d068EC7033724B545E5Ae2

npx hardhat connected-set-counterparty --network bsc_testnet --contract 0x31F76a088dF9802A283088cC8976f2395944712A --counterparty 0xCD58653a854817692079efd8ef0f6928aA66F628 --json

{"contractAddress":"0x31F76a088dF9802A283088cC8976f2395944712A","universalContract":"0xCD58653a854817692079efd8ef0f6928aA66F628","transactionHash":"0x7a7ba679db5210ce6b8290e20883749e0601408162b43bc37a10b6ee7146919b"}

npx hardhat connected-set-counterparty --network base_sepolia --contract 0xe36eA381567Ac954D3d068EC7033724B545E5Ae2 --counterparty 0xCD58653a854817692079efd8ef0f6928aA66F628 --json

{"contractAddress":"0xe36eA381567Ac954D3d068EC7033724B545E5Ae2","universalContract":"0xCD58653a854817692079efd8ef0f6928aA66F628","transactionHash":"0xe9b4039e138f7c068ca288a403a6a7499454286323b4b9b6cc12c93e80e88561"}

npx hardhat universal-set-counterparty --network zeta_testnet --contract 0xCD58653a854817692079efd8ef0f6928aA66F628 --counterparty 0x31F76a088dF9802A283088cC8976f2395944712A --zrc20 0xd97B1de3619ed2c6BEb3860147E30cA8A7dC9891 --json

{"contractAddress":"0xCD58653a854817692079efd8ef0f6928aA66F628","zrc20":"0xd97B1de3619ed2c6BEb3860147E30cA8A7dC9891","connectedContractAddress":"0x31F76a088dF9802A283088cC8976f2395944712A","transactionHash":"0x27e7c5a1878eca4fce74405e1fe722c7ef3660abfb5bc51c9b8912ceb65b5a5b"}

npx hardhat universal-set-counterparty --network zeta_testnet --contract 0xCD58653a854817692079efd8ef0f6928aA66F628 --counterparty 0xe36eA381567Ac954D3d068EC7033724B545E5Ae2 --zrc20 0x236b0DE675cC8F46AE186897fCCeFe3370C9eDeD --json

{"contractAddress":"0xCD58653a854817692079efd8ef0f6928aA66F628","zrc20":"0x236b0DE675cC8F46AE186897fCCeFe3370C9eDeD","connectedContractAddress":"0xe36eA381567Ac954D3d068EC7033724B545E5Ae2","transactionHash":"0x9ffc05de29db59a719bde8bc3f6de43baf660af1e5702e21f367ebfb5916c25c"}

npx hardhat mint --network zeta_testnet --json --contract 0xCD58653a854817692079efd8ef0f6928aA66F628 --token-uri https://example.com/nft/metadata/1

{"contractAddress":"0xCD58653a854817692079efd8ef0f6928aA66F628","mintTransactionHash":"0x76f359263dfcccd898e7564f102d54b11daa763028cc725ee5bd3f05bcc6c2c9","recipient":"0x4955a3F38ff86ae92A914445099caa8eA2B9bA32","tokenURI":"https://example.com/nft/metadata/1","tokenId":"456003645905194763481523353718654221867725429194"}

ZetaChain -> Base NFT transfer

npx hardhat transfer --network zeta_testnet --json --token-id 456003645905194763481523353718654221867725429194 --from 0xCD58653a854817692079efd8ef0f6928aA66F628 --to 0x236b0DE675cC8F46AE186897fCCeFe3370C9eDeD
{"contractAddress":"0xCD58653a854817692079efd8ef0f6928aA66F628","transferTransactionHash":"0x554dec1282f3c367b4a465e391a0887f5b891f86ff2f32048c16c4932c278c4c","sender":"0x4955a3F38ff86ae92A914445099caa8eA2B9bA32","tokenId":"456003645905194763481523353718654221867725429194"}

https://zetachain-testnet.blockscout.com/tx/0x554dec1282f3c367b4a465e391a0887f5b891f86ff2f32048c16c4932c278c4c

https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0x554dec1282f3c367b4a465e391a0887f5b891f86ff2f32048c16c4932c278c4c

Copy link

coderabbitai bot commented Nov 8, 2024

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

examples/call/contracts/Connected.sol Fixed Show fixed Hide fixed
examples/call/contracts/Connected.sol Fixed Show fixed Hide fixed
examples/call/contracts/Connected.sol Fixed Show fixed Hide fixed
examples/call/contracts/Connected.sol Fixed Show fixed Hide fixed
@@ -20,9 +20,11 @@
GatewayEVM public immutable gateway;
uint256 private _nextTokenId;
address public counterparty;
uint256 public gasLimit;

Check warning

Code scanning / Slither

State variables that could be declared immutable Warning

Connected.gasLimit should be immutable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant