@1inch/solidity-utils 2.0.21 → 2.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,18 +3,19 @@
|
|
|
3
3
|
pragma solidity ^0.8.0;
|
|
4
4
|
pragma abicoder v1;
|
|
5
5
|
|
|
6
|
+
import "./interfaces/IWETH.sol";
|
|
7
|
+
|
|
6
8
|
abstract contract OnlyWethReceiver {
|
|
7
9
|
error EthDepositRejected();
|
|
8
10
|
|
|
9
|
-
// solhint-disable-
|
|
10
|
-
address private immutable _WETH;
|
|
11
|
+
IWETH internal immutable _WETH; // solhint-disable-line var-name-mixedcase
|
|
11
12
|
|
|
12
|
-
constructor(
|
|
13
|
+
constructor(IWETH weth) {
|
|
13
14
|
_WETH = weth;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
receive() external payable {
|
|
17
18
|
// solhint-disable-next-line avoid-tx-origin
|
|
18
|
-
if (msg.sender != _WETH) revert EthDepositRejected();
|
|
19
|
+
if (msg.sender != address(_WETH)) revert EthDepositRejected();
|
|
19
20
|
}
|
|
20
21
|
}
|