github.com/ethereum-optimism/optimism@v1.7.2/packages/contracts-bedrock/test/legacy/DeployerWhitelist.t.sol (about) 1 // SPDX-License-Identifier: MIT 2 pragma solidity 0.8.15; 3 4 // Testing utilities 5 import { Test } from "forge-std/Test.sol"; 6 7 // Target contract 8 import { DeployerWhitelist } from "src/legacy/DeployerWhitelist.sol"; 9 10 contract DeployerWhitelist_Test is Test { 11 DeployerWhitelist list; 12 13 /// @dev Sets up the test suite. 14 function setUp() public { 15 list = new DeployerWhitelist(); 16 } 17 18 /// @dev Tests that `owner` is initialized to the zero address. 19 function test_owner_succeeds() external { 20 assertEq(list.owner(), address(0)); 21 } 22 23 /// @dev Tests that `setOwner` correctly sets the contract owner. 24 function test_storageSlots_succeeds() external { 25 vm.prank(list.owner()); 26 list.setOwner(address(1)); 27 28 assertEq(bytes32(uint256(1)), vm.load(address(list), bytes32(uint256(0)))); 29 } 30 }