Skip to content
Open
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
10 changes: 10 additions & 0 deletions src/test/ERC6909.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/tokens/ERC6909.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down