/algorand-royalty-enforcer

PyTEAL implementation of ARC-18 (royalty app) and ARC-20 (smart asa)

Primary LanguagePython

Archived as implementation now lives in a private repository. May make it public again in the future.

Algorand Royalty Enforcer Implementation

This is an implementation of ARC-18 and (partial) ARC-20. It is based on the example at https://github.com/algorand-devrel/royalty/. This implementation adds various tests and some additional checks.

TODO:

  • Implement enforcer contract and tests
  • Build script
  • Setup automated deploy/release workflows
  • Placeholder enforcer contract to match the ABI of ARC-18 and ARC-20
  • Update according to latest ARC-18
  • Implement relevant ARC-20 ABI
  • Implement marketplace contract for ALGO and generic ASA and tests
  • Perform third-party audits
  • Address any issues that come up from audits
  • Additional test cases
  • Finalize contract implementations and make them immutable

Requirements

Setup

poetry shell # optionally create or start virtual environment with poetry
poetry install # install dependencies

In VS Code, make sure you specify the right Python interpreter. You can find the path to the one Poetry setup via:

which python | pbcopy

And then run the VS Code command Python: Select Interpreter and paste in the path.

Build contracts

TODO

./build.sh

Run tests

When running tests, be sure to run the Algorand Sandbox in the default "SandNet" mode. The tests assume Algod and KMD are available with the default URLs, ports, and tokens.

# outside of poetry shell
poetry run pytest

# inside poetry shell
pytest

Add -n 4 to run tests in parallel using the desired number of threads (or -n auto to use max).