Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: cleanup/refactor activity and rewards contracts. #1214

Merged
merged 16 commits into from
Nov 26, 2024
Merged
2 changes: 1 addition & 1 deletion contracts/binding/build.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions contracts/binding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ pub mod ownership_facet;
#[allow(clippy::all)]
pub mod register_subnet_facet;
#[allow(clippy::all)]
pub mod subnet_actor_activity_facet;
#[allow(clippy::all)]
pub mod subnet_actor_checkpointing_facet;
#[allow(clippy::all)]
pub mod subnet_actor_diamond;
Expand All @@ -48,8 +50,6 @@ pub mod subnet_registry_diamond;
#[allow(clippy::all)]
pub mod top_down_finality_facet;
#[allow(clippy::all)]
pub mod validator_reward_facet;
#[allow(clippy::all)]
pub mod xnet_messaging_facet;

// The list of contracts need to convert FvmAddress to fvm_shared::Address
Expand Down
4 changes: 2 additions & 2 deletions contracts/contracts/SubnetActorDiamond.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {SubnetIDHelper} from "./lib/SubnetIDHelper.sol";
import {LibStaking} from "./lib/LibStaking.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {AssetHelper} from "./lib/AssetHelper.sol";
import {LibValidatorReward} from "./activities/ValidatorRewardFacet.sol";
import {LibActivity} from "./lib/LibActivity.sol";

error FunctionNotFound(bytes4 _functionSelector);

Expand Down Expand Up @@ -107,7 +107,7 @@ contract SubnetActorDiamond {
}

if (params.validatorRewarder != address(0)) {
LibValidatorReward.setRewarder(params.validatorRewarder);
LibActivity.setRewarder(params.validatorRewarder);
}
}

Expand Down
10 changes: 5 additions & 5 deletions contracts/contracts/SubnetRegistryDiamond.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ contract SubnetRegistryDiamond {
address diamondCutFacet;
address diamondLoupeFacet;
address ownershipFacet;
address validatorRewardFacet;
address activityFacet;
bytes4[] subnetActorGetterSelectors;
bytes4[] subnetActorManagerSelectors;
bytes4[] subnetActorRewarderSelectors;
Expand All @@ -34,7 +34,7 @@ contract SubnetRegistryDiamond {
bytes4[] subnetActorDiamondCutSelectors;
bytes4[] subnetActorDiamondLoupeSelectors;
bytes4[] subnetActorOwnershipSelectors;
bytes4[] validatorRewardSelectors;
bytes4[] subnetActorActivitySelectors;
SubnetCreationPrivileges creationPrivileges;
}

Expand Down Expand Up @@ -66,7 +66,7 @@ contract SubnetRegistryDiamond {
if (params.ownershipFacet == address(0)) {
revert FacetCannotBeZero();
}
if (params.validatorRewardFacet == address(0)) {
if (params.activityFacet == address(0)) {
revert FacetCannotBeZero();
}

Expand All @@ -88,7 +88,7 @@ contract SubnetRegistryDiamond {
s.SUBNET_ACTOR_DIAMOND_CUT_FACET = params.diamondCutFacet;
s.SUBNET_ACTOR_LOUPE_FACET = params.diamondLoupeFacet;
s.SUBNET_ACTOR_OWNERSHIP_FACET = params.ownershipFacet;
s.VALIDATOR_REWARD_FACET = params.validatorRewardFacet;
s.VALIDATOR_REWARD_FACET = params.activityFacet;

s.subnetActorGetterSelectors = params.subnetActorGetterSelectors;
s.subnetActorManagerSelectors = params.subnetActorManagerSelectors;
Expand All @@ -98,7 +98,7 @@ contract SubnetRegistryDiamond {
s.subnetActorDiamondCutSelectors = params.subnetActorDiamondCutSelectors;
s.subnetActorDiamondLoupeSelectors = params.subnetActorDiamondLoupeSelectors;
s.subnetActorOwnershipSelectors = params.subnetActorOwnershipSelectors;
s.validatorRewardSelectors = params.validatorRewardSelectors;
s.subnetActorActivitySelectors = params.subnetActorActivitySelectors;

s.creationPrivileges = params.creationPrivileges;
}
Expand Down
30 changes: 0 additions & 30 deletions contracts/contracts/activities/IValidatorRewarder.sol

This file was deleted.

28 changes: 0 additions & 28 deletions contracts/contracts/activities/LibActivityMerkleVerifier.sol

This file was deleted.

237 changes: 0 additions & 237 deletions contracts/contracts/activities/ValidatorRewardFacet.sol

This file was deleted.

Loading
Loading