@@ -11,24 +11,28 @@ import { GenericFactory } from "src/GenericFactory.sol";
11
11
contract ReservoirDeployer {
12
12
using FactoryStoreLib for GenericFactory;
13
13
14
+ error GuardianAddressZero ();
15
+ error OutOfOrder ();
16
+ error FactoryHash ();
17
+ error DeployFactoryFailed ();
18
+ error ConstantProductHash ();
19
+ error StableHash ();
20
+
14
21
// Steps.
15
22
uint256 public constant TERMINAL_STEP = 3 ;
16
23
uint256 public step = 0 ;
17
24
18
25
// Bytecode hashes.
19
- bytes32 public constant FACTORY_HASH = bytes32 (0x23864280088f6f71abfba47086784b3c758d1df19a55957e25f1f4bd9336792e );
26
+ bytes32 public constant FACTORY_HASH = bytes32 (0x87b0f73fafcf4bb41e013c8423dc679f6885527007d6c3f1e1834a670cbaadc5 );
20
27
bytes32 public constant CONSTANT_PRODUCT_HASH =
21
28
bytes32 (0xe174de1f7ab5f7c871f23787d956a8d1b4ebbb3b195eb2d6af27fb3a8c9e812e );
22
- bytes32 public constant STABLE_HASH = bytes32 (0x3ae886aee24fa2cc0144d24306033a7ed47e91bc0f962e4bffcef5922ae175f5 );
29
+ bytes32 public constant STABLE_HASH = bytes32 (0x37118cc4f3b41471e6e52968fd506b80bbb1395764db8498cb3f4c4cfb8ab35c );
23
30
24
31
// Deployment addresses.
25
32
GenericFactory public factory;
26
33
27
34
constructor (address aGuardian1 , address aGuardian2 , address aGuardian3 ) {
28
- require (
29
- aGuardian1 != address (0 ) && aGuardian2 != address (0 ) && aGuardian3 != address (0 ),
30
- "DEPLOYER: GUARDIAN_ADDRESS_ZERO "
31
- );
35
+ require (aGuardian1 != address (0 ) && aGuardian2 != address (0 ) && aGuardian3 != address (0 ), GuardianAddressZero ());
32
36
guardian1 = aGuardian1;
33
37
guardian2 = aGuardian2;
34
38
guardian3 = aGuardian3;
@@ -43,8 +47,8 @@ contract ReservoirDeployer {
43
47
//////////////////////////////////////////////////////////////////////////*/
44
48
45
49
function deployFactory (bytes memory aFactoryBytecode ) external returns (GenericFactory) {
46
- require (step == 0 , " FAC_STEP: OUT_OF_ORDER " );
47
- require (keccak256 (aFactoryBytecode) == FACTORY_HASH, " DEPLOYER: FACTORY_HASH " );
50
+ require (step == 0 , OutOfOrder () );
51
+ require (keccak256 (aFactoryBytecode) == FACTORY_HASH, FactoryHash () );
48
52
49
53
// Manual deployment from validated bytecode.
50
54
address lFactoryAddress;
@@ -56,7 +60,7 @@ contract ReservoirDeployer {
56
60
mload (aFactoryBytecode) // size
57
61
)
58
62
}
59
- require (lFactoryAddress != address (0 ), " FAC_STEP: DEPLOYMENT_FAILED " );
63
+ require (lFactoryAddress != address (0 ), DeployFactoryFailed () );
60
64
61
65
// Write the factory address so we can start configuring it.
62
66
factory = GenericFactory (lFactoryAddress);
@@ -75,8 +79,8 @@ contract ReservoirDeployer {
75
79
}
76
80
77
81
function deployConstantProduct (bytes memory aConstantProductBytecode ) external {
78
- require (step == 1 , " CP_STEP: OUT_OF_ORDER " );
79
- require (keccak256 (aConstantProductBytecode) == CONSTANT_PRODUCT_HASH, " DEPLOYER: CP_HASH " );
82
+ require (step == 1 , OutOfOrder () );
83
+ require (keccak256 (aConstantProductBytecode) == CONSTANT_PRODUCT_HASH, ConstantProductHash () );
80
84
81
85
// Add curve & curve specific parameters.
82
86
factory.addCurve (aConstantProductBytecode);
@@ -87,8 +91,8 @@ contract ReservoirDeployer {
87
91
}
88
92
89
93
function deployStable (bytes memory aStableBytecode ) external {
90
- require (step == 2 , " SP_STEP: OUT_OF_ORDER " );
91
- require (keccak256 (aStableBytecode) == STABLE_HASH, " DEPLOYER: STABLE_HASH " );
94
+ require (step == 2 , OutOfOrder () );
95
+ require (keccak256 (aStableBytecode) == STABLE_HASH, StableHash () );
92
96
93
97
// Add curve & curve specific parameters.
94
98
factory.addCurve (aStableBytecode);
0 commit comments