/** * @title BreakerBox * @notice The BreakerBox checks the criteria defined in separate breaker contracts * to determine whether or not buying or selling should be allowed for a * specified rateFeedIDs. The contract stores references to all breakers * that hold criteria to be checked, rateFeedIDs that * can make use of the BreakerBox & their current trading. */ contract BreakerBox is IBreakerBox, Ownable { using SafeMath for uint256; /* ==================== State Variables ==================== */ address[] public rateFeedIDs; // Maps a rate feed to a boolean indicating whether it has been added to the BreakerBox. mapping(address => bool) public rateFeedStatus; // Maps a rate feed to its breakers and their breaker status. (rateFeedID => (breaker => BreakerStatus) mapping(address => mapping(address => BreakerStatus)) public rateFeedBreakerStatus; // Maps a rate feed to the associated trading mode. mapping(address => uint8) public rateFeedTradingMode; // Maps a rate feed to its dependent rate feeds. mapping(address => address[]) public rateFeedDependencies; // Maps a breaker to the associated trading mode it should activate when triggered. mapping(address => uint8) public breakerTradingMode; // List of breakers to be checked. address[] public breakers; // Address of the Mento SortedOracles contract ISortedOracles public sortedOracles; // -- Code omitted for brevity -- // }