Skip to content

Commit a4511b4

Browse files
Merge branch 'master' into 7-bug-release-workflow-failed
2 parents 96b3068 + 9b6c416 commit a4511b4

441 files changed

Lines changed: 67494 additions & 6943 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ testdata/cheats/Vm.sol linguist-generated
44
# See <https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header>
55
*.rs diff=rust
66
crates/lint/testdata/* text eol=lf
7+
crates/lint/testdata/*.stderr whitespace=-blank-at-eof
78
testdata/fixtures/**/* eol=lf
89

910
dprint.json linguist-language=JSON-with-Comments

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @danipopes @mattsse @grandizzy @zerosnacks @0xrusowsky @mablr @figtracer @stevencartavia
1+
* @danipopes @mattsse @grandizzy @0xrusowsky @mablr @figtracer @stevencartavia

.github/scripts/tempo-check.sh

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
66

77
# Non-verification tempo checks: local tests, fork tests, cast commands, DEX operations
88

9-
# Hardfork version, defaults to T3 (latest features)
10-
HARDFORK="${TEMPO_HARDFORK:-T3}"
9+
# Hardfork version, defaults to T5.
10+
HARDFORK="${TEMPO_HARDFORK:-T5}"
1111

1212
# Fee token address, defaults to native fee token
1313
FEE_TOKEN="${TEMPO_FEE_TOKEN:-0x20c0000000000000000000000000000000000000}"
@@ -48,6 +48,12 @@ fund_and_wait() {
4848
done
4949
}
5050

51+
wallet_json_field() {
52+
local wallet_json="$1"
53+
local field="$2"
54+
jq -r --arg field "$field" '(.data // .)[0][$field]' <<<"$wallet_json"
55+
}
56+
5157
echo -e "\n=== INIT TEMPO PROJECT ==="
5258
tmp_dir=$(mktemp -d)
5359
cd "$tmp_dir"
@@ -76,8 +82,8 @@ forge script ${FEE_TOKEN_ARG[@]+"${FEE_TOKEN_ARG[@]}"} script/Mail.s.sol --sig "
7682

7783
echo -e "\n=== CREATE AND FUND ADDRESS ==="
7884
wallet_json="$(cast wallet new --json)"
79-
ADDR="$(jq -r '.[0].address' <<<"$wallet_json")"
80-
PK="$(jq -r '.[0].private_key' <<<"$wallet_json")"
85+
ADDR="$(wallet_json_field "$wallet_json" address)"
86+
PK="$(wallet_json_field "$wallet_json" private_key)"
8187
printf "address: %s\nprivate_key: %s\n" "$ADDR" "$PK"
8288
fund_and_wait "$ADDR"
8389

@@ -158,8 +164,8 @@ cast send ${FEE_TOKEN_ARG[@]+"${FEE_TOKEN_ARG[@]}"} --rpc-url "$ETH_RPC_URL" 0x8
158164
echo -e "\n=== SETUP ACCESS KEY ==="
159165
# Create an access key for testing
160166
access_wallet_json="$(cast wallet new --json)"
161-
ACCESS_KEY="$(jq -r '.[0].private_key' <<<"$access_wallet_json")"
162-
ACCESS_KEY_ADDR="$(jq -r '.[0].address' <<<"$access_wallet_json")"
167+
ACCESS_KEY="$(wallet_json_field "$access_wallet_json" private_key)"
168+
ACCESS_KEY_ADDR="$(wallet_json_field "$access_wallet_json" address)"
163169
printf "Access key address: %s\n" "$ACCESS_KEY_ADDR"
164170

165171
# Authorize the access key on-chain first (required for gas estimation)
@@ -198,8 +204,8 @@ cast send ${FEE_TOKEN_ARG[@]+"${FEE_TOKEN_ARG[@]}"} --rpc-url "$ETH_RPC_URL" 0x8
198204

