File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: UNLICENSED
2+ pragma solidity ^ 0.8 ;
3+
4+ import {IERC20 } from "openzeppelin/contracts/token/ERC20/IERC20.sol " ;
5+
6+ contract FuzzTest {
7+ /// @custom:ape-fuzzer-max-examples 200
8+ function test_with_fuzzing (uint256 a ) external {
9+ require (a != 29678634502528050652056023465820843 , "Found a rare bug! " );
10+ }
11+
12+ /// @custom:ape-fuzz-deadline 1000
13+ function test_token_approvals (IERC20 token , uint256 amount ) external {
14+ require (token.approve (msg .sender , amount));
15+ require (token.allowance (address (this ), msg .sender ) == amount);
16+ }
17+ }
Original file line number Diff line number Diff line change 1+ from ethereum.ercs import IERC20
2+
3+ @external
4+ def test_with_fuzzing (a: uint256 ):
5+ """@custom:ape-fuzzer-max-examples 200"""
6+ assert a != 29678634502528050652056023465820843 , "Found a rare bug! "
7+
8+
9+ @external
10+ def test_token_approvals (token: IERC20, amount: uint256 ):
11+ """@custom:ape-fuzz-deadline 1000"""
12+ assert extcall token.approve (msg .sender , amount)
13+ assert staticcall token.allowance (self , msg .sender ) == amount
You can’t perform that action at this time.
0 commit comments