DiamondCut.sol#_resetProposal does not properly clean securityCouncilMemberLastApprovedProposalId, which makes Getter.sol#getSecurityCouncilMemberLastApprovedProposalId return very outdated data.
Audit: 2022-10-zksync-findings
Severity: MEDIUM

# Lines of code

https://github.com/code-423n4/2022-10-zksync/blob/456078b53a6d09636b84522ac8f3e8049e4e3af5/ethereum/contracts/zksync/facets/DiamondCut.sol#L126
https://github.com/code-423n4/2022-10-zksync/blob/456078b53a6d09636b84522ac8f3e8049e4e3af5/ethereum/contracts/zksync/facets/Getters.sol#L122


# Vulnerability details

## Impact

DiamondCut.sol#_resetProposal does not properly clean securityCouncilMemberLastApprovedProposalId, which affecting Getter.sol#getSecurityCouncilMemberLastApprovedProposalId

the function getSecurityCouncilMemberLastApprovedProposalId info may be very oudated.

```solidity
/// @notice Returns zero for not security council members
/// @return The index of the last diamond cut that security member approved
function getSecurityCouncilMemberLastApprovedProposalId(address _address) external view returns (uint256) {
	return s.diamondCutStorage.securityCouncilMemberLastApprovedProposalId[_address];
}
```

## Proof of Concept

We need to keep the DiamondCutStorage in mind:

```solidity
struct DiamondCutStorage {
    bytes32 proposedDiamondCutHash;
    uint256 proposedDiamondCutTimestamp;
    uint256 lastDiamondFreezeTimestamp;
    uint256 currentProposalId;
    mapping(address => bool) securityCouncilMembers;
    mapping(address => uint256) securityCouncilMemberLastApprovedProposalId;
    uint256 securityCouncilEmergencyApprovals;
}
```

Let us consider the case below:

1. A governor create a proposal by calling

```solidity
function proposeDiamondCut(Diamond.FacetCut[] calldata _facetCuts, address _initAddress) external onlyGovernor {
```

2. The security council member calling the function approveEmergencyDiamondCutAsSecurityCouncilMember to increase the securityCouncilEmergencyApprovals count.

```solidity
 function approveEmergencyDiamondCutAsSecurityCouncilMember(bytes32 _diamondCutHash) external {
```

3. let us three security member up-vote for the current proposal id 5:

Given:

```
mapping(address => uint256) securityCouncilMemberLastApprovedProposalId;
```

We have

```solidity
 {
   address(a) -> 5,
   address(b) -> 5
   address(c) -> 5
 }
```

4. The governor call cancelDiamondCutProposal to cancel the proposal:

```solidity
function cancelDiamondCutProposal() external onlyGovernor {
```

we perform the clean up:

```solidity
delete s.diamondCutStorage.proposedDiamondCutHash;
delete s.diamondCutStorage.proposedDiamondCutTimestamp;
delete s.diamondCutStorage.securityCouncilEmergencyApprovals;
```

however, we does not clean the map: securityCouncilMemberLastApprovedProposalId

we still have this data structure:

```solidity
 {
   address(a) -> 5,
   address(b) -> 5
   address(c) -> 5
 }
```

5. Now a user wants to inspect what is the approved proposal id given an secrutiy council member:

He calls:

```solidity
/// @notice Returns zero for not security council members
/// @return The index of the last diamond cut that security member approved
function getSecurityCouncilMemberLastApprovedProposalId(address _addr