Skip to content

Commit c0ecb14

Browse files
authored
Merge pull request #1226 from graphprotocol/tmigone/legacy-rewards-manager
2 parents 48b3218 + 57af3de commit c0ecb14

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later
2+
3+
pragma solidity ^0.7.6 || 0.8.27;
4+
5+
interface ILegacyRewardsManager {
6+
function getRewards(address allocationID) external view returns (uint256);
7+
}
8+

packages/interfaces/src/types/horizon.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import type {
1212
IRewardsManagerToolshed,
1313
IStaking,
1414
ISubgraphNFT,
15+
ILegacyRewardsManager,
1516
} from '../../types'
1617

1718
export {
@@ -28,4 +29,5 @@ export {
2829
IPaymentsEscrowToolshed as PaymentsEscrow,
2930
IRewardsManagerToolshed as RewardsManager,
3031
ISubgraphNFT as SubgraphNFT,
32+
ILegacyRewardsManager as LegacyRewardsManager,
3133
}

packages/toolshed/src/deployments/horizon/address-book.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { LegacyStaking } from '@graphprotocol/interfaces'
1+
import type { LegacyRewardsManager, LegacyStaking } from '@graphprotocol/interfaces'
22
import { getInterface } from '@graphprotocol/interfaces'
33
import { Provider, Signer } from 'ethers'
44
import { Contract } from 'ethers'
@@ -35,6 +35,14 @@ export class GraphHorizonAddressBook extends AddressBook<number, GraphHorizonCon
3535
: contract) as unknown as LegacyStaking
3636
}
3737

38+
if (contracts.RewardsManager) {
39+
// add LegacyRewardsManager alias using old ILegacyRewardsManager abi
40+
const contract = new Contract(contracts.RewardsManager.target, getInterface('ILegacyRewardsManager'), signerOrProvider)
41+
contracts.LegacyRewardsManager = (enableTxLogging
42+
? wrapTransactionCalls(contract, 'LegacyRewardsManager')
43+
: contract) as unknown as LegacyRewardsManager
44+
}
45+
3846
return contracts
3947
}
4048

packages/toolshed/src/deployments/horizon/contracts.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type {
88
L2Curation,
99
L2GNS,
1010
L2GraphToken,
11+
LegacyRewardsManager,
1112
LegacyStaking,
1213
PaymentsEscrow,
1314
RewardsManager,
@@ -61,6 +62,7 @@ export interface GraphHorizonContracts extends ContractList<GraphHorizonContract
6162
Curation: L2Curation
6263
GNS: L2GNS
6364
LegacyStaking: LegacyStaking
65+
LegacyRewardsManager: LegacyRewardsManager
6466
}
6567

6668
export type GraphHorizonContractName = (typeof GraphHorizonContractNameList)[number]

0 commit comments

Comments
 (0)