📖Data Access

How to access different data inside wav3s.sol

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:

Struct
Parameters

ActionDataBase

struct ActionDataBase {
    address currency;
    string pubId;
    string actionName;
    uint256 budget;
    uint256 reward;
    bool pubIdSet;
    bool initiatedAction;
}

ActionDataFilters

struct ActionDataFilters {
    uint256 zurfersCount;
    address[] zurfers;
    uint256 raffleEnd;
    uint256 winners;
    uint256 withdrawalTime;
    uint256 variable;
    address pubOwner;
}

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

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

Last updated