Skip to content

Commit b2bc093

Browse files
authored
Revert "refactor!: Optional LSP1 Notification on revokeOperator(..) (#763)" (#765)
This reverts commit 63c1a0f.
1 parent 63c1a0f commit b2bc093

31 files changed

+853
-753
lines changed

constants.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export const INTERFACE_IDS = {
2929
LSP1UniversalReceiver: '0x6bb56a14',
3030
LSP1UniversalReceiverDelegate: '0xa245bbda',
3131
LSP6KeyManager: '0x23f34c62',
32-
LSP7DigitalAsset: '0xdaa746b7',
33-
LSP8IdentifiableDigitalAsset: '0x30dc5278',
32+
LSP7DigitalAsset: '0x05519512',
33+
LSP8IdentifiableDigitalAsset: '0x1ae9ba1f',
3434
LSP9Vault: '0x28af17e6',
3535
LSP11BasicSocialRecovery: '0x049a28f1',
3636
LSP14Ownable2Step: '0x94be5999',

contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol

-60
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,11 @@ interface ILSP7DigitalAsset is IERC165, IERC725Y {
5050
* @dev Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its {`authorizedAmountFor(...)`} to `0`.
5151
* @param operator The address revoked from operating
5252
* @param tokenOwner The token owner
53-
* @param notified Bool indicating whether the operator has been notified or not
5453
* @param operatorNotificationData The data to notify the operator about via LSP1.
5554
*/
5655
event RevokedOperator(
5756
address indexed operator,
5857
address indexed tokenOwner,
59-
bool notified,
6058
bytes operatorNotificationData
6159
);
6260

@@ -103,7 +101,6 @@ interface ILSP7DigitalAsset is IERC165, IERC725Y {
103101

104102
/**
105103
* @dev Sets an `amount` of tokens that an `operator` has access from the caller's balance (allowance). See {authorizedAmountFor}.
106-
* Notify the operator based on the LSP1-UniversalReceiver standard
107104
*
108105
* @param operator The address to authorize as an operator.
109106
* @param amount The allowance amount of tokens operator has access to.
@@ -126,7 +123,6 @@ interface ILSP7DigitalAsset is IERC165, IERC725Y {
126123
* on behalf of the token owner (the caller of the function `msg.sender`). See also {authorizedAmountFor}.
127124
*
128125
* @param operator The address to revoke as an operator.
129-
* @param notify Boolean indicating whether to notify the operator or not
130126
* @param operatorNotificationData The data to notify the operator about via LSP1.
131127
*
132128
* @custom:requirements
@@ -137,62 +133,6 @@ interface ILSP7DigitalAsset is IERC165, IERC725Y {
137133
*/
138134
function revokeOperator(
139135
address operator,
140-
bool notify,
141-
bytes memory operatorNotificationData
142-
) external;
143-
144-
/**
145-
* @custom:info This function in the LSP7 contract can be used as a prevention mechanism
146-
* against double spending allowance vulnerability.
147-
*
148-
* @notice Increase the allowance of `operator` by +`addedAmount`
149-
*
150-
* @dev Atomically increases the allowance granted to `operator` by the caller.
151-
* This is an alternative approach to {authorizeOperator} that can be used as a mitigation
152-
* for the double spending allowance problem.
153-
* Notify the operator based on the LSP1-UniversalReceiver standard
154-
*
155-
* @param operator The operator to increase the allowance for `msg.sender`
156-
* @param addedAmount The additional amount to add on top of the current operator's allowance
157-
*
158-
* @custom:requirements
159-
* - `operator` cannot be the same address as `msg.sender`
160-
* - `operator` cannot be the zero address.
161-
*
162-
* @custom:events {AuthorizedOperator} indicating the updated allowance
163-
*/
164-
function increaseAllowance(
165-
address operator,
166-
uint256 addedAmount,
167-
bytes memory operatorNotificationData
168-
) external;
169-
170-
/**
171-
* @custom:info This function in the LSP7 contract can be used as a prevention mechanism
172-
* against the double spending allowance vulnerability.
173-
*
174-
* @notice Decrease the allowance of `operator` by -`subtractedAmount`
175-
*
176-
* @dev Atomically decreases the allowance granted to `operator` by the caller.
177-
* This is an alternative approach to {authorizeOperator} that can be used as a mitigation
178-
* for the double spending allowance problem.
179-
* Notify the operator based on the LSP1-UniversalReceiver standard
180-
*
181-
* @custom:events
182-
* - {AuthorizedOperator} event indicating the updated allowance after decreasing it.
183-
* - {RevokeOperator} event if `subtractedAmount` is the full allowance,
184-
* indicating `operator` does not have any alauthorizedAmountForlowance left for `msg.sender`.
185-
*
186-
* @param operator The operator to decrease allowance for `msg.sender`
187-
* @param subtractedAmount The amount to decrease by in the operator's allowance.
188-
*
189-
* @custom:requirements
190-
* - `operator` cannot be the zero address.
191-
* - `operator` must have allowance for the caller of at least `subtractedAmount`.
192-
*/
193-
function decreaseAllowance(
194-
address operator,
195-
uint256 subtractedAmount,
196136
bytes memory operatorNotificationData
197137
) external;
198138

contracts/LSP7DigitalAsset/LSP7Constants.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pragma solidity ^0.8.4;
33

44
// --- ERC165 interface ids
5-
bytes4 constant _INTERFACEID_LSP7 = 0xdaa746b7;
5+
bytes4 constant _INTERFACEID_LSP7 = 0x05519512;
66

77
// --- Token Hooks
88

0 commit comments

Comments
 (0)