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

feat: contract_call event capture #20

Merged
merged 6 commits into from
May 10, 2024
Merged

Conversation

ctoyan
Copy link
Member

@ctoyan ctoyan commented Apr 30, 2024

Description

After https://github.com/eigerco/giza-axelar-starknet/issues/77 and https://github.com/eigerco/giza-axelar-starknet/issues/78, we need to capture the ContractCall event from Starknet, in order to prepare it for verification against the Axelar message passed from the relayer.

Requirements

  • Add ampd boilerplate for starknet as a new chain
  • Intercept the ContractCall message
  • Prepare it for verification agains the Axelar message

Todos

  • Unit tests
  • Manual tests
  • Documentation
  • Connect epics/issues

Steps to test manually

  • Run a starkli command to execute call_contract on the gateway, so it can emit a ContractCall event.
    For example -
    starkli invoke 0x055fddb9d939ab8c6cfd5a9871663457cd5b2fcb9dad9cdf464a12f1e045c4d4 call_contract str:destination_chain 4 0x4c6f6e67206c6f6e6720737472696e672c2061206c6f74206d6f72652074 0x68616e2033312063686172616374657273207468617420776f756c646e27 0x74206576656e2066697420696e2074776f2066656c74732c20736f207765 0x276c6c2068617665206174206c656173742074776f2066656c747320616e 0x6420612070656e64696e6720776f72642e 17 5 104 101 108 108 111, which equals the following event ContractCallEvent { destination_address: "Long long string, a lot more than 31 characters that wouldn't even fit in two felts, so we'll have at least two felts and a pending word.", destination_chain: "destination_chain", source_address: "0x00b3ff441a68610b30fd5e2abbf3a1548eb6ba6f3559f2862bf2dc757e5828ca", payload_hash: 0x1c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36deac8 }
  • Construct a message corresponding to the one above and send it to axelar verifier
  • Check if the message has been verified in the verifier contract

@ctoyan ctoyan self-assigned this Apr 30, 2024
@ctoyan ctoyan changed the title Feat/call contract capture draft: feat: call contract capture Apr 30, 2024
@ctoyan ctoyan changed the title draft: feat: call contract capture feat: call contract capture Apr 30, 2024
@ctoyan ctoyan changed the title feat: call contract capture feat: ContractCall event capture Apr 30, 2024
@ctoyan ctoyan marked this pull request as draft April 30, 2024 22:03
@ctoyan ctoyan marked this pull request as ready for review May 3, 2024 16:34
@ctoyan ctoyan changed the title feat: ContractCall event capture feat: contract_call event capture May 3, 2024
ampd/src/handlers/starknet_verify_msg.rs Show resolved Hide resolved
ampd/src/handlers/starknet_verify_msg.rs Show resolved Hide resolved
ampd/src/handlers/config.rs Show resolved Hide resolved
ampd/src/starknet/verifier.rs Show resolved Hide resolved
ampd/src/starknet/json_rpc.rs Show resolved Hide resolved
ampd/src/starknet/json_rpc.rs Show resolved Hide resolved
ampd/src/handlers/config.rs Show resolved Hide resolved
ampd/src/lib.rs Show resolved Hide resolved
ampd/src/starknet/events/contract_call.rs Show resolved Hide resolved
ampd/src/starknet/networks.rs Show resolved Hide resolved
ampd/src/starknet/verifier.rs Show resolved Hide resolved
@ctoyan ctoyan changed the title feat: contract_call event capture feat: contract_call event capture May 10, 2024
@ctoyan ctoyan merged commit eb7468c into starknet May 10, 2024
0 of 5 checks passed
@ctoyan ctoyan deleted the feat/call-contract-capture branch May 10, 2024 19:55
ctoyan added a commit that referenced this pull request Jun 10, 2024
ctoyan added a commit that referenced this pull request Jun 10, 2024
ctoyan added a commit that referenced this pull request Aug 7, 2024
ctoyan added a commit that referenced this pull request Sep 9, 2024
ctoyan added a commit that referenced this pull request Sep 9, 2024
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.

2 participants