Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function setMinterManager should verify the input #449

Open
gzliudan opened this issue Apr 15, 2024 · 0 comments
Open

function setMinterManager should verify the input #449

gzliudan opened this issue Apr 15, 2024 · 0 comments

Comments

@gzliudan
Copy link

gzliudan commented Apr 15, 2024

The function setMinterManager does not verify if the input parameter _newMinterManager implements MinterManagementInterface now. So the variable minterManager maybe set to the wrong value by accident.

    function setMinterManager(address _newMinterManager) public onlyOwner {
        emit MinterManagerSet(address(minterManager), _newMinterManager);
        minterManager = MinterManagementInterface(_newMinterManager);
    }

I suggest the following new codes:

    function setMinterManager(address _newMinterManager) public onlyOwner {
        require(
            !MinterManagementInterface(_newMinterManager).isMinter(address(0)),
            "invalid minter mangaer"
        );
        emit MinterManagerSet(address(minterManager), _newMinterManager);
        minterManager = MinterManagementInterface(_newMinterManager);
    }

Or check it by ERC-165.

@gzliudan gzliudan changed the title Bug: function setMinterManager not verify the input parameter _newMinterManager Suggest: function setMinterManager verify the input parameter Apr 15, 2024
@gzliudan gzliudan changed the title Suggest: function setMinterManager verify the input parameter function setMinterManager should verify the input parameter Apr 15, 2024
@gzliudan gzliudan changed the title function setMinterManager should verify the input parameter function setMinterManager should verify the input Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant