Skip to content

Commit

Permalink
♻️ ERC1155: memory -> calldata
Browse files Browse the repository at this point in the history
  • Loading branch information
transmissions11 committed Apr 9, 2022
1 parent 8eef117 commit 5d56a1f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
58 changes: 29 additions & 29 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,43 @@ DSTestPlusTest:testBound() (gas: 16777)
DSTestPlusTest:testFailBoundMinBiggerThanMax() (gas: 309)
DSTestPlusTest:testRelApproxEqBothZeroesPasses() (gas: 413)
ERC1155Test:testApproveAll() (gas: 31009)
ERC1155Test:testBatchBalanceOf() (gas: 158291)
ERC1155Test:testBatchBurn() (gas: 151091)
ERC1155Test:testBatchMintToEOA() (gas: 137342)
ERC1155Test:testBatchMintToERC1155Recipient() (gas: 942662)
ERC1155Test:testBatchBalanceOf() (gas: 157636)
ERC1155Test:testBatchBurn() (gas: 151074)
ERC1155Test:testBatchMintToEOA() (gas: 137337)
ERC1155Test:testBatchMintToERC1155Recipient() (gas: 942650)
ERC1155Test:testBurn() (gas: 38598)
ERC1155Test:testFailBalanceOfBatchWithArrayMismatch() (gas: 9294)
ERC1155Test:testFailBatchBurnInsufficientBalance() (gas: 136173)
ERC1155Test:testFailBatchBurnWithArrayLengthMismatch() (gas: 135565)
ERC1155Test:testFailBatchMintToNonERC1155Recipient() (gas: 167304)
ERC1155Test:testFailBatchMintToRevertingERC1155Recipient() (gas: 358823)
ERC1155Test:testFailBatchMintToWrongReturnDataERC1155Recipient() (gas: 310755)
ERC1155Test:testFailBatchMintToZero() (gas: 131742)
ERC1155Test:testFailBatchMintWithArrayMismatch() (gas: 9618)
ERC1155Test:testFailBalanceOfBatchWithArrayMismatch() (gas: 7936)
ERC1155Test:testFailBatchBurnInsufficientBalance() (gas: 136156)
ERC1155Test:testFailBatchBurnWithArrayLengthMismatch() (gas: 135542)
ERC1155Test:testFailBatchMintToNonERC1155Recipient() (gas: 167292)
ERC1155Test:testFailBatchMintToRevertingERC1155Recipient() (gas: 358811)
ERC1155Test:testFailBatchMintToWrongReturnDataERC1155Recipient() (gas: 310743)
ERC1155Test:testFailBatchMintToZero() (gas: 131737)
ERC1155Test:testFailBatchMintWithArrayMismatch() (gas: 9600)
ERC1155Test:testFailBurnInsufficientBalance() (gas: 34852)
ERC1155Test:testFailMintToNonERC155Recipient() (gas: 68191)
ERC1155Test:testFailMintToRevertingERC155Recipient() (gas: 259435)
ERC1155Test:testFailMintToWrongReturnDataERC155Recipient() (gas: 259389)
ERC1155Test:testFailMintToZero() (gas: 33705)
ERC1155Test:testFailSafeBatchTransferFromToNonERC1155Recipient() (gas: 837593)
ERC1155Test:testFailSafeBatchTransferFromToRevertingERC1155Recipient() (gas: 1029131)
ERC1155Test:testFailSafeBatchTransferFromToWrongReturnDataERC1155Recipient() (gas: 981047)
ERC1155Test:testFailSafeBatchTransferFromToZero() (gas: 802042)
ERC1155Test:testFailSafeBatchTransferFromWithArrayLengthMismatch() (gas: 677324)
ERC1155Test:testFailSafeBatchTransferInsufficientBalance() (gas: 678285)
ERC1155Test:testFailSafeTransferFromInsufficientBalance() (gas: 575455)
ERC1155Test:testFailSafeTransferFromSelfInsufficientBalance() (gas: 34456)
ERC1155Test:testFailSafeTransferFromToNonERC155Recipient() (gas: 96670)
ERC1155Test:testFailSafeTransferFromToRevertingERC1155Recipient() (gas: 287891)
ERC1155Test:testFailSafeTransferFromToWrongReturnDataERC1155Recipient() (gas: 239747)
ERC1155Test:testFailSafeTransferFromToZero() (gas: 62167)
ERC1155Test:testFailSafeBatchTransferFromToNonERC1155Recipient() (gas: 834839)
ERC1155Test:testFailSafeBatchTransferFromToRevertingERC1155Recipient() (gas: 1026377)
ERC1155Test:testFailSafeBatchTransferFromToWrongReturnDataERC1155Recipient() (gas: 978293)
ERC1155Test:testFailSafeBatchTransferFromToZero() (gas: 800000)
ERC1155Test:testFailSafeBatchTransferFromWithArrayLengthMismatch() (gas: 676125)
ERC1155Test:testFailSafeBatchTransferInsufficientBalance() (gas: 676999)
ERC1155Test:testFailSafeTransferFromInsufficientBalance() (gas: 575296)
ERC1155Test:testFailSafeTransferFromSelfInsufficientBalance() (gas: 34297)
ERC1155Test:testFailSafeTransferFromToNonERC155Recipient() (gas: 96510)
ERC1155Test:testFailSafeTransferFromToRevertingERC1155Recipient() (gas: 287731)
ERC1155Test:testFailSafeTransferFromToWrongReturnDataERC1155Recipient() (gas: 239587)
ERC1155Test:testFailSafeTransferFromToZero() (gas: 62014)
ERC1155Test:testMintToEOA() (gas: 34765)
ERC1155Test:testMintToERC1155Recipient() (gas: 608328)
ERC1155Test:testSafeBatchTransferFromToEOA() (gas: 813304)
ERC1155Test:testSafeBatchTransferFromToERC1155Recipient() (gas: 1638477)
ERC1155Test:testSafeTransferFromSelf() (gas: 64328)
ERC1155Test:testSafeTransferFromToEOA() (gas: 605369)
ERC1155Test:testSafeTransferFromToERC1155Recipient() (gas: 1198616)
ERC1155Test:testSafeBatchTransferFromToEOA() (gas: 811268)
ERC1155Test:testSafeBatchTransferFromToERC1155Recipient() (gas: 1635623)
ERC1155Test:testSafeTransferFromSelf() (gas: 64177)
ERC1155Test:testSafeTransferFromToEOA() (gas: 605218)
ERC1155Test:testSafeTransferFromToERC1155Recipient() (gas: 1198352)
ERC20Test:testApprove() (gas: 31058)
ERC20Test:testBurn() (gas: 56970)
ERC20Test:testFailPermitBadDeadline() (gas: 36924)
Expand Down
10 changes: 5 additions & 5 deletions src/tokens/ERC1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ abstract contract ERC1155 {
address to,
uint256 id,
uint256 amount,
bytes memory data
bytes calldata data
) public virtual {
require(msg.sender == from || isApprovedForAll[from][msg.sender], "NOT_AUTHORIZED");

Expand All @@ -78,9 +78,9 @@ abstract contract ERC1155 {
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) public virtual {
uint256 idsLength = ids.length; // Saves MLOADs.

Expand Down Expand Up @@ -117,7 +117,7 @@ abstract contract ERC1155 {
);
}

function balanceOfBatch(address[] memory owners, uint256[] memory ids)
function balanceOfBatch(address[] calldata owners, uint256[] calldata ids)
public
view
virtual
Expand Down

0 comments on commit 5d56a1f

Please sign in to comment.