This repo contains the smart contract for the p00ls platform.
Some parts of these contracts are still being worked on and might change. See the status section below.
The development and test environments are configured through environment variables. It is recommended to configure that using a .env file. The .env.example provides an example of such file, with the different variables listed.
The main variables used are:
- MODE: use production to enable optimization
- REVERT_STRINGS: if set to strip, this option removes all the revert reasons
- XXX_NODE: rpc endpoint for chain
XXX(for migration scripts) - MNEMONIC: mnemonic of the wallet to use (for migration scripts)
- PRIVATE_KEY: private key of the wallet to use (for migration scripts)
If both MNEMONIC and PRIVATE_KEY are defined, MNEMONIC will take priority.
- COVERAGE: enable the coverage plugin (needed to produce coverage reports)
- REPORT: enable the gas report plugin (will produce gas usage reports when running the tests)
- DEBUG: add extra debug. Set
DEBUG=migrationfor extra verbosity during deployments.
The contract deployment script takes its parameters from the scripts/config.js file. This file contains can be used to customize the deployment. If anyone wants to perform a deployment of these contracts, it is strongly encouraged to read the deployment script AND do test deployments.
To compile the contract smart contracts, run
npm run compile
- Tests are run using the following command
npm run test
-
Gas usage report can be produced by adding
REPORT=trueto the command line or to the.envconfiguration file -
Code coverage report can be produced by adding
COVERAGE=trueto the command line or to the.envconfiguration file and running
npm run coverage
In other to deploy these contracts, one should fill two different files:
- the
.envfile must contain credentials (private key or mnemonic) and an url endpoint for the targeted blockchain. - the
scripts/config.jsfile must contain the deploying arguments for the contracts (name, symbol, ...).
See the setup section to learn more about the environment configuration.
Once the settings are configured, you can use the scripts/migrate.js script with the following command:
npx hardhat run scripts/migrate.js --network <blockchain-name>
The migration script will produce a .cache-<chainId>.json file containing the addresses of the deployed contracts.
Note: the deployment workflow is still being worked on.
| Contract name | Status | Audited | Deployment | Upgradeable |
|---|---|---|---|---|
| P00lsCreatorRegistry | Finalized | 1 2 | Proxy - Implementation | ✔️ |
| P00lsTokenCreator | Finalized | 1 2 | Implementation | ✔️ |
| P00lsTokenXCreator | Deprecated | 1 | Implementation | ✔️ |
| P00lsTokenXCreatorV2 | Finalized | 2 | Implementation | ✔️ |
| AMM Router | Finalized | 1 2 | Instance | ❌ |
| AMM Factory | Finalized | 1 2 | Instance | ❌ |
| AMM Pair | Finalized | 1 2 | Implementation | ❌ |
| AuctionFactory | Finalized | 1 2 | Instance | ❌ |
| Auction | Finalized | 1 2 | Implementation | ❌ |
| VestedAirdrops | Finalized | 1 2 | Instance | ❌ |
| VestingFactory | Finalized | 2 | Instance | ❌ |
| Escrow | Finalized | 1 2 | Instance | ❌ |
| Locking | Work in progress | 1 | - | ❌ |
| DAO Timelock | Finalized | 1 2 | - | ❌ |
| DAO Governor | Finalized | 1 2 | - | ✔️ |

