Git Source Inherits: Ownable, IOracleEvents Author: @ShaneDuncan602, @oscarsernarosero, @TJ-Everett This is an example on-chain oracle that maintains an approve list. This is intended to be a model only. It stores the approve list internally and returns bool true if address is in list.

State Variables

approvedAddresses

mapping(address => bool) private approvedAddresses;

Functions

constructor

Constructor that only serves the purpose of notifying the indexer of its creation via event
constructor();

name

Return the contract name
function name() external pure returns (string memory);
Returns
NameTypeDescription
<none>stringname the name of the contract

addToApprovedList

Add addresses to the approve list. Restricted to owner.
function addToApprovedList(address[] memory newApproves) public onlyOwner;
Parameters
NameTypeDescription
newApprovesaddress[]the addresses to add

addAddressToApprovedList

Add single address to the approve list. Restricted to owner.
function addAddressToApprovedList(address newApprove) public onlyOwner;
Parameters
NameTypeDescription
newApproveaddressthe addresses to add

removeFromAprovededList

Remove addresses from the approve list. Restricted to owner.
function removeFromAprovededList(address[] memory removeApproves) public onlyOwner;
Parameters
NameTypeDescription
removeApprovesaddress[]the addresses to remove

isApproved

Check to see if address is in approved list
function isApproved(address addr) public view returns (bool);
Parameters
NameTypeDescription
addraddressthe address to check
Returns
NameTypeDescription
<none>boolapproved returns true if in the approved list, false if not.

isApprovedVerbose

Check to see if address is in approved list. Also emits events based on the results
function isApprovedVerbose(address addr) public returns (bool);
Parameters
NameTypeDescription
addraddressthe address to check
Returns
NameTypeDescription
<none>boolapproved returns true if in the approved list, false if not.