Skip to content

Commit

Permalink
S8: fix to remove unused code
Browse files Browse the repository at this point in the history
Signed-off-by: Jun Kimura <[email protected]>
  • Loading branch information
bluele committed Nov 20, 2024
1 parent 86e5a24 commit f225aba
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 29 deletions.
1 change: 0 additions & 1 deletion contracts/ILCPClientErrors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ interface ILCPClientErrors {
error LCPClientClientStateInvalidKeyExpiration();
error LCPClientClientStateInvalidMrenclaveLength();
error LCPClientClientStateUnexpectedMrenclave();
error LCPClientClientStateEmptyOperators();
error LCPClientClientStateInvalidOperatorAddress();
error LCPClientClientStateInvalidOperatorAddressLength();
error LCPClientClientStateInvalidOperatorsNonce();
Expand Down
8 changes: 0 additions & 8 deletions contracts/LCPClientBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -650,14 +650,6 @@ abstract contract LCPClientBase is ILightClient, ILCPClientErrors {
}
}

function verifyECDSASignature(bytes32 commitment, bytes memory signature, address signer)
internal
pure
returns (bool)
{
return verifyECDSASignature(commitment, signature) == signer;
}

function verifyECDSASignature(bytes32 commitment, bytes memory signature) internal pure returns (address) {
if (uint8(signature[64]) < 27) {
signature[64] = bytes1(uint8(signature[64]) + 27);
Expand Down
16 changes: 0 additions & 16 deletions contracts/LCPCommitment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,6 @@ library LCPCommitment {
bytes state;
}

function parseUpdateStateProxyMessage(bytes calldata messageBytes)
internal
pure
returns (UpdateStateProxyMessage memory)
{
HeaderedProxyMessage memory hm = abi.decode(messageBytes, (HeaderedProxyMessage));
// MSB first
// 0-1: version
// 2-3: message type
// 4-31: reserved
if (hm.header != LCP_MESSAGE_HEADER_UPDATE_STATE) {
revert LCPCommitmentUnexpectedProxyMessageHeader();
}
return abi.decode(hm.message, (UpdateStateProxyMessage));
}

struct MisbehaviourProxyMessage {
PrevState[] prevStates;
bytes context;
Expand Down
2 changes: 1 addition & 1 deletion slither.config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"detectors_to_run": "arbitrary-send-erc20,array-by-reference,incorrect-shift,name-reused,rtlo,suicidal,uninitialized-storage,arbitrary-send-erc20-permit,controlled-array-length,controlled-delegatecall,delegatecall-loop,msg-value-loop,reentrancy-eth,unchecked-transfer,weak-prng,domain-separator-collision,erc20-interface,erc721-interface,locked-ether,mapping-deletion,shadowing-abstract,tautology,write-after-write,boolean-cst,reentrancy-no-eth,reused-constructor,tx-origin,unchecked-lowlevel,unchecked-send,variable-scope,void-cst,events-access,events-maths,incorrect-unary,boolean-equal,deprecated-standards,erc20-indexed,function-init-state,pragma,reentrancy-unlimited-gas,immutable-states,var-read-using-this",
"detectors_to_run": "arbitrary-send-erc20,array-by-reference,incorrect-shift,name-reused,rtlo,suicidal,uninitialized-storage,arbitrary-send-erc20-permit,controlled-array-length,controlled-delegatecall,delegatecall-loop,msg-value-loop,reentrancy-eth,unchecked-transfer,weak-prng,domain-separator-collision,erc20-interface,erc721-interface,locked-ether,mapping-deletion,shadowing-abstract,tautology,write-after-write,boolean-cst,reentrancy-no-eth,reused-constructor,tx-origin,unchecked-lowlevel,unchecked-send,variable-scope,void-cst,events-access,events-maths,incorrect-unary,boolean-equal,deprecated-standards,erc20-indexed,function-init-state,pragma,reentrancy-unlimited-gas,immutable-states,var-read-using-this,dead-code",
"filter_paths": "(test/|node_modules/|contracts/proto/)"
}
14 changes: 11 additions & 3 deletions test/TestHelper.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,20 @@ library LCPCommitmentTestHelper {
LCPCommitment.trustingPeriodContextEval(context, currentTimestampNanos);
}

function parseUpdateStateProxyMessage(bytes calldata commitmentBytes)
function parseUpdateStateProxyMessage(bytes calldata messageBytes)
public
pure
returns (LCPCommitment.UpdateStateProxyMessage memory commitment)
returns (LCPCommitment.UpdateStateProxyMessage memory)
{
return LCPCommitment.parseUpdateStateProxyMessage(commitmentBytes);
LCPCommitment.HeaderedProxyMessage memory hm = abi.decode(messageBytes, (LCPCommitment.HeaderedProxyMessage));
// MSB first
// 0-1: version
// 2-3: message type
// 4-31: reserved
if (hm.header != LCPCommitment.LCP_MESSAGE_HEADER_UPDATE_STATE) {
revert LCPCommitment.LCPCommitmentUnexpectedProxyMessageHeader();
}
return abi.decode(hm.message, (LCPCommitment.UpdateStateProxyMessage));
}

function parseVerifyMembershipCommitmentProofs(bytes calldata proofBytes)
Expand Down

0 comments on commit f225aba

Please sign in to comment.