Skip to content

Commit 2b08ee8

Browse files
committed
fixes
1 parent 35499cf commit 2b08ee8

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/SafeSingletonDeployer.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.0;
33

4-
import {VmSafe} from "forge-std/Vm.sol";
4+
import {Vm} from "forge-std/Vm.sol";
55

66
/// @notice Library for deploying contracts using Safe's Singleton Factory
77
/// https://github.com/safe-global/safe-singleton-factory
@@ -14,7 +14,7 @@ library SafeSingletonDeployer {
1414
bytes constant factoryCode =
1515
hex"7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3";
1616

17-
VmSafe private constant VM = VmSafe(address(uint160(uint256(keccak256("hevm cheat code")))));
17+
Vm private constant VM = Vm(address(uint160(uint256(keccak256("hevm cheat code")))));
1818

1919
function computeAddress(bytes memory creationCode, bytes32 salt) public pure returns (address) {
2020
return computeAddress(creationCode, "", salt);
@@ -98,9 +98,9 @@ library SafeSingletonDeployer {
9898
return keccak256(abi.encodePacked(creationCode, args));
9999
}
100100

101-
function prepareAnvil() {
101+
function prepareAnvil() public {
102102
if (block.chainid == 31337) {
103-
vm.etch(SafeSingletonDeployer.SAFE_SINGLETON_FACTORY, factoryCode);
103+
VM.etch(SafeSingletonDeployer.SAFE_SINGLETON_FACTORY, factoryCode);
104104
}
105105
}
106106
}

test/SafeSingletonDeployer.t.sol

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ import {MockReverting} from "./MockReverting.sol";
1010

1111
contract SafeSingletonDeployerTest is Test {
1212
function test_deploy_createsAtExpectedAddress() public {
13-
address expectedAddress =
14-
SafeSingletonDeployer.computeAddress(type(Mock).creationCode, abi.encode(1), bytes32("0x1234"));
13+
address expectedAddress = SafeSingletonDeployer.computeAddress(
14+
type(Mock).creationCode,
15+
abi.encode(1),
16+
bytes32("0x1234")
17+
);
1518
assertEq(expectedAddress.code, "");
1619
address returnAddress = SafeSingletonDeployer.deploy({
1720
creationCode: type(Mock).creationCode,

0 commit comments

Comments
 (0)