199205
echo -e "\n=== CAST KEYCHAIN: AUTHORIZE ==="
200206
kc_wallet_json="$(cast wallet new --json)"
201-
KC_KEY_PK="$(jq -r '.[0].private_key' <<<"$kc_wallet_json")"
202-
KC_KEY_ADDR="$(jq -r '.[0].address' <<<"$kc_wallet_json")"
207+
KC_KEY_PK="$(wallet_json_field "$kc_wallet_json" private_key)"
208+
KC_KEY_ADDR="$(wallet_json_field "$kc_wallet_json" address)"
203209
printf "Keychain key address: %s\n" "$KC_KEY_ADDR"
204210

205211
cast keychain auth "$KC_KEY_ADDR" secp256k1 1893456000 \
@@ -212,11 +218,11 @@ echo "$KC_INFO" | grep -q "secp256k1"
212218

213219
echo -e "\n=== CAST KEYCHAIN: KEY-INFO --json ==="
214220
KC_INFO_JSON=$(cast keychain info "$ADDR" "$KC_KEY_ADDR" --rpc-url "$ETH_RPC_URL" --json)
215-
echo "$KC_INFO_JSON" | jq -e '.signatureType == "secp256k1"'
221+
echo "$KC_INFO_JSON" | jq -e '.data.signatureType == "secp256k1"'
216222

217223
echo -e "\n=== CAST KEYCHAIN: AUTHORIZE WITH LIMIT ==="
218224
kc_limited_json="$(cast wallet new --json)"
219-
KC_LIMITED_ADDR="$(jq -r '.[0].address' <<<"$kc_limited_json")"
225+
KC_LIMITED_ADDR="$(wallet_json_field "$kc_limited_json" address)"
220226
cast keychain auth "$KC_LIMITED_ADDR" secp256k1 1893456000 \
221227
--limit "$FEE_TOKEN:1000000000" \
222228
--rpc-url "$ETH_RPC_URL" --private-key "$PK" ${FEE_TOKEN_ARG[@]+"${FEE_TOKEN_ARG[@]}"}
@@ -272,8 +278,8 @@ echo "OK: duplicate authorize correctly rejected"
272278
if [[ "$HARDFORK" == "T3" ]]; then
273279
echo -e "\n=== CAST KEYCHAIN: AUTHORIZE WITH --scope (ADDRESS ONLY, UNRESTRICTED) ==="
274280
kc_scoped_json="$(cast wallet new --json)"
275-
KC_SCOPED_PK="$(jq -r '.[0].private_key' <<<"$kc_scoped_json")"
276-
KC_SCOPED_ADDR="$(jq -r '.[0].address' <<<"$kc_scoped_json")"
281+
KC_SCOPED_PK="$(wallet_json_field "$kc_scoped_json" private_key)"
282+
KC_SCOPED_ADDR="$(wallet_json_field "$kc_scoped_json" address)"
277283
cast keychain auth "$KC_SCOPED_ADDR" secp256k1 1893456000 \
278284
--scope 0x86A2EE8FAf9A840F7a2c64CA3d51209F9A02081D \
279285
--rpc-url "$ETH_RPC_URL" --private-key "$PK" ${FEE_TOKEN_ARG[@]+"${FEE_TOKEN_ARG[@]}"}
@@ -296,8 +302,8 @@ if [[ "$HARDFORK" == "T3" ]]; then
296302

297303
echo -e "\n=== CAST KEYCHAIN: AUTHORIZE WITH --scope + SELECTORS ==="
298304
kc_sel_json="$(cast wallet new --json)"
299-
KC_SEL_PK="$(jq -r '.[0].private_key' <<<"$kc_sel_json")"
300-
KC_SEL_ADDR="$(jq -r '.[0].address' <<<"$kc_sel_json")"
305+
KC_SEL_PK="$(wallet_json_field "$kc_sel_json" private_key)"
306+
KC_SEL_ADDR="$(wallet_json_field "$kc_sel_json" address)"
301307
cast keychain auth "$KC_SEL_ADDR" secp256k1 1893456000 \
302308
--scope "$FEE_TOKEN:transfer,approve" \
303309
--rpc-url "$ETH_RPC_URL" --private-key "$PK" ${FEE_TOKEN_ARG[@]+"${FEE_TOKEN_ARG[@]}"}
@@ -313,15 +319,15 @@ if [[ "$HARDFORK" == "T3" ]]; then
313319

