Closed Confucian-e closed 1 month ago
node-bindings
v0.5.4
macOS (Apple Silicon)
I'm transferring 1 ether using anvil but received 1 ether and 21000 wei.
// setup anvil node let provider = ProviderBuilder::new() .with_recommended_fillers() .on_anvil_with_wallet(); let receiver = Address::ZERO; let balance_before = provider.get_balance(receiver).await.unwrap(); // send tx let value = parse_ether("1").unwrap(); let tx = TransactionRequest::default() .with_to(receiver) .with_value(value); let tx_hash = provider .send_transaction(tx) .await .unwrap() .watch() .await .unwrap(); println!("tx_hash: {:?}", tx_hash); let balancer_after = provider.get_balance(receiver).await.unwrap(); let balance_change = balancer_after - balance_before; println!("balance_change: {:?}", balance_change);
The value of balance_change is 1000000000000021000.
balance_change
1000000000000021000
you sent to zero address, by default the zero address is the fee recipient for that block hence the additional balance.
miner 0x0000000000000000000000000000000000000000
Component
node-bindings
What version of Alloy are you on?
v0.5.4
Operating System
macOS (Apple Silicon)
Describe the bug
I'm transferring 1 ether using anvil but received 1 ether and 21000 wei.
The value of
balance_change
is1000000000000021000
.