0

In onlyMinter(), there is a line with only _;. I'm having troubles adding a minter address, so I'm just checking the various contracts that go into ERC721. The function is

modifier onlyMinter() {
    require(isMinter(msg.sender));
    _;
}

What does _; do? Is it an error?

marked as duplicate by Ismael, Richard Horrocks, Rosco Kalis, Achala Dissanayake, shane Jan 20 at 18:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

Modifier code is merged with the modified function. _ is the wildcard that tells the compiler where to put the function code relative to the modifier code.

Have a look over here for explanation, examples: Using a modifier as a function in Solidity

Hope it helps.

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