Skip to content

chore: rename TAPCollector to GraphTallyCollector #1106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 11, 2025
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
Expand Up @@ -10,9 +10,9 @@ import type {
} from '@graphprotocol/contracts'
import type {
GraphPayments,
GraphTallyCollector,
HorizonStaking,
PaymentsEscrow,
TAPCollector,
} from '@graphprotocol/horizon'
import type { ContractList } from '../../lib/contract'

Expand All @@ -29,7 +29,7 @@ export const GraphHorizonContractNameList = [
'HorizonStaking',
'GraphPayments',
'PaymentsEscrow',
'TAPCollector',
'GraphTallyCollector',
] as const

const root = path.resolve(__dirname, '../../../../..') // hardhat-graph-protocol root
Expand All @@ -49,7 +49,7 @@ export const GraphHorizonArtifactsMap = {
HorizonStaking: HORIZON_ARTIFACTS_PATH,
GraphPayments: HORIZON_ARTIFACTS_PATH,
PaymentsEscrow: HORIZON_ARTIFACTS_PATH,
TAPCollector: HORIZON_ARTIFACTS_PATH,
GraphTallyCollector: HORIZON_ARTIFACTS_PATH,
} as const

export interface GraphHorizonContracts extends ContractList<GraphHorizonContractName> {
Expand All @@ -65,7 +65,7 @@ export interface GraphHorizonContracts extends ContractList<GraphHorizonContract
HorizonStaking: HorizonStaking
GraphPayments: GraphPayments
PaymentsEscrow: PaymentsEscrow
TAPCollector: TAPCollector
GraphTallyCollector: GraphTallyCollector

// Aliases
GraphToken: L2GraphToken
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"PaymentsEscrow": {
"address": "0x09B985a2042848A08bA59060EaF0f07c6F5D4d54"
},
"TAPCollector": {
"GraphTallyCollector": {
"address": "0xacC71844EF6beEF70106ABe6E51013189A1f3738"
},
"GraphProxyAdmin": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { IPaymentsCollector } from "./IPaymentsCollector.sol";
import { IGraphPayments } from "./IGraphPayments.sol";

/**
* @title Interface for the {TAPCollector} contract
* @title Interface for the {GraphTallyCollector} contract
* @dev Implements the {IPaymentCollector} interface as defined by the Graph
* Horizon payments protocol.
* @notice Implements a payments collector contract that can be used to collect
* payments using a TAP RAV (Receipt Aggregate Voucher).
* payments using a GraphTally RAV (Receipt Aggregate Voucher).
*/
interface ITAPCollector is IPaymentsCollector {
interface IGraphTallyCollector is IPaymentsCollector {
/// @notice Details for a payer-signer pair
/// @dev Signers can be removed only after a thawing period
struct PayerAuthorization {
Expand All @@ -33,7 +33,7 @@ interface ITAPCollector is IPaymentsCollector {
address serviceProvider;
// The address of the data service the RAV was issued to
address dataService;
// The RAV timestamp, indicating the latest TAP Receipt in the RAV
// The RAV timestamp, indicating the latest GraphTally Receipt in the RAV
uint64 timestampNs;
// Total amount owed to the service provider since the beginning of the
// payer-service provider relationship, including all debt that is already paid for.
Expand Down Expand Up @@ -107,92 +107,92 @@ interface ITAPCollector is IPaymentsCollector {
* @param authorizingPayer The address of the payer authorizing the signer
* @param signer The address of the signer
*/
error TAPCollectorSignerAlreadyAuthorized(address authorizingPayer, address signer);
error GraphTallyCollectorSignerAlreadyAuthorized(address authorizingPayer, address signer);

/**
* Thrown when the signer proof deadline is invalid
* @param proofDeadline The deadline for the proof provided by the signer
* @param currentTimestamp The current timestamp
*/
error TAPCollectorInvalidSignerProofDeadline(uint256 proofDeadline, uint256 currentTimestamp);
error GraphTallyCollectorInvalidSignerProofDeadline(uint256 proofDeadline, uint256 currentTimestamp);

/**
* Thrown when the signer proof is invalid
*/
error TAPCollectorInvalidSignerProof();
error GraphTallyCollectorInvalidSignerProof();

/**
* Thrown when the signer is not authorized by the payer
* @param payer The address of the payer
* @param signer The address of the signer
*/
error TAPCollectorSignerNotAuthorizedByPayer(address payer, address signer);
error GraphTallyCollectorSignerNotAuthorizedByPayer(address payer, address signer);

/**
* Thrown when the attempting to revoke a signer that was already revoked
* @param signer The address of the signer
*/
error TAPCollectorAuthorizationAlreadyRevoked(address payer, address signer);
error GraphTallyCollectorAuthorizationAlreadyRevoked(address payer, address signer);

/**
* Thrown when attempting to thaw a signer that is already thawing
* @param signer The address of the signer
* @param thawEndTimestamp The timestamp at which the thawing period ends
*/
error TAPCollectorSignerAlreadyThawing(address signer, uint256 thawEndTimestamp);
error GraphTallyCollectorSignerAlreadyThawing(address signer, uint256 thawEndTimestamp);

/**
* Thrown when the signer is not thawing
* @param signer The address of the signer
*/
error TAPCollectorSignerNotThawing(address signer);
error GraphTallyCollectorSignerNotThawing(address signer);

/**
* Thrown when the signer is still thawing
* @param currentTimestamp The current timestamp
* @param thawEndTimestamp The timestamp at which the thawing period ends
*/
error TAPCollectorSignerStillThawing(uint256 currentTimestamp, uint256 thawEndTimestamp);
error GraphTallyCollectorSignerStillThawing(uint256 currentTimestamp, uint256 thawEndTimestamp);

/**
* Thrown when the RAV signer is invalid
*/
error TAPCollectorInvalidRAVSigner();
error GraphTallyCollectorInvalidRAVSigner();

/**
* Thrown when the RAV payer does not match the signers authorized payer
* @param authorizedPayer The address of the authorized payer
* @param ravPayer The address of the RAV payer
*/
error TAPCollectorInvalidRAVPayer(address authorizedPayer, address ravPayer);
error GraphTallyCollectorInvalidRAVPayer(address authorizedPayer, address ravPayer);

/**
* Thrown when the RAV is for a data service the service provider has no provision for
* @param dataService The address of the data service
*/
error TAPCollectorUnauthorizedDataService(address dataService);
error GraphTallyCollectorUnauthorizedDataService(address dataService);

/**
* Thrown when the caller is not the data service the RAV was issued to
* @param caller The address of the caller
* @param dataService The address of the data service
*/
error TAPCollectorCallerNotDataService(address caller, address dataService);
error GraphTallyCollectorCallerNotDataService(address caller, address dataService);

/**
* @notice Thrown when the tokens collected are inconsistent with the collection history
* Each RAV should have a value greater than the previous one
* @param tokens The amount of tokens in the RAV
* @param tokensCollected The amount of tokens already collected
*/
error TAPCollectorInconsistentRAVTokens(uint256 tokens, uint256 tokensCollected);
error GraphTallyCollectorInconsistentRAVTokens(uint256 tokens, uint256 tokensCollected);

/**
* Thrown when the attempting to collect more tokens than what it's owed
* @param tokensToCollect The amount of tokens to collect
* @param maxTokensToCollect The maximum amount of tokens to collect
*/
error TAPCollectorInvalidTokensToCollectAmount(uint256 tokensToCollect, uint256 maxTokensToCollect);
error GraphTallyCollectorInvalidTokensToCollectAmount(uint256 tokensToCollect, uint256 maxTokensToCollect);

/**
* @notice Authorize a signer to sign on behalf of the payer.
Expand Down
Loading