Skip to content

Commit

Permalink
apply forge fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetto90 committed Jan 18, 2024
1 parent eb5fb39 commit 999de7b
Show file tree
Hide file tree
Showing 34 changed files with 321 additions and 4,262 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/test-solidity.yaml

This file was deleted.

1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

15 changes: 0 additions & 15 deletions .prettierrc.json

This file was deleted.

6 changes: 0 additions & 6 deletions .solhint.json

This file was deleted.

4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"solidity.formatter": "forge",
"editor.formatOnSave": true
}
10 changes: 1 addition & 9 deletions contracts/OverlayV1Deployer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,7 @@ contract OverlayV1Deployer is IOverlayV1Deployer {
ov = _ov;
}

function parameters()
external
view
returns (
address ov_,
address feed_,
address factory_
)
{
function parameters() external view returns (address ov_, address feed_, address factory_) {
ov_ = ov;
feed_ = feed;
factory_ = factory;
Expand Down
28 changes: 12 additions & 16 deletions contracts/OverlayV1Factory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ contract OverlayV1Factory is IOverlayV1Factory {

// event for risk param updates
event ParamUpdated(
address indexed user,
address indexed market,
Risk.Parameters name,
uint256 value
address indexed user, address indexed market, Risk.Parameters name, uint256 value
);

// event for emergency shutdown
Expand Down Expand Up @@ -131,11 +128,11 @@ contract OverlayV1Factory is IOverlayV1Factory {

/// @dev deploys a new market contract
/// @return market_ address of the new market
function deployMarket(
address feedFactory,
address feed,
uint256[15] calldata params
) external onlyGovernor returns (address market_) {
function deployMarket(address feedFactory, address feed, uint256[15] calldata params)
external
onlyGovernor
returns (address market_)
{
// check feed and feed factory are available for a new market
_checkFeed(feedFactory, feed);

Expand Down Expand Up @@ -167,26 +164,25 @@ contract OverlayV1Factory is IOverlayV1Factory {
}

/// @notice Checks all risk params are within acceptable bounds
function _checkRiskParams(uint256[15] calldata params) private view{
function _checkRiskParams(uint256[15] calldata params) private view {
uint256 length = params.length;
for (uint256 i = 0; i < length; i++) {
_checkRiskParam(Risk.Parameters(i), params[i]);
}
}

/// @notice Checks risk param is within acceptable bounds
function _checkRiskParam(Risk.Parameters name, uint256 value) private view{
function _checkRiskParam(Risk.Parameters name, uint256 value) private view {
uint256 minValue = PARAMS_MIN.get(name);
uint256 maxValue = PARAMS_MAX.get(name);
require(value >= minValue && value <= maxValue, "OVV1: param out of bounds");
}

/// @notice Setter for per-market risk parameters adjustable by governance
function setRiskParam(
address feed,
Risk.Parameters name,
uint256 value
) external onlyGovernor {
function setRiskParam(address feed, Risk.Parameters name, uint256 value)
external
onlyGovernor
{
_checkRiskParam(name, value);
OverlayV1Market market = OverlayV1Market(getMarket[feed]);
market.setRiskParam(name, value);
Expand Down
Loading

0 comments on commit 999de7b

Please sign in to comment.