LedgerHQ / ledger-fresh-management

This is where product topics are discussed for Ledger Fresh
Apache License 2.0
14 stars 2 forks source link

Starkcheck: Back-end trace analyser #24

Open CremaFR opened 1 year ago

CremaFR commented 1 year ago

repo of the project

https://github.com/LedgerHQ/StarkCheck

CremaFR commented 1 year ago

Initial specs/idea:

Considering all the point above this back-end will have one endpoint /checks which takes a raw transactions and a policy as parameters and returns a message with a signed transaction hash.

Inputs: Transaction as defined here: https://docs.starknet.io/documentation/architecture_and_concepts/Blocks/transactions/ Policy is a list of

The back run simulate transaction on a node and analyse the trace to determine the risks. The back should also check for approvals (and returns warning if an address in the policy is spotted in the trace).

CremaFR commented 1 year ago

Some addresses and selectors to checks

eth erc20 addr: 0x72df4dc5b6c4df72e4288857317caf2ce9da166ab8719ab8306516a2fddfff7

approve selector: 0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c transferFrom selector: 0x41b033f4a31df8067c24d1e9b550a2ce75fd4a29e1147af9752174f0e6cb20 transfer selector: 0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e

Some interesting transaction hash to check for "complex" calldata: https://testnet.starkscan.co/tx/0x02e6c38c8579fef5d530945d98a0f7905452a6e764658daf4e108d211ddffd06#internal-calls

CremaFR commented 1 year ago
Screenshot 2022-12-20 at 13 37 51

The contract account's plugin will be updated to have the following:

yogh333 commented 1 year ago

Draft sequence diagrams:

  1. Setting a policy: Starkcheck_ set Policy
  2. Checking a policy: Starkcheck_ check Policy

To be reviewed

yogh333 commented 1 year ago

Updated Sequence diagrams:

  1. Set policy: Starkcheck_ set Policy (1)
  2. Check policy: Starkcheck_ check Policy (1)
qd-qd commented 1 year ago

In the following days, this issue will be detailed by all the tasks listed in the Starkcheck module project and then closed.