Skip to content

Commit 7c30463

Browse files
authored
Merge pull request #2127 from kleros/feat/storage-gap
fix: update storage layout
2 parents 62d5723 + cfdb1f4 commit 7c30463

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1146
-932
lines changed

contracts/CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ The format is based on [Common Changelog](https://common-changelog.org/).
88

99
### Changed
1010

11+
- **Breaking:** Add event parameter `KlerosCore.TokenAndETHShift._degreeOfCoherencyFee` and renamed the other parameters to `_degreeOfCoherencyPnk`, `_amountPnk`, `_amountFee` ([#2097](https://github.com/kleros/kleros-v2/issues/2097))
12+
- **Breaking:** Move state variable `DisputeKitClassicBase.nbVotes` to the `Round` struct ([#2097](https://github.com/kleros/kleros-v2/issues/2097))
1113
- **Breaking:** Stake the juror's PNK rewards instead of transferring them out ([#2099](https://github.com/kleros/kleros-v2/issues/2099))
1214
- **Breaking:** Replace `require()` with `revert()` and custom errors outside KlerosCore for consistency and smaller bytecode ([#2084](https://github.com/kleros/kleros-v2/issues/2084))
1315
- **Breaking:** Rename the interface from `RNG` to `IRNG` ([#2054](https://github.com/kleros/kleros-v2/issues/2054))
14-
- **Breaking:** Remove the `_block` parameter from `IRNG.requestRandomness()` and `IRNG.receiveRandomness()`, not needed for the primary VRF-based RNG ([#2054](https://github.com/kleros/kleros-v2/issues/2054))
1516
- **Breaking:** Rename `governor` to `owner` in order to comply with the lightweight ownership standard [ERC-5313](https://eipsinsight.com/ercs/erc-5313) ([#2112](https://github.com/kleros/kleros-v2/issues/2112))
1617
- **Breaking:** Apply the penalties to the stakes in the Sortition Tree ([#2107](https://github.com/kleros/kleros-v2/issues/2107))
1718
- **Breaking:** Make `SortitionModule.getJurorBalance().stakedInCourt` include the penalties ([#2107](https://github.com/kleros/kleros-v2/issues/2107))
@@ -32,6 +33,8 @@ The format is based on [Common Changelog](https://common-changelog.org/).
3233

3334
### Added
3435

36+
- **Breaking:** Add storage gap arrays to `KlerosCore` structs `Round`, `Dispute` and `Court` ([#2097](https://github.com/kleros/kleros-v2/issues/2097))
37+
- **Breaking:** Add storage gap arrays to `DisputeKitClassicBase` state variables and to the structs `Round`, `Dispute` and `Vote` ([#2097](https://github.com/kleros/kleros-v2/issues/2097))
3538
- **Breaking:** Add a new field `drawnJurorFromCourtIDs` to the `Round` struct in `KlerosCoreBase` and `KlerosCoreUniversity` ([#2107](https://github.com/kleros/kleros-v2/issues/2107))
3639
- **Breaking:** Add a new state variable `jumpDisputeKitID` to the `DisputeKitClassicBase` contract ([#2114](https://github.com/kleros/kleros-v2/issues/2114))
3740
- **Breaking:** Add a parameter `_recoveryCommit` to the event `DisputeKitShutter.CommitCastShutter` ([#2100](https://github.com/kleros/kleros-v2/issues/2100))
@@ -41,6 +44,13 @@ The format is based on [Common Changelog](https://common-changelog.org/).
4144
- Allow the dispute kits to specify which new dispute kit to use when a court jump occurs ([#2114](https://github.com/kleros/kleros-v2/issues/2114))
4245
- Allow stake changes to by-pass delayed stakes when initiated by the SortitionModule by setting the `_noDelay` parameter to `true` in `SortitionModule.validateStake()` ([#2107](https://github.com/kleros/kleros-v2/issues/2107))
4346

47+
### Removed
48+
49+
- **Breaking:** Remove unused event parameters `IArbitrableV2.DisputeRequest._templateUri` ([#2097](https://github.com/kleros/kleros-v2/issues/2097))
50+
- **Breaking:** Remove deprecated `SortitionModule` state variables `alreadyTransferred`, `randomNumberRequestBlock`, `rngLookahead` and `latestDelayedStakeIndex` ([#2097](https://github.com/kleros/kleros-v2/issues/2097))
51+
- **Breaking:** Remove struct variable `DisputeKitClassicBase.Round.nbVotes` ([#2097](https://github.com/kleros/kleros-v2/issues/2097))
52+
- **Breaking:** Remove the `_block` parameter from `IRNG.requestRandomness()` and `IRNG.receiveRandomness()`, not needed for the primary VRF-based RNG ([#2054](https://github.com/kleros/kleros-v2/issues/2054))
53+
4454
### Fixed
4555

4656
- Do not pass to Voting period if all the commits are cast because it breaks the current Shutter auto-reveal process. ([#2085](https://github.com/kleros/kleros-v2/issues/2085))

contracts/foundry.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ src = 'src'
1010
out = 'out'
1111
libs = ['../node_modules', 'lib']
1212

13+
[lint]
14+
severity = ['high', 'medium']
15+
1316
[rpc_endpoints]
1417
arbitrumSepolia = "https://sepolia-rollup.arbitrum.io/rpc"
1518
arbitrum = "https://arb1.arbitrum.io/rpc"

contracts/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@
8787
"watch": "hardhat watch",
8888
"natspec-smells": "natspec-smells",
8989
"docgen": "hardhat docgen",
90-
"docserve": "scripts/docPreprocess.sh && forge doc --serve",
91-
"docbuild": "scripts/docPreprocess.sh && forge doc --build --out dist && scripts/docPostprocess.sh",
9290
"populate:courts:devnet": "hardhat populate:courts --from v2_devnet --network arbitrumSepoliaDevnet",
9391
"populate:courts:testnet": "hardhat populate:courts --from v2_testnet --network arbitrumSepolia",
9492
"populate:courts:mainnet": "hardhat populate:courts --from v2_mainnet --network arbitrum",

contracts/src/arbitration/DisputeTemplateRegistry.sol

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ import "../proxy/Initializable.sol";
66
import "./interfaces/IDisputeTemplateRegistry.sol";
77

88
/// @title Dispute Template Registry
9-
/// @dev A contract to maintain a registry of dispute templates.
9+
/// @notice A contract to maintain a registry of dispute templates.
1010
contract DisputeTemplateRegistry is IDisputeTemplateRegistry, UUPSProxiable, Initializable {
1111
string public constant override version = "2.0.0";
1212

1313
// ************************************* //
1414
// * Storage * //
1515
// ************************************* //
1616

17-
/// @dev The owner of the contract.
17+
/// @notice The owner of the contract.
1818
address public owner;
1919

20-
/// @dev The number of templates.
20+
/// @notice The number of templates.
2121
uint256 public templates;
2222

2323
// ************************************* //
@@ -38,7 +38,7 @@ contract DisputeTemplateRegistry is IDisputeTemplateRegistry, UUPSProxiable, Ini
3838
_disableInitializers();
3939
}
4040

41-
/// @dev Initializer
41+
/// @notice Initializer
4242
/// @param _owner Owner of the contract.
4343
function initialize(address _owner) external initializer {
4444
owner = _owner;
@@ -54,7 +54,7 @@ contract DisputeTemplateRegistry is IDisputeTemplateRegistry, UUPSProxiable, Ini
5454
// NOP
5555
}
5656

57-
/// @dev Changes the owner of the contract.
57+
/// @notice Changes the owner of the contract.
5858
/// @param _owner The new owner.
5959
function changeOwner(address _owner) external onlyByOwner {
6060
owner = _owner;
@@ -64,10 +64,7 @@ contract DisputeTemplateRegistry is IDisputeTemplateRegistry, UUPSProxiable, Ini
6464
// * State Modifiers * //
6565
// ************************************* //
6666

67-
/// @dev Registers a new dispute template.
68-
/// @param _templateTag The tag of the template (optional).
69-
/// @param _templateData The data of the template.
70-
/// @param _templateDataMappings The data mappings of the template.
67+
/// @inheritdoc IDisputeTemplateRegistry
7168
function setDisputeTemplate(
7269
string memory _templateTag,
7370
string memory _templateData,

0 commit comments

Comments
 (0)