all files / contracts/mocks/ GasGriefer.sol

0% Statements 0/3
100% Branches 0/0
0% Functions 0/2
0% Lines 0/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29                                                         
// SPDX-License-Identifier: GPL-3.0-or-later
 
pragma solidity 0.8.6;
 
 
/**
 * @title GasGriefer
 * @author solace.fi
 * @notice Used to test safety of ETH transfers to arbitrary contracts. Will use as much gas is given and more.
 */
contract GasGriefer {
 
    uint256 public acc;
 
    receive () external payable {
        _grief();
    }
 
    fallback () external payable {
        _grief();
    }
 
    function _grief() internal {
        for(uint256 i = 0; i < type(uint256).max; i++) {
            acc += 1;
        }
    }
}