Skip to content

Commit 6a5a579

Browse files
authored
fix: Spearbit audit fixes (#45)
* fix: update comment and file name * chore: delete file for casing: * chore: add back same file * docs: update readme with fixes * fix: typo * chore: add ascii
1 parent ddb6f9a commit 6a5a579

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111

1212
This repository contains the implementation of a Peg Stability Module (PSM) contract, which facilitates the swapping, depositing, and withdrawing of three given assets to maintain stability and ensure the peg of involved assets. The PSM supports both yield-bearing and non-yield-bearing assets.
1313

14-
The PSM contract allows users to swap between USDC, USDS, and sSUDS, deposit any of the assets to mint shares, and withdraw any of the assets by burning shares.
14+
The PSM contract allows users to swap between USDC, USDS, and sUSDS, deposit any of the assets to mint shares, and withdraw any of the assets by burning shares.
1515

1616
The conversion between a stablecoin and `susds` is provided by a rate provider contract. The rate provider returns the conversion rate between `susds` and the stablecoin in 1e27 precision. The conversion between the stablecoins is one to one.
1717

18-
The conversion rate between assets and shares is based on the total value of assets held by the PSM. The total value is calculated by converting the assets to their equivalent value in USD with 18 decimal precision. The shares represent the ownership of the underlying assets in the PSM. Since three assets are used, each with different precisions and values, they are converted to a common USD-denominated value for share conversions.
18+
The conversion rate between assets and shares is based on the total value of assets within the PSM. This includes USDS and sUSDS held custody by the PSM, and USDC held custody by the `pocket`. The total value is calculated by converting the assets to their equivalent value in USD with 18 decimal precision. The shares represent the ownership of the underlying assets in the PSM. Since three assets are used, each with different precisions and values, they are converted to a common USD-denominated value for share conversions.
1919

2020
For detailed implementation, refer to the contract code and `IPSM3` interface documentation.
2121

src/PSM3.sol

+9
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ import { Math } from "openzeppelin-contracts/contracts/utils/math/Math.sol";
1111
import { IPSM3 } from "src/interfaces/IPSM3.sol";
1212
import { IRateProviderLike } from "src/interfaces/IRateProviderLike.sol";
1313

14+
/*
15+
███████╗██████╗ █████╗ ██████╗ ██╗ ██╗ ██████╗ ███████╗███╗ ███╗
16+
██╔════╝██╔══██╗██╔══██╗██╔══██╗██║ ██╔╝ ██╔══██╗██╔════╝████╗ ████║
17+
███████╗██████╔╝███████║██████╔╝█████╔╝ ██████╔╝███████╗██╔████╔██║
18+
╚════██║██╔═══╝ ██╔══██║██╔══██╗██╔═██╗ ██╔═══╝ ╚════██║██║╚██╔╝██║
19+
███████║██║ ██║ ██║██║ ██║██║ ██╗ ██║ ███████║██║ ╚═╝ ██║
20+
╚══════╝╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝
21+
*/
22+
1423
contract PSM3 is IPSM3, Ownable {
1524

1625
using SafeERC20 for IERC20;

src/interfaces/IPSM3.sol

+1-2
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ interface IPSM3 {
9292

9393
/**
9494
* @dev Returns the IERC20 interface representing sUSDS. This asset is the yield-bearing
95-
* asset in the PSM (e.g., sUSDS). The value of this asset is queried from the
96-
* rate provider.
95+
* asset in the PSM. The value of this asset is queried from the rate provider.
9796
* @return The IERC20 interface of sUSDS.
9897
*/
9998
function susds() external view returns (IERC20);
File renamed without changes.

0 commit comments

Comments
 (0)