-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved functions for adding/replacing/removing functions
- Loading branch information
Showing
14 changed files
with
90 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.7.1; | ||
pragma solidity ^0.7.6; | ||
pragma experimental ABIEncoderV2; | ||
|
||
/******************************************************************************\ | ||
* Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen) | ||
* EIP-2535 Diamond Standard: https://eips.ethereum.org/EIPS/eip-2535 | ||
/******************************************************************************/ | ||
|
||
|
||
import "../interfaces/IDiamondCut.sol"; | ||
import "../libraries/LibDiamond.sol"; | ||
|
||
|
@@ -24,14 +23,6 @@ contract DiamondCutFacet is IDiamondCut { | |
bytes calldata _calldata | ||
) external override { | ||
LibDiamond.enforceIsContractOwner(); | ||
for (uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++) { | ||
LibDiamond.addReplaceRemoveFacetSelectors( | ||
_diamondCut[facetIndex].facetAddress, | ||
_diamondCut[facetIndex].action, | ||
_diamondCut[facetIndex].functionSelectors | ||
); | ||
} | ||
emit DiamondCut(_diamondCut, _init, _calldata); | ||
LibDiamond.initializeDiamondCut(_init, _calldata); | ||
LibDiamond.diamondCut(_diamondCut, _init, _calldata); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters