Skip to content

Commit f91a8cc

Browse files
committed
Removed sponsor == operator requirement
1 parent 04d1040 commit f91a8cc

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

src/allocators/SimpleAllocator.sol

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,10 @@ contract SimpleAllocator is ISimpleAllocator {
6767
}
6868

6969
/// @inheritdoc IAllocator
70-
function attest(address operator_, address from_, address, uint256 id_, uint256 amount_)
71-
external
72-
view
73-
returns (bytes4)
74-
{
70+
function attest(address, address from_, address, uint256 id_, uint256 amount_) external view returns (bytes4) {
7571
if (msg.sender != COMPACT_CONTRACT) {
7672
revert InvalidCaller(msg.sender, COMPACT_CONTRACT);
7773
}
78-
// For a transfer, the sponsor is the arbiter
79-
if (operator_ != from_) {
80-
revert InvalidCaller(operator_, from_);
81-
}
8274
uint256 balance = ERC6909(COMPACT_CONTRACT).balanceOf(from_, id_);
8375
// Check unlocked balance
8476
bytes32 tokenHash = _getTokenHash(id_, from_);

test/SimpleAllocator.t.sol

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,12 +447,6 @@ contract SimpleAllocator_Attest is Deposited {
447447
simpleAllocator.attest(address(user), address(user), address(usdc), usdcId, defaultAmount);
448448
}
449449

450-
function test_revert_InvalidCaller_FromNotOperator() public {
451-
vm.prank(attacker);
452-
vm.expectRevert(abi.encodeWithSelector(ISimpleAllocator.InvalidCaller.selector, attacker, user));
453-
compactContract.transfer(user, attacker, defaultAmount, address(usdc), address(simpleAllocator));
454-
}
455-
456450
function test_revert_InsufficientBalance_NoActiveLock(uint128 falseAmount_) public {
457451
vm.assume(falseAmount_ > defaultAmount);
458452

0 commit comments

Comments
 (0)