Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0c80c47

Browse files
committedDec 21, 2023
evm: remove comments
1 parent 90bcbce commit 0c80c47

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed
 

‎evm/src/contracts/CircleIntegration/Governance.sol

-24
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,23 @@ abstract contract Governance is IGovernance, State, ERC1967Upgrade {
4242
// unless the target chain is 0 (which means all chains).
4343
uint16 targetChain;
4444
(targetChain, offset) = vaa.payload.asUint16Unchecked(offset);
45-
46-
// NOTE: Reverting with Error(string) comes from the old implementation, so we preserve it.
4745
require(targetChain == 0 || targetChain == _chainId, "invalid target chain");
4846

4947
uint16 foreignChain;
5048
(foreignChain, offset) = vaa.payload.asUint16Unchecked(offset);
51-
52-
// NOTE: Reverting with Error(string) comes from the old implementation, so we preserve it.
5349
require(foreignChain != 0 && foreignChain != _chainId, "invalid chain");
5450

5551
mapping(uint16 => bytes32) storage registeredEmitters = getRegisteredEmitters();
5652

5753
// For now, ensure that we cannot register the same foreign chain again.
58-
// NOTE: Reverting with Error(string) comes from the old implementation, so we preserve it.
5954
require(registeredEmitters[foreignChain] == 0, "chain already registered");
6055

6156
bytes32 foreignAddress;
6257
(foreignAddress, offset) = vaa.payload.asBytes32Unchecked(offset);
63-
64-
// NOTE: Reverting with Error(string) comes from the old implementation, so we preserve it.
6558
require(foreignAddress != 0, "emitter cannot be zero address");
6659

6760
uint32 cctpDomain;
6861
(cctpDomain, offset) = vaa.payload.asUint32Unchecked(offset);
69-
70-
// NOTE: Reverting with Error(string) comes from the old implementation, so we preserve it.
7162
require(cctpDomain != _localCctpDomain, "domain == localDomain()");
7263

7364
_checkLength(vaa.payload, offset);
@@ -102,14 +93,10 @@ abstract contract Governance is IGovernance, State, ERC1967Upgrade {
10293
// contract upgrades should only be relevant for this contract's chain ID
10394
uint16 targetChain;
10495
(targetChain, offset) = vaa.payload.asUint16Unchecked(offset);
105-
106-
// NOTE: Reverting with Error(string) comes from the old implementation, so we preserve it.
10796
require(targetChain == _chainId, "invalid target chain");
10897

10998
bytes32 encodedImplementation;
11099
(encodedImplementation, offset) = vaa.payload.asBytes32Unchecked(offset);
111-
112-
// NOTE: Reverting with Error(string) comes from the old implementation, so we preserve it.
113100
require(bytes12(encodedImplementation) == 0, "invalid address");
114101

115102
_checkLength(vaa.payload, offset);
@@ -125,7 +112,6 @@ abstract contract Governance is IGovernance, State, ERC1967Upgrade {
125112
abi.encodeWithSignature("circleIntegrationImplementation()")
126113
);
127114

128-
// NOTE: Reverting with Error(string) comes from the old implementation, so we preserve it.
129115
require(queried.length == 32, "invalid implementation");
130116
require(
131117
abi.decode(queried, (bytes32)) == keccak256("circleIntegrationImplementation()"),
@@ -141,8 +127,6 @@ abstract contract Governance is IGovernance, State, ERC1967Upgrade {
141127
// call initialize function of the new implementation
142128
(bool success, bytes memory reason) =
143129
newImplementation.delegatecall(abi.encodeWithSignature("initialize()"));
144-
145-
// NOTE: Reverting with Error(string) comes from the old implementation, so we preserve it.
146130
require(success, string(reason));
147131

148132
emit ContractUpgraded(currentImplementation, newImplementation);
@@ -180,41 +164,33 @@ abstract contract Governance is IGovernance, State, ERC1967Upgrade {
180164
uint8 action
181165
) private view returns (IWormhole.VM memory vaa, uint256 offset) {
182166
// Make sure the blockchain has not forked.
183-
// NOTE: Reverting with Error(string) comes from the old implementation, so we preserve it.
184167
require(block.chainid == _evmChain, "invalid evm chain");
185168

186169
// verify the governance message
187170
bool valid;
188171
string memory reason;
189172
(vaa, valid, reason) = _wormhole.parseAndVerifyVM(encodedVaa);
190-
191-
// NOTE: Reverting with Error(string) comes from the old implementation, so we preserve it.
192173
require(valid, reason);
193174

194175
// Confirm that the governance message was sent from the governance contract.
195-
// NOTE: Reverting with Error(string) comes from the old implementation, so we preserve it.
196176
require(vaa.emitterChainId == GOVERNANCE_CHAIN, "invalid governance chain");
197177
require(vaa.emitterAddress == GOVERNANCE_EMITTER, "invalid governance contract");
198178

199179
// Confirm that this governance action has not been consumed already.
200-
// NOTE: Reverting with Error(string) comes from the old implementation, so we preserve it.
201180
require(!consumedVaas[vaa.hash], "governance action already consumed");
202181

203182
bytes32 govModule;
204183
(govModule, offset) = vaa.payload.asBytes32Unchecked(offset);
205184

206-
// NOTE: Reverting with Error(string) comes from the old implementation, so we preserve it.
207185
require(govModule == GOVERNANCE_MODULE, "invalid governance module");
208186

209187
uint8 govAction;
210188
(govAction, offset) = vaa.payload.asUint8Unchecked(offset);
211189

212-
// NOTE: Reverting with Error(string) comes from the old implementation, so we preserve it.
213190
require(govAction == action, "invalid governance action");
214191
}
215192

216193
function _checkLength(bytes memory encoded, uint256 expected) private pure {
217-
// NOTE: Reverting with Error(string) comes from the old implementation, so we preserve it.
218194
require(encoded.length == expected, "invalid governance payload length");
219195
}
220196

0 commit comments

Comments
 (0)
Please sign in to comment.