• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

RigoBlock / v3-contracts / 13261352678

11 Feb 2025 10:59AM UTC coverage: 84.94% (+2.6%) from 82.368%
13261352678

Pull #622

github

web-flow
Merge f22d260e3 into 08bd3b51b
Pull Request #622: feat: automated nav

761 of 962 branches covered (79.11%)

Branch coverage included in aggregate %.

523 of 711 new or added lines in 28 files covered. (73.56%)

18 existing lines in 5 files now uncovered.

1698 of 1933 relevant lines covered (87.84%)

44.05 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/contracts/protocol/extensions/adapters/AMulticall.sol
1
// SPDX-License-Identifier: GPL-2.0-or-later
2

3
// solhint-disable-next-line
4
pragma solidity 0.8.17;
5

6
import "./interfaces/IAMulticall.sol";
7

8
/// @title AMulticall - Allows sending mulple transactions to the pool.
9
/// @notice As per https://github.com/Uniswap/swap-router-contracts/blob/main/contracts/base/MulticallExtended.sol
10
contract AMulticall is IAMulticall {
11
    modifier checkDeadline(uint256 deadline) {
12
        require(_blockTimestamp() <= deadline, "AMULTICALL_DEADLINE_PAST_ERROR");
13✔
13
        _;
12✔
14
    }
15

16
    modifier checkPreviousBlockhash(bytes32 previousBlockhash) {
17
        require(blockhash(block.number - 1) == previousBlockhash, "AMULTICALL_BLOCKHASH_ERROR");
13✔
18
        _;
12✔
19
    }
20

21
    /// @inheritdoc IAMulticall
22
    function multicall(bytes[] calldata data) public override returns (bytes[] memory results) {
23
        results = new bytes[](data.length);
165✔
24
        for (uint256 i = 0; i < data.length; i++) {
165✔
25
            (bool success, bytes memory result) = address(this).delegatecall(data[i]);
201✔
26

27
            if (!success) {
201✔
28
                // Next 5 lines from https://ethereum.stackexchange.com/a/83577
29
                if (result.length < 68) revert();
24!
UNCOV
30
                assembly {
×
31
                    result := add(result, 0x04)
32
                }
UNCOV
33
                revert(abi.decode(result, (string)));
×
34
            }
35

36
            results[i] = result;
177✔
37
        }
38
    }
39

40
    /// @inheritdoc IAMulticall
41
    function multicall(uint256 deadline, bytes[] calldata data)
42
        external
43
        payable
44
        override
45
        checkDeadline(deadline)
13✔
46
        returns (bytes[] memory)
47
    {
48
        return multicall(data);
12✔
49
    }
50

51
    /// @inheritdoc IAMulticall
52
    function multicall(bytes32 previousBlockhash, bytes[] calldata data)
53
        external
54
        payable
55
        override
56
        checkPreviousBlockhash(previousBlockhash)
13✔
57
        returns (bytes[] memory)
58
    {
59
        return multicall(data);
12✔
60
    }
61

62
    /// @dev Method that exists purely to be overridden for tests
63
    /// @return The current block timestamp
64
    function _blockTimestamp() internal view virtual returns (uint256) {
65
        return block.timestamp;
13✔
66
    }
67
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc