Skip to content

Commit

Permalink
Use immutable variables where possible (#2528)
Browse files Browse the repository at this point in the history
Co-authored-by: rotciv <victorfage@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
  • Loading branch information
3 people authored Feb 19, 2021
1 parent 0059b17 commit 7d20d0e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion contracts/payment/PullPayment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import "./escrow/Escrow.sol";
* payments with {payments}, and retrieve them with {withdrawPayments}.
*/
abstract contract PullPayment {
Escrow private _escrow;
Escrow immutable private _escrow;

constructor () {
_escrow = new Escrow();
Expand Down
2 changes: 1 addition & 1 deletion contracts/payment/escrow/RefundEscrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ contract RefundEscrow is ConditionalEscrow {
event RefundsEnabled();

State private _state;
address payable private _beneficiary;
address payable immutable private _beneficiary;

/**
* @dev Constructor.
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/ERC20/ERC20Capped.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "./ERC20.sol";
* @dev Extension of {ERC20} that adds a cap to the supply of tokens.
*/
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
Expand Down
6 changes: 3 additions & 3 deletions contracts/token/ERC20/TokenTimelock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ contract TokenTimelock {
using SafeERC20 for IERC20;

// ERC20 basic token contract being held
IERC20 private _token;
IERC20 immutable private _token;

// beneficiary of tokens after they are released
address private _beneficiary;
address immutable private _beneficiary;

// timestamp when token release is enabled
uint256 private _releaseTime;
uint256 immutable private _releaseTime;

constructor (IERC20 token_, address beneficiary_, uint256 releaseTime_) {
// solhint-disable-next-line not-rely-on-time
Expand Down

0 comments on commit 7d20d0e

Please sign in to comment.