-
Notifications
You must be signed in to change notification settings - Fork 442
/
justfile
34 lines (25 loc) · 979 Bytes
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
set dotenv-load := true
#test contracts using forge
build-contracts:
forge install --root ./contracts
forge test --root ./contracts
#test contracts using forge
test-contracts:
forge test --root ./contracts
#download source code from etherscan for members of the protocols.json file
download-protocol-sources:
#!/usr/bin/env bash
for name in $(jq -r 'keys[]' protocols.json); do
address=$(jq -r ".$name" protocols.json)
echo "Downloading $name from $address"
cast etherscan-source --etherscan-api-key $ETHERSCAN_API_KEY -d ./contracts/src/protocols $address
done
#generate bindings for elements of the contracts directory
generate-bindings:
forge bind --bindings-path ./bindings --root ./contracts --crate-name bindings --force
#download sources and generate bindings
build-bindings-crate: download-protocol-sources generate-bindings
fmt:
cargo +nightly fmt --all
clippy:
cargo clippy --all --all-features