From e86bb0758878de314de10c311d2e2dc34113b4d2 Mon Sep 17 00:00:00 2001 From: "nicoacosta.eth" Date: Tue, 5 Nov 2024 21:25:30 -0300 Subject: [PATCH] feat: add user param to plasa view --- src/plasa/Plasa.sol | 4 ++-- src/plasa/interfaces/IPlasaView.sol | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plasa/Plasa.sol b/src/plasa/Plasa.sol index 7bf9872..d1a354b 100644 --- a/src/plasa/Plasa.sol +++ b/src/plasa/Plasa.sol @@ -86,11 +86,11 @@ contract Plasa is Ownable, IPlasa { } /// @inheritdoc IPlasaView - function getPlasaView() external view returns (PlasaView memory) { + function getPlasaView(address user) external view returns (PlasaView memory) { return PlasaView({ data: PlasaData({ contractAddress: address(this), namesContract: address(names) }), - user: PlasaUser({ isRegistered: isRegistered(msg.sender), username: getUsername(msg.sender) }) + user: PlasaUser({ isRegistered: isRegistered(user), username: getUsername(user) }) }); } } diff --git a/src/plasa/interfaces/IPlasaView.sol b/src/plasa/interfaces/IPlasaView.sol index b3d1b90..b225cab 100644 --- a/src/plasa/interfaces/IPlasaView.sol +++ b/src/plasa/interfaces/IPlasaView.sol @@ -29,6 +29,7 @@ interface IPlasaView { } /// @notice Retrieves the Plasa view data. + /// @param user The address of the user whose Plasa view data is to be retrieved. /// @return PlasaView The Plasa view data. - function getPlasaView() external view returns (PlasaView memory); + function getPlasaView(address user) external view returns (PlasaView memory); }