Skip to content

Commit

Permalink
Merge pull request #44 from jbx-protocol/version/terminal-3.1.1
Browse files Browse the repository at this point in the history
fees on some redemptions
  • Loading branch information
mejango authored Jul 2, 2023
2 parents 1dbc059 + 4959896 commit d45af6f
Show file tree
Hide file tree
Showing 193 changed files with 39,145 additions and 7,629 deletions.
35 changes: 9 additions & 26 deletions contracts/JBChainlinkV3PriceFeed.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

import '@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol';
import './interfaces/IJBPriceFeed.sol';
import './libraries/JBFixedPointNumber.sol';
import {AggregatorV3Interface} from '@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol';
import {IJBPriceFeed} from './interfaces/IJBPriceFeed.sol';
import {JBFixedPointNumber} from './libraries/JBFixedPointNumber.sol';

/**
@notice
A generalized price feed for the Chainlink AggregatorV3Interface.
@dev
Adheres to -
IJBPriceFeed: General interface for the methods in this contract that interact with the blockchain's state according to the protocol's rules.
*/
/// @notice A generalized price feed for the Chainlink AggregatorV3Interface.
contract JBChainlinkV3PriceFeed is IJBPriceFeed {
// A library that provides utility for fixed point numbers.
using JBFixedPointNumber for uint256;
Expand All @@ -28,24 +21,16 @@ contract JBChainlinkV3PriceFeed is IJBPriceFeed {
// ---------------- public stored immutable properties --------------- //
//*********************************************************************//

/**
@notice
The feed that prices are reported from.
*/
/// @notice The feed that prices are reported from.
AggregatorV3Interface public immutable feed;

//*********************************************************************//
// ------------------------- external views -------------------------- //
//*********************************************************************//

/**
@notice
Gets the current price from the feed, normalized to the specified number of decimals.
@param _decimals The number of decimals the returned fixed point price should include.
@return The current price of the feed, as a fixed point number with the specified number of decimals.
*/
/// @notice Gets the current price from the feed, normalized to the specified number of decimals.
/// @param _decimals The number of decimals the returned fixed point price should include.
/// @return The current price of the feed, as a fixed point number with the specified number of decimals.
function currentPrice(uint256 _decimals) external view override returns (uint256) {
// Get the latest round information.
(uint80 roundId, int256 _price, , uint256 updatedAt, uint80 answeredInRound) = feed
Expand All @@ -71,9 +56,7 @@ contract JBChainlinkV3PriceFeed is IJBPriceFeed {
// -------------------------- constructor ---------------------------- //
//*********************************************************************//

/**
@param _feed The feed to report prices from.
*/
/// @param _feed The feed to report prices from.
constructor(AggregatorV3Interface _feed) {
feed = _feed;
}
Expand Down
607 changes: 225 additions & 382 deletions contracts/JBController.sol

Large diffs are not rendered by default.

647 changes: 240 additions & 407 deletions contracts/JBController3_0_1.sol

Large diffs are not rendered by default.

Loading

0 comments on commit d45af6f

Please sign in to comment.