> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mystockline.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# HolidayCalendar

> HolidayCalendar is an append-only list of market holidays keyed by UTC day index (timestamp divided by 86400).

HolidayCalendar is an append-only list of market holidays keyed by UTC day index (timestamp divided by 86400). EquityOracle reads it to return DARK on holidays and their offsets. It can only force a haircut or a revert, never a live price. Days must be added at least one day in advance and cannot be removed.

`HolidayCalendar` lets you:

* Check whether a UTC day is a listed holiday
* Let the owner append future holidays
* Read the lockout constant and the owner

Addresses per network. Every address is also on [Addresses](/resources/addresses).

| Network                 | Address                                                                                                                                       |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Robinhood Chain testnet | [0x6B94075693a0c186a72701000926519A34F70673](https://explorer.testnet.chain.robinhood.com/address/0x6B94075693a0c186a72701000926519A34F70673) |

The source code is [`src/oracles/HolidayCalendar.sol`](https://github.com/stockline-xyz/contracts/blob/main/src/oracles/HolidayCalendar.sol) on GitHub. The ABI is [`/abis/HolidayCalendar.json`](/abis/HolidayCalendar.json).

## Write methods

### addHolidays

```solidity theme={"system"}
function addHolidays(uint32[] calldata days_) external
```

Appends UTC day indices to the holiday list. Owner only. Each day must start after the current time (HolidayNotFuture), at least `LOCKOUT` ahead (HolidayLockout), and not already be listed (HolidayAlreadySet).

<Warning>
  Owner only. Reverts with NotOwner otherwise. Holidays cannot be removed once added.
</Warning>

**Input parameters**

| Name   | Type       | Description                                                                |
| ------ | ---------- | -------------------------------------------------------------------------- |
| days\_ | `uint32[]` | Array of UTC day indices, each equal to a Unix timestamp divided by 86400. |

## Events

### HolidayAdded

```solidity theme={"system"}
event HolidayAdded(uint32 day)
```

Fires once for every day added.

## Errors

### NotOwner

```solidity theme={"system"}
error NotOwner()
```

The caller is not the owner, or the constructor owner was zero.

### HolidayNotFuture

```solidity theme={"system"}
error HolidayNotFuture(uint32 day)
```

The day starts at or before the current block time.

### HolidayLockout

```solidity theme={"system"}
error HolidayLockout(uint32 day)
```

The day starts less than 1 day from now.

### HolidayAlreadySet

```solidity theme={"system"}
error HolidayAlreadySet(uint32 day)
```

The day is already listed.
