From fcab5ed3d664d2b7433e42e243fccbdedae0e43e Mon Sep 17 00:00:00 2001 From: Apostolof Date: Fri, 20 Nov 2020 22:34:01 +0200 Subject: [PATCH] Add getUser contract function --- packages/concordia-contracts/contracts/Forum.sol | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/concordia-contracts/contracts/Forum.sol b/packages/concordia-contracts/contracts/Forum.sol index 5b15290..cff1f8c 100644 --- a/packages/concordia-contracts/contracts/Forum.sol +++ b/packages/concordia-contracts/contracts/Forum.sol @@ -1,5 +1,6 @@ //SPDX-License-Identifier: MIT pragma solidity 0.7.1; +pragma experimental ABIEncoderV2; contract Forum { @@ -73,6 +74,10 @@ contract Forum { return users[userAddress].timestamp; } + function getUser(address userAddress) public view returns (User memory) { + require(hasUserSignedUp(userAddress), "User hasn't signed up yet."); + return users[userAddress]; + } //----------------------------------------POSTING---------------------------------------- struct Topic {