AccessControlled
AccessControlledβ
The contract stores an admin address which is checked against msg.sender
in the onlyAdmin
modifier.
Additionally, a specific msg.sender
can be verified with the onlyCaller
modifier.
SetAdminβ
event SetAdmin(address admin)
logs new admin
of this
By emitting this data, an indexer will be able to keep track of what address is the admin of this contract.
Parametersβ
Name | Type | Description |
---|---|---|
admin | address | The new admin. |
_adminβ
address _admin
The admin address.
constructorβ
constructor(address admin_) public
AccessControlled
's constructor
Parametersβ
Name | Type | Description |
---|---|---|
admin_ | address | The address of the admin that can access privileged functions and also allowed to change the admin. Cannot be address(0) . |
onlyAdminβ
modifier onlyAdmin()
This modifier verifies that msg.sender
is the admin.
onlyCallerβ
modifier onlyCaller(address caller)
This modifier verifies that msg.sender
is the caller.
Parametersβ
Name | Type | Description |
---|---|---|
caller | address | The address of the caller that can access the modified function. |
adminOrCallerβ
modifier adminOrCaller(address caller)
This modifier verifies that msg.sender
is either caller or the admin
Parametersβ
Name | Type | Description |
---|---|---|
caller | address | The address of a caller that can access the modified function. |
adminβ
function admin() public view returns (address current)
Retrieves the current admin.
Return Valuesβ
Name | Type | Description |
---|---|---|
current | address | admin. |
setAdminβ
function setAdmin(address admin_) public
This sets the admin. Only the current admin can change the admin.
Parametersβ
Name | Type | Description |
---|---|---|
admin_ | address | The new admin. Cannot be address(0) . |