Skip to content

Commit

Permalink
Merge pull request #1 from astrodevs-labs/docs
Browse files Browse the repository at this point in the history
Docs
  • Loading branch information
0xtekgrinder committed Sep 5, 2023
2 parents 770005c + e1bdcc3 commit 8568127
Show file tree
Hide file tree
Showing 28 changed files with 910 additions and 7 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/retype-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish Retype powered website to GitHub Pages
on:
workflow_dispatch:
push:
branches:
- main
paths:
- docs/**/*

jobs:
publish:
name: Publish to retype branch

runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v3

- uses: retypeapp/action-build@latest
with:
config: docs/retype.yml

- uses: retypeapp/action-github-pages@latest
with:
update-branch: true
4 changes: 2 additions & 2 deletions contracts/src/abstracts/AFees.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { Owned2Step } from "../utils/Owned2Step.sol";
import { Errors } from "../utils/Errors.sol";

/// @author 0xtekgrinder
/// @title Fees contract
/// @notice contract to manage fees
/// @title AFees
/// @notice Abstract contract to allow access only to operator or owner
abstract contract AFees is Owned2Step {
/*//////////////////////////////////////////////////////////////
EVENTS
Expand Down
8 changes: 3 additions & 5 deletions contracts/src/abstracts/AOperator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ pragma solidity 0.8.20;
import { Errors } from "../utils/Errors.sol";
import { Owned2Step } from "../utils/Owned2Step.sol";

/**
* @title AOperator contract
* @notice Provide operator checking
* @author 0xMemoryGrinder
*/
/// @author 0xtekgrinder
/// @title AOperator
/// @notice Abstract contract to allow access only to operator or owner
abstract contract AOperator is Owned2Step {
/*//////////////////////////////////////////////////////////////
EVENTS
Expand Down
Binary file added docs/docs/assets/AuraCvxDeposit-ApproveAura.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/AuraCvxDeposit-ApproveCvx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/AuraCvxDeposit-Deposit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/AuraCvxDeposit-Deposited.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/AuraCvxDeposit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/WarDeposit-Approve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/WarDeposit-Deposit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/WarDeposit-Deposited.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/WarDeposit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/WarWithdraw-Withdraw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/WarWithdraw-Withdrawn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/WarWithdraw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/logoFull.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/logoFullWhite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
sidebar_position: 1
---


# Overview

![Logo](./assets/logoFull.png)


Tholgar is a DeFi protocol that build products on top of other DeFi protocol enabling users to gain higher yield than alone.

We empower synergy with Paladin Vote stakeholders to build products that will benefit the whole ecosystem.

Our first product is an auto-compounder built on top of Warlord. It will let anyone join a vault and gain higher and more optimized yield in a non custodial manner.
9 changes: 9 additions & 0 deletions docs/docs/retype.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
input: .
output: .retype
url: https://docs.tholgar.xyz # Add your website address here
branding:
title: Tholgar
label: Docs
logo: assets/logo512.png
footer:
copyright: "© Copyright {{ year }}. All rights reserved."
74 changes: 74 additions & 0 deletions docs/docs/warlord-vault/deposit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
sidebar_position: 3
---

# Deposit

Currently, two set of tokens can be deposited : WAR and AURA/CVX. The process is nearly the same for both sets.

## Deposit WAR

### Accessing WAR deposit

The war deposit is the default option when the app is loaded. You can still retrieve it by selecting the deposit tab and selecting WAR token in the bottom-left dropdown.

![WAR Deposit](../assets/WarDeposit.png)

### Depositing

#### Enter amount

Enter the desired amount of WAR you wish to deposit and click the "Deposit" button.

#### Approval

A dialog will open by first asking you to approve the WAR spending (according to ERC-20 standards).
You can select to approve only your deposit amount or approve the max spending to avoid this step on the following deposits.

![Approve allowances](../assets/WarDeposit-Approve.png)

#### Deposit

You will then be prompted to sign the transaction to deposit. This is the final step.

![Deposit](../assets/WarDeposit-Deposit.png)

#### Verify

The "Circulating Supply" and "War Locked" stats should be increased by your deposit amount. If it is not immediatly the case, try to refresh you page.

![Deposited](../assets/WarDeposit-Deposited.png)


## Deposit AURA/CVX
### Accessing AURA/CVX deposit

To access AURA/CVX deposit, you need to change the deposit token(s) by using the bottom-left dropdown in the deposit tab.

![Aura/CVX deposit](../assets/AuraCvxDeposit.png)

### Depositing

#### Enter amount

Enter the desired amount of AURA and/or CVX you wish to deposit and click the "Deposit" button.

#### Approval

A dialog will open by first asking you to approve the AURA and CVX spendings (according to ERC-20 standards).
You can select to approve only your deposit amount or approve the max spending to avoid those step on the following deposits.

![Approve AURA allowances](../assets/AuraCvxDeposit-ApproveAura.png)
![Approve CVX allowances](../assets/AuraCvxDeposit-ApproveCvx.png)

#### Deposit

You will then be prompted to sign the transaction to deposit. This is the final step.

![Deposit](../assets/AuraCvxDeposit-Deposit.png)

#### Verify

The "Circulating Supply" and "War Locked" stats should be increased by your deposit amounts wheighted by the current ratios. If it is not immediatly the case, try to refresh you page.

![Deposited](../assets/AuraCvxDeposit-Deposited.png)
23 changes: 23 additions & 0 deletions docs/docs/warlord-vault/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
sidebar_position: 1
---

# Overview

## What is Warlord ?

Warlord is an index of governance tokens which gains yield and that will auto compound some rewards into WAR + optimize the overall yield with an auto voter on most rewarding vote incentives. You can read more about it [here](https://doc.paladin.vote/warlord/overview).

## What is the Warlord Vault ?

It is a product built by Tholgar team. This is an auto-compounder built on top of Warlord. It will let anyone join a vault and gain higher and more optimized yield in a non custodial manner.

All vote incentives will be claimed every week and auto-compounded into the vault gaining even more yield.

It uses the ERC4626 standard to follow the industry standart developped by yearn to enable more composability with other protocols.

## Addresses

- Vault: [0x188cA46Aa2c7ae10C14A931512B62991D5901453](https://etherscan.io/address/0x188ca46aa2c7ae10c14a931512b62991d5901453)
- Zap: [0x0598c652eEB0F95137Af02f32022005139453744](https://etherscan.io/address/0x0598c652eeb0f95137af02f32022005139453744)
- Swapper: [0x4247d145049B426d39f19F41555137D9cB154B99](https://etherscan.io/address/0x4247d145049b426d39f19f41555137d9cb154b99)
11 changes: 11 additions & 0 deletions docs/docs/warlord-vault/redeem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
sidebar_position: 5
---

# Redeem

To redeem in AURA/CVX, you will first have to withdraw your tWAR into WAR tokens ([see how](withdraw.md)).

Once you have WAR tokens in your wallet, you will need to go to Paladin's Warlord app to initiate the reddem process.

The instructions can be found here <https://doc.paladin.vote/warlord/redeeming-war>
178 changes: 178 additions & 0 deletions docs/docs/warlord-vault/smat_contracts/swapper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
---
sidebar_position: 2
---

# Swapper

This is an contract that will handle all of the swaps for the vault. So far it will use an router to swap any tokens and send them back to the sender. It is set as another contract to be able to change it in the future if the paradigm of router change drastically. It is meant to be used in a push / pull manner with the **swap** function.


## State Variables
### swapRouter
Dex/aggregaor router to call to perform swaps


```solidity
address public swapRouter;
```


### tokenTransferAddress
Address to allow to swap tokens


```solidity
address public tokenTransferAddress;
```


### vault
Address of the ERC4626 vault


```solidity
address public vault;
```


## Functions
### onlyVault


```solidity
modifier onlyVault();
```

### constructor


```solidity
constructor(address initialOwner, address initialSwapRouter, address initialTokenTransferAddress)
Owned2Step(initialOwner);
```

### setSwapRouter

Set the dex/aggregator router to call to perform swaps


```solidity
function setSwapRouter(address newSwapRouter) external onlyOwner;
```
**Parameters**

|Name|Type|Description|
|----|----|-----------|
|`newSwapRouter`|`address`|address of the router|


### setTokenTransferAddress

Set the token proxy address to allow to swap tokens


```solidity
function setTokenTransferAddress(address newTokenTransferAddress) external onlyOwner;
```
**Parameters**

|Name|Type|Description|
|----|----|-----------|
|`newTokenTransferAddress`|`address`|address of the token proxy|


### setVault

Set the vault address


```solidity
function setVault(address newVault) external onlyOwner;
```
**Parameters**

|Name|Type|Description|
|----|----|-----------|
|`newVault`|`address`|address of the vault|


### recoverERC20

Recover ERC2O tokens in the contract

*Recover ERC2O tokens in the contract*


```solidity
function recoverERC20(address token) external onlyOwner returns (bool);
```
**Parameters**

|Name|Type|Description|
|----|----|-----------|
|`token`|`address`|Address of the ERC2O token|

**Returns**

|Name|Type|Description|
|----|----|-----------|
|`<none>`|`bool`|bool: success|


### swap

Swap tokens using the router/aggregator

*The calldatas should set the recipient of the tokens to the vault*


```solidity
function swap(address[] calldata tokens, bytes[] calldata callDatas) external onlyVault;
```
**Parameters**

|Name|Type|Description|
|----|----|-----------|
|`tokens`|`address[]`|array of tokens to swap|
|`callDatas`|`bytes[]`|array of bytes to call the router/aggregator|


### _performRouterSwap

Perform the swap using the router/aggregator


```solidity
function _performRouterSwap(bytes calldata callData) internal;
```
**Parameters**

|Name|Type|Description|
|----|----|-----------|
|`callData`|`bytes`|bytes to call the router/aggregator|


## Events
### SwapRouterUpdated
Event emitted when the swap router is updated


```solidity
event SwapRouterUpdated(address oldSwapRouter, address newSwapRouter);
```

### TokenTransferAddressUpdated
Event emitted when the token proxy is updated


```solidity
event TokenTransferAddressUpdated(address oldTokenTransferAddress, address newTokenTransferAddress);
```

### VaultUpdated
Event emitted when the vault is updated


```solidity
event VaultUpdated(address oldVault, address newVault);
```
Loading

0 comments on commit 8568127

Please sign in to comment.