Skip to content

Commit ed8b329

Browse files
authored
Resolve: Update state variables that could be declared immutable as immutable #605 (#609)
* Turn vars to immutable * Make vars immutable
1 parent 3f192ec commit ed8b329

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

contracts/base/Staking1155Base.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import { CurrencyTransferLib } from "../lib/CurrencyTransferLib.sol";
4646

4747
contract Staking1155Base is ContractMetadata, Multicall, Ownable, Staking1155, ERC165, IERC1155Receiver {
4848
/// @dev ERC20 Reward Token address. See {_mintRewards} below.
49-
address public rewardToken;
49+
address public immutable rewardToken;
5050

5151
/// @dev The address of the native token wrapper contract.
5252
address internal immutable nativeTokenWrapper;

contracts/base/Staking20Base.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import { CurrencyTransferLib } from "../lib/CurrencyTransferLib.sol";
4545

4646
contract Staking20Base is ContractMetadata, Multicall, Ownable, Staking20 {
4747
/// @dev ERC20 Reward Token address. See {_mintRewards} below.
48-
address public rewardToken;
48+
address public immutable rewardToken;
4949

5050
/// @dev Total amount of reward tokens in the contract.
5151
uint256 private rewardTokenBalance;

contracts/base/Staking721Base.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ import { CurrencyTransferLib } from "../lib/CurrencyTransferLib.sol";
4646

4747
contract Staking721Base is ContractMetadata, Multicall, Ownable, Staking721, ERC165, IERC721Receiver {
4848
/// @dev ERC20 Reward Token address. See {_mintRewards} below.
49-
address public rewardToken;
49+
address public immutable rewardToken;
5050

5151
/// @dev The address of the native token wrapper contract.
52-
address public nativeTokenWrapper;
52+
address public immutable nativeTokenWrapper;
5353

5454
/// @dev Total amount of reward tokens in the contract.
5555
uint256 private rewardTokenBalance;

contracts/extension/Staking1155.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ abstract contract Staking1155 is ReentrancyGuard, IStaking1155 {
1515
//////////////////////////////////////////////////////////////*/
1616

1717
///@dev Address of ERC1155 contract -- staked tokens belong to this contract.
18-
address public stakingToken;
18+
address public immutable stakingToken;
1919

2020
/// @dev Flag to check direct transfers of staking tokens.
2121
uint8 internal isStaking = 1;

contracts/extension/Staking721.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ abstract contract Staking721 is ReentrancyGuard, IStaking721 {
1515
//////////////////////////////////////////////////////////////*/
1616

1717
///@dev Address of ERC721 NFT contract -- staked tokens belong to this contract.
18-
address public stakingToken;
18+
address public immutable stakingToken;
1919

2020
/// @dev Flag to check direct transfers of staking tokens.
2121
uint8 internal isStaking = 1;

contracts/infra/ContractPublisher.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ contract ContractPublisher is IContractPublisher, ERC2771Context, AccessControlE
3030

3131
/// @notice Whether the contract publisher is paused.
3232
bool public isPaused;
33-
IContractPublisher public prevPublisher;
33+
IContractPublisher public immutable prevPublisher;
3434

3535
/*///////////////////////////////////////////////////////////////
3636
Mappings

0 commit comments

Comments
 (0)