From 26034ff05460e9d2f8499e066f59de94dae4c455 Mon Sep 17 00:00:00 2001 From: neokry Date: Thu, 21 Sep 2023 15:23:26 +0900 Subject: [PATCH] Adds get token to mirror --- src/token/interfaces/IMirrorToken.sol | 6 +++++- src/token/partial-mirror/IPartialMirrorToken.sol | 3 ++- src/token/partial-mirror/PartialMirrorToken.sol | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/token/interfaces/IMirrorToken.sol b/src/token/interfaces/IMirrorToken.sol index 09f2a12..b225d41 100644 --- a/src/token/interfaces/IMirrorToken.sol +++ b/src/token/interfaces/IMirrorToken.sol @@ -5,7 +5,11 @@ pragma solidity 0.8.16; /// @author Neokry /// @notice A token that allows mirroring another token's ownership interface IMirrorToken { - /// @notice Mirrors the ownership of a given tokenId from {tokenToMirror} + /// @notice Gets the token address being mirrored + /// @return The token address being mirrored + function getTokenToMirror() external view returns (address); + + /// @notice Mirrors the ownership of a given tokenId /// @param _tokenId The ERC-721 token to mirror function mirror(uint256 _tokenId) external; } diff --git a/src/token/partial-mirror/IPartialMirrorToken.sol b/src/token/partial-mirror/IPartialMirrorToken.sol index df8572b..940f712 100644 --- a/src/token/partial-mirror/IPartialMirrorToken.sol +++ b/src/token/partial-mirror/IPartialMirrorToken.sol @@ -5,12 +5,13 @@ import { IUUPS } from "../../lib/interfaces/IUUPS.sol"; import { IERC721Votes } from "../../lib/interfaces/IERC721Votes.sol"; import { IManager } from "../../manager/IManager.sol"; import { IBaseToken } from "../interfaces/IBaseToken.sol"; +import { IMirrorToken } from "../interfaces/IMirrorToken.sol"; import { PartialMirrorTokenTypesV1 } from "./types/PartialMirrorTokenTypesV1.sol"; /// @title IToken /// @author Neokry /// @notice The external Token events, errors and functions -interface IPartialMirrorToken is IUUPS, IERC721Votes, IBaseToken, PartialMirrorTokenTypesV1 { +interface IPartialMirrorToken is IUUPS, IERC721Votes, IBaseToken, IMirrorToken, PartialMirrorTokenTypesV1 { /// /// /// EVENTS /// /// /// diff --git a/src/token/partial-mirror/PartialMirrorToken.sol b/src/token/partial-mirror/PartialMirrorToken.sol index b623cdb..d5990c9 100644 --- a/src/token/partial-mirror/PartialMirrorToken.sol +++ b/src/token/partial-mirror/PartialMirrorToken.sol @@ -303,6 +303,11 @@ contract PartialMirrorToken is IPartialMirrorToken, VersionedContract, UUPS, Own /// /// /// Mirror /// /// /// + /// @notice Gets the token address being mirrored + /// @return The token address being mirrored + function getTokenToMirror() external view override returns (address) { + return tokenToMirror; + } /// @notice Mirrors the ownership of a given tokenId from the mirrored token /// @param _tokenId The ERC-721 token to mirror