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

NexusMutual / smart-contracts / #1431

11 Sep 2025 09:20AM UTC coverage: 53.601% (-33.8%) from 87.363%
#1431

Pull #1451

MilGard91
chore: add create1 scripts
Pull Request #1451: chore: deployment scripts create1 and create2

821 of 1674 branches covered (49.04%)

Branch coverage included in aggregate %.

1620 of 2880 relevant lines covered (56.25%)

13.52 hits per line

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

52.63
/contracts/modules/staking/StakingPoolFactory.sol
1
// SPDX-License-Identifier: AGPL-3.0-only
2

3
pragma solidity ^0.8.18;
4

5
import "../../interfaces/IStakingPoolFactory.sol";
6
import "./MinimalBeaconProxy.sol";
7

8
contract StakingPoolFactory is IStakingPoolFactory {
9

10
  address public operator;
11
  uint96 internal _stakingPoolCount;
12

13
  // temporary beacon address storage to avoid constructor arguments in the proxy
14
  address public beacon;
15

16
  constructor(address _operator) {
17
    operator = _operator;
2✔
18
  }
19

20
  function changeOperator(address newOperator) public {
21
    require(msg.sender == operator, "StakingPoolFactory: Not operator");
×
22
    require(newOperator != address(0), "StakingPoolFactory: Invalid operator");
×
23
    operator = newOperator;
×
24
  }
25

26
  function stakingPoolCount() external view returns (uint) {
27
    return _stakingPoolCount;
1✔
28
  }
29

30
  function create(address _beacon) external returns (uint poolId, address stakingPoolAddress) {
31

32
    require(msg.sender == operator, "StakingPoolFactory: Not operator");
14!
33

34
    beacon = _beacon;
14✔
35
    poolId = ++_stakingPoolCount;
14✔
36

37
    stakingPoolAddress = address(
14✔
38
      new MinimalBeaconProxy{salt : bytes32(poolId)}()
39
    );
40

41
    require(
14!
42
      stakingPoolAddress != address(0),
43
      "StakingPoolFactory: Failed to create staking pool"
44
    );
45

46
    emit StakingPoolCreated(poolId, stakingPoolAddress);
14✔
47
  }
48
}
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