Skip to content

Commit ba3a569

Browse files
authored
Merge pull request #9 from symbioticfi/sync-core
Sync with core
2 parents f2b66da + a743983 commit ba3a569

12 files changed

+52
-16
lines changed

lib/core

Submodule core updated 56 files

script/deploy/DefaultOperatorRewards.s.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-License-Identifier: UNLICENSED
1+
// SPDX-License-Identifier: MIT
22
pragma solidity 0.8.25;
33

44
import {Script} from "forge-std/Script.sol";

script/deploy/DefaultOperatorRewardsFactory.s.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-License-Identifier: UNLICENSED
1+
// SPDX-License-Identifier: MIT
22
pragma solidity 0.8.25;
33

44
import {Script} from "forge-std/Script.sol";

script/deploy/DefaultStakerRewards.s.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-License-Identifier: UNLICENSED
1+
// SPDX-License-Identifier: MIT
22
pragma solidity 0.8.25;
33

44
import {Script} from "forge-std/Script.sol";

script/deploy/DefaultStakerRewardsFactory.s.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-License-Identifier: UNLICENSED
1+
// SPDX-License-Identifier: MIT
22
pragma solidity 0.8.25;
33

44
import {Script} from "forge-std/Script.sol";

src/interfaces/defaultOperatorRewards/IDefaultOperatorRewards.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity 0.8.25;
2+
pragma solidity ^0.8.0;
33

