3
3
pragma solidity >= 0.6.12 < 0.8.0 ;
4
4
pragma abicoder v2;
5
5
6
- import { IL1GraphTokenLockMigrator } from "./IL1GraphTokenLockMigrator .sol " ;
6
+ import { IL1GraphTokenLockTransferTool } from "./IL1GraphTokenLockTransferTool .sol " ;
7
7
8
8
/**
9
9
* @title Base interface for the L1Staking contract.
10
- * @notice This interface is used to define the migration helpers that are implemented in L1Staking.
10
+ * @notice This interface is used to define the transfer tools that are implemented in L1Staking.
11
11
* @dev Note it includes only the L1-specific functionality, not the full IStaking interface.
12
12
*/
13
13
interface IL1StakingBase {
14
- /// @dev Emitted when an indexer migrates their stake to L2.
15
- /// This can happen several times as indexers can migrate partial stake.
16
- event IndexerMigratedToL2 (
14
+ /// @dev Emitted when an indexer transfers their stake to L2.
15
+ /// This can happen several times as indexers can transfer partial stake.
16
+ event IndexerStakeTransferredToL2 (
17
17
address indexed indexer ,
18
18
address indexed l2Indexer ,
19
- uint256 migratedStakeTokens
19
+ uint256 transferredStakeTokens
20
20
);
21
21
22
- /// @dev Emitted when a delegator migrates their delegation to L2
23
- event DelegationMigratedToL2 (
22
+ /// @dev Emitted when a delegator transfers their delegation to L2
23
+ event DelegationTransferredToL2 (
24
24
address indexed delegator ,
25
25
address indexed l2Delegator ,
26
26
address indexed indexer ,
27
27
address l2Indexer ,
28
- uint256 migratedDelegationTokens
28
+ uint256 transferredDelegationTokens
29
29
);
30
30
31
- /// @dev Emitted when the L1GraphTokenLockMigrator is set
32
- event L1GraphTokenLockMigratorSet (address l1GraphTokenLockMigrator );
31
+ /// @dev Emitted when the L1GraphTokenLockTransferTool is set
32
+ event L1GraphTokenLockTransferToolSet (address l1GraphTokenLockTransferTool );
33
33
34
- /// @dev Emitted when a delegator unlocks their tokens ahead of time because the indexer has migrated
35
- event StakeDelegatedUnlockedDueToMigration (address indexed indexer , address indexed delegator );
34
+ /// @dev Emitted when a delegator unlocks their tokens ahead of time because the indexer has transferred to L2
35
+ event StakeDelegatedUnlockedDueToL2Transfer (address indexed indexer , address indexed delegator );
36
36
37
37
/**
38
- * @notice Set the L1GraphTokenLockMigrator contract address
38
+ * @notice Set the L1GraphTokenLockTransferTool contract address
39
39
* @dev This function can only be called by the governor.
40
- * @param _l1GraphTokenLockMigrator Address of the L1GraphTokenLockMigrator contract
40
+ * @param _l1GraphTokenLockTransferTool Address of the L1GraphTokenLockTransferTool contract
41
41
*/
42
- function setL1GraphTokenLockMigrator (IL1GraphTokenLockMigrator _l1GraphTokenLockMigrator )
43
- external ;
42
+ function setL1GraphTokenLockTransferTool (
43
+ IL1GraphTokenLockTransferTool _l1GraphTokenLockTransferTool
44
+ ) external ;
44
45
45
46
/**
46
47
* @notice Send an indexer's stake to L2.
47
48
* @dev This function can only be called by the indexer (not an operator).
48
49
* It will validate that the remaining stake is sufficient to cover all the allocated
49
- * stake, so the indexer might have to close some allocations before migrating .
50
+ * stake, so the indexer might have to close some allocations before transferring .
50
51
* It will also check that the indexer's stake is not locked for withdrawal.
51
52
* Since the indexer address might be an L1-only contract, the function takes a beneficiary
52
53
* address that will be the indexer's address in L2.
53
54
* The caller must provide an amount of ETH to use for the L2 retryable ticket, that
54
55
* must be at least `_maxSubmissionCost + _gasPriceBid * _maxGas`.
55
- * @param _l2Beneficiary Address of the indexer in L2. If the indexer has previously migrated stake, this must match the previously-used value.
56
- * @param _amount Amount of stake GRT to migrate to L2
56
+ * @param _l2Beneficiary Address of the indexer in L2. If the indexer has previously transferred stake, this must match the previously-used value.
57
+ * @param _amount Amount of stake GRT to transfer to L2
57
58
* @param _maxGas Max gas to use for the L2 retryable ticket
58
59
* @param _gasPriceBid Gas price bid for the L2 retryable ticket
59
60
* @param _maxSubmissionCost Max submission cost for the L2 retryable ticket
60
61
*/
61
- function migrateStakeToL2 (
62
+ function transferStakeToL2 (
62
63
address _l2Beneficiary ,
63
64
uint256 _amount ,
64
65
uint256 _maxGas ,
@@ -70,20 +71,20 @@ interface IL1StakingBase {
70
71
* @notice Send an indexer's stake to L2, from a GraphTokenLockWallet vesting contract.
71
72
* @dev This function can only be called by the indexer (not an operator).
72
73
* It will validate that the remaining stake is sufficient to cover all the allocated
73
- * stake, so the indexer might have to close some allocations before migrating .
74
+ * stake, so the indexer might have to close some allocations before transferring .
74
75
* It will also check that the indexer's stake is not locked for withdrawal.
75
- * The L2 beneficiary for the stake will be determined by calling the L1GraphTokenLockMigrator contract,
76
- * so the caller must have previously migrated tokens through that first
77
- * (see GIP-0046 for details: https://forum.thegraph.com/t/gip-0046-l2-migration-helpers/ 4023).
78
- * The ETH for the L2 gas will be pulled from the L1GraphTokenLockMigrator , so the owner of
76
+ * The L2 beneficiary for the stake will be determined by calling the L1GraphTokenLockTransferTool contract,
77
+ * so the caller must have previously transferred tokens through that first
78
+ * (see GIP-0046 for details: https://forum.thegraph.com/t/4023).
79
+ * The ETH for the L2 gas will be pulled from the L1GraphTokenLockTransferTool , so the owner of
79
80
* the GraphTokenLockWallet must have previously deposited at least `_maxSubmissionCost + _gasPriceBid * _maxGas`
80
- * ETH into the L1GraphTokenLockMigrator contract (using its depositETH function).
81
- * @param _amount Amount of stake GRT to migrate to L2
81
+ * ETH into the L1GraphTokenLockTransferTool contract (using its depositETH function).
82
+ * @param _amount Amount of stake GRT to transfer to L2
82
83
* @param _maxGas Max gas to use for the L2 retryable ticket
83
84
* @param _gasPriceBid Gas price bid for the L2 retryable ticket
84
85
* @param _maxSubmissionCost Max submission cost for the L2 retryable ticket
85
86
*/
86
- function migrateLockedStakeToL2 (
87
+ function transferLockedStakeToL2 (
87
88
uint256 _amount ,
88
89
uint256 _maxGas ,
89
90
uint256 _gasPriceBid ,
@@ -93,19 +94,19 @@ interface IL1StakingBase {
93
94
/**
94
95
* @notice Send a delegator's delegated tokens to L2
95
96
* @dev This function can only be called by the delegator.
96
- * This function will validate that the indexer has migrated their stake using migrateStakeToL2 ,
97
+ * This function will validate that the indexer has transferred their stake using transferStakeToL2 ,
97
98
* and that the delegation is not locked for undelegation.
98
99
* Since the delegator's address might be an L1-only contract, the function takes a beneficiary
99
100
* address that will be the delegator's address in L2.
100
101
* The caller must provide an amount of ETH to use for the L2 retryable ticket, that
101
102
* must be at least `_maxSubmissionCost + _gasPriceBid * _maxGas`.
102
- * @param _indexer Address of the indexer (in L1, before migrating )
103
+ * @param _indexer Address of the indexer (in L1, before transferring to L2 )
103
104
* @param _l2Beneficiary Address of the delegator in L2
104
105
* @param _maxGas Max gas to use for the L2 retryable ticket
105
106
* @param _gasPriceBid Gas price bid for the L2 retryable ticket
106
107
* @param _maxSubmissionCost Max submission cost for the L2 retryable ticket
107
108
*/
108
- function migrateDelegationToL2 (
109
+ function transferDelegationToL2 (
109
110
address _indexer ,
110
111
address _l2Beneficiary ,
111
112
uint256 _maxGas ,
@@ -116,34 +117,34 @@ interface IL1StakingBase {
116
117
/**
117
118
* @notice Send a delegator's delegated tokens to L2, for a GraphTokenLockWallet vesting contract
118
119
* @dev This function can only be called by the delegator.
119
- * This function will validate that the indexer has migrated their stake using migrateStakeToL2 ,
120
+ * This function will validate that the indexer has transferred their stake using transferStakeToL2 ,
120
121
* and that the delegation is not locked for undelegation.
121
- * The L2 beneficiary for the delegation will be determined by calling the L1GraphTokenLockMigrator contract,
122
- * so the caller must have previously migrated tokens through that first
123
- * (see GIP-0046 for details: https://forum.thegraph.com/t/gip-0046-l2-migration-helpers/ 4023).
124
- * The ETH for the L2 gas will be pulled from the L1GraphTokenLockMigrator , so the owner of
122
+ * The L2 beneficiary for the delegation will be determined by calling the L1GraphTokenLockTransferTool contract,
123
+ * so the caller must have previously transferred tokens through that first
124
+ * (see GIP-0046 for details: https://forum.thegraph.com/t/4023).
125
+ * The ETH for the L2 gas will be pulled from the L1GraphTokenLockTransferTool , so the owner of
125
126
* the GraphTokenLockWallet must have previously deposited at least `_maxSubmissionCost + _gasPriceBid * _maxGas`
126
- * ETH into the L1GraphTokenLockMigrator contract (using its depositETH function).
127
- * @param _indexer Address of the indexer (in L1, before migrating )
127
+ * ETH into the L1GraphTokenLockTransferTool contract (using its depositETH function).
128
+ * @param _indexer Address of the indexer (in L1, before transferring to L2 )
128
129
* @param _maxGas Max gas to use for the L2 retryable ticket
129
130
* @param _gasPriceBid Gas price bid for the L2 retryable ticket
130
131
* @param _maxSubmissionCost Max submission cost for the L2 retryable ticket
131
132
*/
132
- function migrateLockedDelegationToL2 (
133
+ function transferLockedDelegationToL2 (
133
134
address _indexer ,
134
135
uint256 _maxGas ,
135
136
uint256 _gasPriceBid ,
136
137
uint256 _maxSubmissionCost
137
138
) external ;
138
139
139
140
/**
140
- * @notice Unlock a delegator's delegated tokens, if the indexer has migrated
141
+ * @notice Unlock a delegator's delegated tokens, if the indexer has transferred to L2
141
142
* @dev This function can only be called by the delegator.
142
- * This function will validate that the indexer has migrated their stake using migrateStakeToL2 ,
143
+ * This function will validate that the indexer has transferred their stake using transferStakeToL2 ,
143
144
* and that the indexer has no remaining stake in L1.
144
145
* The tokens must previously be locked for undelegation by calling `undelegate()`,
145
146
* and can be withdrawn with `withdrawDelegated()` immediately after calling this.
146
- * @param _indexer Address of the indexer (in L1, before migrating )
147
+ * @param _indexer Address of the indexer (in L1, before transferring to L2 )
147
148
*/
148
- function unlockDelegationToMigratedIndexer (address _indexer ) external ;
149
+ function unlockDelegationToTransferredIndexer (address _indexer ) external ;
149
150
}
0 commit comments