Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions e2e_test/shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ TOKEN_ADDR=0x471ece3750da237f93b8e339c536989b8978a438
FEE_CURRENCY_WHITELIST_ADDR=0xbb024e9cdcb2f9e34d893630d19611b8a5381b3c
SORTED_ORACLES_ADDR=0xefb84935239dacdecf7c5ba76d8de40b077b7b33
FEE_CURRENCY=0x000000000000000000000000000000000000ce16
FEE_HANDLER=0xcd437749e43a154c07f3553504c68fbfd56b8778

FIXIDITY_1=1000000000000000000000000
ZERO_ADDRESS=0x0000000000000000000000000000000000000000
17 changes: 17 additions & 0 deletions e2e_test/test_base_fee_recipient.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
#shellcheck disable=SC2086
set -eo pipefail
set -x

source shared.sh

# Send token and check balance
balance_before=$(cast balance $FEE_HANDLER)
tx_json=$(cast send --json --private-key $ACC_PRIVKEY $TOKEN_ADDR 'transfer(address to, uint256 value) returns (bool)' 0x000000000000000000000000000000000000dEaD 100)
gas_used=$(echo $tx_json | jq -r '.gasUsed')
block_number=$(echo $tx_json | jq -r '.blockNumber')
base_fee=$(cast base-fee $block_number)
expected_balance_change=$((base_fee * gas_used))
balance_after=$(cast balance $FEE_HANDLER)
echo "Balance change: $balance_before -> $balance_after"
[[ $((balance_before + expected_balance_change)) -eq $balance_after ]] || (echo "Balance did not change as expected"; exit 1)