From 634f08de93593c831e8b8ee2b05c9f409426463f Mon Sep 17 00:00:00 2001 From: superical Date: Mon, 8 Nov 2021 15:27:27 +0800 Subject: [PATCH] feat: add surrender function (#39) --- contracts/TitleEscrowCloneable.sol | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contracts/TitleEscrowCloneable.sol b/contracts/TitleEscrowCloneable.sol index 14efb742..8cfaef10 100644 --- a/contracts/TitleEscrowCloneable.sol +++ b/contracts/TitleEscrowCloneable.sol @@ -8,7 +8,6 @@ import "./interfaces/ITitleEscrow.sol"; import "./lib/Initializable.sol"; import { ERC721, ERC165 } from "./lib/ERC721.sol"; - contract TitleEscrowCloneable is Context, Initializable, ITitleEscrow, HasHolderInitializable, HasNamedBeneficiaryInitializable, ERC165 { // Documentation on how this smart contract works: https://docs.tradetrust.io/docs/overview/title-transfer @@ -106,6 +105,10 @@ contract TitleEscrowCloneable is Context, Initializable, ITitleEscrow, HasHolder _transferTo(newOwner); } + function surrender() external isHoldingToken onlyBeneficiary onlyHolder { + _transferTo(address(tokenRegistry)); + } + function transferToNewEscrow(address newBeneficiary, address newHolder) public override