-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GITBOOK-419: Improving Periphery section
- Loading branch information
1 parent
34116c7
commit 9e48733
Showing
9 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# 🛰 Periphery | ||
|
||
This section contains valuable resources that are not part of the protocol's core and could be helpful for developers seeking to integrate Exactly into other applications. | ||
|
||
These smart contracts function as peripherals, seamlessly integrating with the Protocol contracts and acting as indispensable "helpers." While they undergo continuous development and refinement, it's essential to note that they have not yet undergone a formal audit due to their auxiliary nature. | ||
|
||
**Peripheral contracts can be found here:** [https://github.com/exactly/protocol/tree/main/contracts/periphery](https://github.com/exactly/protocol/tree/main/contracts/periphery) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# 🪂 Airdrop | ||
|
||
Using Solmate's Merkle tree library, this smart contract can validate the eligibility of an address for the airdrop and the appropriate amount based on a set of predetermined criteria. | ||
|
||
It interfaces with the [Sablier protocol](https://sablier.com), a token streaming mechanism, to facilitate the creation of an NFT for each recipient and subsequently initiate the airdrop stream. | ||
|
||
GitHub URL: [https://github.com/exactly/protocol/blob/main/contracts/periphery/Airdrop.sol](https://github.com/exactly/protocol/blob/main/contracts/periphery/Airdrop.sol) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# 🌀 DebtManager | ||
|
||
This contract allows users to handle their positions in a more flexible way. Making use of [Balancer's flash loans](https://docs.balancer.fi/reference/contracts/flash-loans.html) (currently, there are 0 fees for flash loans) and [Uniswap's flash swaps](https://docs.uniswap.org/contracts/v2/guides/smart-contract-integration/using-flash-swaps), it allows users to rollover their debts or leverage their positions. The DebtManager contract facilitates both same-asset and cross-asset leverage-deleverage functions.  | ||
|
||
This contract also uses ['permits'](https://help.1inch.io/en/articles/5435386-permit-712-signed-token-approvals-and-how-they-work-on-1inch) for approvals related to allowing you to transfer tokens on your behalf and perform withdrawals or borrows from a Market. Permits are signatures spent when the user completes the transaction, and the approved amount is always exact. After the leverage or deleverage operation is completed, the DebtManager no longer has any allowance over tokens, withdraws or borrows. | ||
|
||
GitHub URL: [https://github.com/exactly/protocol/blob/main/contracts/periphery/DebtManager.sol](https://github.com/exactly/protocol/blob/main/contracts/periphery/DebtManager.sol) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# 👓 DebtPreviewer | ||
|
||
This is a smart contract designed to abstract the `DebtManager` logic, it provides read-only functions ready to be consumed by Exactly’s web app. | ||
|
||
**This contract has mainly 2 purposes:** | ||
|
||
* Retrieve information about any account collateral and debt for any pair of markets in exactly. | ||
* Allow accounts to preview their positions, simulating a leverage or deleverage to a certain ratio with a desired health factor. | ||
|
||
\ | ||
GitHub URL: [https://github.com/exactly/protocol/blob/main/contracts/periphery/DebtPreviewer.sol](https://github.com/exactly/protocol/blob/main/contracts/periphery/DebtPreviewer.sol) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# 🪙 EXA | ||
|
||
The EXA smart contract encapsulates the functionality of the EXA ERC20 token. This smart contract uses OpenZeppelin's [`ERC20VotesUpgradeable`](https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/token/ERC20/extensions/ERC20VotesUpgradeable.sol) implementation. | ||
|
||
GitHub URL: [https://github.com/exactly/protocol/blob/main/contracts/periphery/EXA.sol](https://github.com/exactly/protocol/blob/main/contracts/periphery/EXA.sol) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# 🥩 Proto-Staker | ||
|
||
This smart contract is integrated into Exactly Protocol’s web app to enable users to provide EXA and WETH to a [Velodrome](https://velodrome.finance/) liquidity pool in several ways: | ||
|
||
* Providing ETH, where half is wrapped into WETH, and the remaining half is used to purchase EXA before being added to the EXA/WETH Liquidity Pool (LP). | ||
* Providing both ETH and EXA to be added to the EXA/WETH Liquidity Pool. | ||
* Claiming EXA rewards and sending ETH, which are both added to the Liquidity Pool. | ||
|
||
This contract also uses '[permits](https://help.1inch.io/en/articles/5435386-permit-712-signed-token-approvals-and-how-they-work-on-1inch)' to perform these transactions. | ||
|
||
GitHub URL: [https://github.com/exactly/protocol/blob/history/proto-staking-0/contracts/periphery/ProtoStaker.sol ](https://github.com/exactly/protocol/blob/history/proto-staking-0/contracts/periphery/ProtoStaker.sol) | ||
|
||
\ | ||
\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 🔁 Swapper | ||
|
||
This utility contract allows users to send ETH and purchase EXA. It’s integrated with [Socket](https://socket.tech), enabling purchases on OP Mainnet from other networks. It also uses ['permits'](https://help.1inch.io/en/articles/5435386-permit-712-signed-token-approvals-and-how-they-work-on-1inch). |