Skip to content

Commit

Permalink
refactor: abi.encodePacked => abi.encode
Browse files Browse the repository at this point in the history
  • Loading branch information
b00ste committed Sep 5, 2023
1 parent 4599e20 commit c2698ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
11 changes: 3 additions & 8 deletions contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ abstract contract LSP7DigitalAssetCore is ILSP7DigitalAsset {
data
);

bytes memory lsp1Data = abi.encodePacked(address(0), to, amount, data);
bytes memory lsp1Data = abi.encode(address(0), to, amount, data);
_notifyTokenReceiver(to, allowNonLSP1Recipient, lsp1Data);
}

Expand Down Expand Up @@ -416,12 +416,7 @@ abstract contract LSP7DigitalAssetCore is ILSP7DigitalAsset {

emit Transfer(operator, from, address(0), amount, false, data);

bytes memory lsp1Data = abi.encodePacked(
from,
address(0),
amount,
data
);
bytes memory lsp1Data = abi.encode(from, address(0), amount, data);
_notifyTokenSender(from, lsp1Data);
}

Expand Down Expand Up @@ -473,7 +468,7 @@ abstract contract LSP7DigitalAssetCore is ILSP7DigitalAsset {

emit Transfer(operator, from, to, amount, allowNonLSP1Recipient, data);

bytes memory lsp1Data = abi.encodePacked(from, to, amount, data);
bytes memory lsp1Data = abi.encode(from, to, amount, data);

_notifyTokenSender(from, lsp1Data);
_notifyTokenReceiver(to, allowNonLSP1Recipient, lsp1Data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ abstract contract LSP8IdentifiableDigitalAssetCore is
data
);

bytes memory lsp1Data = abi.encodePacked(address(0), to, tokenId, data);
bytes memory lsp1Data = abi.encode(address(0), to, tokenId, data);
_notifyTokenReceiver(to, allowNonLSP1Recipient, lsp1Data);
}

Expand Down Expand Up @@ -389,7 +389,7 @@ abstract contract LSP8IdentifiableDigitalAssetCore is

emit Transfer(operator, tokenOwner, address(0), tokenId, false, data);

bytes memory lsp1Data = abi.encodePacked(
bytes memory lsp1Data = abi.encode(
tokenOwner,
address(0),
tokenId,
Expand Down Expand Up @@ -453,7 +453,7 @@ abstract contract LSP8IdentifiableDigitalAssetCore is

emit Transfer(operator, from, to, tokenId, allowNonLSP1Recipient, data);

bytes memory lsp1Data = abi.encodePacked(from, to, tokenId, data);
bytes memory lsp1Data = abi.encode(from, to, tokenId, data);

_notifyTokenSender(from, lsp1Data);
_notifyTokenReceiver(to, allowNonLSP1Recipient, lsp1Data);
Expand Down

0 comments on commit c2698ab

Please sign in to comment.