forked from Synthetixio/synthetix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFeePoolEternalStorage.sol
61 lines (49 loc) · 1.77 KB
/
FeePoolEternalStorage.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
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
-----------------------------------------------------------------
FILE INFORMATION
-----------------------------------------------------------------
file: FeePoolEternalStorage.sol
version: 1.0
author: Clinton Ennis
Jackson Chan
date: 2019-04-05
-----------------------------------------------------------------
MODULE DESCRIPTION
-----------------------------------------------------------------
The FeePoolEternalStorage is for any state the FeePool contract
needs to persist between upgrades to the FeePool logic.
Please see EternalStorage.sol
-----------------------------------------------------------------
*/
pragma solidity 0.4.25;
import "./LimitedSetup.sol";
import "./EternalStorage.sol";
contract FeePoolEternalStorage is EternalStorage, LimitedSetup {
bytes32 constant LAST_FEE_WITHDRAWAL = "last_fee_withdrawal";
/**
* @dev Constructor.
* @param _owner The owner of this contract.
*/
constructor(address _owner, address _feePool)
EternalStorage(_owner, _feePool)
LimitedSetup(6 weeks)
public
{
}
/**
* @notice Import data from FeePool.lastFeeWithdrawal
* @dev Only callable by the contract owner, and only for 6 weeks after deployment.
* @param accounts Array of addresses that have claimed
* @param feePeriodIDs Array feePeriodIDs with the accounts last claim
*/
function importFeeWithdrawalData(address[] accounts, uint[] feePeriodIDs)
external
onlyOwner
onlyDuringSetup
{
require(accounts.length == feePeriodIDs.length, "Length mismatch");
for (uint8 i = 0; i < accounts.length; i++) {
this.setUIntValue(keccak256(abi.encodePacked(LAST_FEE_WITHDRAWAL, accounts[i])), feePeriodIDs[i]);
}
}
}