0

I have the supply key of the token but it has no admin key so I cannot change its ownership and make it owned by the smart contract.

2 Answers 2

1

If the Token is an ERC-20 token, its mint function would be "internal" and can be called by the token contract itself, our any child contract that inherited from the token contract. See the following code:

function _mint(address account, uint256 value) internal {
    if (account == address(0)) {
        revert ERC20InvalidReceiver(address(0));
    }
    _update(address(0), account, value);
}

So if you write a minter smart contract and inherit that from token contract, you must be able to call mint function of token.

see below link to see code samples:

HederaTokenService.sol

1

In most cases, a smart contract cannot mint tokens it does not own, unless it has explicit permissions. Token minting is typically restricted to the contract owner or authorized addresses. If a token contract lacks an admin key, standard minting functions won't be available. However, custom functionalities or permissions may allow external contracts to mint under specific conditions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.