The protocol owner will never be able to withdraw the funds.
pragma solidity ^0.8.19;
import "forge-std/Test.sol";
import "../src/MultiSig.sol";
import "../src/SoulboundProfileNFT.sol";
import "../src/LikeRegistry.sol";
contract TestMultisig is Test {
MultiSigWallet multiSig;
SoulboundProfileNFT soulboundNFT;
LikeRegistry likeRegistry;
address Alice = address(0x123);
address Bob = address(0x456);
address owner = makeAddr("owner");
function setUp() public {
vm.prank(owner);
soulboundNFT = new SoulboundProfileNFT();
vm.prank(owner);
likeRegistry = new LikeRegistry(address(soulboundNFT));
}
function testWithdrawlByOwner() public {
vm.prank(Alice);
soulboundNFT.mintProfile("Alice", 25, "ipfs://profileImage");
vm.prank(Bob);
soulboundNFT.mintProfile("Bob", 25, "ipfs://profileImage");
vm.deal(Alice, 10 ether);
vm.deal(Bob, 10 ether);
vm.prank(Alice);
(bool success,) = address(likeRegistry).call{value: 1 ether}(abi.encodeWithSignature("likeUser(address)", Bob));
vm.prank(Bob);
(bool success2,) =
address(likeRegistry).call{value: 1 ether}(abi.encodeWithSignature("likeUser(address)", Alice));
vm.prank(owner);
vm.expectRevert("No fees to withdraw");
likeRegistry.withdrawFees();
}
}
function likeUser(address liked) external payable {
...
if (likes[liked][msg.sender]) {
matches[msg.sender].push(liked);
matches[liked].push(msg.sender);
emit Matched(msg.sender, liked);
matchRewards(liked, msg.sender);
}
+ @> userBalances[msg.sender] += msg.value;
}