Skip to content

Commit 6714a22

Browse files
committed
Updated README documentation
1 parent 7be0a1d commit 6714a22

File tree

2 files changed

+65
-1
lines changed

2 files changed

+65
-1
lines changed

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ Options:
109109
--checker-reentrancy Enable reentrancy checker.
110110
--checker-timestampdependency Enable timestamp-dependency checker.
111111
--checker-txorigin Enable tx-origin checker.
112+
--cross-chain-analysis Run a cross-chain analysis.
113+
--cross-chain-policy <arg> Import a cross-chain policy.
112114
--etherscan-api-key <arg> Insert your Etherscan API key.
113115
--link-unsound-jumps-to-all-jumpdest Link all unsound jumps to all jumpdest.
114116
--output-directory-path <arg> Filepath of the output directory.
@@ -193,6 +195,68 @@ EVMLiSA.analyzeContract(new SmartContract().setBytecode("0x6080..."));
193195
EVMLiSA.analyzeSetOfContracts(Path.of("list-of-contracts.txt"));
194196
```
195197

198+
## Cross-Chain Policy Configuration
199+
200+
For cross-chain analysis, EVMLiSA supports policy files that define event-function mappings between smart contracts. The policy file should be a JSON file with the following structure:
201+
202+
### Policy JSON format
203+
204+
```json
205+
{
206+
"policy": [
207+
{
208+
"event": "EventName1",
209+
"function": "functionName1"
210+
},
211+
{
212+
"event": "EventName2",
213+
"function": "functionName2"
214+
}
215+
]
216+
}
217+
```
218+
219+
### Policy structure explanation
220+
221+
- **policy**: An array of objects, each containing:
222+
- **event**: The name of the event that triggers a cross-chain operation
223+
- **function**: The name of the function that should be called in response to the event
224+
225+
### Example
226+
227+
```json
228+
{
229+
"policy": [
230+
{
231+
"event": "Deposit",
232+
"function": "deposit"
233+
},
234+
{
235+
"event": "TransferOut",
236+
"function": "transferOut"
237+
},
238+
{
239+
"event": "VaultTransfer",
240+
"function": "returnVaultAssets"
241+
}
242+
]
243+
}
244+
```
245+
246+
### Usage with Policy
247+
248+
When running cross-chain analysis, specify the policy file using the `--cross-chain-policy` option:
249+
250+
```bash
251+
java -jar build/libs/evm-lisa-all.jar \
252+
--cross-chain-analysis \
253+
--bytecode-directory-path /path/to/bytecode \
254+
--abi-directory-path /path/to/abi \
255+
--cross-chain-policy /path/to/policy.json
256+
```
257+
258+
> Note: if no policy file is provided, EVMLiSA will use a default policy that matches events and functions by name.
259+
196260
## Contributors
197261

198262
<a href="https://github.com/lisa-analyzer/evm-lisa/graphs/contributors">

src/main/java/it/unipr/EVMLiSA.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ private Options getOptions() {
969969

970970
Option enableCrossChainAnalysisOption = Option.builder()
971971
.longOpt("cross-chain-analysis")
972-
.desc("Run a cross-chain analysis..")
972+
.desc("Run a cross-chain analysis.")
973973
.required(false)
974974
.hasArg(false)
975975
.build();

0 commit comments

Comments
 (0)