Skip to content

Commit

Permalink
allow for first cut
Browse files Browse the repository at this point in the history
  • Loading branch information
LayneHaber committed Jun 26, 2022
1 parent 14df4c6 commit 8f0061e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ library LibDiamond {
address _init,
bytes memory _calldata
) internal {
uint256 time = diamondStorage().acceptanceTimes[keccak256(abi.encode(_diamondCut))];
require(time > 0 && time < block.timestamp, "LibDiamond: delay not elapsed");
DiamondStorage storage ds = diamondStorage();
if (ds.facetAddresses.length != 0) {
uint256 time = ds.acceptanceTimes[keccak256(abi.encode(_diamondCut))];
require(time > 0 && time < block.timestamp, "LibDiamond: delay not elapsed");
} // Otherwise, this is the first instance of deployment and it can be set automatically
for (uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++) {
IDiamondCut.FacetCutAction action = _diamondCut[facetIndex].action;
if (action == IDiamondCut.FacetCutAction.Add) {
Expand Down

0 comments on commit 8f0061e

Please sign in to comment.