Skip to content

Commit e87c70f

Browse files
authored
fix: update TEST_CONTRACT_ADDRESS (#12475)
Currently it's set to dapp's default test contract. It was added incorrectly here 262bdf2. Set it to the correct CALLER.create(1) which is what is actually deployed. We also remove it from the default labels since we likely have a label already from the actual source code.
1 parent efcde6c commit e87c70f

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

crates/evm/core/src/constants.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ pub const HARDHAT_CONSOLE_ADDRESS: Address = address!("0x000000000000000000636F6
2929
pub const CALLER: Address = address!("0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38");
3030

3131
/// The default test contract address.
32-
pub const TEST_CONTRACT_ADDRESS: Address = address!("0xb4c79daB8f259C7Aee6E5b2Aa729821864227e84");
32+
///
33+
/// Derived from `CALLER.create(1)`.
34+
pub const TEST_CONTRACT_ADDRESS: Address = address!("0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496");
3335

3436
/// Magic return value returned by the `assume` cheatcode.
3537
pub const MAGIC_ASSUME: &[u8] = b"FOUNDRY::ASSUME";

crates/evm/traces/src/decoder/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ use foundry_common::{
1515
};
1616
use foundry_evm_core::{
1717
abi::{Vm, console},
18-
constants::{
19-
CALLER, CHEATCODE_ADDRESS, DEFAULT_CREATE2_DEPLOYER, HARDHAT_CONSOLE_ADDRESS,
20-
TEST_CONTRACT_ADDRESS,
21-
},
18+
constants::{CALLER, CHEATCODE_ADDRESS, DEFAULT_CREATE2_DEPLOYER, HARDHAT_CONSOLE_ADDRESS},
2219
decode::RevertDecoder,
2320
precompiles::{
2421
BLAKE_2F, EC_ADD, EC_MUL, EC_PAIRING, EC_RECOVER, IDENTITY, MOD_EXP, POINT_EVALUATION,
@@ -176,7 +173,6 @@ impl CallTraceDecoder {
176173
(HARDHAT_CONSOLE_ADDRESS, "console".to_string()),
177174
(DEFAULT_CREATE2_DEPLOYER, "Create2Deployer".to_string()),
178175
(CALLER, "DefaultSender".to_string()),
179-
(TEST_CONTRACT_ADDRESS, "DefaultTestContract".to_string()),
180176
(EC_RECOVER, "ECRecover".to_string()),
181177
(SHA_256, "SHA-256".to_string()),
182178
(RIPEMD_160, "RIPEMD-160".to_string()),

crates/forge/tests/cli/test_cmd/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ contract PrecompileLabelsTest is Test {
978978
vm.deal(address(0x000000000000000000636F6e736F6c652e6c6f67), 1 ether);
979979
vm.deal(address(0x4e59b44847b379578588920cA78FbF26c0B4956C), 1 ether);
980980
vm.deal(address(0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38), 1 ether);
981-
vm.deal(address(0xb4c79daB8f259C7Aee6E5b2Aa729821864227e84), 1 ether);
981+
vm.deal(address(0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496), 1 ether);
982982
vm.deal(address(1), 1 ether);
983983
vm.deal(address(2), 1 ether);
984984
vm.deal(address(3), 1 ether);
@@ -1011,7 +1011,7 @@ Traces:
10111011
│ └─ ← [Return]
10121012
├─ [0] VM::deal(DefaultSender: [0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38], 1000000000000000000 [1e18])
10131013
│ └─ ← [Return]
1014-
├─ [0] VM::deal(DefaultTestContract: [0xb4c79daB8f259C7Aee6E5b2Aa729821864227e84], 1000000000000000000 [1e18])
1014+
├─ [0] VM::deal(PrecompileLabelsTest: [0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496], 1000000000000000000 [1e18])
10151015
│ └─ ← [Return]
10161016
├─ [0] VM::deal(ECRecover: [0x0000000000000000000000000000000000000001], 1000000000000000000 [1e18])
10171017
│ └─ ← [Return]

0 commit comments

Comments
 (0)