Skip to content

Commit

Permalink
Pass pwn hub owner in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
ashhanai committed Oct 24, 2022
1 parent e24373e commit 21bddb8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/hub/PWNHub.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ contract PWNHub is Ownable {
|* # CONSTRUCTOR *|
|*----------------------------------------------------------*/

constructor() Ownable() {

constructor(address owner) Ownable() {
_transferOwnership(owner);
}


Expand Down
2 changes: 1 addition & 1 deletion src/loan/type/PWNSimpleLoan.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ contract PWNSimpleLoan is PWNVault, IPWNLoanMetadataProvider {

/**
* @notice Struct defining a simple loan.
* @param status 0 == none/dead || 2 == running/accepted offer || 3 == paid back || 4 == expired.
* @param status 0 == none/dead || 2 == running/accepted offer/accepted request || 3 == paid back || 4 == expired.
* @param borrower Address of a borrower.
* @param expiration Unix timestamp (in seconds) setting up a default date.
* @param lateRepaymentEnabled If true, a borrower can repay a loan even after an expiration date, but not after lender claims expired loan.
Expand Down
2 changes: 1 addition & 1 deletion test/helper/BaseIntegrationTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ abstract contract BaseIntegrationTest is Test {
abi.encodeWithSignature("initialize(address,uint16,address)", address(this), 0, feeCollector)
);
config = PWNConfig(address(proxy));
hub = new PWNHub();
hub = new PWNHub(address(this));

loanToken = new PWNLOAN(address(hub));
simpleLoan = new PWNSimpleLoan(address(hub), address(loanToken), address(config));
Expand Down
6 changes: 2 additions & 4 deletions test/unit/PWNHub.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ abstract contract PWNHubTest is Test {
}

function setUp() external {
vm.prank(owner);
hub = new PWNHub();
hub = new PWNHub(owner);
}


Expand All @@ -48,8 +47,7 @@ contract PWNHub_Constructor_Test is PWNHubTest {
function test_shouldSetHubOwner() external {
address otherOwner = address(0x4321);

vm.prank(otherOwner);
hub = new PWNHub();
hub = new PWNHub(otherOwner);

assertTrue(hub.owner() == otherOwner);
}
Expand Down

0 comments on commit 21bddb8

Please sign in to comment.