Oracle Configuration
Oracles may be used with the protocol to provide approved and/or denied lists. These oracles are used in conjunction with either the Account Approve Deny Oracle Rule or the Account Approve Deny Oracle Flexible Rule, which are created and applied like any other rule. Up to ten oracle rules may be applied per action. The protocol provides example oracle contracts (OracleApproved, OracleDenied) or external oracles can be created to suit the use case.
Approval List Oracle
OracleApproved allows for addresses to be added/removed from an internal list that is then checked by the Account Approve Deny Oracle Rule during the applied user action when the rule’s _oracleType is 1.
Add Functions
Remove Functions
Check Functions
Parameters:
- newApprove (address): new approved address.
- newApproves (address[]): array of approved addresses.
- removeApprove (address): address to remove from approval list
- addr (address): address to check for approval
Parameter Optionality:
There are no options for the parameters of the add or remove functions.
The implementations for each of the above functions can be found in the OracleApproved contract.
Denial List Oracle
OracleDenied allows for addresses to be added/removed from an internal list that is then checked by the Account Approve Deny Oracle Rule during the applied user action when the rule’s oracleType is 0.
Add Functions
Remove Functions
Check Functions
Parameters:
- newDeniedAddr (address): new denied address.
- newDeniedAddrs (address[]): array of denied addresses.
- removeDeniedAddr (address): address to remove from denied list
- removeDeniedAddrs (address[]): addresses to remove from denied list
- addr (address): address to check for denial
Parameter Optionality:
There are no options for the parameters of the add or remove functions.
The implementations for each of the above functions can be found in the OracleDenied contract.
Upgrading:
To upgrade to a new oracle address first create a new AccountApproveOrDenyOracle
rule or AccountApproveOrDenyOracleFlexible
rule with the new oracle type and address. This requires the new oracle address to be deployed and conform to the IOracle interface. Add the new rule with the Rule Processor Diamond and use the protocol generated ruleId
to set the new oracle rule within the asset handler to be upgraded.
Process for switching to an external access level provider
See External Oracle for details.