Skip to content

Commit c47efde

Browse files
committed
feat: make sure the data auto-resets after an upgrade
1 parent 6d8cf2b commit c47efde

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/XanV1.sol

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ contract XanV1 is IXanV1, Initializable, ERC20Upgradeable, ERC20BurnableUpgradea
2525
/// @param voterBodyData The upgrades proposed by the voter body from a current implementation.
2626
struct XanV1Storage {
2727
address governanceCouncil;
28-
Council.ProposedUpgrade governanceCouncilData;
28+
mapping(address current => Council.ProposedUpgrade) governanceCouncilData;
2929
mapping(address current => Ranking.ProposedUpgrades) voterBodyData;
3030
}
3131

@@ -343,7 +343,7 @@ contract XanV1 is IXanV1, Initializable, ERC20Upgradeable, ERC20BurnableUpgradea
343343
/// @notice Authorizes an upgrade.
344344
/// @param newImpl The new implementation to authorize the upgrade to.
345345
function _authorizeUpgrade(address newImpl) internal view virtual override {
346-
address councilProposedImpl = _getXanV1Storage().governanceCouncilData.proposedImpl;
346+
address councilProposedImpl = _getGovernanceCouncilData().proposedImpl;
347347

348348
// TODO!
349349
if (newImpl == councilProposedImpl) {
@@ -421,21 +421,21 @@ contract XanV1 is IXanV1, Initializable, ERC20Upgradeable, ERC20BurnableUpgradea
421421
revert("NOT IMPLEMENTED");
422422
}
423423

424-
/// @notice Returns the proposed upgrades from the from current implementation from the contract storage location.
425-
/// @return voterBodyData The data associated with proposed upgrades from current implementation.
424+
/// @notice Returns the proposed upgrades from the current implementation from the contract storage location.
425+
/// @return voterBodyData The data associated with proposed upgrades from the current implementation.
426426
function _getVoterBodyData() internal view virtual returns (Ranking.ProposedUpgrades storage voterBodyData) {
427427
voterBodyData = _getXanV1Storage().voterBodyData[implementation()];
428428
}
429429

430-
/// @notice Returns the data of the upgrade proposed by the council from the contract storage location.
431-
/// @return proposedUpgrade The data associated with upgrade proposed by the council.
430+
/// @notice Returns the data of the upgrade proposed by the council from the current implementation from the contract storage location.
431+
/// @return proposedUpgrade The data associated with upgrade proposed by the council from the current implementation.
432432
function _getGovernanceCouncilData()
433433
internal
434434
view
435435
virtual
436436
returns (Council.ProposedUpgrade storage proposedUpgrade)
437437
{
438-
proposedUpgrade = _getXanV1Storage().governanceCouncilData;
438+
proposedUpgrade = _getXanV1Storage().governanceCouncilData[implementation()];
439439
}
440440

441441
/// @notice Returns the storage from the Xan V1 storage location.

0 commit comments

Comments
 (0)