You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments