This repository contains the tokenomics part of Autonolas onchain-protocol contracts.
A graphical overview is available here:
An overview of the Autonolas tokenomics model is provided here. A description of the tokenomics contracts related to Olas staking is provided here.
Details on tokenomics model and Olas Staking can be found here and 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, the logic that regulates the discount factor for bonds, and Olas staking emissions. The Tokenomics contract is deployed via the proxy contract, such that it is possible to update the current Tokenomics implementation.
-
Core contracts:
-
Staking related contracts:
- DefaultDepositProcessorL1
- DefaultTargetDispenserL2
- EthereumDepositProcessor.sol
- ArbitrumDepositProcessorL1
- ArbitrumTargetDispenserL2
- GnosisDepositProcessorL1
- GnosisTargetDispenserL2
- OptimismDepositProcessorL1
- OptimismTargetDispenserL2
- PolygonDepositProcessorL1
- PolygonTargetDispenserL2
- WormholeDepositProcessorL1
- WormholeTargetDispenserL2
-
Auxiliary contracts:
- 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 npm10.1.0
and nodev18.6.0
); Foundry
is required to run the foundry tests.
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
The contracts, deploy scripts, regular scripts and tests are located in the following folders respectively:
contracts
scripts
test
Compile the code:
npm run compile
Run tests with Hardhat:
npx hardhat test
Run tests with Foundry:
forge test --hh -vv
- 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.
The static audit checks all the deployed contracts on-chain info correctness and can be run using the following script:
node scripts/audit_chains/audit_contracts_setup.js
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.
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.
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
It is advised to check the following list of instructions before enabling OLAS-based LP tokens.
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
The tokenomics contracts were inspired and based on the following sources: