-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7211a0e
commit df1dd15
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: LicenseRef-DCL-1.0 | ||
// SPDX-FileCopyrightText: Copyright (c) 2020 thedavidmeister | ||
pragma solidity =0.8.25; | ||
|
||
import {ICloneableFactoryV2} from "rain.factory/interface/ICloneableFactoryV2.sol"; | ||
import {ReceiptFactoryTest} from "../abstract/ReceiptFactoryTest.sol"; | ||
import {Receipt} from "src/concrete/receipt/Receipt.sol"; | ||
import {TestReceipt} from "test/concrete/TestReceipt.sol"; | ||
|
||
library LibReceiptCreator { | ||
/// Helper to create child receipt. | ||
function createReceipt( | ||
ICloneableFactoryV2 factory, | ||
Receipt receiptImplementation, | ||
address owner | ||
) internal returns (TestReceipt) { | ||
// Clone TestReceipt using the factory and initialize it with the owner | ||
address clone = factory.clone(address(receiptImplementation), abi.encode(owner)); | ||
// Return the clone cast to TestReceipt type | ||
return TestReceipt(clone); | ||
} | ||
} |