diff --git a/src/test/ERC6909.t.sol b/src/test/ERC6909.t.sol index 57cdb738..2eaa5187 100644 --- a/src/test/ERC6909.t.sol +++ b/src/test/ERC6909.t.sol @@ -160,6 +160,16 @@ contract ERC6909Test is DSTestPlus { token.transferFrom(sender, receiver, 1337, 100); } + function testFailTransferFromNotAuthorizedMsgSender() public { + address sender = address(0xABCD); + address receiver = address(0xBEEF); + + token.mint(sender, 1337, 100); + + hevm.prank(sender); + token.transferFrom(sender, receiver, 1337, 100); + } + function testMint( address receiver, uint256 id, diff --git a/src/tokens/ERC6909.sol b/src/tokens/ERC6909.sol index 15b4f307..763b3754 100644 --- a/src/tokens/ERC6909.sol +++ b/src/tokens/ERC6909.sol @@ -48,7 +48,7 @@ abstract contract ERC6909 { uint256 id, uint256 amount ) public virtual returns (bool) { - if (msg.sender != sender && !isOperator[sender][msg.sender]) { + if (!isOperator[sender][msg.sender]) { uint256 allowed = allowance[sender][msg.sender][id]; if (allowed != type(uint256).max) allowance[sender][msg.sender][id] = allowed - amount; }