poseidon-solidity-example/lib/forge-std/src/Base.sol
lib/forge-std/src/Base.solRaw
1// SPDX-License-Identifier: MIT
2pragma solidity >=0.6.2 <0.9.0;
3
4import {StdStorage} from "./StdStorage.sol";
5import {Vm, VmSafe} from "./Vm.sol";
6
7abstract 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.
11 address internal constant CONSOLE = 0x000000000000000000636F6e736F6c652e6c6f67;
12 // Default address for tx.origin and msg.sender, 0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38.
13 address internal constant DEFAULT_SENDER = address(uint160(uint256(keccak256("foundry default caller"))));
14 // Address of the test contract, deployed by the DEFAULT_SENDER.
15 address internal constant DEFAULT_TEST_CONTRACT = 0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f;
16 // Deterministic deployment address of the Multicall3 contract.
17 address internal constant MULTICALL3_ADDRESS = 0xcA11bde05977b3631167028862bE2a173976CA11;
18
19 uint256 internal constant UINT256_MAX =
20 115792089237316195423570985008687907853269984665640564039457584007913129639935;
21
22 Vm internal constant vm = Vm(VM_ADDRESS);
23 StdStorage internal stdstore;
24}
25
26abstract contract TestBase is CommonBase {}
27
28abstract contract ScriptBase is CommonBase {
29 // Used when deploying with create2, https://github.com/Arachnid/deterministic-deployment-proxy.
30 address internal constant CREATE2_FACTORY = 0x4e59b44847b379578588920cA78FbF26c0B4956C;
31
32 VmSafe internal constant vmSafe = VmSafe(VM_ADDRESS);
33}