Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* check transferFrom return value, test * docgen and snapshot * rename to isTransferSuccessful Co-authored-by: amiecorso <amie@nori.com>
- Loading branch information
Showing
7 changed files
with
214 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.17; | ||
import "../IERC20WithPermit.sol"; | ||
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol"; | ||
|
||
contract MockUnsafeERC20Permit is ERC20PermitUpgradeable, IERC20WithPermit { | ||
function initialize() public initializer { | ||
__ERC20Permit_init("MockUnsafeERC20Permit"); | ||
__ERC20_init_unchained("MockUnsafeERC20Permit", "MERC20"); | ||
_mint(_msgSender(), 1_000_000_000_000_000_000_000_000); | ||
} | ||
|
||
/** | ||
* @dev "Unsafe" ERC20 implementations may not revert in the case of a transfer failure, and instead | ||
* indicate failure by returning false. This contract can be used for testing purposes to simulate | ||
* such an implementation. | ||
*/ | ||
function transferFrom( | ||
address, | ||
address, | ||
uint256 | ||
) | ||
public | ||
virtual | ||
override(ERC20Upgradeable, IERC20Upgradeable) | ||
returns (bool) | ||
{ | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.