# ASA Stats Permission dApp

The ASA Stats Permission dApp repository at [GitHub](https://github.com/asastats/permission-dapp/) contains the code for the Permission dApp smart contract, including its deployment to the Algorand blockchain (Mainnet and Testnet). It also includes code to populate its Algorand boxes with data for the ASA Stats DAO governors and subscribers.

The Permission dApp (deployed on Mainnet: [Link](https://lora.algokit.io/mainnet/application/2685515413)) is responsible for managing access permissions and tracking governance votes. It functions as the central authority for feature authorization for ASA Stats subscribers and DAO Governors, while also providing the foundational framework for all future DAO voting activities.

## Background

Our DAO's story started four years ago with an [Open Letter](https://github.com/asastats/dao-discussion/discussions/1) and has kept growing, all the way up to our latest update. Along the way, we've welcomed 141 governors into the ASA Stats DAO.

Every official document we put out locks in the exact number of votes for each governor. We keep track of these "seat votes" as simple JSON files in our Permission dApp repository. Here's how the math works: a governor's vote count directly translates to their permission value at a neat 1-to-1 million ratio.

If you're subscribed through one of our dApps on Subtopia.io, you automatically get extra features based on these predefined permission levels.

And until June 2025, everyone who joined our official governance staking programs also enjoyed bonus features, with their permissions handled by the same dApp.

## Why a Resubmission?

The previous attempt failed due to specific circumstances. The proposal was the very first to be voted on by xGovernors on the renewed platform. Across the Algorand ecosystem’s community channels, many users — as well as Algorand Foundation officials ([Link](https://forum.algorand.co/t/xgov-pause-for-parameters-change/15053/3)) and xGov Committee members — emphasized that the proposal was a victim of circumstance as the inaugural vote and that a resubmission is strongly justified ([Link](https://forum.algorand.co/t/xgov-pause-for-parameters-change/15053/5)). If nothing else, the Algorand Foundation’s immediate response and the subsequent deployment of xGov 2.0 speak in its favor.

Beyond these reasons, the previous discussion has served its exact purpose. The repository and proposal have been updated ([Link](https://forum.algorand.co/t/xgov-pause-for-parameters-change/15053/4)) based on community feedback!

## Why It's Useful

While ASA Stats uses this dApp to track DAO governor votes and permissions, the repository can be adapted by any organization seeking to manage measurable internal statuses. We are happy to assist others in modifying the code for their specific use cases.

Every branch in the repository is covered by unit tests, maintaining 100% test coverage as one of the project’s key goals.

The Permission dApp smart contract code is also fully covered by unit tests. Its integration with the blockchain is comprehensively tested using Algorand Python Testing on a localnet, as well as with a suite of integration tests run against a deployed application on Algorand Testnet.

We use GitHub Actions to automatically test every commit against two different Python versions ([Link](https://github.com/asastats/permission-dapp/actions)).

The code is well-documented, and we automatically build and publish the documentation to Read the Docs with each update ([Link](https://permission-dapp.readthedocs.io/en/latest/)).

Beyond providing a foundation for Algorand projects to maintain a record of their membership, this code — for the first time in an open-source repository — presents methods for fetching on-chain data from Cometa decentralized applications and derivatives, as well as from Subtopia.io applications.

## Proposal Funded!

[View the discussion](https://forum.algorand.co/t/asa-stats-permission-dapp/15087)

## Upvotes

- Upvotes: 478,542  
- Abstains: 8,192  
- Downvotes: 702

## xGov Quorum

## Vote Quorum

## Majority Approved

### About the team
Ivica Paleka is the founder and core developer of the ASA Stats project.

His professional programming career began at university, where he developed desktop software for financial and inventory accounting. In subsequent years, he designed and built a wide variety of custom desktop applications for clients, including accounting systems for cafe bars, retail shops, currency exchange offices, and ticketing systems for bus and boat travel.

After a few years, he transitioned entirely to Python. Since then, he has developed desktop applications using Python wrappers for GTK, Qt, wxWidgets, and Tkinter, and has built numerous web applications with Django.

More recently, he successfully brought a long-planned project, the Hopemeet match engine, to production. He also developed arrangeit ([Link](https://github.com/ipaleka/arrangeit)), an open-source and cross-platform successor to the shareware he created in the 1990s.

Before devoting himself full-time to the ASA Stats project in October 2021, he authored several comprehensive tutorials for the Algorand developer portal, such as:

- [Getting started with Python Algorand SDK and Django](https://developer.algorand.org/solutions/getting-started-with-python-algorand-sdk-and-django/)
- [Create and test smart contracts using Python](https://developer.algorand.org/tutorials/create-and-test-smart-contracts-using-python/)

He also created the Algorand provisioning repository ([Link](https://github.com/ipaleka/algorand-provisioning)), which contains Ansible scripts for deploying an Algorand Node on all major operating systems.

### Additional Info

This proposal builds on the successful work of the previously funded xGov-70 and xGov-141 proposals, which secured high availability for the ASA Stats API in the previous period. The primary goal of this new proposal remains consistent: to fund the ongoing development of the ASA Stats website, mobile app, and the Algorand ecosystem's only portfolio tracking API. Utilizing the xGov system also aligns perfectly with our core mission, as outlined in the original [whitepaper](https://www.asastats.com/whitepaper.pdf) — to gradually transition the entire ASA Stats codebase to open-source.

### Adoption Metrics

- The Permission dApp update script, run from a dedicated permanent SystemD service, checks for changed subscribers' values every 10 Algorand blocks.
- Data for a total of 143 Algorand addresses is permanently locked in the dApp's user boxes.
- A total of 1630 staking programs' entries had been collected and evaluated, from a total of 407 Algorand accounts.

Created By [devpool.asastats.algo](https://xgov.algorand.co/profile/PCXATSSLZVWFV76HO3YK4FUKUKC5TAAVF5I3YTT5GPV2IZYIVHK5HQ7IAE) // 7 months ago

##### Past Proposals
- ASA Stats Permission dApp [Rejected]
- The Rewards Suite by ASA Stats: All-in-one infrastructure for transparent contributor rewards [Deleted]
- The Rewards Suite by ASA Stats: All-in-one infrastructure for transparent contributor rewards [Funded]
