Skip to content

Instantly share code, notes, and snippets.

@jmsaavedra
Created September 11, 2023 23:24
Show Gist options
  • Save jmsaavedra/e3894ec53305a5e790f87fcf4afb1b84 to your computer and use it in GitHub Desktop.
Save jmsaavedra/e3894ec53305a5e790f87fcf4afb1b84 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: Infinite Objects
import "@manifoldxyz/libraries-solidity/contracts/access/AdminControl.sol";
import "@manifoldxyz/creator-core-solidity/contracts/core/IERC1155CreatorCore.sol";
import "@manifoldxyz/creator-core-solidity/contracts/extensions/ERC1155/IERC1155CreatorExtensionApproveTransfer.sol";
contract IoSingleTransferExt is AdminControl, IERC1155CreatorExtensionApproveTransfer{
/**
* @dev Set whether or not the creator contract will check the extension for approval of token transfer
*/
function setApproveTransfer(address creator, bool enabled) external override adminRequired {
}
/**
* @dev Called by creator contract to approve a transfer
*/
function approveTransfer(address operator, address from, address to, uint256[] calldata tokenIds, uint256[] calldata amounts) external returns (bool) {
require(isAdmin(msg.sender), "Only contract owner can transfer the token");
return IERC1155CreatorExtensionApproveTransfer(operator).approveTransfer(operator, from, to, tokenIds, amounts);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment