npm package: @floatprotocol/float-contracts
Description: The smart contracts behind Float Protocol
Author: FloatProtocol
Latest version: 1.0.3

<div align="center">
  
  ![float_thumbprint](https://user-images.githubusercontent.com/77080072/123523623-a1b32500-d6bc-11eb-8bf2-d68965fe025e.png)

</div>

<h1 align="center">
  Float Protocol
</h1>

<h4 align="center">
    
[![Production CI](https://github.com/FloatProtocol/float-contracts/actions/workflows/prod.yml/badge.svg)](https://github.com/FloatProtocol/float-contracts/actions/workflows/prod.yml)
[![Monitor TWAP](https://github.com/FloatProtocol/float-contracts/actions/workflows/monitor_twap.yml/badge.svg)](https://github.com/FloatProtocol/float-contracts/actions/workflows/monitor_twap.yml)
  
</h4>

<h3 align="center">
  <a href="https://floatprotocol.com">Website</a> |
  <a href="https://docs.floatprotocol.com">Documentation</a> |
  <a href="https://observablehq.com/collection/@floatcoder/float-protocol-litepaper">Research</a> |
  <a href="https://discord.gg/tmu78Rc8Fn">Discord</a>
</h3>

## What is Float Protocol?

Float Protocol is building the decentralised monetary system of the future. At the heart of the protocol is the FLOAT token. It is designed to be the first truly native internet currency.

Unlike most stablecoins, whilst FLOAT is _designed to be stable_ and has significantly lower volatility than most cryptocurrencies, it is _not designed to hold its price at $1.00_. Instead, it focuses on maintaining your buying power:

> **$1,000 from May 2020 has the same buying power as $952 in May 2021** (source [bls.gov](https://www.bls.gov/data/inflation_calculator.htm)).
>
> In real terms, you are down *-4.7%* in your "stablecoin", even though you still see $1,000.

**Float Protocol originates from novel research while applying the best techniques of prior work:**
- **Dutch Auction Stabilisation** - Float Protocol uniquely applies Dutch Auctions to price stabilisation providing arbitrage opportunities to contract and expand supply. 
  - *Single Block Composability* - Dutch Auctions are instant settlement which allows for flash loans, DEX aggregation opportunities; all with zero speculation.
  - *User benefiting slippage* - As prices start high and decrease deterministically, any slippage only results in more profit.
- **Decentralised & Democratic** - DAO owned and community controlled with >50% of governance token distributed according to our [Democratic Launch](https://medium.com/float-protocol/what-is-a-fair-launch-anyway-cbe0bd4f8b22). 
- **Algorithmically controlled** - The price movement is [clearly defined](https://observablehq.com/@floatcoder/target-price?collection=@floatcoder/float-protocol-litepaper), autonomous and algorithmic with no active management. 
- **Basket Tracking** - FLOAT tracks the contents of a basket of "crypto goods" without sudden spikes. 
- **2 Token System** - FLOAT is the stablecoin targeting a band around the target price. BANK is the governance token that accrues seigniorage revenue and excess collateral value.

## Responsible Disclosure

[See SECURITY.md](./SECURITY.md)

## Contributing

The contracts are compiled with [Hardhat](https://hardhat.org/getting-started/) and tested using [Waffle](https://hardhat.org/guides/waffle-testing.html#testing-with-ethers-js-waffle) and [TypeScript](https://hardhat.org/guides/typescript.html#typescript-support).

### Installation

```sh
# Clone repository from github
git clone https://github.com/FloatProtocol/float-contracts.git
cd float-contracts
# Install dependencies
yarn
```

Update the `.env` file with your API Keys for deploying to an Ethereum Public Testnet.

### Build

```sh
yarn build
```

### Test

```sh
yarn test
```

### Coverage

```sh
yarn coverage
```

### Deploy to Hardhat EVM

```sh
yarn dev
yarn local:dev
```

Will deploy the contracts to `localhost:8545`.

### Running Slither

[Slither](https://github.com/crytic/slither) is a Solidity static analysis framework. To run it locally:

```sh
pip3 install slither-analyzer
slither .
```

### In-Depth security testing

Use the `eth-security-toolbox` docker image.

```sh
docker pull trailofbits/eth-security-toolbox
docker run -it -v $(pwd):/share trailofbits/eth-security-toolbox
```