npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@valantis/valantis-core

v1.0.0

Published

![Valantis](img/Valantis_Banner.png)

Downloads

1

Readme

Valantis

Valantis

Implementation of the Valantis Core smart contracts in Solidity.

Setting up Foundry

We use Foundry as our Solidity development framework. See here for installation instructions, docs and examples.

Once installed, build the project:

forge build

Install dependencies:

forge install && yarn install

Tests:

To run foundry tests which included concrete tests and fuzz tests:

forge test

To run integration tests, first copy .env.example to .env :

cp .env.sample .env
npx hardhat test

Note: If the default public RPC fails, change MAINNET_URL to another provider's url.

Docs:

forge doc --serve --port 8080

Folder structure description

lib:

Contains all smart contract external dependencies, installed via Foundry as git submodules.

src

Contains source code of the smart contracts (excluding /mocks folders). Number of lines of code:

cloc src --not-match-d=mocks

ALM: Liquidity Module (LM) implementations, which are custom DEX logic contracts written in a modular way. It containes structs and interface which will need to be implemented by ALM.

governance: Contracts which are relevant in the context of the Valantis DAO, token, Gauges, Governance Escrow and its middlewares, and token emission mechanisms to eligible pools and ALMs. This is described in more detail in the white-paper. Currently contains only interface for AuctionController.

libraries: Various helper libraries used in other folders.

oracles: Contains interface for Oracle Module. There are two types, Universal and Sovereign, one of each type of pool.

pools: Implementation of Sovereign and Universal pools, the core backbone of Valantis that hosts all Modules, including LM, Swap Fee and Oracle modules.

protocol-factory: Holds the official addresses of the most important core contract factories in the protocol, including: Universal and Sovereign Pool factories, LM factories (one for each LM design), Swap Fee Module factories, Universal and Sovereign Oracle factories, Universal and Sovereign Gauge factories, etc, as well as respective deployments from within those factories. Valantis DAO will be able to add or remove certain addresses in this whitelist.

swap-fee-modules: Swap Fee module interface, which can be implemented and then plugged into Sovereign or Universal pools. Currently only contains a Swap Fee Module whose fixed swap fee is configurable by a designated address.

utils: Utils contracts which can be extended or used as library by main contracts.

mocks: Mock contracts used to simulate different behaviour for different components, used in tests.

test

All relevent tests for contracts in src are in this folder

base: Base contracts for a respective contract, which are extended in concrete/fuzz/invariant tests for respective contracts. They contain helper internal functions to help in testing.

helpers: Helper contracts for mock contracts, to enable interacting with mock contracts. It is recommended to use respective helper contract to interact with mocks.

deployers: Deployer contract for respective contract, containing function for deploying target contract, this needs to be extended by test contract which wants to use or test target contract.

libraries: Tests for library contracts. It contains fuzz and concrete tests, both for target library.

concrete: Concrete tests are used to unit test target contract with hard coded values.

fuzz: Fuzz tests are used to test public functions in target contracts like Universal Pool and Sovereign Pool.

integration: Integration tests are used to test deployment and test basic functions of target contracts on mainnet fork, using real tokens.

invariant: Invariant tests are use to test for certain invariant for target contract. Currently only covers Sovereign Pool.