Skip to content

Commit 960e25c

Browse files
tmigoneRembrandtK
authored andcommitted
feat: add LegacyRewardsManager to interfaces and horizon contracts
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
1 parent 310db0b commit 960e25c

File tree

4 files changed

+52
-1
lines changed

4 files changed

+52
-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+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import type {
2+
IControllerToolshed,
3+
IEpochManagerToolshed,
4+
IL2GNSToolshed,
5+
IGraphPayments,
6+
IGraphProxyAdmin,
7+
IGraphTallyCollectorToolshed,
8+
IGraphToken,
9+
IHorizonStakingToolshed,
10+
IL2CurationToolshed,
11+
IPaymentsEscrowToolshed,
12+
IRewardsManagerToolshed,
13+
IStaking,
14+
ISubgraphNFT,
15+
ILegacyRewardsManager,
16+
} from '../../types'
17+
18+
export {
19+
IControllerToolshed as Controller,
20+
IEpochManagerToolshed as EpochManager,
21+
IGraphPayments as GraphPayments,
22+
IGraphProxyAdmin as GraphProxyAdmin,
23+
IGraphTallyCollectorToolshed as GraphTallyCollector,
24+
IHorizonStakingToolshed as HorizonStaking,
25+
IL2CurationToolshed as L2Curation,
26+
IL2GNSToolshed as L2GNS,
27+
IGraphToken as L2GraphToken,
28+
IStaking as LegacyStaking,
29+
IPaymentsEscrowToolshed as PaymentsEscrow,
30+
IRewardsManagerToolshed as RewardsManager,
31+
ISubgraphNFT as SubgraphNFT,
32+
ILegacyRewardsManager as LegacyRewardsManager,
33+
}

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)