@@ -6,13 +6,47 @@ interface IProtocolRegistryErrors {
66 error InputArrayLengthMismatch ();
77}
88
9- interface IProtocolRegistryTypes {}
9+ interface IProtocolRegistryTypes {
10+ /**
11+ * @notice Configuration for a protocol deployment.
12+ * @param pausable Whether this deployment can be paused.
13+ * @param upgradeable Whether this deployment is upgradeable.
14+ * @param splitContract Whether this deployment uses a split-contract pattern (two implementations).
15+ * @param deprecated Whether this deployment is deprecated.
16+ */
17+ struct DeploymentConfig {
18+ bool pausable;
19+ bool upgradeable;
20+ bool splitContract;
21+ bool deprecated;
22+ }
23+
24+ /**
25+ * @notice Parameters describing a protocol deployment.
26+ * @param addr The address of the deployment (proxy address if upgradeable).
27+ * @param config The configuration for the deployment.
28+ */
29+ struct Deployment {
30+ address addr;
31+ DeploymentConfig config;
32+ }
33+ }
1034
1135interface IProtocolRegistryEvents is IProtocolRegistryTypes {
12- /// @notice Emitted when the version is set for a given address.
13- /// @param addr The address for which the version is set.
14- /// @param semver The semantic version string set for the address.
15- event VersionSet (address indexed addr , string semver );
36+ /**
37+ * @notice Emitted when a deployment is shipped.
38+ * @param addr The address of the deployment.
39+ * @param implementations The implementation addresses for the deployment.
40+ * @param semanticVersion The semantic version associated with the deployment.
41+ */
42+ event DeploymentShipped (address indexed addr , address [] implementations , string semanticVersion );
43+
44+ /**
45+ * @notice Emitted when a deployment is configured.
46+ * @param addr The address of the deployment.
47+ * @param config The configuration for the deployment.
48+ */
49+ event DeploymentConfigured (address indexed addr , DeploymentConfig config );
1650}
1751
1852interface IProtocolRegistry is IProtocolRegistryErrors , IProtocolRegistryEvents {
@@ -25,44 +59,55 @@ interface IProtocolRegistry is IProtocolRegistryErrors, IProtocolRegistryEvents
2559 ) external ;
2660
2761 /**
28- * @notice Sets the semantic version for a single address.
29- * @dev Only callable by the contract owner.
30- * @param addr The address for which to set the version.
31- * @param semver The semantic version string to set for the address.
62+ * @notice Ships a deployment and it's corresponding implementations.
63+ * @dev Only callable by the owner.
64+ * @param deployment The deployment to ship.
65+ * @param implementations The implementations to ship.
66+ * @param semanticVersion The semantic version to ship.
67+ */
68+ function ship (
69+ Deployment calldata deployment ,
70+ address [] calldata implementations ,
71+ string calldata semanticVersion
72+ ) external ;
73+
74+ /**
75+ * @notice Ships a list of deployments and their corresponding implementations.
76+ * @dev Only callable by the owner.
77+ * @param deployments The deployments to ship.
78+ * @param implementations The implementations to ship.
79+ * @param semanticVersion The semantic version to ship.
3280 */
33- function setVersion (address addr , string calldata semver ) external ;
81+ function ship (
82+ Deployment[] calldata deployments ,
83+ address [][] calldata implementations ,
84+ string calldata semanticVersion
85+ ) external ;
3486
3587 /**
36- * @notice Sets the same semantic version for each address in the provided array .
37- * @dev Only callable by the contract owner.
38- * @param addresses The addresses for which to set the version .
39- * @param semver The semantic version string to set for all addresses .
88+ * @notice Configures a deployment .
89+ * @dev Only callable by the owner.
90+ * @param deploymentIndex The index of the deployment to configure .
91+ * @param config The configuration to set.
4092 */
41- function setVersions ( address [] calldata addresses , string calldata semver ) external ;
93+ function configure ( uint256 deploymentIndex , DeploymentConfig calldata config ) external ;
4294
4395 /**
44- * @notice Sets a distinct semantic version for each address in the provided array.
45- * @dev Only callable by the contract owner.
46- * @param addresses The addresses for which to set the version.
47- * @param semvers The semantic version strings to set, one for each address.
96+ * @notice Pauses all deployments that support pausing.
97+ * @dev Loops over all deployments and attempts to invoke `pauseAll()` on each contract that is marked as pausable.
98+ * Silently ignores errors during calls for rapid pausing in emergencies. Owner only.
4899 */
49- function setVersions ( address [] calldata addresses , string [] calldata semvers ) external ;
100+ function pauseAll ( ) external ;
50101
51102 /**
52- * @notice Returns the semantic version string for a given address.
53- * @param addr The address to query.
54- * @return The semantic version string associated with the address.
103+ * @notice Returns the semantic version string for the latest deployment.
104+ * @return The semantic version string associated with the latest deployment.
55105 */
56- function version (
57- address addr
58- ) external view returns (string memory );
106+ function latestVersion () external view returns (string memory );
59107
60108 /**
61- * @notice Returns the major version string for a given address.
62- * @param addr The address to query.
63- * @return The major version string associated with the address.
109+ * @notice Returns the major version string for the latest deployment.
110+ * @return The major version string associated with the latest deployment.
64111 */
65- function majorVersion (
66- address addr
67- ) external view returns (string memory );
112+ function latestMajorVersion () external view returns (string memory );
68113}
0 commit comments