Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow overriding of ERC1155 functions #2263

Merged
merged 2 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions contracts/mocks/ERC1155Mock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,4 @@ contract ERC1155Mock is ERC1155 {
function burnBatch(address owner, uint256[] memory ids, uint256[] memory values) public {
_burnBatch(owner, ids, values);
}

function doSafeTransferAcceptanceCheck(address operator, address from, address to, uint256 id, uint256 value, bytes memory data) public {
_doSafeTransferAcceptanceCheck(operator, from, to, id, value, data);
}

function doSafeBatchTransferAcceptanceCheck(address operator, address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data) public {
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, values, data);
}
}
24 changes: 11 additions & 13 deletions contracts/token/ERC1155/ERC1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ contract ERC1155 is ERC165, IERC1155
* @param operator address to set the approval
* @param approved representing the status of the approval to be set
*/
function setApprovalForAll(address operator, bool approved) external override virtual {
function setApprovalForAll(address operator, bool approved) public virtual override {
require(msg.sender != operator, "ERC1155: cannot set approval status for self");
_operatorApprovals[msg.sender][operator] = approved;
emit ApprovalForAll(msg.sender, operator, approved);
Expand Down Expand Up @@ -130,11 +130,11 @@ contract ERC1155 is ERC165, IERC1155
address to,
uint256 id,
uint256 value,
bytes calldata data
bytes memory data
)
external
override
public
virtual
override
{
require(to != address(0), "ERC1155: target address must be non-zero");
require(
Expand Down Expand Up @@ -164,13 +164,13 @@ contract ERC1155 is ERC165, IERC1155
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
uint256[] memory ids,
uint256[] memory values,
bytes memory data
)
external
override
public
virtual
override
{
require(ids.length == values.length, "ERC1155: IDs and values must have same lengths");
require(to != address(0), "ERC1155: target address must be non-zero");
Expand Down Expand Up @@ -275,8 +275,7 @@ contract ERC1155 is ERC165, IERC1155
uint256 value,
bytes memory data
)
internal
virtual
private
{
if(to.isContract()) {
require(
Expand All @@ -295,8 +294,7 @@ contract ERC1155 is ERC165, IERC1155
uint256[] memory values,
bytes memory data
)
internal
virtual
private
{
if(to.isContract()) {
require(
Expand Down