Skip to content

language touchups #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 77 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
68f88d3
JBController3_1 => JBController
mejango Nov 13, 2023
302eda7
merged
mejango Nov 14, 2023
25ecc11
JBTokens
filipviz Nov 14, 2023
4050d18
Merge conflicts
filipviz Nov 14, 2023
e0fb3c1
ruleset progress
filipviz Nov 15, 2023
52dc6e7
Restore tests
filipviz Nov 15, 2023
b26a6af
ruleset progress, approval hook progress
filipviz Nov 15, 2023
1e1cfe7
ruleset progress
filipviz Nov 15, 2023
2d11959
renaming, misc progress
filipviz Nov 16, 2023
630d90e
eligible/standby -> currently/next approvable
filipviz Nov 16, 2023
e737bd3
fmt
mejango Nov 20, 2023
7dd1578
merged
mejango Nov 20, 2023
ae74d23
merged IJBToken
mejango Nov 20, 2023
d150685
merged
mejango Nov 20, 2023
cb03716
JBTokenList
mejango Nov 20, 2023
89529fd
-
mejango Nov 20, 2023
cade3e9
merge small changes
filipviz Nov 20, 2023
c79fa29
further rulesets progress
filipviz Nov 20, 2023
f4b4be2
wrap up rulesets
filipviz Nov 21, 2023
c54f1f7
splits
filipviz Nov 21, 2023
9bf18c5
JBPermissions
filipviz Nov 22, 2023
38a26c8
JBPrices
filipviz Nov 22, 2023
8c6e360
JBFundAccessLimits
filipviz Nov 25, 2023
9fcebd8
file name sync
mejango Nov 27, 2023
9d4fbf4
-
mejango Nov 27, 2023
b57f7f4
Merge branch 'transition/adjusted-file-names' into feature/language
mejango Nov 27, 2023
1882050
merged small
mejango Nov 27, 2023
4651881
JBDirectory
filipviz Nov 27, 2023
9896947
Pay/redeem hooks. Some of JBTerminalStore.
filipviz Nov 27, 2023
b26f186
merged
mejango Nov 27, 2023
98c82b6
merged
mejango Nov 28, 2023
3484bde
fix merge errors; tests passing; misc changes
filipviz Nov 28, 2023
6c414a7
IDs -> Ids
filipviz Nov 28, 2023
d4bb0f3
JBTerminalStore
filipviz Nov 28, 2023
a07398b
JBController
filipviz Nov 29, 2023
d09bb46
small error update
filipviz Nov 29, 2023
8a0aca5
Terminal interfaces
filipviz Nov 30, 2023
be0dea5
JBMultiTerminal + Controller improvements
filipviz Nov 30, 2023
3d05d7d
JBMultiTerminal
filipviz Dec 1, 2023
0c0551b
Small touches
filipviz Dec 1, 2023
7b1d41d
Improvements for misc libs/interfaces, etc.
filipviz Dec 1, 2023
f859626
ETH -> native, misc fixes
filipviz Dec 1, 2023
4486a67
Helpers, small changes
filipviz Dec 1, 2023
a8eaeac
tests progress
filipviz Dec 2, 2023
1d76e97
Finish tests
filipviz Dec 2, 2023
7e916a2
small touches
filipviz Dec 2, 2023
b8dff01
fix: metadata resolver lib naming
simon-something Dec 2, 2023
693cd17
remove JBFeeType (deprecated)
filipviz Dec 2, 2023
37f21db
suggestions from 0xba5ed
filipviz Dec 4, 2023
73a4500
merged
mejango Dec 4, 2023
dab2ffc
small fixes, fmt
filipviz Dec 4, 2023
80dc350
jango multiterminal suggestions
filipviz Dec 4, 2023
26b07b6
Test progress
filipviz Dec 4, 2023
20293ed
Metadata resolver; many small fixes
filipviz Dec 4, 2023
6ead3ab
Controller updates
filipviz Dec 4, 2023
e3a7003
small fixes throughout
filipviz Dec 4, 2023
e49b8a8
deploy script
mejango Dec 4, 2023
a0fc124
JBMultiTerminal improvements
filipviz Dec 4, 2023
fecd23d
deploy script
mejango Dec 4, 2023
839b3ad
Directory fixes
filipviz Dec 4, 2023
d969542
Small nits. Schedule -> queue, remove unused reference
filipviz Dec 4, 2023
97ae9c3
test pass
mejango Dec 4, 2023
0a127e5
standard permissions comments
filipviz Dec 5, 2023
dc5c28e
rm unused
mejango Dec 5, 2023
41a6267
splitHook -> hook; util scripts; configured -> queued
filipviz Dec 5, 2023
11e7c03
several adjustments
filipviz Dec 5, 2023
f7491fa
Surplus payout limit, getRulesetOf, misc fixes
filipviz Dec 5, 2023
e902915
Small simplifications
filipviz Dec 5, 2023
1fa613a
JBTokenList.NATIVE -> JBConstants.NATIVE_TOKEN
filipviz Dec 5, 2023
ba7e925
Revert surplus payout limit
filipviz Dec 5, 2023
7e44bcc
Move TestRulesetQueuing
filipviz Dec 5, 2023
49c42b9
merged
mejango Dec 5, 2023
970abb6
Remove unused errors
filipviz Dec 5, 2023
02cc938
JBERC20Token -> JBERC20
filipviz Dec 5, 2023
1b83275
allowDiscretionaryMinting -> allowOwnerMinting
filipviz Dec 5, 2023
8a4dd52
Move to TestRulesetQueueing
filipviz Dec 5, 2023
e71a77d
Remove AccessJBLib (unused)
filipviz Dec 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contracts/JBChainlinkV3PriceFeed.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ contract JBChainlinkV3PriceFeed is IJBPriceFeed {
// ------------------------- external views -------------------------- //
//*********************************************************************//

/// @notice Gets the current price from the feed, normalized to the specified number of decimals.
/// @notice Gets the current price (per unit) 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) {
function currentUnitPrice(uint256 _decimals) external view override returns (uint256) {
// Get the latest round information.
(uint80 roundId, int256 _price,, uint256 updatedAt, uint80 answeredInRound) =
feed.latestRoundData();
Expand Down
528 changes: 272 additions & 256 deletions contracts/JBController.sol

Large diffs are not rendered by default.

56 changes: 23 additions & 33 deletions contracts/JBDeadline.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,47 @@ pragma solidity ^0.8.16;

import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {JBBallotState} from "./enums/JBBallotState.sol";
import {IJBFundingCycleBallot} from "./interfaces/IJBFundingCycleBallot.sol";
import {JBFundingCycle} from "./structs/JBFundingCycle.sol";

/// @notice Manages approving funding cycle reconfigurations automatically after a buffer period.
contract JBReconfigurationBufferBallot is ERC165, IJBFundingCycleBallot {
//*********************************************************************//
// --------------------------- custom errors ------------------------- //
//*********************************************************************//

/// @notice Throw if the duration used to initialize this contract is too long.
error WRONG_DURATION();
import {JBApprovalStatus} from "./enums/JBApprovalStatus.sol";
import {IJBRulesetApprovalHook} from "./interfaces/IJBRulesetApprovalHook.sol";
import {JBRuleset} from "./structs/JBRuleset.sol";

/// @notice Ruleset approval hook which rejects rulesets if they are not queued at least `duration` seconds before the current ruleset ends. In other words, rulesets must be queued before the deadline to take effect.
contract JBDeadline is ERC165, IJBRulesetApprovalHook {
//*********************************************************************//
// ---------------- public immutable stored properties --------------- //
//*********************************************************************//

/// @notice The number of seconds that must pass for a funding cycle reconfiguration to become either `Approved` or `Failed`.
/// @notice The minimum difference between the time a ruleset is queued and the time it starts, as a number of seconds. If the difference is greater than this number, the ruleset is `Approved`.
uint256 public immutable override duration;

//*********************************************************************//
// -------------------------- public views --------------------------- //
//*********************************************************************//

/// @notice The approval state of a particular funding cycle.
/// @param _projectId The ID of the project to which the funding cycle being checked belongs.
/// @param _configured The configuration of the funding cycle to check the state of.
/// @param _start The start timestamp of the funding cycle to check the state of.
/// @return The state of the provided ballot.
function stateOf(uint256 _projectId, uint256 _configured, uint256 _start)
/// @notice The approval status of a particular ruleset.
/// @param _projectId The ID of the project to which the ruleset being checked belongs.
/// @param _rulesetId The `rulesetId` of the ruleset to check the status of. The `rulesetId` is the timestamp for when ruleset was queued.
/// @param _start The start timestamp of the ruleset to check the status of.
/// @return The status of the approval hook.
function approvalStatusOf(uint256 _projectId, uint256 _rulesetId, uint256 _start)
public
view
override
returns (JBBallotState)
returns (JBApprovalStatus)
{
_projectId; // Prevents unused var compiler and natspec complaints.

// If the provided configured timestamp is after the start timestamp, the ballot is Failed.
if (_configured > _start) return JBBallotState.Failed;
// If the provided rulesetId timestamp is after the start timestamp, the approval hook is Failed.
if (_rulesetId > _start) return JBApprovalStatus.Failed;

unchecked {
// If there was sufficient time between configuration and the start of the cycle, it is approved. Otherwise, it is failed.
// If the ballot hasn't yet started, it's state is ApprovalExpected.
return (_start - _configured < duration)
? JBBallotState.Failed
// If there was sufficient time between queuing and the start of the ruleset, it is approved. Otherwise, it is failed.
// If the approval hook hasn't yet started, its approval status is ApprovalExpected.
return (_start - _rulesetId < duration)
? JBApprovalStatus.Failed
: (block.timestamp < _start - duration)
? JBBallotState.ApprovalExpected
: JBBallotState.Approved;
? JBApprovalStatus.ApprovalExpected
: JBApprovalStatus.Approved;
}
}

Expand All @@ -65,19 +58,16 @@ contract JBReconfigurationBufferBallot is ERC165, IJBFundingCycleBallot {
override(ERC165, IERC165)
returns (bool)
{
return _interfaceId == type(IJBFundingCycleBallot).interfaceId
return _interfaceId == type(IJBRulesetApprovalHook).interfaceId
|| super.supportsInterface(_interfaceId);
}

//*********************************************************************//
// -------------------------- constructor ---------------------------- //
//*********************************************************************//

/// @param _duration The number of seconds to wait until a reconfiguration can be either `Approved` or `Failed`.
/// @param _duration The minimum number of seconds between the time a ruleset is queued and that ruleset's `start` for it to be `Approved`.
constructor(uint256 _duration) {
// Insure we don't underflow in state Of
if (_duration > block.timestamp) revert WRONG_DURATION();

duration = _duration;
}
}
Loading