Modifiers
onlyEOAEx()
This modifier ensures that the function is called from an externally owned account (EOA) when the allowContractCalls
variable is set to false
and the caller is not whitelisted. If the caller is a contract and is not whitelisted, the modifier will revert with an error message.
Parameters
None
Errors
NOT_EOA(address)
- If the caller is a contract and is not whitelisted, this error is thrown.
Example Usage
onlyWhitelistedToken(address token)
This modifier ensures that the token is already whitelisted. If the token is not whitelisted, the modifier will revert with an error message.
Parameters
token
- The address of the token to check if it's whitelisted.
Errors
TOKEN_NOT_WHITELISTED(address)
- If the token is not whitelisted, this error is thrown.
Example Usage
lock()
This modifier ensures that the function is not reentrant. If the function is currently being executed, the modifier will revert with an error message.
Parameters
None
Errors
LOCKED()
- If the function is currently being executed, this error is thrown.
Example Usage
inExec()
This modifier ensures that the function is called from within the execution scope. The POSITION_ID
must be set to a non-zero value and the SPELL
variable must be set to the address of the calling contract. If the function is currently being executed or the execution scope has not been set, the modifier will revert with an error message.
Parameters
None
Errors
NOT_IN_EXEC()
- If the function is not called from within the execution scope, this error is thrown.NOT_FROM_SPELL(address)
- If the caller is not theSPELL
contract, this error is thrown.LOCKED()
- If the function is currently being executed or the execution scope has not been set, this error is thrown.
Example Usage
poke(address token)
This modifier ensures that the interest rate of the given token is accrued before executing the function. If the token's interest rate has not been accrued, the modifier will accrue the interest rate before executing the function.
Parameters
token
- The address of the token to accrue interest rate
Errors
None
Example Usage
Last updated