all files / contracts/mocks/ BlockGetter.sol

100% Statements 2/2
100% Branches 0/0
100% Functions 2/2
100% Lines 2/2
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                                  14×               165×      
// SPDX-License-Identifier: GPL-3.0-or-later
 
pragma solidity 0.8.6;
 
 
/**
 * @title BlockGetter
 * @author solace.fi
 * @notice Used to get information about the chain. Useful in situations where chain manipulation results in the wrong results being returned.
 */
contract BlockGetter {
 
    /**
     * @notice Returns the elevation of the latest block in the chain.
     * @return num The block number.
     */
    function getBlockNumber() external view returns (uint256 num) {
        return block.number;
    }
 
    /**
     * @notice Returns the timestamp of the latest block in the chain.
     * @return timestamp The block timestamp.
     */
    function getBlockTimestamp() external view returns (uint256 timestamp) {
        return block.timestamp;
    }
}