Skip to content

valory-xyz/autonolas-tokenomics

Repository files navigation

Autonolas Tokenomics

Introduction

This repository contains the tokenomics part of Autonolas onchain-protocol contracts.

A graphical overview is available here:

architecture

An overview of the Autonolas tokenomics model, a high-level description of smart contacts, and a full set of smart contract specifications are provided here.

The Depository and Treasury contracts are inspired by OlympusDAO concepts. The Tokenomics contract implements the brunt of the reward logic for component and agent owners, and the logic that regulates the discount factor for bonds. The Tokenomics contract is deployed via the proxy contract, such that it is possible to update the current Tokenomics implementation.

Development

Prerequisites

  • This repository follows the standard Hardhat development process.
  • The code is written on Solidity starting from version 0.8.18.
  • The standard versions of Node.js along with Yarn are required to proceed further (confirmed to work with Yarn 1.22.19 and npm 10.1.0 and node v18.6.0);
  • Foundry is required to run the foundry tests.

Install the dependencies

The project has submodules to get the dependencies. Make sure you run git clone --recursive or init the submodules yourself. The dependency list is managed by the package.json file, and the setup parameters are stored in the hardhat.config.js file. Simply run the following command to install the project:

yarn install

Core components

The contracts, deploy scripts, regular scripts and tests are located in the following folders respectively:

contracts
scripts
test

Compile the code and run

Compile the code:

npm run compile

Run tests with Hardhat:

npx hardhat test

Run tests with Foundry:

forge test --hh -vv

Audits

The audit is provided as development matures. The latest audit reports can be found here: audits. A list of known vulnerabilities can be found here: Vulnerabilities list tokenomics.

Linters

  • ESLint is used for JS code.
  • solhint is used for Solidity linting.

Github workflows

The PR process is managed by github workflows, where the code undergoes several steps in order to be verified. Those include:

  • code installation;
  • running linters;
  • running tests.

Deployment

The deployment of contracts to the test- and main-net is split into step-by-step series of scripts for more control and checkpoint convenience. The description of deployment procedure can be found here: deployment.

The finalized contract ABIs for deployment and their number of optimization passes are located here: ABIs.

For testing purposes, the hardhat node deployment script is located here.

Deployed Protocol

The list of contract addresses for different chains and their full contract configuration can be found here.

In order to test the protocol setup on all the deployed chains, the audit script is implemented. Make sure to export required API keys for corresponding chains (see the script for more information). The audit script can be run as follows:

node scripts/audit_chains/audit_contracts_setup.js

LP Token Guide

It is advised to check the following list of instructions before enabling OLAS-based LP tokens.

LP Token List

OLAS-based LP tokens eligible for bonding come from various chains. At a minimum, after OLAS has been bridged to a specific chain, the OLAS-XCHAIN_TOKEN LP token is created to provide the liquidity on that chain.

In order to participate in bonding with LPs from different chains, the LP owner needs to transfer LP tokens to the ETH mainnet and deposit via a Depository contract directly, or by using the Bonding UI.

For more information about bonding enabled LP tokens and bridging see here

Acknowledgements

The tokenomics contracts were inspired and based on the following sources:

About

This repository contains the Autonolas tokenomics part of the autonolas-v1 protocol.

Resources

License

Stars

Watchers

Forks

Packages

No packages published