Skip to content
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

Merge train r4 test #62

Open
wants to merge 10 commits into
base: merge-train-r4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ ROLES
Any protocol pauser can pause and unpause this contract

Anyone can call registerOracle to register a contract for use (firewall access)



*/

contract SmartCommitmentForwarder is
Expand Down Expand Up @@ -262,15 +265,12 @@ contract SmartCommitmentForwarder is
public view
returns (uint256) {


address pausingManager = IHasProtocolPausingManager( _tellerV2 ).getProtocolPausingManager();

return MathUpgradeable.max(
lastUnpausedAt,
IPausableTimestamp(pausingManager).getLastUnpausedAt()
)
;

);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ contract LenderCommitmentGroupFactory is OwnableUpgradeable {



/**
* @notice Initializes the factory contract.
* @param _lenderGroupBeacon The address of the beacon proxy used for deploying group contracts.
*/
function initialize(address _lenderGroupBeacon )
external
initializer
Expand All @@ -44,11 +48,14 @@ contract LenderCommitmentGroupFactory is OwnableUpgradeable {
}


/*
This should deploy a new lender commitment group pool contract.
It will use create commitment args in order to define the pool contracts parameters such as its primary principal token.
Shares will be distributed at a 1:1 ratio of the primary principal token so if 1e18 raw WETH are deposited, the depositor gets 1e18 shares for the group pool.
*/
/**
* @notice Deploys a new lender commitment group pool contract.
* @dev The function initializes the deployed contract and optionally adds an initial principal amount.
* @param _initialPrincipalAmount The initial principal amount to be deposited into the group contract.
* @param _commitmentGroupConfig Configuration parameters for the lender commitment group.
* @param _poolOracleRoutes Array of pool route configurations for the Uniswap pricing library.
* @return newGroupContract_ Address of the newly deployed group contract.
*/
function deployLenderCommitmentGroupPool(
uint256 _initialPrincipalAmount,
ILenderCommitmentGroup.CommitmentGroupConfig calldata _commitmentGroupConfig,
Expand All @@ -74,19 +81,12 @@ contract LenderCommitmentGroupFactory is OwnableUpgradeable {

//it is not absolutely necessary to have this call here but it allows the user to potentially save a tx step so it is nice to have .
if (_initialPrincipalAmount > 0) {
//should pull in the creators initial committed principal tokens .

//send the initial principal tokens to _newgroupcontract here !
// so it will have them for addPrincipalToCommitmentGroup which will pull them from here

_addPrincipalToCommitmentGroup(
_addPrincipalToCommitmentGroup(
address(newGroupContract_),
_initialPrincipalAmount,
_commitmentGroupConfig.principalTokenAddress

);


);
}


Expand All @@ -96,7 +96,12 @@ contract LenderCommitmentGroupFactory is OwnableUpgradeable {
}



/**
* @notice Adds principal tokens to a commitment group.
* @param _newGroupContract The address of the group contract to add principal tokens to.
* @param _initialPrincipalAmount The amount of principal tokens to add.
* @param _principalTokenAddress The address of the principal token contract.
*/
function _addPrincipalToCommitmentGroup(
address _newGroupContract,
uint256 _initialPrincipalAmount,
Expand Down
Loading
Loading