Skip to content

Commit a642d32

Browse files
committed
Add immutable to properties
1 parent 2284603 commit a642d32

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

contracts/solc-0.8/CPKFactory.sol

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,23 @@ contract CPKFactory {
1818
);
1919

2020
uint256 public constant version = 2;
21-
ProxyImplSetter public proxyImplSetter;
22-
IGnosisSafeProxyFactory public gnosisSafeProxyFactory;
21+
ProxyImplSetter public immutable proxyImplSetter;
22+
IGnosisSafeProxyFactory public immutable gnosisSafeProxyFactory;
23+
address public immutable proxyExtCodeHash;
2324

2425
constructor(IGnosisSafeProxyFactory _gnosisSafeProxyFactory) {
2526
proxyImplSetter = new ProxyImplSetter(address(this));
2627
gnosisSafeProxyFactory = _gnosisSafeProxyFactory;
28+
proxyExtCodeHash = keccak256(gnosisSafeProxyFactory.proxyRuntimeCode());
2729
}
2830

29-
// Accessors removed until something is figured out about the fact that these depend on the compiler
30-
// but really should depend instead on the specific gnosisSafeProxyFactory instance used
31-
32-
// function proxyCreationCode() external pure returns (bytes memory) {
33-
// return type(GnosisSafeProxy).creationCode;
34-
// }
35-
36-
// function proxyRuntimeCode() external pure returns (bytes memory) {
37-
// return type(GnosisSafeProxy).runtimeCode;
38-
// }
31+
function proxyCreationCode() external pure returns (bytes memory) {
32+
return gnosisSafeProxyFactory.proxyCreationCode();
33+
}
3934

40-
// bytes32 public constant proxyExtCodeHash = keccak256(type(GnosisSafeProxy).runtimeCode);
35+
function proxyRuntimeCode() external pure returns (bytes memory) {
36+
return gnosisSafeProxyFactory.proxyRuntimeCode();
37+
}
4138

4239
function createProxyAndExecTransaction(
4340
address owner,

contracts/solc-0.8/CPKFactoryFacade.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { Enum } from "./dep-ports/Enum.sol";
55
import { CPKFactory, CPKFactoryTx } from "./CPKFactory.sol";
66

77
contract CPKFactoryFacade {
8-
CPKFactory cpkFactory;
9-
address safeVersion;
10-
uint256 salt;
11-
address fallbackHandler;
8+
CPKFactory immutable cpkFactory;
9+
address immutable safeVersion;
10+
uint256 immutable salt;
11+
address immutable fallbackHandler;
1212

1313
constructor(
1414
CPKFactory _cpkFactory,

contracts/solc-0.8/ProxyImplSetter.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
pragma solidity >=0.8.0;
33

44
contract ProxyImplSetter {
5+
address public immutable initialSetter;
6+
57
address implementation;
6-
// KLUDGE: make this immutable after solc versions get fixed
7-
address public initialSetter;
88

99
constructor(address _initialSetter) {
1010
initialSetter = _initialSetter;

0 commit comments

Comments
 (0)