mirror of
https://github.com/logos-co/staking.git
synced 2025-01-10 18:56:00 +00:00
f259286e98
This commit introduces a first version of a `VaultFactory` that later will be extended to be capable of instantiating reward vaults and possible keep track of vault instances per owner. As a first step, this implementation comes with a `createVault()` function which takes care of creating vaults. Because `VaultFactory` also knows about `StakeManager` it can derive the manager's address and stake token from it when creating vaults, allowing the API to be without arguments. Partially addresses #37
22 lines
856 B
Solidity
22 lines
856 B
Solidity
// SPDX-License-Identifier: UNLICENSED
|
|
pragma solidity >=0.8.19 <=0.9.0;
|
|
|
|
import { BaseScript } from "./Base.s.sol";
|
|
import { DeploymentConfig } from "./DeploymentConfig.s.sol";
|
|
import { StakeManager } from "../contracts/StakeManager.sol";
|
|
import { VaultFactory } from "../contracts/VaultFactory.sol";
|
|
|
|
contract Deploy is BaseScript {
|
|
function run() public returns (VaultFactory, StakeManager, DeploymentConfig) {
|
|
DeploymentConfig deploymentConfig = new DeploymentConfig(broadcaster);
|
|
(, address token) = deploymentConfig.activeNetworkConfig();
|
|
|
|
vm.startBroadcast(broadcaster);
|
|
StakeManager stakeManager = new StakeManager(token, address(0));
|
|
VaultFactory vaultFactory = new VaultFactory(address(stakeManager));
|
|
vm.stopBroadcast();
|
|
|
|
return (vaultFactory, stakeManager, deploymentConfig);
|
|
}
|
|
}
|