Skip to content

Commit

Permalink
extract constants to shared files (#660)
Browse files Browse the repository at this point in the history
  • Loading branch information
doerfli committed Sep 16, 2024
1 parent de04d82 commit 17f8ca2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
8 changes: 1 addition & 7 deletions contracts/instance/InstanceAdmin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,12 @@ import {ObjectType, INSTANCE} from "../type/ObjectType.sol";
import {RoleId, ADMIN_ROLE} from "../type/RoleId.sol";
import {Str} from "../type/String.sol";
import {VersionPart} from "../type/Version.sol";
import {INSTANCE_TARGET_NAME, INSTANCE_ADMIN_TARGET_NAME, INSTANCE_STORE_TARGET_NAME, PRODUCT_STORE_TARGET_NAME, BUNDLE_SET_TARGET_NAME, RISK_SET_TARGET_NAME} from "./TargetNames.sol";


contract InstanceAdmin is
AccessAdmin
{
string public constant INSTANCE_TARGET_NAME = "Instance";
string public constant INSTANCE_ADMIN_TARGET_NAME = "InstanceAdmin";
string public constant INSTANCE_STORE_TARGET_NAME = "InstanceStore";
string public constant PRODUCT_STORE_TARGET_NAME = "ProductStore";
string public constant BUNDLE_SET_TARGET_NAME = "BundleSet";
string public constant RISK_SET_TARGET_NAME = "RiskSet";

// onlyInstanceService
error ErrorInstanceAdminNotInstanceService(address caller);

Expand Down
8 changes: 1 addition & 7 deletions contracts/instance/InstanceAuthorizationV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {ACCOUNTING, ORACLE, POOL, INSTANCE, COMPONENT, DISTRIBUTION, APPLICATION
import {BundleSet} from "../instance/BundleSet.sol";
import {InstanceAdmin} from "../instance/InstanceAdmin.sol";
import {InstanceStore} from "../instance/InstanceStore.sol";
import {INSTANCE_TARGET_NAME, INSTANCE_ADMIN_TARGET_NAME, INSTANCE_STORE_TARGET_NAME, PRODUCT_STORE_TARGET_NAME, BUNDLE_SET_TARGET_NAME, RISK_SET_TARGET_NAME} from "./TargetNames.sol";
import {ProductStore} from "../instance/ProductStore.sol";
import {ADMIN_ROLE, INSTANCE_OWNER_ROLE, PUBLIC_ROLE} from "../type/RoleId.sol";
import {RiskSet} from "../instance/RiskSet.sol";
Expand All @@ -22,13 +23,6 @@ contract InstanceAuthorizationV3
string public constant INSTANCE_ROLE_NAME = "InstanceRole";
string public constant INSTANCE_OWNER_ROLE_NAME = "InstanceOwnerRole";

string public constant INSTANCE_TARGET_NAME = "Instance";
string public constant INSTANCE_STORE_TARGET_NAME = "InstanceStore";
string public constant PRODUCT_STORE_TARGET_NAME = "ProductStore";
string public constant INSTANCE_ADMIN_TARGET_NAME = "InstanceAdmin";
string public constant BUNDLE_SET_TARGET_NAME = "BundleSet";
string public constant RISK_SET_TARGET_NAME = "RiskSet";

constructor()
Authorization(
INSTANCE_TARGET_NAME,
Expand Down
10 changes: 10 additions & 0 deletions contracts/instance/TargetNames.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.20;

string constant INSTANCE_TARGET_NAME = "Instance";
string constant INSTANCE_ADMIN_TARGET_NAME = "InstanceAdmin";
string constant INSTANCE_STORE_TARGET_NAME = "InstanceStore";
string constant PRODUCT_STORE_TARGET_NAME = "ProductStore";
string constant BUNDLE_SET_TARGET_NAME = "BundleSet";
string constant RISK_SET_TARGET_NAME = "RiskSet";

0 comments on commit 17f8ca2

Please sign in to comment.