-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMockKept_Arbitrum.sol
48 lines (39 loc) · 1.58 KB
/
MockKept_Arbitrum.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.13;
import "../attribute/Kept/Kept_Arbitrum.sol";
contract MockKept_Arbitrum is Kept_Arbitrum {
address public benefactor;
constructor(address benefactor_) {
benefactor = benefactor_;
}
/// @dev This event helps us test that `data` is being passed around correctly
event RaiseKeeperFeeCalled(UFixed18 amount, bytes data);
function initialize(AggregatorV3Interface ethTokenOracleFeed_, Token18 keeperToken_) external initializer(1) {
super.__Kept__initialize(ethTokenOracleFeed_, keeperToken_);
}
function _raiseKeeperFee(UFixed18 amount, bytes memory data) internal override returns (UFixed18) {
emit RaiseKeeperFeeCalled(amount, data);
keeperToken().pull(benefactor, amount);
return amount;
}
function toBeKept(
UFixed18 multiplierBase,
uint256 bufferBase,
UFixed18 multiplierCalldata,
uint256 bufferCalldata,
bytes calldata applicableCalldata,
uint256 value,
bytes memory data
)
external
keep(KeepConfig(multiplierBase, bufferBase, multiplierCalldata, bufferCalldata), applicableCalldata, value, data)
{ }
/// @dev This function is used to figure out what gasUsed is. We can't hardcode this
/// @dev in tests because it depends on whether we're running coverage or not.
function instrumentGas() external returns (uint256) {
uint256 startGas = gasleft();
emptyFunc();
return startGas - gasleft() - 24;
}
function emptyFunc() internal {}
}