Hello OpenZeppelin Community!
I've extended the openzeppelin ERC20 contract with some additional features that reflect the Crowdsale contract from 2.x but with a more recent version of solidity and the open zeppelin library. I was considering deploying a contract per user (gas intensive / expensive) when I came across the ERC1155 token it appears as though I can deploy one contract and allow my users to access a method in the contract to mint their own token (fungible token). So, I would like to extend the ERC1155 contract by adding the same methods I've added to the ERC20 contract but I will need to do it by ID and allow each user to control their token through methods that apply to their own token.
For example, the ERC1155 pausable contract here:
abstract contract ERC1155Pausable is ERC1155, Pausable {
/**
* @dev See {ERC1155-_beforeTokenTransfer}.
*
* Requirements:
*
* - the contract must not be paused.
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override {
super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
require(!paused(), "ERC1155Pausable: token transfer while paused");
}
}
I've only been writing smart contract for a couple of weeks, so forgive me if I'm misunderstanding but it appears as though this contract pauses all activity in the entire contract and therefore all tokens under the contract instance.
What I am trying to do is assign admin/control rights to an account as a one-to-one relationship with a token at a given id with various methods in the contract under their control.
1.) Is this an appropriate use case for the 1155 contract?
2.) What would you suggest as an approach to allowing an address to control a token as admin?
Any feedback and direction you can provide is greatly appreciated. I was happy to find this library as a solid starting point for building dApps!
Cheers,