/platypus-core

🧬 Core smart contracts of Platypus Finance

Primary LanguageTypeScriptOtherNOASSERTION

Lint Tests Slither

Platypus Finance v1 Core

Core smart contracts of Platypus Finance.

Before getting started with this repo, please read:

Overview

Platypus has devised a whole new kind of StableSwap for enhanced capital efficiency, scalability and user experience in the Avalanche ecosystem.

Contracts

We detail a few of the core contracts for the Platypus Finance Protocol.

Core.sol

Handles most of the math: fees, slippage and haircut as defined in the yellow paper.

Pool.sol

Handles deposits, withdrawals and swaps with an open and extendable pool design.

Testing and Development

Local Development

Requires node@>=14

Install dependencies

yarn

Compile Contracts

yarn compile

Run tests

yarn test

Slither

Run

We use a mirror of slither to guarantee consistency and compatibility. It is located in this repository.

docker run --rm -it -v "$PWD":/src platypusfinance/eth-security-toolbox
# Inside container
cd /src
slither .

Slither may generate false positives that may break CI. To suppress these false positives :

docker run --rm -it -v "$PWD":/src platypusfinance/eth-security-toolbox
# Inside container
cd /src
slither . --triage
# An interactive prompt will be invoked for suppressing the warnings

A new slither.db.json will be created and should be commited.

Echidna fuzzer

To launch echidna fuzzer, first cd into the core directory.

rm -rf crytic-export/; yarn compile; docker run -it -v "$PWD":/src platypusfinance/eth-security-toolbox
# Inside container
solc-select 0.8.9; cd /src/; echidna-test . --contract IntegrationTest --config echidna.yaml

UML Diagram

Audits and Security

Read our bug bounty program details and SECURITY disclosure.

Licensing

The primary license for Platypus Finance Core v1 is the Business Source License 1.1 (BUSL-1.1), see LICENSE.