Skip to content

Commit

Permalink
Merge pull request #660 from ubiquity/revert-655-development
Browse files Browse the repository at this point in the history
Revert "Resolves #647 - Use EIP-1967"
  • Loading branch information
rndquu authored May 28, 2023
2 parents 8072e38 + a483ba1 commit 741c336
Showing 1 changed file with 11 additions and 32 deletions.
43 changes: 11 additions & 32 deletions packages/contracts/src/dollar/libraries/LibAppStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,6 @@ contract Modifiers {
* @dev Works identically to OZ's nonReentrant.
* @dev Used to avoid state storage collision within diamond.
*/
// Getters and setters for each variable in AppStorage

function getDollarTokenAddress() internal view returns (address) {
return LibAppStorage.appStorage().dollarTokenAddress;
}

function setDollarTokenAddress(address newValue) internal {
LibAppStorage.appStorage().dollarTokenAddress = newValue;
}

function getCreditNftAddress() internal view returns (address) {
return LibAppStorage.appStorage().creditNftAddress;
}

function setCreditNftAddress(address newValue) internal {
LibAppStorage.appStorage().creditNftAddress = newValue;
}

// Implement getters and setters for other variables in AppStorage

modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
Expand All @@ -96,7 +77,15 @@ contract Modifiers {
LibDiamond.enforceIsContractOwner();
_;
}


modifier onlyCreditNFTManager() {
require(
LibAccessControl.hasRole(CREDIT_NFT_MANAGER_ROLE, msg.sender),
"Caller is not a Credit NFT manager"
);
_;
}

modifier onlyAdmin() {
require(
LibAccessControl.hasRole(DEFAULT_ADMIN_ROLE, msg.sender),
Expand Down Expand Up @@ -128,17 +117,8 @@ contract Modifiers {
*
* - The contract must not be paused.
*/

modifier onlyCreditNFTManager() {
require(
LibAccessControl.hasRole(CREDIT_NFT_MANAGER_ROLE, msg.sender),
"Caller is not a Credit NFT manager"
);
_;
}

modifier whenNotPaused() {
require(!LibAppStorage.appStorage().paused, "Pausable: paused");
require(!LibAccessControl.paused(), "Pausable: paused");
_;
}

Expand All @@ -150,7 +130,7 @@ contract Modifiers {
* - The contract must be paused.
*/
modifier whenPaused() {
require(LibAppStorage.appStorage().paused, "Pausable: not paused");
require(LibAccessControl.paused(), "Pausable: not paused");
_;
}

Expand Down Expand Up @@ -194,4 +174,3 @@ contract Modifiers {
_;
}
}

1 comment on commit 741c336

@ubiquibot
Copy link

@ubiquibot ubiquibot bot commented on 741c336 May 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.