@@ -11,25 +11,19 @@ import "./utils/ChainIdWithType.sol";
1111import "./utils/ProposalNonceTracker.sol " ;
1212import "./interfaces/IExecutor.sol " ;
1313
14- /**
15- @title Facilitates proposals execution and resource ID additions/updates
16- @author ChainSafe Systems & Webb Technologies.
17- */
14+ /// @title Facilitates proposals execution and resource ID additions/updates
15+ /// @author ChainSafe Systems & Webb Technologies.
1816contract SignatureBridge is Governable , ChainIdWithType , ProposalNonceTracker {
1917 // resourceID => handler address
2018 mapping (bytes32 => address ) public _resourceIdToHandlerAddress;
2119
22- /**
23- Verifying signature of governor over some data
24- */
20+ /// @notice Verifying signature of governor over some data
2521 modifier signedByGovernor (bytes memory data , bytes memory sig ) {
2622 require (isSignatureFromGovernor (data, sig), "SignatureBridge: Not valid sig from governor " );
2723 _;
2824 }
2925
30- /**
31- Verifying signature of governor over some datahash
32- */
26+ /// @notice Verifying signature of governor over some datahash
3327 modifier signedByGovernorPrehashed (bytes32 hashedData , bytes memory sig ) {
3428 require (
3529 isSignatureFromGovernorPrehashed (hashedData, sig),
@@ -38,9 +32,7 @@ contract SignatureBridge is Governable, ChainIdWithType, ProposalNonceTracker {
3832 _;
3933 }
4034
41- /**
42- Verifying many signatures from a governor over some datahash
43- */
35+ /// @notice Verifying many signatures from a governor over some datahash
4436 modifier manySignedByGovernor (bytes [] memory data , bytes [] memory sig ) {
4537 require (data.length == sig.length , "SignatureBridge: Data and sig lengths must match " );
4638 for (uint256 i = 0 ; i < data.length ; i++ ) {
@@ -52,23 +44,19 @@ contract SignatureBridge is Governable, ChainIdWithType, ProposalNonceTracker {
5244 _;
5345 }
5446
55- /**
56- @notice Initializes SignatureBridge with a governor
57- @param initialGovernor Addresses that should be initially granted the relayer role.
58- */
47+ /// @notice Initializes SignatureBridge with a governor
48+ /// @param initialGovernor Addresses that should be initially granted the relayer role.
5949 constructor (address initialGovernor , uint32 nonce ) Governable (initialGovernor, nonce) {}
6050
61- /**
62- @notice Sets a new resource for handler contracts that use the IExecutor interface,
63- and maps the {handlerAddress} to {newResourceID} in {_resourceIdToHandlerAddress}.
64- @notice Only callable by an address that currently has the admin role.
65- @param resourceID Target resource ID of the proposal header.
66- @param functionSig Function signature of the proposal header.
67- @param nonce Nonce of the proposal header.
68- @param newResourceID Secondary resourceID begin mapped to a handler address.
69- @param handlerAddress Address of handler resource will be set for.
70- @param sig The signature from the governor of the encoded set resource proposal.
71- */
51+ /// @notice Sets a new resource for handler contracts that use the IExecutor interface,
52+ /// and maps the {handlerAddress} to {newResourceID} in {_resourceIdToHandlerAddress}.
53+ /// @notice Only callable by an address that currently has the admin role.
54+ /// @param resourceID Target resource ID of the proposal header.
55+ /// @param functionSig Function signature of the proposal header.
56+ /// @param nonce Nonce of the proposal header.
57+ /// @param newResourceID Secondary resourceID begin mapped to a handler address.
58+ /// @param handlerAddress Address of handler resource will be set for.
59+ /// @param sig The signature from the governor of the encoded set resource proposal.
7260 function adminSetResourceWithSignature (
7361 bytes32 resourceID ,
7462 bytes4 functionSig ,
@@ -84,21 +72,19 @@ contract SignatureBridge is Governable, ChainIdWithType, ProposalNonceTracker {
8472 sig
8573 )
8674 {
87- _handleSetResource (resourceID, functionSig, nonce, newResourceID, handlerAddress);
75+ _handleSetResource (resourceID, functionSig, newResourceID, handlerAddress);
8876 }
8977
90- /**
91- @notice Sets a batch new resources for handler contracts that use the IExecutor interface,
92- and maps the {handlerAddress} to {newResourceID} in {_resourceIdToHandlerAddress}.
93- @notice Only callable by an address that currently has the admin role.
94- @param resourceID Target resource ID of the proposal header.
95- @param functionSig Function signature of the proposal header.
96- @param nonces Nonces of the proposal headers.
97- @param newResourceIDs Secondary resourceIDs begin mapped to a handler address.
98- @param handlerAddresses Addresses of handler resource will be set for.
99- @param hashedData The encoded data of all proposals to be used for easy checking.
100- @param sig The signature from the governor of the encoded set resource proposal.
101- */
78+ /// @notice Sets a batch new resources for handler contracts that use the IExecutor interface,
79+ /// and maps the {handlerAddress} to {newResourceID} in {_resourceIdToHandlerAddress}.
80+ /// @notice Only callable by an address that currently has the admin role.
81+ /// @param resourceID Target resource ID of the proposal header.
82+ /// @param functionSig Function signature of the proposal header.
83+ /// @param nonces Nonces of the proposal headers.
84+ /// @param newResourceIDs Secondary resourceIDs begin mapped to a handler address.
85+ /// @param handlerAddresses Addresses of handler resource will be set for.
86+ /// @param hashedData The encoded data of all proposals to be used for easy checking.
87+ /// @param sig The signature from the governor of the encoded set resource proposal.
10288 function batchAdminSetResourceWithSignature (
10389 bytes32 resourceID ,
10490 bytes4 functionSig ,
@@ -131,31 +117,21 @@ contract SignatureBridge is Governable, ChainIdWithType, ProposalNonceTracker {
131117 );
132118
133119 for (uint i = 0 ; i < nonces.length ; i++ ) {
134- _handleSetResource (
135- resourceID,
136- functionSig,
137- nonces[i],
138- newResourceIDs[i],
139- handlerAddresses[i]
140- );
120+ _handleSetResource (resourceID, functionSig, newResourceIDs[i], handlerAddresses[i]);
141121 }
142122 }
143123
144- /**
145- @notice Executes a proposal signed by the governor.
146- @param data Data meant for execution by execution handlers.
147- */
124+ /// @notice Executes a proposal signed by the governor.
125+ /// @param data Data meant for execution by execution handlers.
148126 function executeProposalWithSignature (
149127 bytes calldata data ,
150128 bytes memory sig
151129 ) external signedByGovernor (data, sig) {
152130 _handleExecuteProposal (data);
153131 }
154132
155- /**
156- @notice Executes a many of proposals signed by the governor in a single tx.
157- @param data Data meant for execution by execution handlers.
158- */
133+ /// @notice Executes a many of proposals signed by the governor in a single tx.
134+ /// @param data Data meant for execution by execution handlers.
159135 function executeManyProposalsWithSignature (
160136 bytes [] calldata data ,
161137 bytes [] memory sig
@@ -165,10 +141,8 @@ contract SignatureBridge is Governable, ChainIdWithType, ProposalNonceTracker {
165141 }
166142 }
167143
168- /**
169- @notice Executes a batch of proposals signed by the governor in a single tx.
170- @param data Data meant for execution by execution handlers.
171- */
144+ /// @notice Executes a batch of proposals signed by the governor in a single tx.
145+ /// @param data Data meant for execution by execution handlers.
172146 function batchExecuteProposalsWithSignature (
173147 bytes [] calldata data ,
174148 bytes memory sig
@@ -193,7 +167,6 @@ contract SignatureBridge is Governable, ChainIdWithType, ProposalNonceTracker {
193167 function _handleSetResource (
194168 bytes32 resourceID ,
195169 bytes4 functionSig ,
196- uint32 nonce ,
197170 bytes32 newResourceID ,
198171 address handlerAddress
199172 ) internal {
0 commit comments