@@ -5,19 +5,26 @@ import {StdStorage} from "./StdStorage.sol";
55import {Vm, VmSafe} from "./Vm.sol " ;
66
77abstract contract CommonBase {
8- // Cheat code address, 0x7109709ECfa91a80626fF3989D68f67F5b1DD12D.
9- address internal constant VM_ADDRESS = address (uint160 (uint256 (keccak256 ("hevm cheat code " ))));
10- // console.sol and console2.sol work by executing a staticcall to this address.
8+ /// @dev Cheat code address.
9+ /// Calculated as `address(uint160(uint256(keccak256("hevm cheat code"))))`.
10+ address internal constant VM_ADDRESS = 0x7109709ECfa91a80626fF3989D68f67F5b1DD12D ;
11+ /// @dev console.sol and console2.sol work by executing a staticcall to this address.
12+ /// Calculated as `address(uint160(uint88(bytes11("console.log"))))`.
1113 address internal constant CONSOLE = 0x000000000000000000636F6e736F6c652e6c6f67 ;
12- // Used when deploying with create2, https://github.com/Arachnid/deterministic-deployment-proxy.
14+ /// @dev Used when deploying with create2.
15+ /// Taken from https://github.com/Arachnid/deterministic-deployment-proxy.
1316 address internal constant CREATE2_FACTORY = 0x4e59b44847b379578588920cA78FbF26c0B4956C ;
14- // Default address for tx.origin and msg.sender, 0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38.
15- address internal constant DEFAULT_SENDER = address (uint160 (uint256 (keccak256 ("foundry default caller " ))));
16- // Address of the test contract, deployed by the DEFAULT_SENDER.
17+ /// @dev The default address for tx.origin and msg.sender.
18+ /// Calculated as `address(uint160(uint256(keccak256("foundry default caller"))))`.
19+ address internal constant DEFAULT_SENDER = 0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38 ;
20+ /// @dev The address of the first contract `CREATE`d by a running test contract.
21+ /// When running tests, each test contract is `CREATE`d by `DEFAULT_SENDER` with nonce 1.
22+ /// Calculated as `VM.computeCreateAddress(VM.computeCreateAddress(DEFAULT_SENDER, 1), 1)`.
1723 address internal constant DEFAULT_TEST_CONTRACT = 0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f ;
18- // Deterministic deployment address of the Multicall3 contract.
24+ /// @dev Deterministic deployment address of the Multicall3 contract.
25+ /// Taken from https://www.multicall3.com.
1926 address internal constant MULTICALL3_ADDRESS = 0xcA11bde05977b3631167028862bE2a173976CA11 ;
20- // The order of the secp256k1 curve.
27+ /// @dev The order of the secp256k1 curve.
2128 uint256 internal constant SECP256K1_ORDER =
2229 115792089237316195423570985008687907852837564279074904382605163141518161494337 ;
2330
0 commit comments