Unverified Commit 7d20d0e2 by Francisco Giordano Committed by GitHub

Use immutable variables where possible (#2528)

Co-authored-by: rotciv <victorfage@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
parent 0059b17d
...@@ -23,7 +23,7 @@ import "./escrow/Escrow.sol"; ...@@ -23,7 +23,7 @@ import "./escrow/Escrow.sol";
* payments with {payments}, and retrieve them with {withdrawPayments}. * payments with {payments}, and retrieve them with {withdrawPayments}.
*/ */
abstract contract PullPayment { abstract contract PullPayment {
Escrow private _escrow; Escrow immutable private _escrow;
constructor () { constructor () {
_escrow = new Escrow(); _escrow = new Escrow();
......
...@@ -23,7 +23,7 @@ contract RefundEscrow is ConditionalEscrow { ...@@ -23,7 +23,7 @@ contract RefundEscrow is ConditionalEscrow {
event RefundsEnabled(); event RefundsEnabled();
State private _state; State private _state;
address payable private _beneficiary; address payable immutable private _beneficiary;
/** /**
* @dev Constructor. * @dev Constructor.
......
...@@ -8,7 +8,7 @@ import "./ERC20.sol"; ...@@ -8,7 +8,7 @@ import "./ERC20.sol";
* @dev Extension of {ERC20} that adds a cap to the supply of tokens. * @dev Extension of {ERC20} that adds a cap to the supply of tokens.
*/ */
abstract contract ERC20Capped is ERC20 { abstract contract ERC20Capped is ERC20 {
uint256 private _cap; uint256 immutable private _cap;
/** /**
* @dev Sets the value of the `cap`. This value is immutable, it can only be * @dev Sets the value of the `cap`. This value is immutable, it can only be
......
...@@ -15,13 +15,13 @@ contract TokenTimelock { ...@@ -15,13 +15,13 @@ contract TokenTimelock {
using SafeERC20 for IERC20; using SafeERC20 for IERC20;
// ERC20 basic token contract being held // ERC20 basic token contract being held
IERC20 private _token; IERC20 immutable private _token;
// beneficiary of tokens after they are released // beneficiary of tokens after they are released
address private _beneficiary; address immutable private _beneficiary;
// timestamp when token release is enabled // timestamp when token release is enabled
uint256 private _releaseTime; uint256 immutable private _releaseTime;
constructor (IERC20 token_, address beneficiary_, uint256 releaseTime_) { constructor (IERC20 token_, address beneficiary_, uint256 releaseTime_) {
// solhint-disable-next-line not-rely-on-time // solhint-disable-next-line not-rely-on-time
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment