Skip to content

Commit

Permalink
chore: update solc, remove stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-fruitful committed Mar 13, 2024
1 parent 4cbf068 commit a026edd
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 50 deletions.
22 changes: 1 addition & 21 deletions src/facets/ACLFacet.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
pragma solidity 0.8.24;

import { LibACL, LibHelpers } from "../libs/LibACL.sol";
import { LibConstants as LC } from "../libs/LibConstants.sol";
Expand Down Expand Up @@ -64,26 +64,6 @@ contract ACLFacet is Modifiers {
return LibACL._isInGroup(_objectId, _contextId, LibHelpers._stringToBytes32(_group));
}

/**
* @notice Check whether a parent object belongs to the `_group` group in given context
* @dev Objects can have a parent object, i.e. entity is a parent of a user
* @param _objectId ID of an object whose parent is being checked for role group membership
* @param _contextId Context in which the role group membership is being checked
* @param _group name of the role group
* @return true if object's parent is a member of this role group, false otherwise
*/
function isParentInGroup(
bytes32 _objectId,
bytes32 _contextId,
string memory _group
)
external
view
returns (bool)
{
return LibACL._isParentInGroup(_objectId, _contextId, LibHelpers._stringToBytes32(_group));
}

/**
* @notice Check whether a user can assign specific object to the `_role` role in given context
* @dev Check permission to assign to a role
Expand Down
2 changes: 1 addition & 1 deletion src/facets/GovernanceFacet.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
pragma solidity 0.8.24;

import { IDiamondCut } from "lib/diamond-2-hardhat/contracts/interfaces/IDiamondCut.sol";
import { Modifiers } from "../shared/Modifiers.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/facets/NaymsOwnershipFacet.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
pragma solidity 0.8.24;

import { LibDiamond } from "lib/diamond-2-hardhat/contracts/libraries/LibDiamond.sol";
import { IERC173 } from "lib/diamond-2-hardhat/contracts/interfaces/IERC173.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/facets/NaymsTokenFacet.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
pragma solidity 0.8.24;

import { AppStorage, LibAppStorage } from "../shared/AppStorage.sol";
import { Modifiers } from "../shared/Modifiers.sol";
Expand Down
13 changes: 7 additions & 6 deletions src/facets/PhasedDiamondCutFacet.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

/******************************************************************************\
* Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen)
* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535
/******************************************************************************/
pragma solidity 0.8.24;

/**
* \
* Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen)
* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535
* /*****************************************************************************
*/
import { IDiamondCut } from "lib/diamond-2-hardhat/contracts/interfaces/IDiamondCut.sol";
import { LibDiamond } from "lib/diamond-2-hardhat/contracts/libraries/LibDiamond.sol";
import { AppStorage, LibAppStorage } from "src/shared/AppStorage.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/libs/LibACL.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
pragma solidity 0.8.24;

import { AppStorage, LibAppStorage } from "../shared/AppStorage.sol";
import { LibDiamond } from "lib/diamond-2-hardhat/contracts/libraries/LibDiamond.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/libs/LibConstants.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
pragma solidity 0.8.24;

/**
* @dev Settings keys.
Expand Down
12 changes: 10 additions & 2 deletions src/libs/LibGovernance.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
pragma solidity 0.8.24;

import { IDiamondCut } from "lib/diamond-2-hardhat/contracts/interfaces/IDiamondCut.sol";

/// @notice Contains internal methods for upgrade functionality
library LibGovernance {
function _calculateUpgradeId(IDiamondCut.FacetCut[] memory _diamondCut, address _init, bytes memory _calldata) internal pure returns (bytes32) {
function _calculateUpgradeId(
IDiamondCut.FacetCut[] memory _diamondCut,
address _init,
bytes memory _calldata
)
internal
pure
returns (bytes32)
{
return keccak256(abi.encode(_diamondCut, _init, _calldata));
}
}
2 changes: 1 addition & 1 deletion src/libs/LibHelpers.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
pragma solidity 0.8.24;

/// @notice Pure functions
library LibHelpers {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/LibInitDiamond.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
pragma solidity 0.8.24;

import { AppStorage, LibAppStorage } from "../shared/AppStorage.sol";
import { LibConstants as LC } from "./LibConstants.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/libs/LibNaymsToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
pragma solidity 0.8.24;

import { AppStorage, LibAppStorage } from "../shared/AppStorage.sol";

Expand Down
3 changes: 1 addition & 2 deletions src/shared/AppStorage.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
pragma solidity 0.8.24;

/// @notice storage for NAYM coin

Expand All @@ -26,7 +26,6 @@ struct AppStorage {
mapping(bytes32 objectId => bytes32 objectsDataHash) objectDataHashes;
mapping(bytes32 objectId => string tokenSymbol) objectTokenSymbol;
mapping(bytes32 objectId => string tokenName) objectTokenName;
mapping(bytes32 objectId => address tokenWrapperAddress) objectTokenWrapper;
//// ACL Configuration////
mapping(bytes32 roleId => mapping(bytes32 groupId => bool isRoleInGroup)) groups; //role => (group => isRoleInGroup)
mapping(bytes32 roleId => bytes32 assignerGroupId) canAssign; //role => Group that can assign/unassign that role
Expand Down
27 changes: 18 additions & 9 deletions src/shared/CustomErrors.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
pragma solidity 0.8.24;

/// @dev The Nayms Diamond (proxy contract) owner (address) must be mutually exclusive with the system admin role.
error OwnerCannotBeSystemAdmin();
Expand All @@ -17,8 +17,10 @@ error AssignerGroupIsMissing();
/// @param roleInContext Role that is being assigned
error AssignerCannotUnassignRole(bytes32 assigner, bytes32 assignee, bytes32 context, string roleInContext);

/// @notice Error message for when a sender is not authorized to perform an action with their assigned role in a given context of a group
/// @dev In the assertPrivilege modifier, this error message returns the context and the role in the context, not the user's role in the system context.
/// @notice Error message for when a sender is not authorized to perform an action with their assigned role in a given
/// context of a group
/// @dev In the assertPrivilege modifier, this error message returns the context and the role in the context, not the
/// user's role in the system context.
/// @param msgSenderId Id of the sender
/// @param context Context in which the sender is trying to perform an action
/// @param roleInContext Role of the sender in the context
Expand Down Expand Up @@ -53,7 +55,8 @@ error EntityExistsAlready(bytes32 entityId);
/// @dev The object type is not supported in this function call.
error InvalidObjectType(bytes32 objectId, bytes12 objectType);

/// @dev The object ID being passed in is expected to be an address type, but the bottom (least significant) 12 bytes are not empty.
/// @dev The object ID being passed in is expected to be an address type, but the bottom (least significant) 12 bytes
/// are not empty.
error InvalidObjectIdForAddress(bytes32 objectId);

/// @dev (non specific) the object is not enabled to be tokenized.
Expand All @@ -74,7 +77,8 @@ error ExternalDepositAmountCannotBeZero();
/// @dev Passing in 0 amount for withdraws is not allowed.
error ExternalWithdrawAmountCannotBeZero();

/// @dev The receiver of the withdraw must haveGroupPriviledge with the roles entity admin, comptroller combined, or comptroller withdraw.
/// @dev The receiver of the withdraw must haveGroupPriviledge with the roles entity admin, comptroller combined, or
/// comptroller withdraw.
error ExternalWithdrawInvalidReceiver(address receiver);

/// @dev Cannot create a simple policy with policyId of 0
Expand All @@ -83,8 +87,10 @@ error PolicyIdCannotBeZero();
/// @dev Policy commissions among commission receivers cannot sum to be greater than 10_000 basis points.
error PolicyCommissionsBasisPointsCannotBeGreaterThan10000(uint256 calculatedTotalBp);

/// @dev The total basis points for a fee schedule, policy fee receivers at policy creation, or maker bp cannot be greater than half of LibConstants.BP_FACTOR.
/// This is to prevent the total basis points of a fee schedule with additional fee receivers (policy fee receivers for fee payments on premiums) from being greater than 100%.
/// @dev The total basis points for a fee schedule, policy fee receivers at policy creation, or maker bp cannot be
/// greater than half of LibConstants.BP_FACTOR.
/// This is to prevent the total basis points of a fee schedule with additional fee receivers (policy fee receivers
/// for fee payments on premiums) from being greater than 100%.
error FeeBasisPointsExceedHalfMax(uint256 actual, uint256 expected);

/// @dev The total fees can never exceed the premium payment or the marketplace trade.
Expand All @@ -94,7 +100,9 @@ error FeeBasisPointsExceedMax(uint256 actual, uint256 expected);
error UtilizedCapacityGreaterThanMaxCapacity(uint256 utilizedCapacity, uint256 maxCapacity);

/// @dev Policy stakeholder signature validation failed
error SimplePolicyStakeholderSignatureInvalid(bytes32 signingHash, bytes signature, bytes32 signerId, bytes32 signersParent, bytes32 entityId);
error SimplePolicyStakeholderSignatureInvalid(
bytes32 signingHash, bytes signature, bytes32 signerId, bytes32 signersParent, bytes32 entityId
);

/// @dev When creating a simple policy, the total claims paid should start at 0.
error SimplePolicyClaimsPaidShouldStartAtZero();
Expand All @@ -111,7 +119,8 @@ error PolicyDoesNotExist(bytes32 policyId);
/// @dev It is not possible to cancel policyId after maturation date has passed
error PolicyCannotCancelAfterMaturation(bytes32 policyId);

/// @dev There is a duplicate address in the list of signers (the previous signer in the list is not < the next signer in the list).
/// @dev There is a duplicate address in the list of signers (the previous signer in the list is not < the next signer
/// in the list).
error DuplicateSignerCreatingSimplePolicy(address previousSigner, address nextSigner);

/// @dev The minimum sell amount on the marketplace cannot be zero.
Expand Down
2 changes: 1 addition & 1 deletion src/shared/FreeStructs.sol
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
pragma solidity 0.8.24;
2 changes: 1 addition & 1 deletion src/shared/Modifiers.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
pragma solidity 0.8.24;

/// @notice modifiers

Expand Down

0 comments on commit a026edd

Please sign in to comment.