Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 621bbfb

Browse files
committedJan 16, 2025·
T
1 parent 9918898 commit 621bbfb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed
 

‎src/DN404Mirror.sol

+7-7
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ contract DN404Mirror {
353353
/// @dev Returns the address of the base DN404 contract.
354354
function baseERC20() public view virtual returns (address base) {
355355
base = _getDN404NFTStorage().baseERC20;
356-
if (base == address(0)) _revert(uint32(NotLinked.selector));
356+
if (base == address(0)) _rv(uint32(NotLinked.selector));
357357
}
358358

359359
/// @dev Fallback modifier to execute calls from the base DN404 contract.
@@ -364,7 +364,7 @@ contract DN404Mirror {
364364

365365
// `logTransfer(uint256[])`.
366366
if (fnSelector == 0x263c69d6) {
367-
if (msg.sender != $.baseERC20) _revert(uint32(SenderNotBase.selector));
367+
if (msg.sender != $.baseERC20) _rv(uint32(SenderNotBase.selector));
368368
/// @solidity memory-safe-assembly
369369
assembly {
370370
let o := add(0x24, calldataload(0x04)) // Packed logs offset.
@@ -388,7 +388,7 @@ contract DN404Mirror {
388388
}
389389
// `logDirectTransfer(address,address,uint256[])`.
390390
if (fnSelector == 0x144027d3) {
391-
if (msg.sender != $.baseERC20) _revert(uint32(SenderNotBase.selector));
391+
if (msg.sender != $.baseERC20) _rv(uint32(SenderNotBase.selector));
392392
/// @solidity memory-safe-assembly
393393
assembly {
394394
let from := calldataload(0x04)
@@ -406,10 +406,10 @@ contract DN404Mirror {
406406
if (fnSelector == 0x0f4599e5) {
407407
if ($.deployer != address(0)) {
408408
if (address(uint160(_calldataload(0x04))) != $.deployer) {
409-
_revert(uint32(SenderNotDeployer.selector));
409+
_rv(uint32(SenderNotDeployer.selector));
410410
}
411411
}
412-
if ($.baseERC20 != address(0)) _revert(uint32(AlreadyLinked.selector));
412+
if ($.baseERC20 != address(0)) _rv(uint32(AlreadyLinked.selector));
413413
$.baseERC20 = msg.sender;
414414
/// @solidity memory-safe-assembly
415415
assembly {
@@ -425,7 +425,7 @@ contract DN404Mirror {
425425
/// fallback with utilities like Solady's `LibZip.cdFallback()`.
426426
/// And always remember to always wrap the fallback with `dn404NFTFallback`.
427427
fallback() external payable virtual dn404NFTFallback {
428-
_revert(uint32(FnSelectorNotRecognized.selector)); // Not mandatory. Just for quality of life.
428+
_rv(uint32(FnSelectorNotRecognized.selector)); // Not mandatory. Just for quality of life.
429429
}
430430

431431
/// @dev This is to silence the compiler warning.
@@ -507,7 +507,7 @@ contract DN404Mirror {
507507
}
508508

509509
/// @dev More bytecode-efficient way to revert.
510-
function _revert(uint32 s) private pure {
510+
function _rv(uint32 s) private pure {
511511
/// @solidity memory-safe-assembly
512512
assembly {
513513
mstore(0x00, s)

0 commit comments

Comments
 (0)
Please sign in to comment.