Questions tagged [modifiers]
The modifiers tag has no usage guidance.
5
questions
66
votes
2answers
24k views
Solidity: What is the difference between `view` and `constant`?
Solidity 0.4.16 introduced the view and constant function modifiers. The documentation says:
constant for functions: Same as view.
Does this mean view is just an alias for constant? If so, why do ...
42
votes
1answer
11k views
Are underscores `_` in modifiers code or are they just meant to look cool?
I often see _ in modifiers
modifier onlyOwner() {
if (msg.sender != owner) throw;
_
}
Does it execute any code or is it meant to make the code easier to read ?
14
votes
1answer
1k views
Bad Jump Destination error
I wrote what I thought was a dead simple contract - a saving jar... you add value ("save") into the jar and when the balance of the contract reaches a certain amount ("target"), then I am able to ...
0
votes
0answers
45 views
Are function modifiers added to the stack in solidity? [duplicate]
I've got a function with a decent number of modifiers and I hit the CompilerError: Stack too deep, try removing local variables error. If I remove one of the modifiers though, everything's all right.
...
0
votes
1answer
139 views
Function modifier effect on return value
Having the following code
pragma solidity ^0.6.4;
contract TestModifier {
mapping (address => bool) public authorities;
mapping (address => address) public authorized;
modifier ...