External Oracle
External oracles may be used in the protocol. They must conform to the IOracle interface. Oracles must be of approved or denied style where the user address is checked for approval or denial.
Required functions for the External Oracle
Denial Oracle
Approval Oracle
NOTE: It is not necessary to implement the IOracle interface in the external oracle. The correct function needs only to exist within it.
Sample implementations for each of the above functions can be found in the example oracle contracts.
see OracleApproved
see OracleDenied
Process for using an external oracle
External oracles are used in conjunction with Account Approve Deny Oracle Rule. The external oracle is created and its deployed address is noted. When the Account Approve Deny Oracle Rule is created, this address is used in the _oracleAddress parameter whereas _oracleType corresponds to approved or denied type(0 for denied, 1 for approved).
see Account Approve Deny Oracle Rule
Once the this rule is created, it can then be applied like any other rule. The process is as follows:
-
- Deploy the external oracle.
-
- Create the rule specifying the _oracleAddress and _oracleType. See Account Approve Deny Oracle Rule for details.
-
- Apply the rule to the desired token’s handler. See Account Approve Deny Oracle Rule for details.