diff --git a/src/LinearPriceCalculator.sol b/src/LinearPriceCalculator.sol index 0bf6bd2..70d0664 100644 --- a/src/LinearPriceCalculator.sol +++ b/src/LinearPriceCalculator.sol @@ -1,21 +1,21 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.24; -import { Ownable2Step } from "openzeppelin-contracts/contracts/access/Ownable2Step.sol"; +import { Ownable } from "openzeppelin-contracts/contracts/access/Ownable.sol"; import { IPriceCalculator } from "./IPriceCalculator.sol"; /// Address 0x0000...0000 was used instead of an ERC20 token address error OnlyTokensAllowed(); /// @title Linear Price Calculator to determine the price to acquire a membership -contract LinearPriceCalculator is IPriceCalculator, Ownable2Step { +contract LinearPriceCalculator is IPriceCalculator, Ownable { /// @notice Address of the ERC20 token accepted by this contract. address public token; /// @notice The price per message per epoch uint256 public pricePerMessagePerEpoch; - constructor(address _token, uint256 _pricePerMessagePerEpoch) Ownable2Step() { + constructor(address _token, uint256 _pricePerMessagePerEpoch) Ownable() { _setTokenAndPrice(_token, _pricePerMessagePerEpoch); } diff --git a/src/WakuRlnV2.sol b/src/WakuRlnV2.sol index efaed97..9578a86 100644 --- a/src/WakuRlnV2.sol +++ b/src/WakuRlnV2.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.24; import { LazyIMT, LazyIMTData } from "@zk-kit/imt.sol/LazyIMT.sol"; import { PoseidonT3 } from "poseidon-solidity/PoseidonT3.sol"; -import { Ownable2StepUpgradeable } from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; +import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; @@ -20,7 +20,7 @@ error InvalidIdCommitment(uint256 idCommitment); /// Invalid pagination query error InvalidPaginationQuery(uint256 startIndex, uint256 endIndex); -contract WakuRlnV2 is Initializable, Ownable2StepUpgradeable, UUPSUpgradeable, MembershipUpgradeable { +contract WakuRlnV2 is Initializable, OwnableUpgradeable, UUPSUpgradeable, MembershipUpgradeable { /// @notice The Field uint256 public constant Q = 21_888_242_871_839_275_222_246_405_745_257_275_088_548_364_400_416_034_343_698_204_186_575_808_495_617; diff --git a/test/WakuRlnV2.t.sol b/test/WakuRlnV2.t.sol index ea92926..4a06ea8 100644 --- a/test/WakuRlnV2.t.sol +++ b/test/WakuRlnV2.t.sol @@ -668,8 +668,7 @@ contract WakuRlnV2Test is Test { /*| Name | Type | Slot | Offset | Bytes | |---------------------|-----------------------------------------------------|------|--------|-------| - | nextFreeIndex | uint32 | 256 | 0 | 4 | */ - + | nextFreeIndex | uint32 | 206 | 0 | 4 | */ /* Pro tip: to easily find the storage slot of a variable, without having to calculate the storage layout based on the variable declaration, set the variable to an easily grepable value like 0xDEADBEEF, and then @@ -687,7 +686,7 @@ contract WakuRlnV2Test is Test { */ // we set nextFreeIndex to 4294967295 (1 << 20) = 0x00100000 - vm.store(address(w), bytes32(uint256(256)), 0x0000000000000000000000000000000000000000000000000000000000100000); + vm.store(address(w), bytes32(uint256(206)), 0x0000000000000000000000000000000000000000000000000000000000100000); token.approve(address(w), price); vm.expectRevert(bytes("Membership set is full")); w.register(1, membershipRateLimit);