If the original contract does not have this functionality built in, the only way to do this is to transfer ownership of the original contract to a new contract that looks something like this:
contract LimitedOwner is Ownable
{
OriginalContract public ownedTokenContract;
// Explicitly allow these functions to be called
function burn(uint256 _amount) onlyOwner
{
ownedTokenContract.burn(_amount);
}
function mint(address _address, uint256 _amount) onlyOwner
{
ownedTokenContract.mint(_address, _amount);
}
// All the original contract's owner-only functions that have not been
// implemented in this LimitedOwner contract can never be called again.
}
LimitedOwner
should not be able to call transferOwnership
on the original contract, because then the disabled functions could be re-enabled by transferring ownership away from the LimitedOwner
. Instead, the LimitedOwner
contract should have its own transferOwnership
function to keep the ability to transfer ownership and to further limit the owner's abilities in the future.
If your original contract had no transferOwnership
(or similar) function, it would not have been possible.
disable a function
,burn
,burn function
,mint
,mint function
,destroying the whole ownership
andownership
. Regardless of that, a typical answer in this case would be with code, so the exact question in question should be properly specified. Lastly, since the user has mentioned OZ in a response comment, it should be emphasized that: 1. OZ is not a standard (at least not yet). 2. OZ versions keep changing (specificallyOwnable
).