forked from Open-Attestation/token-registry
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: title escrow factory (Open-Attestation#84)
* feat: composite factory * refactor: remove TitleEscrowCloner * chore: simplify test commands * refactor: export TitleEscrowFactory in lib * test: add test for TitleEscrowFactory
- Loading branch information
Showing
27 changed files
with
290 additions
and
352 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
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.0; | ||
|
||
import "@openzeppelin/contracts/proxy/Clones.sol"; | ||
import "./TitleEscrowCloneable.sol"; | ||
import "./interfaces/ITitleEscrowFactory.sol"; | ||
|
||
contract TitleEscrowFactory is ITitleEscrowFactory { | ||
address public override implementation; | ||
|
||
constructor() { | ||
implementation = address(new TitleEscrowCloneable()); | ||
} | ||
|
||
function create( | ||
address tokenRegistry, | ||
address beneficiary, | ||
address holder | ||
) external override returns (address) { | ||
address clone = Clones.clone(implementation); | ||
TitleEscrowCloneable(clone).initialize(tokenRegistry, beneficiary, holder, address(this)); | ||
|
||
emit TitleEscrowDeployed(address(clone), tokenRegistry, beneficiary, holder); | ||
|
||
return address(clone); | ||
} | ||
} |
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
This file was deleted.
Oops, something went wrong.
8 changes: 4 additions & 4 deletions
8
contracts/interfaces/ITitleEscrowCreator.sol → contracts/interfaces/ITitleEscrowFactory.sol
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
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
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.0; | ||
|
||
import "./TitleEscrowCloneableMock.sol"; | ||
import "../TitleEscrowFactory.sol"; | ||
|
||
contract TitleEscrowFactoryMock is TitleEscrowFactory { | ||
constructor() { | ||
implementation = address(new TitleEscrowCloneableMock()); | ||
} | ||
} |
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
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
/* eslint-disable camelcase */ | ||
export { | ||
TitleEscrowCloneable__factory as TitleEscrowCloneableFactory, | ||
TitleEscrowCloner__factory as TitleEscrowClonerFactory, | ||
TitleEscrowFactory__factory as TitleEscrowFactoryFactory, | ||
TradeTrustERC721__factory as TradeTrustERC721Factory, | ||
TitleEscrowCloneable, | ||
TitleEscrowCloner, | ||
TitleEscrowFactory, | ||
TradeTrustERC721, | ||
} from "./contracts"; |
Oops, something went wrong.