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

delvtech / hyperdrive / 10586743291

27 Aug 2024 10:22PM UTC coverage: 90.031%. First build
10586743291

Pull #1146

github

mcclurejt
function visibility fix
Pull Request #1146: consistent registry addresses

0 of 4 new or added lines in 1 file covered. (0.0%)

2312 of 2568 relevant lines covered (90.03%)

346749.3 hits per line

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

0.0
/contracts/src/factory/HyperdriveCreate3Factory.sol
1
// SPDX-License-Identifier: Apache-2.0
2
pragma solidity 0.8.22;
3

4
import { CREATE3 } from "solmate/utils/CREATE3.sol";
5

6
/// @author DELV
7
/// @title HyperdriveCreate3Factory
8
/// @notice Uses CREATE3 to deploy a contract to a precomputable address that
9
///         is only dependent on the deployer's address and the provided salt.
10
/// @custom:disclaimer The language used in this code is for coding convenience
11
///                    only, and is not intended to, and does not, have any
12
///                    particular legal or regulatory significance.
13
contract HyperdriveCreate3Factory {
14
    /// @notice Deploy the contract with the provided creation code to a
15
    ///         precomputable address determined by only the deployer address
16
    ///         and salt.
17
    /// @param _salt Salt to use for the deployment.
18
    /// @param _creationCode Creation code of the contract to deploy.
19
    function deploy(
20
        bytes32 _salt,
21
        bytes memory _creationCode
22
    ) external payable returns (address deployed) {
23
        // Include the deployer's address as part of the salt to prevent
24
        // frontrunning and give deployers their own "namespaces".
NEW
25
        _salt = keccak256(abi.encodePacked(msg.sender, _salt));
×
NEW
26
        return CREATE3.deploy(_salt, _creationCode, msg.value);
×
27
    }
28

29
    /// @notice Use the deployer address and salt to compute the address of a
30
    ///         contract deployed via CREATE3.
31
    /// @param _deployer Address of the contract deployer.
32
    /// @param _salt Salt of the deployed contract.
33
    /// @return Address of the CREATE3 deployed contract.
34
    function getDeployed(
35
        address _deployer,
36
        bytes32 _salt
37
    ) external pure returns (address) {
NEW
38
        _salt = keccak256(abi.encodePacked(_deployer, _salt));
×
NEW
39
        return CREATE3.getDeployed(_salt, _deployer);
×
40
    }
41
}
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

© 2026 Coveralls, Inc