Skip to content

Commit

Permalink
docs: Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mgnfy-view committed Apr 23, 2024
1 parent 48c2541 commit 7c69502
Show file tree
Hide file tree
Showing 14 changed files with 196 additions and 22 deletions.
13 changes: 10 additions & 3 deletions docs/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ A thunder swap pool factory is deployed on-chain, and users can interact with it

Both normal swaps and flash swaps take place using the `ThunderSwapPool::flashSwapExactInput()` and `ThunderSwapPool::flashSwapExactOutput()` functions. In a normal swap, the `receiver` address is the user's wallet address; however, in a flash swap, a user sets the `receiver` address as the contract's address (which is `IThunderSwapReceiver` interface compliant). The contract that receives the token loan has to ensure that enough tokens are approved to the `ThunderSwapPool` when the control returns to it and the loan is paid back (along with fees). With flash swaps, contracts can also activate hooks before and after a swap to fine tune their swapping strategy.

Thunder Swap is marching towards a community-driven future with the introduction of the $THUD token, which is the key utility and governance token in the Thunder Swap ecosystem. Currently, the only way to obtain $THUD is via an airdrop conducted by the protocol team to reward loyal and regular users of the protocol.

### Built With

Expand Down Expand Up @@ -115,10 +116,16 @@ That's it, you are good to go now!
## Roadmap

- [x] Smart contract development
- [ ] Testing
- [x] Thunder Swap Core
- [x] Thunder Swap $THUD token
- [x] Thunder Swap Airdrop Manager
- [x] Testing
- [x] Unit testing
- [ ] Fuzz testing
- [ ] UI development
- [x] Pool deployment tests
- [x] Liquidity tests
- [x] Flash swap tests
- [x] Airdrop tests
- [x] Miscellaneous tests

See the [open issues](https://github.com/mgnfy-view/thunder-swap/issues) for a full list of proposed features (and known issues).

Expand Down
2 changes: 2 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@
- [ThunderSwapPoolFactory](src/core/ThunderSwapPoolFactory.sol/contract.ThunderSwapPoolFactory.md)
- [❱ governance](src/governance/README.md)
- [Thud](src/governance/Thud.sol/contract.Thud.md)
- [ThunderGovernor](src/governance/ThunderGovernor.sol/contract.ThunderGovernor.md)
- [ThunderTimeLock](src/governance/ThunderTimelock.sol/contract.ThunderTimeLock.md)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IThunderSwapHooks
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/538bce28778223301347f4273ff464e4ab8e7382/src/ThunderSwapReceiver/interfaces/IThunderSwapHooks.sol)
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/48c2541b51225b6140f6383b56ab80046ea60c03/src/ThunderSwapReceiver/interfaces/IThunderSwapHooks.sol)


## Functions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IThunderSwapReceiver
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/538bce28778223301347f4273ff464e4ab8e7382/src/ThunderSwapReceiver/interfaces/IThunderSwapReceiver.sol)
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/48c2541b51225b6140f6383b56ab80046ea60c03/src/ThunderSwapReceiver/interfaces/IThunderSwapReceiver.sol)

**Inherits:**
[IThunderSwapHooks](/src/ThunderSwapReceiver/interfaces/IThunderSwapHooks.sol/interface.IThunderSwapHooks.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# AirdropManager
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/538bce28778223301347f4273ff464e4ab8e7382/src/auxiliary/AirdropManager.sol)
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/48c2541b51225b6140f6383b56ab80046ea60c03/src/auxiliary/AirdropManager.sol)

**Inherits:**
Ownable
Expand Down Expand Up @@ -139,35 +139,48 @@ function getToken(uint256 _tokenIndex) external view returns (address);
|`_tokenIndex`|`uint256`|The index of the token in the supported tokens list|


### getAirdropLimit


```solidity
function getAirdropLimit() external pure returns (uint256);
```
**Returns**

|Name|Type|Description|
|----|----|-----------|
|`<none>`|`uint256`|The max number of receiver's for a single airdrop session|


## Events
### AirdropManager__TokenSupported
### TokenSupported

```solidity
event AirdropManager__TokenSupported(address token);
event TokenSupported(address token);
```

### AirdropManager__TokensAirdropped
### TokensAirdropped

```solidity
event AirdropManager__TokensAirdropped(address token, uint256 totalAmount);
event TokensAirdropped(address token, uint256 totalAmount);
```

## Errors
### AirdropManager__LimitBreached
### LimitBreached

```solidity
error AirdropManager__LimitBreached(uint256 numberOfRecepients, uint256 allowedNumberOfRecepients);
error LimitBreached(uint256 numberOfRecepients, uint256 allowedNumberOfRecepients);
```

### AirdropManager__TokenAlreadySupported
### TokenAlreadySupported

```solidity
error AirdropManager__TokenAlreadySupported();
error TokenAlreadySupported();
```

### AirdropManager__InsufficientTokenBalance
### InsufficientTokenBalance

```solidity
error AirdropManager__InsufficientTokenBalance();
error InsufficientTokenBalance();
```

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# LiquidityProviderToken
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/538bce28778223301347f4273ff464e4ab8e7382/src/core/LiquidityProviderToken.sol)
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/48c2541b51225b6140f6383b56ab80046ea60c03/src/core/LiquidityProviderToken.sol)

**Inherits:**
ERC20, Ownable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ThunderSwapPool
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/538bce28778223301347f4273ff464e4ab8e7382/src/core/ThunderSwapPool.sol)
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/48c2541b51225b6140f6383b56ab80046ea60c03/src/core/ThunderSwapPool.sol)

**Inherits:**
[IThunderSwapPool](/src/core/interfaces/IThunderSwapPool.sol/interface.IThunderSwapPool.md), ReentrancyGuard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ThunderSwapPoolFactory
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/538bce28778223301347f4273ff464e4ab8e7382/src/core/ThunderSwapPoolFactory.sol)
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/48c2541b51225b6140f6383b56ab80046ea60c03/src/core/ThunderSwapPoolFactory.sol)

**Inherits:**
Ownable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IThunderSwapPool
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/538bce28778223301347f4273ff464e4ab8e7382/src/core/interfaces/IThunderSwapPool.sol)
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/48c2541b51225b6140f6383b56ab80046ea60c03/src/core/interfaces/IThunderSwapPool.sol)


## Functions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# LiquiditySupplyAndSwapMath
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/538bce28778223301347f4273ff464e4ab8e7382/src/core/lib/LiquiditySupplyAndSwapMath.sol)
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/48c2541b51225b6140f6383b56ab80046ea60c03/src/core/lib/LiquiditySupplyAndSwapMath.sol)


## Functions
Expand Down
2 changes: 2 additions & 0 deletions docs/src/src/governance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

# Contents
- [Thud](Thud.sol/contract.Thud.md)
- [ThunderGovernor](ThunderGovernor.sol/contract.ThunderGovernor.md)
- [ThunderTimeLock](ThunderTimelock.sol/contract.ThunderTimeLock.md)
2 changes: 1 addition & 1 deletion docs/src/src/governance/Thud.sol/contract.Thud.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Thud
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/538bce28778223301347f4273ff464e4ab8e7382/src/governance/Thud.sol)
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/48c2541b51225b6140f6383b56ab80046ea60c03/src/governance/Thud.sol)

**Inherits:**
ERC20, ERC20Permit, ERC20Votes, Ownable
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# ThunderGovernor
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/48c2541b51225b6140f6383b56ab80046ea60c03/src/governance/ThunderGovernor.sol)

**Inherits:**
Governor, GovernorSettings, GovernorCountingSimple, GovernorVotes, GovernorVotesQuorumFraction, GovernorTimelockControl


## Functions
### constructor


```solidity
constructor(
IVotes _token,
TimelockController _timelock
)
Governor("ThunderGovernor")
GovernorSettings(7200, 50400, 100e18)
GovernorVotes(_token)
GovernorVotesQuorumFraction(4)
GovernorTimelockControl(_timelock);
```

### votingDelay


```solidity
function votingDelay() public view override(Governor, GovernorSettings) returns (uint256);
```

### votingPeriod


```solidity
function votingPeriod() public view override(Governor, GovernorSettings) returns (uint256);
```

### quorum


```solidity
function quorum(uint256 blockNumber)
public
view
override(Governor, GovernorVotesQuorumFraction)
returns (uint256);
```

### state


```solidity
function state(uint256 proposalId)
public
view
override(Governor, GovernorTimelockControl)
returns (ProposalState);
```

### proposalNeedsQueuing


```solidity
function proposalNeedsQueuing(uint256 proposalId)
public
view
override(Governor, GovernorTimelockControl)
returns (bool);
```

### proposalThreshold


```solidity
function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256);
```

### _queueOperations


```solidity
function _queueOperations(
uint256 proposalId,
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
)
internal
override(Governor, GovernorTimelockControl)
returns (uint48);
```

### _executeOperations


```solidity
function _executeOperations(
uint256 proposalId,
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
)
internal
override(Governor, GovernorTimelockControl);
```

### _cancel


```solidity
function _cancel(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
)
internal
override(Governor, GovernorTimelockControl)
returns (uint256);
```

### _executor


```solidity
function _executor() internal view override(Governor, GovernorTimelockControl) returns (address);
```

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# ThunderTimeLock
[Git Source](https://github.com/Sahil-Gujrati/thunder-swap/blob/48c2541b51225b6140f6383b56ab80046ea60c03/src/governance/ThunderTimelock.sol)

**Inherits:**
TimelockController


## Functions
### constructor


```solidity
constructor(
uint256 minDelay,
address[] memory proposers,
address[] memory executors
)
TimelockController(minDelay, proposers, executors, msg.sender);
```

0 comments on commit 7c69502

Please sign in to comment.