Skip to content

Commit

Permalink
fix: emit both amount authorized and total authorized
Browse files Browse the repository at this point in the history
commit to now emit both the amount for which the collector was authorized and also the total amount for which they are now authorized
  • Loading branch information
MoonBoi9001 committed Oct 1, 2024
1 parent aa27c54 commit 96b5c3c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import { IDataService } from "./IDataService.sol";
interface IDataServiceRescuable is IDataService {
/**
* @notice Emitted when tokens are rescued from the contract.
* @param from The address initiating the rescue
* @param to The address receiving the rescued tokens
* @param token The address of the token being rescued
* @param tokens The amount of tokens rescued
*/
event TokensRescued(address indexed from, address indexed to, address token, uint256 tokens);

Expand Down
10 changes: 8 additions & 2 deletions packages/horizon/contracts/interfaces/IPaymentsEscrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ interface IPaymentsEscrow {
* @notice Emitted when a payer authorizes a collector to collect funds
* @param payer The address of the payer
* @param collector The address of the collector
* @param allowance The number of tokens the collector is allowed to collect
* @param addedAllowance The amount of tokens added to the collector's allowance
* @param newTotalAllowance The new total allowance after addition
*/
event AuthorizedCollector(address indexed payer, address indexed collector, uint256 allowance);
event AuthorizedCollector(
address indexed payer,
address indexed collector,
uint256 addedAllowance,
uint256 newTotalAllowance
);

/**
* @notice Emitted when a payer thaws a collector
Expand Down
2 changes: 1 addition & 1 deletion packages/horizon/contracts/payments/PaymentsEscrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ contract PaymentsEscrow is Initializable, MulticallUpgradeable, GraphDirectory,
require(allowance != 0, PaymentsEscrowInvalidZeroTokens());
Collector storage collector = authorizedCollectors[msg.sender][collector_];
collector.allowance += allowance;
emit AuthorizedCollector(msg.sender, collector_, collector.allowance);
emit AuthorizedCollector(msg.sender, collector_, allowance, collector.allowance);
}

/**
Expand Down

0 comments on commit 96b5c3c

Please sign in to comment.