Overview
Purpose
The purpose of oracles within the protocol is to give applications flexibility in creating, maintaining, and using user address approval and denial lists.
Oracles may be used with the protocol to provide approved and/or denied lists. These oracles are used in conjunction with the Account Approve Deny Oracle Rule which is 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.
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.
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.
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
Oracle Rules
Oracle Rules | Purpose |
---|---|
Oracle | The purpose of the account-approve-deny-oracle rule is to check if an address in the transaction is an approved or denied address. Addresses are added to the oracle lists by the owner of the oracle contract for any reason that the owner deems necessary. Oracle rules are applied per action type and for burn and sell actions the sender address is checked. For all other actions, the receiver address is checked. If an address is not on an approved oracle list, they will be denied from receiving application tokens. This rule can be used to restrict transfers to only specific contract addresses or wallets that are approved by the oracle owner. An example is NFT exchanges that support ERC2981 royalty payments. The deny list is designed as a tool to reduce the risk of malicious actors in the ecosystem. If an address is on the deny oracle list they are denied receiving tokens. Any address not on the deny list will pass this rule check. |