Skip to content

Commit

Permalink
fix ownership for create2 (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xgregthedev authored Jan 25, 2024
1 parent 5da8b31 commit e15b671
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
52 changes: 26 additions & 26 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ TestLoanCombinations:testLoan20For721SimpleInterestDutchFixedRepay() (gas: 59254
TestLoanCombinations:testLoan20for20SimpleInterestDutchFixedRepay() (gas: 599755)
TestLoanCombinations:testLoan721for20SimpleInterestDutchFixedRepay() (gas: 589973)
TestLoanCombinations:testLoanAstariaSettlementRepay() (gas: 579790)
TestNewLoan:testBuyNowPayLater() (gas: 3018513)
TestNewLoan:testNewLoanAs1271ProxyAccountSender() (gas: 874179)
TestNewLoan:testNewLoanAs1271ProxyAccountThirdPartyFiller() (gas: 885204)
TestNewLoan:testBuyNowPayLater() (gas: 3018543)
TestNewLoan:testNewLoanAs1271ProxyAccountSender() (gas: 874195)
TestNewLoan:testNewLoanAs1271ProxyAccountThirdPartyFiller() (gas: 885220)
TestNewLoan:testNewLoanERC721CollateralDefaultTerms2() (gas: 429635)
TestNewLoan:testNewLoanRefinance() (gas: 589971)
TestNewLoan:testNewLoanViaOriginatorBorrowerApprovalAndLenderApproval() (gas: 324707)
TestNewLoan:testNewLoanViaOriginatorLenderApproval() (gas: 383503)
TestNewLoan:testSettleLoan() (gas: 642156)
TestNewLoan:testSettleLoan() (gas: 642162)
TestPausableNonReentrant:testNotOwner() (gas: 21276)
TestPausableNonReentrant:testPauseAndUnpause() (gas: 22643)
TestPausableNonReentrant:testReentrancy() (gas: 15404)
Expand All @@ -101,42 +101,42 @@ TestSimpleInterestPricing:test_getRefinanceConsideration() (gas: 907796)
TestStarport:testAcquireTokensFail() (gas: 60473)
TestStarport:testAcquireTokensSuccess() (gas: 162844)
TestStarport:testActive() (gas: 69358)
TestStarport:testAdditionalTransfers() (gas: 300755)
TestStarport:testAdditionalTransfersOriginate() (gas: 275540)
TestStarport:testAdditionalTransfers() (gas: 300747)
TestStarport:testAdditionalTransfersOriginate() (gas: 275532)
TestStarport:testAdditionalTransfersRefinance() (gas: 218120)
TestStarport:testApplyRefinanceConsiderationToLoanMalformed() (gas: 129484)
TestStarport:testCannotIssueSameLoanTwice() (gas: 364125)
TestStarport:testCannotIssueSameLoanTwice() (gas: 364109)
TestStarport:testCannotOriginateWhilePaused() (gas: 73479)
TestStarport:testCannotSettleInvalidLoan() (gas: 74969)
TestStarport:testCannotSettleUnlessValidCustodian() (gas: 71007)
TestStarport:testCaveatEnforcerRevert() (gas: 102601)
TestStarport:testDefaultFeeRake1() (gas: 383458)
TestStarport:testDefaultFeeRake2() (gas: 445821)
TestStarport:testDefaultFeeRakeExoticDebt() (gas: 394368)
TestStarport:testEIP712Signing() (gas: 83109)
TestStarport:testCaveatEnforcerRevert() (gas: 102593)
TestStarport:testDefaultFeeRake1() (gas: 383442)
TestStarport:testDefaultFeeRake2() (gas: 445805)
TestStarport:testDefaultFeeRakeExoticDebt() (gas: 394352)
TestStarport:testEIP712Signing() (gas: 83093)
TestStarport:testExcessiveFeeRake() (gas: 19992)
TestStarport:testExoticDebtWithCustomPricingAndRepayment() (gas: 1237829)
TestStarport:testExoticDebtWithCustomPricingAndSettlement() (gas: 1695881)
TestStarport:testExoticDebtWithNoCaveatsNotAsBorrower() (gas: 376639)
TestStarport:testExoticDebtWithCustomPricingAndRepayment() (gas: 1237813)
TestStarport:testExoticDebtWithCustomPricingAndSettlement() (gas: 1695865)
TestStarport:testExoticDebtWithNoCaveatsNotAsBorrower() (gas: 376631)
TestStarport:testIncrementCaveatNonce() (gas: 35117)
TestStarport:testInitializedFlagSetProperly() (gas: 67372)
TestStarport:testInvalidAdditionalTransfersOriginate() (gas: 230426)
TestStarport:testInvalidAdditionalTransfersOriginate() (gas: 230418)
TestStarport:testInvalidAdditionalTransfersRefinance() (gas: 170620)
TestStarport:testInvalidAmountCollateral() (gas: 165968)
TestStarport:testInvalidAmountCollateral721() (gas: 165968)
TestStarport:testInvalidItemType() (gas: 151916)
TestStarport:testInvalidTransferLengthCollateral() (gas: 154185)
TestStarport:testInvalidTransferLengthDebt() (gas: 175984)
TestStarport:testInvalidAmountCollateral() (gas: 165960)
TestStarport:testInvalidAmountCollateral721() (gas: 165960)
TestStarport:testInvalidItemType() (gas: 151908)
TestStarport:testInvalidTransferLengthCollateral() (gas: 154177)
TestStarport:testInvalidTransferLengthDebt() (gas: 175976)
TestStarport:testInvalidateCaveatSalt() (gas: 33428)
TestStarport:testNonDefaultCustodianCustodyCallFails() (gas: 264267)
TestStarport:testNonDefaultCustodianCustodyCallSuccess() (gas: 290392)
TestStarport:testNonDefaultCustodianCustodyCallFails() (gas: 264259)
TestStarport:testNonDefaultCustodianCustodyCallSuccess() (gas: 290384)
TestStarport:testNonPayableFunctions() (gas: 114479)
TestStarport:testOverrideFeeRake() (gas: 379873)
TestStarport:testOverrideFeeRake() (gas: 379857)
TestStarport:testPause() (gas: 18127)
TestStarport:testRefinancePostRepaymentFails() (gas: 127765)
TestStarport:testStargateGetOwner() (gas: 8851)
TestStarport:testTokenNoCodeCollateral() (gas: 150707)
TestStarport:testTokenNoCodeDebt() (gas: 180980)
TestStarport:testTokenNoCodeCollateral() (gas: 150699)
TestStarport:testTokenNoCodeDebt() (gas: 180972)
TestStarport:testUnpause() (gas: 17187)
TestStrategistOriginator:testEncodeWithAccountCounter() (gas: 12429)
TestStrategistOriginator:testIncrementCounterAsStrategist() (gas: 38457)
Expand Down
4 changes: 2 additions & 2 deletions src/Starport.sol
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ contract Starport is PausableNonReentrant {
/* CONSTRUCTOR */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

constructor(address seaport_, Stargate stargate_) {
constructor(address seaport_, Stargate stargate_, address owner_) {
SG = stargate_;
chainId = block.chainid;
CACHED_DOMAIN_SEPARATOR = keccak256(abi.encode(EIP_DOMAIN, NAME, VERSION, block.chainid, address(this)));
Expand All @@ -177,7 +177,7 @@ contract Starport is PausableNonReentrant {
defaultCustodianCodeHash := extcodehash(custodian)
}
DEFAULT_CUSTODIAN_CODE_HASH = defaultCustodianCodeHash;
_initializeOwner(msg.sender);
_initializeOwner(owner_);
}

function domainSeparator() public view returns (bytes32) {
Expand Down
2 changes: 1 addition & 1 deletion test/StarportTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ contract StarportTest is BaseOrderTest, Stargate {
refinancer = makeAndAllocateAccount("refinancer");
fulfiller = makeAndAllocateAccount("fulfiller");

SP = new Starport(address(consideration), Stargate(address(this)));
SP = new Starport(address(consideration), Stargate(address(this)), address(this));
custodian = new Custodian(SP, address(consideration));
SO = new StrategistOriginator(SP, strategist.addr, address(this));
pricing = new SimpleInterestPricing(SP);
Expand Down

0 comments on commit e15b671

Please sign in to comment.