314320
echo -e "\n=== CAST KEYCHAIN: AUTHORIZE WITH --scopes JSON ==="
315321
kc_json_json="$(cast wallet new --json)"
316-
KC_JSON_ADDR="$(jq -r '.[0].address' <<<"$kc_json_json")"
322+
KC_JSON_ADDR="$(wallet_json_field "$kc_json_json" address)"
317323
cast keychain auth "$KC_JSON_ADDR" secp256k1 1893456000 \
318324
--scopes "[{\"target\":\"$FEE_TOKEN\",\"selectors\":[\"transfer\"]},{\"target\":\"0x86A2EE8FAf9A840F7a2c64CA3d51209F9A02081D\"}]" \
319325
--rpc-url "$ETH_RPC_URL" --private-key "$PK" ${FEE_TOKEN_ARG[@]+"${FEE_TOKEN_ARG[@]}"}
320326
echo "OK: authorized key with --scopes JSON"
321327

322328
echo -e "\n=== CAST KEYCHAIN: AUTHORIZE WITH MULTIPLE LIMITS ==="
323329
kc_multi_json="$(cast wallet new --json)"
324-
KC_MULTI_ADDR="$(jq -r '.[0].address' <<<"$kc_multi_json")"
330+
KC_MULTI_ADDR="$(wallet_json_field "$kc_multi_json" address)"
325331
cast keychain auth "$KC_MULTI_ADDR" secp256k1 1893456000 \
326332
--limit "$FEE_TOKEN:1000000" \
327333
--limit "0x20C0000000000000000000000000000000000001:2000000" \
@@ -336,8 +342,8 @@ if [[ "$HARDFORK" == "T3" ]]; then
336342

337343
echo -e "\n=== CAST KEYCHAIN: AUTHORIZE WITH RAW HEX SELECTOR ==="
338344
kc_hex_json="$(cast wallet new --json)"
339-
KC_HEX_PK="$(jq -r '.[0].private_key' <<<"$kc_hex_json")"
340-
KC_HEX_ADDR="$(jq -r '.[0].address' <<<"$kc_hex_json")"
345+
KC_HEX_PK="$(wallet_json_field "$kc_hex_json" private_key)"
346+
KC_HEX_ADDR="$(wallet_json_field "$kc_hex_json" address)"
341347
# increment() selector = 0xd09de08a
342348
cast keychain auth "$KC_HEX_ADDR" secp256k1 1893456000 \
343349
--scope "0x86A2EE8FAf9A840F7a2c64CA3d51209F9A02081D:0xd09de08a" \
@@ -354,8 +360,8 @@ if [[ "$HARDFORK" == "T3" ]]; then
354360
echo -e "\n=== CAST KEYCHAIN: SET-SCOPE ==="
355361
# Create a new unrestricted key, then add scope restrictions via set-scope
356362
kc_ss_json="$(cast wallet new --json)"
357-
KC_SS_PK="$(jq -r '.[0].private_key' <<<"$kc_ss_json")"
358-
KC_SS_ADDR="$(jq -r '.[0].address' <<<"$kc_ss_json")"
363+
KC_SS_PK="$(wallet_json_field "$kc_ss_json" private_key)"
364+
KC_SS_ADDR="$(wallet_json_field "$kc_ss_json" address)"
359365
cast keychain auth "$KC_SS_ADDR" secp256k1 1893456000 \
360366
--rpc-url "$ETH_RPC_URL" --private-key "$PK" ${FEE_TOKEN_ARG[@]+"${FEE_TOKEN_ARG[@]}"}
361367

@@ -403,8 +409,8 @@ if [[ "$HARDFORK" == "T3" ]]; then
403409

