Closed YingQm closed 2 years ago
In Diamond.sol fallback function
LibDiamond.DiamondStorage storage ds; bytes32 position = LibDiamond.DIAMOND_STORAGE_POSITION; // get diamond storage assembly { ds.slot := position }
why not use LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();?
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
Because using LibDiamond.diamondStorage() costs a bit more gas and the fallback is very frequently called.
LibDiamond.diamondStorage()
In Diamond.sol fallback function
why not use
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
?