Skip to content

Commit

Permalink
just prior to attempting cross-chain liquidation
Browse files Browse the repository at this point in the history
  • Loading branch information
adamocallaghan committed Sep 4, 2024
1 parent ae895e1 commit 3db11dc
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ docs/

# Dotenv file
.env

# some review notes
FINAL_REVIEW.md
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@ deploy-contracts--to-optimism-and-set-addresses-for-collateral-and-stablecoin:

set-peer-on-both-using-script:
forge script script/SetPeers.s.sol:SetPeers --broadcast --account deployer -vvvvv



# read max mintable
read-max-mintable-for-user:
cast call $(BASE_SEPOLIA_OAPP_ADDRESS) --rpc-url $(BASE_SEPOLIA_RPC) "getMaxMintableByUser(address)(uint)" $(DEPLOYER_PUBLIC_ADDRESS)
60 changes: 60 additions & 0 deletions OTOKEN_FINAL_REVIEW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# OTOKEN: FINAL REVIEW NOTES

## General:

- Standardise pragmas across all of our files to ^0.8.19
- contractHasTokens modifier is only used once in each exercise, should be moved to BaseExercise
- if not moved to base, check if a modifier has any gas disadvantages to a standard if statement check

## SablierStreamCreator.sol

- Remappings to be cleand up
- Is there a way to remove the Linear and create everything with Dynamic?
- We may want to set 'cancellable' to be false - think about this? (It might seem to people like we can cancel their reward streams)
- lines 76 & 104: do we need to zero out the token approval? Remove from both Sablier functions.
- line 125: Move segmentAmount up to the uint256 calcs above the for loop (line 122)

## FixedExercise.sol

- Remove the credit system
- Remove multiplier entirely - just set the price at whatever it should be (including the discount)
- line143: setPrice function to check against zero
- lines 180 & 181: Remove maxPaymentAmount & it's check (not need, no oracle called)
- line 13: Remove maxPaymentAmount from FixedExerciseParams struct

## LockedLPExercise.sol

- line 17: remove the IPair interface
- line 86: remove commented out 'pair' address variable
- Add Note: LockedLPExercise contract is tested against Thena on BNB Chain.
- Multiplier Variables:
- maxMultiplier and minMultiplier should be constants (lines 96 & 97)
- maxMultiplier and minMultiplier should be renamed to something clear
- Contract MAX and MIN Multipliers:
- maxMultiplier should be something like: 1000 (90% off)
- minMultiplier should be something like: 20000 (100% premium, i.e. negative discount)
- Constructor:
- maxMultiplier and minMultiplier to be set in the constructor
- checks to be put in place to check the constructor max/min against the constant ones
- Setter:
- setMultipliers (onlyOwner) to be added
- Duration Variables:
- should follow the same format (constants, constructor-set, and setter available) as for the multipliers
- Should we distribute fees befoer or after the LP is created? (Yes, we should, seems to be the consensus)
- View function required for the frontend to query how much a user has to pay

## VestedExercise.sol

- Same as with the LockedLPExercise, constants to be set for the upper and lower bounds of the vestDuration (e.g. 1 week - 4 years)
- then vestDurations should be settable in constructor (and later via a setter function)
- line 106: remove the second "emit SetOracle"
- getLockDurationFromDiscount
- don't rely on this without explaining exactly how it's working
- can the ints be changed to uints in this function (what was the error)

## CustomStreamExercise.sol

- line 108: remove the second "emit SetOracle"
- line 138: move the segmentExponents length check into the internal exercise function
- lines 187 - 190: the multiplier range check here is how the checks should work on the other contract setters
- line 217: change revert error Exercise RequestedAmountTooHigh() to same as DiscountExercise contract - Exercise SlippageTooHigh()
2 changes: 1 addition & 1 deletion src/StableEngine.sol
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ contract StableEngine is OApp, IERC721Receiver {
// IChainlinkDataFeed nftPriceFeed = IChainlinkDataFeed(nftOracles[0]);
// uint256 nftPrice = uint256(nftPriceFeed.latestAnswer());
// return nftPrice * 1e10; // bring it up as chainlink returns it with 8 decimals only
return 36000e18;
return 25000e18;
}

// =========================
Expand Down

0 comments on commit 3db11dc

Please sign in to comment.