That’s very good question and concern. And I think I am confident to also give you a good answer:
There is multiple ways to do permission. Centralized admin-role based permission is only one way.
here are other ways
- Allowing auto-sale via native ETHs or exchange of other ERC721 / ERC20
contract SomeNFT {
const uint256 CHARGE = ...;
fallback() {
require(msg.value > CHARGE);
mint(nextId, ...);
// increase nextId etc;
}
}
In this contract above, anyone who send a native ETH of that evm chain above the CHARGE
will be minted one NFT, no admin permission is involved.
1b. Variant of 1, auto-sale via receiving ERC20*/ERC721/ERC1155. assuming the name of token is called “GoldToken”
contract SomeNFT is ERC1155TokenReceiver {
function OnERC1155TokenReceived(
address operator, address from, address to, uint256 tokenId, uint256 amount, bytes calldata data) {
require(operator == intendedAddressOfGoldToken);
require(amount >= CHARGE);
mint(…);
}
}
- Authorized Minting via a Smart Proposal(EIP-5247)
struct Proposal {
uint256 id;
address contract;
bytes memory txForMint;
}
contract SomeDAO {
function execute(Proposal proposal) public onlyPassed {
require(_isProposalPassedAndLocked(proposal.id));
address erc721 = proposal.contract;
erc721.call(txForMint);
}
}
In this contract, a DAO can agree to mint one or many tokens but based on a Smart Proposal which can be voted upon.
- Allow a mint but endorsed by Admin via Smart Endorsement(EIP-5453)
contract SomeNFT {
function mint(...) public onlyEndorsedByAdmin() {
...
}
}
In this contract, an admin can sign an offchain endorsement message but the claimer will actually create the transaction TX.
- Mint NFT via auctions
contract SomeNFT {
function commit() {
...
}
function bid(tokenId) { }
function mint(...) public onlyWonAuction() {
...
}
modifier onlyWonAuction {
// Code logic for msg.sender has valid committed bid price
// Code logic for msg.sender has bid highest price within the a deadline
}
}