404410
echo -e "\n=== CAST KEYCHAIN: AUTHORIZE WITH RECIPIENT RESTRICTION ==="
405411
kc_recip_json="$(cast wallet new --json)"
406-
KC_RECIP_PK="$(jq -r '.[0].private_key' <<<"$kc_recip_json")"
407-
KC_RECIP_ADDR="$(jq -r '.[0].address' <<<"$kc_recip_json")"
412+
KC_RECIP_PK="$(wallet_json_field "$kc_recip_json" private_key)"
413+
KC_RECIP_ADDR="$(wallet_json_field "$kc_recip_json" address)"
408414
# Only allow transfer to a specific recipient
409415
ALLOWED_RECIPIENT="0x4ef5DFf69C1514f4Dbf85aA4F9D95F804F64275F"
410416
cast keychain auth "$KC_RECIP_ADDR" secp256k1 1893456000 \
@@ -422,7 +428,7 @@ if [[ "$HARDFORK" == "T3" ]]; then
422428

423429
echo -e "\n=== CAST KEYCHAIN: --scopes JSON WITH RECIPIENTS ==="
424430
kc_jsonr_json="$(cast wallet new --json)"
425-
KC_JSONR_ADDR="$(jq -r '.[0].address' <<<"$kc_jsonr_json")"
431+
KC_JSONR_ADDR="$(wallet_json_field "$kc_jsonr_json" address)"
426432
cast keychain auth "$KC_JSONR_ADDR" secp256k1 1893456000 \
427433
--scopes "[{\"target\":\"$FEE_TOKEN\",\"selectors\":[{\"selector\":\"transfer\",\"recipients\":[\"$ALLOWED_RECIPIENT\"]}]},{\"target\":\"0x86A2EE8FAf9A840F7a2c64CA3d51209F9A02081D\"}]" \
428434
--rpc-url "$ETH_RPC_URL" --private-key "$PK" ${FEE_TOKEN_ARG[@]+"${FEE_TOKEN_ARG[@]}"}
@@ -434,8 +440,8 @@ fi # end T3-only scope tests
434440
echo -e "\n=== SETUP SPONSOR ==="
435441
# Create a sponsor wallet for testing sponsored (gasless) transactions
436442
sponsor_wallet_json="$(cast wallet new --json)"
437-
SPONSOR_PK="$(jq -r '.[0].private_key' <<<"$sponsor_wallet_json")"
438-
SPONSOR_ADDR="$(jq -r '.[0].address' <<<"$sponsor_wallet_json")"
443+
SPONSOR_PK="$(wallet_json_field "$sponsor_wallet_json" private_key)"
444+
SPONSOR_ADDR="$(wallet_json_field "$sponsor_wallet_json" address)"
439445
printf "Sponsor address: %s\n" "$SPONSOR_ADDR"
440446

441447
# Fund the sponsor address (sponsor pays gas)
@@ -802,8 +808,8 @@ echo -e "\n=== ANVIL FORK TESTS ==="
802808
# Use a fresh wallet for fork tests to avoid fee token exhaustion from prior devnet tests
803809
echo -e "\n=== ANVIL FORK: CREATE AND FUND FRESH WALLET ==="
804810
fork_wallet_json="$(cast wallet new --json)"
805-
FORK_ADDR="$(jq -r '.[0].address' <<<"$fork_wallet_json")"
806-
FORK_PK="$(jq -r '.[0].private_key' <<<"$fork_wallet_json")"
811+
FORK_ADDR="$(wallet_json_field "$fork_wallet_json" address)"
812+
FORK_PK="$(wallet_json_field "$fork_wallet_json" private_key)"
807813
printf "Fork test address: %s\n" "$FORK_ADDR"
808814
fund_and_wait "$FORK_ADDR"
809815

.github/scripts/tempo-deploy.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ fi
2424

2525
echo -e "\n=== USING FEE TOKEN: $FEE_TOKEN ==="
2626

27+
wallet_json_field() {
28+
local wallet_json="$1"
29+
local field="$2"
30+
jq -r --arg field "$field" '(.data // .)[0][$field]' <<<"$wallet_json"
31+
}
32+
2733
echo -e "\n=== INIT TEMPO PROJECT ==="
2834
tmp_dir=$(mktemp -d)
2935
cd "$tmp_dir"
@@ -38,8 +44,8 @@ if [[ -n "${PRIVATE_KEY:-}" ]]; then
3844
else
3945
echo -e "\n=== CREATE AND FUND ADDRESS ==="
4046
wallet_json="$(cast wallet new --json)"
41-
ADDR="$(jq -r '.[0].address' <<<"$wallet_json")"
42-
PK="$(jq -r '.[0].private_key' <<<"$wallet_json")"
47+
ADDR="$(wallet_json_field "$wallet_json" address)"
48+
PK="$(wallet_json_field "$wallet_json" private_key)"
4349

4450
for i in {1..100}; do
4551
OUT=$(cast rpc tempo_fundAddress "$ADDR" --rpc-url "$ETH_RPC_URL" 2>&1 || true)

.github/scripts/tempo-wallet.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,16 @@ fund_and_wait() {
4444
done
4545
}
4646

47+
wallet_json_field() {
48+
local wallet_json="$1"
49+
local field="$2"
50+
jq -r --arg field "$field" '(.data // .)[0][$field]' <<<"$wallet_json"
51+
}
52+
4753
echo -e "\n=== CREATE DIRECT-MODE WALLET ==="
4854
wallet_json="$(cast wallet new --json)"
49-
WALLET_ADDR="$(jq -r '.[0].address' <<<"$wallet_json")"
50-
WALLET_PK="$(jq -r '.[0].private_key' <<<"$wallet_json")"
55+
WALLET_ADDR="$(wallet_json_field "$wallet_json" address)"
56+
WALLET_PK="$(wallet_json_field "$wallet_json" private_key)"
5157
printf "address: %s\n" "$WALLET_ADDR"
5258

5359
echo -e "\n=== WRITE keys.toml ==="

.github/workflows/ci-mpp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
# Build and install binaries
4242
- name: Build and install Foundry binaries
4343
run: |
44-
cargo build --profile dev --locked -p forge -p cast -p anvil -p chisel
44+
cargo build --profile dev --locked --bin forge --bin cast --bin anvil --bin chisel
4545
echo "${{ github.workspace }}/target/debug" >> "$GITHUB_PATH"
4646
4747
- name: Run MPP e2e test

.github/workflows/ci-tempo.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
if: |
4444
github.event_name != 'pull_request' ||
4545
github.event.pull_request.head.repo.full_name == github.repository
46-
runs-on: depot-ubuntu-latest
46+
runs-on: depot-ubuntu-latest-16
4747
timeout-minutes: 60
4848
permissions:
4949
contents: read
@@ -62,7 +62,7 @@ jobs:
6262
# Build and install binaries
6363
- name: Build and install Foundry binaries
6464
run: |
65-
cargo build --profile dev --locked -p forge -p cast -p anvil -p chisel
65+
cargo build --profile dev --locked --bin forge --bin cast --bin anvil --bin chisel
6666
echo "${{ github.workspace }}/target/debug" >> "$GITHUB_PATH"
6767
6868
- name: Check Tempo fork schedule compatibility

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,17 @@ If you would like to test the binaries built from your change, see [foundryup](h
135135

136136
If you would like to use a debugger with breakpoints to debug a patch you might be working on, keep in mind we currently strip debug info for faster builds, which is _not_ the default. Therefore, to use a debugger, you need to enable it on the workspace [`Cargo.toml`'s `dev` profile](https://github.com/foundry-rs/foundry/tree/HEAD/Cargo.toml#L15-L18).
137137

138+
#### Output channels (stdout vs. stderr)
139+
140+
Foundry CLIs follow a strict output-channel contract: **stdout is the command's
141+
machine-readable result; stderr is everything else** (warnings, errors,
142+
progress, status prose, prompts). When adding or modifying user-facing output,
143+
read [`docs/dev/output-channels.md`](docs/dev/output-channels.md) and use the
144+
`sh_*` macros from `foundry_common::io` (`sh_println!`, `sh_status!`,
145+
`sh_progress!`, `sh_warn!`, `sh_err!`). A workspace-wide clippy
146+
`disallowed-macros` lint (see [`clippy.toml`](clippy.toml)) forbids
147+
`std::print*` and `std::eprint*`; use the `sh_*` macros instead.
148+
138149
#### Adding tests
139150

140151
If the change being proposed alters code, it is either adding new functionality to Foundry, or fixing existing, broken functionality.

0 commit comments

Comments
 (0)