> For the complete documentation index, see [llms.txt](https://docs.metapass.world/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.metapass.world/reference/smart-contract-specifications/eventfactory.md).

# EventFactory

### Function signatures

#### `createEvent(FactoryStructs.EventMetadata calldata _metadata)`

Creates an event using the metadata provided. Sets the owner of the event to `msg.sender`.

#### `transferOwnership(uint160 eventId, address _newOwner)`

Transfers the ownership of an event to a new address. Only callable by the owner of an event.

#### `cancelEvent(uint160 eventId)`

Cancels an event, and enables refunds. Only callable by the owner of an event.

#### `createTicket(uint160 eventId, string calldata uri, bytes32 uriHash, bool useTokenIDInURI, uint256 _ticketPrice, FactoryStructs.TicketMetadata calldata _ticketMetadata)`

Creates a ticket smart contract using the provided data. Only callable by the owner of an event.

#### `validateTicket(uint160 eventId, address holder, Ticket ticket, uint256 ticketId, uint256 timestamp, uint8 v, bytes32 r, bytes32 s)`

Validates a ticket using the provided data and signature. This is a view function that costs no gas.

#### `isStamperAuthorized(address stamper, uint160 eventId)`

Check if a stamper is authorised for an event. This is a view function that costs no gas.

#### `addStamperToEvent(address stamper, uint160 eventId)`

Adds a stamper to an event. Only callable by the owner of an event.

#### `removeStamperFromEvent(address stamper, uint160 eventId)`

Removes a stamper from an event. Only callable by the owner of an event.

### Structs

```
library FactoryStructs {
    struct EventMetadata {
        uint256 timeStart;
        uint256 timeEnd;
    }
    
    struct TicketMetadata {
        uint256 maxTickets;
        uint256 ticketStartTime;
        uint256 ticketEndTime;
        bool acceptDonations;
        bool allowRefunds;
    }
}
```
