Skip to content

Commit 0286e2d

Browse files
authored
♻️ Fix pullOwner (#152)
1 parent 0eadedc commit 0286e2d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/DN404Mirror.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,14 +363,15 @@ contract DN404Mirror {
363363
address newOwner;
364364
address base = baseERC20();
365365
uint32 baseOwnerFunctionSelector = uint32(_baseOwnerFunctionSelector());
366+
DN404NFTStorage storage $ = _getDN404NFTStorage();
367+
address oldOwner = $.owner;
366368
/// @solidity memory-safe-assembly
367369
assembly {
368370
mstore(0x00, baseOwnerFunctionSelector)
369371
let success := staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x20)
370372
newOwner := mul(shr(96, mload(0x0c)), and(gt(returndatasize(), 0x1f), success))
373+
if iszero(success) { if shl(96, oldOwner) { revert(0x00, 0x00) } }
371374
}
372-
DN404NFTStorage storage $ = _getDN404NFTStorage();
373-
address oldOwner = $.owner;
374375
if (oldOwner != newOwner) {
375376
$.owner = newOwner;
376377
emit OwnershipTransferred(oldOwner, newOwner);

0 commit comments

Comments
 (0)