Skip to content

Commit dc6cbe8

Browse files
authored
add info about Seth to verification docs (#1643)
1 parent 2e43648 commit dc6cbe8

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

book/src/framework/verify.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Verifying Contracts
22

3+
## Using Foundry
4+
35
You need to install [Foundry](https://book.getfoundry.sh/getting-started/installation) first, `forge` should be available in your `$PATH`.
46

57
Check out our [example](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/examples/myproject/verify_test.go) of programmatically verifying contracts using `Blockscout` and `Foundry`. You'll need to provide:
@@ -17,3 +19,42 @@ Check out our [example](https://github.com/smartcontractkit/chainlink-testing-fr
1719
)
1820
require.NoError(t, err)
1921
```
22+
23+
## Using Seth
24+
25+
If you don't want to verify contracts or you can't or don't want to use `Blockscout` not all is lost.
26+
27+
### With CLI
28+
29+
You can use `Seth` to trace your transaction both from your Go code or from [the CLI](https://smartcontractkit.github.io/chainlink-testing-framework/libs/seth.html#single-transaction-tracing). Remember that you need to adjust `seth.toml` to point to gethwrappers or ABIs of contracts you want to trace.
30+
31+
### Programatic
32+
33+
If you want to use from Go code, you need to have a couple of things in mind:
34+
* you need to point Seth to your Gethwrappers, so that it can extract ABIs from them
35+
* you need to decide, when it should trace transactions: reverted, none or all (by default, only reverted ones are traced)
36+
* you need to decide, where to output tracing results: console, dot graphs, json files (be default, to console)
37+
38+
If printing to console remember to set `Seth` log level to `debug`, otherwise you won't see anything relevant printed:
39+
```
40+
```
41+
42+
43+
44+
```go
45+
client, err := NewClientBuilder().
46+
WithNetworkName("my network").
47+
WithRpcUrl("ws://localhost:8546").
48+
WithPrivateKeys([]string{"ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"}).
49+
// tracing
50+
WithTracing(seth.TracingLevel_All, []string{seth.TraceOutput_Console}).
51+
// folder with gethwrappers for ABI decoding
52+
WithGethWrappersFolders([]string{"./gethwrappers/ccip", "./gethwrappers/keystone"}).
53+
Build()
54+
55+
if err != nil {
56+
log.Fatal(err)
57+
}
58+
```
59+
60+
For more information about configuring `Seth` please read about [TOML config](https://smartcontractkit.github.io/chainlink-testing-framework/libs/seth.html#toml-configuration) and [programatic builder](https://smartcontractkit.github.io/chainlink-testing-framework/libs/seth.html#config).

0 commit comments

Comments
 (0)