-
Notifications
You must be signed in to change notification settings - Fork 8
/
AssertionStakingPoolCreator.sol
36 lines (32 loc) · 1.37 KB
/
AssertionStakingPoolCreator.sol
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
30
31
32
33
34
35
36
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1
//
pragma solidity ^0.8.0;
import "./AssertionStakingPool.sol";
import "./StakingPoolCreatorUtils.sol";
import "./interfaces/IAssertionStakingPoolCreator.sol";
/// @notice Creates staking pool contract for a target assertion. Can be used for any child Arbitrum chain running on top of the deployed AssertionStakingPoolCreator's chain.
contract AssertionStakingPoolCreator is IAssertionStakingPoolCreator {
/// @inheritdoc IAssertionStakingPoolCreator
function createPool(
address _rollup,
bytes32 _assertionHash
) external returns (IAssertionStakingPool) {
AssertionStakingPool assertionPool = new AssertionStakingPool{salt: 0}(_rollup, _assertionHash);
emit NewAssertionPoolCreated(_rollup, _assertionHash, address(assertionPool));
return assertionPool;
}
/// @inheritdoc IAssertionStakingPoolCreator
function getPool(
address _rollup,
bytes32 _assertionHash
) public view returns (IAssertionStakingPool) {
return IAssertionStakingPool(
StakingPoolCreatorUtils.getPool(
type(AssertionStakingPool).creationCode,
abi.encode(_rollup, _assertionHash)
)
);
}
}