# Bond

## Pre-deployment

There is a `deployment` folder that contains deployment information per network. You can utilize already deployed contracts or redeploy them. For clean deploy just delete the deployment file.

## Deployment

For proper functioning contracts must be deployed in particular order. Firstly `aggregator` contract must be deployed, after that any or both(depends on which auctioneer you need to use) of teller contracts can be deployed, now auctioneer contracts can be deployed.

### Aggregator

After you set required env variables, use next command:

```sh
npm run deploy:aggregator
```

### Teller

Depends on which auctioneer type you need `Fixed-Expiry` or `Fixed-Term`, same type of teller must be deployed. Also you need to specify `ADDRESS_BENEFICIARY` environment variable, see details in `.env.template`.

#### Fixed-Expiry Teller

```sh
npm run deploy:fixed_expiry_teller
```

#### Fixed-Term Teller

```sh
npm run deploy:fixed_term_sda
```

### Auctioneer

#### Fixed-Expiry FPA

```sh
npm run deploy:fixed_expiry_fpa
```

#### Fixed-Expiry OFPA

```sh
npm run deploy:fixed_expiry_ofpa
```

#### Fixed-Expiry OSDA

```sh
npm run deploy:fixed_expiry_osda
```

#### Fixed-Expiry SDA

```sh
npm run deploy:fixed_expiry_sda
```

---

#### Fixed-Term FPA

```sh
npm run deploy:fixed_term_fpa
```

#### Fixed-Term OFPA

```sh
npm run deploy:fixed_term_ofpa
```

#### Fixed-Term OSDA

```sh
npm run deploy:fixed_term_osda
```

#### Fixed-Term SDA

```sh
npm run deploy:fixed_term_sda
```

## Local development

To clone repo itself, run the following command:

```sh
git clone https://github.com/ambrosus/airdao-bond.git
```

Then you have to initialize submodules running the following command:

```sh
git submodule init
```

To pull lates changes from submodule:

```sh
git submodule update --remote
```
