📄 test/UnauthorizedCaller.sol
D-OPEN SOVEREIGN

Documentation & Insights

@title UnauthorizedCaller
@dev Simple contract for testing that unauthorized contracts cannot call protected BouncerStorage functions
1/*
2 * Copyright (c) 2026 DataPond D-Library Pty Ltd. ("The Sanctuary")
3 * Non-Profit Public Library — The World Library
4 * 
5 * D-SAFE Certification issued by POND Enterprise.
6 * Published under the D-Open Code Sovereign Licence v1.0 framework
7 * DataPond D-Library All exclusive Right reserved on modifiying the code - CC Attribution to data pond, Non modifiable, Non Commercial.
8 * https://registry.world.bibliotech.com/licence
9 * Source code donated to DataPond D-Library by it's author: data pond.
10 * 
11 * Technical Guardian ("The Shield"): Pond Enterprise Pty Ltd. (ACN 694 747 987)
12 * All liability claims about D-SAFE certification issues coming from the published D-Safe direction must be addressed with Pond Enterprise Pty Ltd.
13 * Code Modification automatically voids the certified liability protection provided by Pond Enterprise.
14 */
15
16// SPDX-License-Identifier: Apache-2.0
17pragma solidity ^0.8.24;
18
19import "../IBouncerStorage.sol";
20
21/**
22 * @title UnauthorizedCaller
23 * @dev Simple contract for testing that unauthorized contracts cannot call protected BouncerStorage functions
24 */
25contract UnauthorizedCaller {
26    function callNewAccount(
27        address bouncerStorageAddr,
28        address caller,
29        string calldata country,
30        string calldata language,
31        uint32 referredBy
32    ) external returns (string memory username, string memory countryStr, string memory languageStr, uint32 newUserId) {
33        IBouncerStorage bouncerStorage = IBouncerStorage(bouncerStorageAddr);
34        return bouncerStorage.newAccount(caller, country, language, referredBy);
35    }
36    
37    function callUnregister(
38        address bouncerStorageAddr,
39        address caller
40    ) external {
41        IBouncerStorage bouncerStorage = IBouncerStorage(bouncerStorageAddr);
42        bouncerStorage.unregister(caller);
43    }
44    
45    function callDefineCombinations(
46        address bouncerStorageAddr,
47        string[] calldata adjectives,
48        string[] calldata verbs
49    ) external {
50        IBouncerStorage bouncerStorage = IBouncerStorage(bouncerStorageAddr);
51        bouncerStorage.defineCombinations(adjectives, verbs);
52    }
53}