Skip to content

Commit

Permalink
Merge pull request #224 from euler-xyz/fix/spearbit-fixes-2
Browse files Browse the repository at this point in the history
Spearbit Synth documentation fixes
  • Loading branch information
dglowinski authored May 20, 2024
2 parents e187749 + a966d2e commit 8a71e42
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Synths/EulerSavingsRate.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ contract EulerSavingsRate is EVCUtil, ERC4626 {
}

function maxRedeem(address owner) public view override returns (uint256) {
// Max redeem can potentially be 0 if there is a liability
// If account has borrows, withdrawal might be reverted by the controller during account status checks.
// The vault has no way to verify or enforce the behaviour of the controller, which the account owner
// has enabled. It will therefore assume that all of the assets would be witheld by the controller and
// under-estimate the return amount to zero.
// Integrators who handle borrowing should implement custom logic to work with the particular controllers
// they want to support.
if (evc.getControllers(owner).length > 0) {
return 0;
}
Expand All @@ -79,7 +84,12 @@ contract EulerSavingsRate is EVCUtil, ERC4626 {
}

function maxWithdraw(address owner) public view override returns (uint256) {
// Max withdraw can potentially be 0 if there is a liability
// If account has borrows, withdrawal might be reverted by the controller during account status checks.
// The vault has no way to verify or enforce the behaviour of the controller, which the account owner
// has enabled. It will therefore assume that all of the assets would be witheld by the controller and
// under-estimate the return amount to zero.
// Integrators who handle borrowing should implement custom logic to work with the particular controllers
// they want to support.
if (evc.getControllers(owner).length > 0) {
return 0;
}
Expand Down
6 changes: 6 additions & 0 deletions src/Synths/PegStabilityModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ contract PegStabilityModule is EVCUtil {
error E_ZeroAddress();
error E_FeeExceedsBPS();

/// @param _evc The address of the EVC.
/// @param _synth The address of the synthetic asset.
/// @param _underlying The address of the underlying asset.
/// @param toUnderlyingFeeBPS The fee for swapping to the underlying asset in basis points. eg: 100 = 1%
/// @param toSynthFeeBPS The fee for swapping to the synthetic asset in basis points. eg: 100 = 1%
/// @param _conversionPrice The conversion price between the synthetic and underlying asset. eg: 1e18 = 1 SYNTH == 1 UNDERLYING, 0.01e18 = 1 SYNTH == 0.01 UNDERLYING
constructor(
address _evc,
address _synth,
Expand Down

0 comments on commit 8a71e42

Please sign in to comment.