Skip to content

Commit

Permalink
Update internal ERC-20 property to use internal references
Browse files Browse the repository at this point in the history
  • Loading branch information
broccolirob committed Aug 29, 2023
1 parent e107c8a commit 7d20365
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions contracts/ERC20/internal/properties/ERC20BasicProperties.sol
Original file line number Diff line number Diff line change
Expand Up @@ -294,23 +294,23 @@ abstract contract CryticERC20BasicProperties is CryticERC20Base {
function test_ERC20_transferFromMoreThanAllowance(
address target
) public {
uint256 balance_sender = token.balanceOf(msg.sender);
uint256 balance_receiver = token.balanceOf(target);
uint256 allowance = token.allowance(msg.sender, address(this));
uint256 balance_sender = balanceOf(msg.sender);
uint256 balance_receiver = balanceOf(target);
uint256 allowance = allowance(msg.sender, address(this));
require(balance_sender > 0 && allowance < balance_sender);

bool r = token.transferFrom(msg.sender, target, allowance + 1);
bool r = this.transferFrom(msg.sender, target, allowance + 1);
assertWithMsg(
r == false,
"Successful transferFrom for more than allowance"
);
assertEq(
token.balanceOf(msg.sender),
balanceOf(msg.sender),
balance_sender,
"TransferFrom for more than amount approved source allowance"
);
assertEq(
token.balanceOf(target),
balanceOf(target),
balance_receiver,
"TransferFrom for more than amount approved target allowance"
);
Expand Down

0 comments on commit 7d20365

Please sign in to comment.