# Data Access

There is public information about the state of actions and budgets in the contract useful for frontend and client apps to create a great user experience for Zurfers.

### Direct Values

The following are public single variables:

| Parameter                       | type    | Description                                                                               |
| ------------------------------- | ------- | ----------------------------------------------------------------------------------------- |
| nextActionId                    | uint256 | The next ActionId to be emitted                                                           |
| protocolFee                     | uint256 | The percentage of the budget charged by the protocol per action funded.                   |
| baseFee                         | uint256 | The base fee in native currency charged by the protocol each time a fundAction is called. |
| s\_NativeCurrencyProtocolWallet | uint256 | The amount of native currency fees acumulated by the protocol.                            |

### Mappings

The following are public accesible mappings:

| Parameter                               | Inputs                                         | Returns                  | Description                                                            |
| --------------------------------------- | ---------------------------------------------- | ------------------------ | ---------------------------------------------------------------------- |
| s\_PubIdToActionNameToActionDataBase    | \[string: "pubId"]\[string: "actionName"]      | struct ActionDataBase    | Access ActionDataBase struct by giving pubId and actionName values.    |
| s\_PubIdToActionNameToActionDataFilters | \[string: "pubId"]\[string: "actionName"]      | struct ActionDataFilters | Access ActionDataFilters struct by giving pubId and actionName values. |
| s\_currencyWhitelisted                  | \[address: "currency"]                         | bool                     | Returns true if currency is whitelisted.                               |
| s\_superCurrencyWhitelisted             | \[address: "currency"]                         | bool                     | Returns true if currency is whitelisted as superCurrency.              |
| s\_appAddressToAppFee                   | \[address: "appAddress"]                       | uint256                  | Returns the fee in percetage that the app charges.                     |
| s\_userToCurrencyToWalletBudget         | \[address: "user"]\[address: "currency"]       | uint256                  | Returns the internal  currency balance of the user.                    |
| s\_userToNativeCurrencyToWalletBudget   | \[address: "user"]                             | uint256                  | Returns the internal  native currency balance of the user.             |
| s\_CurrencyToProtocolWallet             | \[address: "currency"]                         | uint256                  | Returns the acumulated protocol fees of the currency.                  |
| s\_appToCurrencyToWallet                | \[address: "appAddress"]\[address: "currency"] | uint256                  | Returns the acumulated APP fees of the currency.                       |

###

### Structs

Structs can give you access to data related to recorded actions:

<table><thead><tr><th>Struct</th><th>Parameters</th></tr></thead><tbody><tr><td>ActionDataBase</td><td><p></p><pre class="language-solidity"><code class="lang-solidity">struct ActionDataBase {
    address currency;
    string pubId;
    string actionName;
    uint256 budget;
    uint256 reward;
    bool pubIdSet;
    bool initiatedAction;
}
</code></pre></td></tr><tr><td>ActionDataFilters</td><td><p></p><pre class="language-solidity"><code class="lang-solidity">struct ActionDataFilters {
    uint256 zurfersCount;
    address[] zurfers;
    uint256 raffleEnd;
    uint256 winners;
    uint256 withdrawalTime;
    uint256 variable;
    address pubOwner;
}
</code></pre></td></tr></tbody></table>

Then, you can access the "currency" used in an Action by calling the mapping:

```solidity
s_PubIdToActionNameToActionDataBase["pubId"]["actionName"].currency
```