44
interface IDefaultOperatorRewards {
55
error InsufficientBalance();

src/interfaces/defaultOperatorRewards/IDefaultOperatorRewardsFactory.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity 0.8.25;
2+
pragma solidity ^0.8.0;
33

44
interface IDefaultOperatorRewardsFactory {
55
/**

src/interfaces/defaultStakerRewards/IDefaultStakerRewards.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity 0.8.25;
2+
pragma solidity ^0.8.0;
33

44
import {IStakerRewards} from "../stakerRewards/IStakerRewards.sol";
55

src/interfaces/defaultStakerRewards/IDefaultStakerRewardsFactory.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity 0.8.25;
2+
pragma solidity ^0.8.0;
33

44
import {IDefaultStakerRewards} from "./IDefaultStakerRewards.sol";
55

src/interfaces/stakerRewards/IStakerRewards.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity 0.8.25;
2+
pragma solidity ^0.8.0;
33

44
interface IStakerRewards {
55
/**

test/defaultStakerRewards/DefaultStakerRewards.t.sol

+21-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {OptInService} from "@symbioticfi/core/src/contracts/service/OptInService
1515
import {Vault} from "@symbioticfi/core/src/contracts/vault/Vault.sol";
1616
import {NetworkRestakeDelegator} from "@symbioticfi/core/src/contracts/delegator/NetworkRestakeDelegator.sol";
1717
import {FullRestakeDelegator} from "@symbioticfi/core/src/contracts/delegator/FullRestakeDelegator.sol";
18+
import {OperatorSpecificDelegator} from "@symbioticfi/core/src/contracts/delegator/OperatorSpecificDelegator.sol";
1819
import {Slasher} from "@symbioticfi/core/src/contracts/slasher/Slasher.sol";
1920
import {VetoSlasher} from "@symbioticfi/core/src/contracts/slasher/VetoSlasher.sol";
2021

@@ -23,6 +24,8 @@ import {VaultConfigurator, IVaultConfigurator} from "@symbioticfi/core/src/contr
2324
import {IVault} from "@symbioticfi/core/src/interfaces/vault/IVault.sol";
2425
import {INetworkRestakeDelegator} from "@symbioticfi/core/src/interfaces/delegator/INetworkRestakeDelegator.sol";
2526
import {IBaseDelegator} from "@symbioticfi/core/src/interfaces/delegator/IBaseDelegator.sol";
27+
import {IBaseSlasher} from "@symbioticfi/core/src/interfaces/slasher/IBaseSlasher.sol";
28+
import {ISlasher} from "@symbioticfi/core/src/interfaces/slasher/ISlasher.sol";
2629

2730
import {DefaultStakerRewardsFactory} from "../../src/contracts/defaultStakerRewards/DefaultStakerRewardsFactory.sol";
2831
import {IDefaultStakerRewards} from "../../src/interfaces/defaultStakerRewards/IDefaultStakerRewards.sol";
@@ -78,8 +81,10 @@ contract DefaultStakerRewardsTest is Test {
7881
operatorMetadataService = new MetadataService(address(operatorRegistry));
7982
networkMetadataService = new MetadataService(address(networkRegistry));
8083
networkMiddlewareService = new NetworkMiddlewareService(address(networkRegistry));
81-
operatorVaultOptInService = new OptInService(address(operatorRegistry), address(vaultFactory));
82-
operatorNetworkOptInService = new OptInService(address(operatorRegistry), address(networkRegistry));
84+
operatorVaultOptInService =
85+
new OptInService(address(operatorRegistry), address(vaultFactory), "OperatorVaultOptInService");
86+
operatorNetworkOptInService =
87+
new OptInService(address(operatorRegistry), address(networkRegistry), "OperatorNetworkOptInService");
8388

8489
address vaultImpl =
8590
address(new Vault(address(delegatorFactory), address(slasherFactory), address(vaultFactory)));
@@ -109,6 +114,19 @@ contract DefaultStakerRewardsTest is Test {
109114
);
110115
delegatorFactory.whitelist(fullRestakeDelegatorImpl);
111116

117+
address operatorSpecificDelegatorImpl = address(
118+
new OperatorSpecificDelegator(
119+
address(operatorRegistry),
120+
address(networkRegistry),
121+
address(vaultFactory),
122+
address(operatorVaultOptInService),
123+
address(operatorNetworkOptInService),
124+
address(delegatorFactory),
125+
delegatorFactory.totalTypes()
126+
)
127+
);
128+
delegatorFactory.whitelist(operatorSpecificDelegatorImpl);
129+
112130
address slasherImpl = address(
113131
new Slasher(
114132
address(vaultFactory),
@@ -172,7 +190,7 @@ contract DefaultStakerRewardsTest is Test {
172190
),
173191
withSlasher: false,
174192
slasherIndex: 0,
175-
slasherParams: ""
193+
slasherParams: abi.encode(ISlasher.InitParams({baseParams: IBaseSlasher.BaseParams({isBurnerHook: true})}))
176194
})
177195
);
178196

test/defaultStakerRewards/DefaultStakerRewardsFactory.t.sol

+21-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {OptInService} from "@symbioticfi/core/src/contracts/service/OptInService
1515
import {Vault} from "@symbioticfi/core/src/contracts/vault/Vault.sol";
1616
import {NetworkRestakeDelegator} from "@symbioticfi/core/src/contracts/delegator/NetworkRestakeDelegator.sol";
1717
import {FullRestakeDelegator} from "@symbioticfi/core/src/contracts/delegator/FullRestakeDelegator.sol";
18+
import {OperatorSpecificDelegator} from "@symbioticfi/core/src/contracts/delegator/OperatorSpecificDelegator.sol";
1819
import {Slasher} from "@symbioticfi/core/src/contracts/slasher/Slasher.sol";
1920
import {VetoSlasher} from "@symbioticfi/core/src/contracts/slasher/VetoSlasher.sol";
2021

@@ -23,6 +24,8 @@ import {VaultConfigurator, IVaultConfigurator} from "@symbioticfi/core/src/contr
2324
import {IVault} from "@symbioticfi/core/src/interfaces/vault/IVault.sol";
2425
import {INetworkRestakeDelegator} from "@symbioticfi/core/src/interfaces/delegator/INetworkRestakeDelegator.sol";
2526
import {IBaseDelegator} from "@symbioticfi/core/src/interfaces/delegator/IBaseDelegator.sol";
27+
import {IBaseSlasher} from "@symbioticfi/core/src/interfaces/slasher/IBaseSlasher.sol";
28+
import {ISlasher} from "@symbioticfi/core/src/interfaces/slasher/ISlasher.sol";
2629

2730
import {DefaultStakerRewardsFactory} from "../../src/contracts/defaultStakerRewards/DefaultStakerRewardsFactory.sol";
2831
import {DefaultStakerRewards} from "../../src/contracts/defaultStakerRewards/DefaultStakerRewards.sol";
@@ -70,8 +73,10 @@ contract DefaultStakerRewardsFactoryTest is Test {
7073
operatorMetadataService = new MetadataService(address(operatorRegistry));
7174
networkMetadataService = new MetadataService(address(networkRegistry));
7275
networkMiddlewareService = new NetworkMiddlewareService(address(networkRegistry));
73-
operatorVaultOptInService = new OptInService(address(operatorRegistry), address(vaultFactory));
74-
operatorNetworkOptInService = new OptInService(address(operatorRegistry), address(networkRegistry));
76+
operatorVaultOptInService =
77+
new OptInService(address(operatorRegistry), address(vaultFactory), "OperatorVaultOptInService");
78+
operatorNetworkOptInService =
79+
new OptInService(address(operatorRegistry), address(networkRegistry), "OperatorNetworkOptInService");
7580

7681
address vaultImpl =
7782
address(new Vault(address(delegatorFactory), address(slasherFactory), address(vaultFactory)));
@@ -101,6 +106,19 @@ contract DefaultStakerRewardsFactoryTest is Test {
101106
);
102107
delegatorFactory.whitelist(fullRestakeDelegatorImpl);
103108

109+
address operatorSpecificDelegatorImpl = address(
110+
new OperatorSpecificDelegator(
111+
address(operatorRegistry),
112+
address(networkRegistry),
113+
address(vaultFactory),
114+
address(operatorVaultOptInService),
115+
address(operatorNetworkOptInService),
116+
address(delegatorFactory),
117+
delegatorFactory.totalTypes()
118+
)
119+
);
120+
delegatorFactory.whitelist(operatorSpecificDelegatorImpl);
121+
104122
address slasherImpl = address(
105123
new Slasher(
106124
address(vaultFactory),
@@ -164,7 +182,7 @@ contract DefaultStakerRewardsFactoryTest is Test {
164182
),
165183
withSlasher: false,
166184
slasherIndex: 0,
167-
slasherParams: ""
185+
slasherParams: abi.encode(ISlasher.InitParams({baseParams: IBaseSlasher.BaseParams({isBurnerHook: true})}))
168186
})
169187
);
170188

0 commit comments

Comments
 (0)