Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6 || 0.8.27;

interface ILegacyRewardsManager {
function getRewards(address allocationID) external view returns (uint256);
}

2 changes: 2 additions & 0 deletions packages/interfaces/src/types/horizon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import type {
IRewardsManagerToolshed,
IStaking,
ISubgraphNFT,
ILegacyRewardsManager,
} from '../../types'

export {
Expand All @@ -28,4 +29,5 @@ export {
IPaymentsEscrowToolshed as PaymentsEscrow,
IRewardsManagerToolshed as RewardsManager,
ISubgraphNFT as SubgraphNFT,
ILegacyRewardsManager as LegacyRewardsManager,
}
10 changes: 9 additions & 1 deletion packages/toolshed/src/deployments/horizon/address-book.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LegacyStaking } from '@graphprotocol/interfaces'
import type { LegacyRewardsManager, LegacyStaking } from '@graphprotocol/interfaces'
import { getInterface } from '@graphprotocol/interfaces'
import { Provider, Signer } from 'ethers'
import { Contract } from 'ethers'
Expand Down Expand Up @@ -35,6 +35,14 @@ export class GraphHorizonAddressBook extends AddressBook<number, GraphHorizonCon
: contract) as unknown as LegacyStaking
}

if (contracts.RewardsManager) {
// add LegacyRewardsManager alias using old ILegacyRewardsManager abi
const contract = new Contract(contracts.RewardsManager.target, getInterface('ILegacyRewardsManager'), signerOrProvider)
contracts.LegacyRewardsManager = (enableTxLogging
? wrapTransactionCalls(contract, 'LegacyRewardsManager')
: contract) as unknown as LegacyRewardsManager
}

return contracts
}

Expand Down
2 changes: 2 additions & 0 deletions packages/toolshed/src/deployments/horizon/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type {
L2Curation,
L2GNS,
L2GraphToken,
LegacyRewardsManager,
LegacyStaking,
PaymentsEscrow,
RewardsManager,
Expand Down Expand Up @@ -61,6 +62,7 @@ export interface GraphHorizonContracts extends ContractList<GraphHorizonContract
Curation: L2Curation
GNS: L2GNS
LegacyStaking: LegacyStaking
LegacyRewardsManager: LegacyRewardsManager
}

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