Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Sep 24, 2024
1 parent 35499cf commit e5ae174
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/SafeSingletonDeployer.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

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

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

function computeAddress(bytes memory creationCode, bytes32 salt) public pure returns (address) {
return computeAddress(creationCode, "", salt);
Expand Down Expand Up @@ -98,9 +98,9 @@ library SafeSingletonDeployer {
return keccak256(abi.encodePacked(creationCode, args));
}

function prepareAnvil() {
function prepareAnvil() public {
if (block.chainid == 31337) {
vm.etch(SafeSingletonDeployer.SAFE_SINGLETON_FACTORY, factoryCode);
VM.etch(SafeSingletonDeployer.SAFE_SINGLETON_FACTORY, factoryCode);
}
}
}

0 comments on commit e5ae174

Please sign in to comment.