Skip to content

Commit

Permalink
Minor styling edits
Browse files Browse the repository at this point in the history
  • Loading branch information
cygaar committed Feb 10, 2024
1 parent 77c8bad commit d63e05c
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/DN404.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ abstract contract DN404 {
uint256 private constant _MAX_TOKEN_ID = 0xffffffff;

// approveNFT(address,uint256,address)
uint256 private constant APPROVE_NFT_SIG = 0xd10b6e0c;
uint256 private constant _APPROVE_NFT_SIG = 0xd10b6e0c;

// setApprovalForAll(address,bool,address)
uint256 private constant SET_APPROVAL_FOR_ALL_SIG = 0x813500fc;
uint256 private constant _SET_APPROVAL_FOR_ALL_SIG = 0x813500fc;

// transferFromNFT(address,address,uint256,address)
uint256 private constant TRANSFER_FROM_NFT_SIG = 0xe5eb36c8;
uint256 private constant _TRANSFER_FROM_NFT_SIG = 0xe5eb36c8;

struct AddressData {
// The alias for the address. Zero means absence of an alias.
Expand Down Expand Up @@ -168,9 +168,7 @@ abstract contract DN404 {
internal
virtual
{
DN404Storage storage $ = _getDN404Storage();

$.operatorApprovals[msgSender][operator] = approved;
_getDN404Storage().operatorApprovals[msgSender][operator] = approved;
}

function transferFrom(address from, address to, uint256 amount) external virtual {
Expand Down Expand Up @@ -245,9 +243,7 @@ abstract contract DN404 {
}

function sisterNftContract() external view returns (address) {
DN404Storage storage $ = _getDN404Storage();

return $.sisterNFTContract;
return _getDN404Storage().sisterNFTContract;
}

function _transfer(address from, address to, uint256 amount) internal returns (bool) {
Expand Down Expand Up @@ -371,7 +367,7 @@ abstract contract DN404 {
uint256 fnSelector = _calldataload(0) >> 224;
uint256 calldatasize = msg.data.length;

if (fnSelector == TRANSFER_FROM_NFT_SIG) {
if (fnSelector == _TRANSFER_FROM_NFT_SIG) {
if (calldatasize < 132) revert();

address from = address(uint160(_calldataload(4)));
Expand All @@ -380,7 +376,7 @@ abstract contract DN404 {
address msgSender = address(uint160(_calldataload(100)));

transferFromNFT(from, to, id, msgSender);
} else if (fnSelector == SET_APPROVAL_FOR_ALL_SIG) {
} else if (fnSelector == _SET_APPROVAL_FOR_ALL_SIG) {
if (calldatasize < 100) revert();

address spender = address(uint160(_calldataload(4)));
Expand All @@ -392,7 +388,7 @@ abstract contract DN404 {
address msgSender = address(uint160(_calldataload(68)));

setApprovalForAll(spender, status, msgSender);
} else if (fnSelector == APPROVE_NFT_SIG) {
} else if (fnSelector == _APPROVE_NFT_SIG) {
if (calldatasize < 100) revert();

address spender = address(uint160(_calldataload(4)));
Expand Down

0 comments on commit d63e05c

Please sign in to comment.