📄 Subscription.sol
D-OPEN SOVEREIGN
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 {ISubscriptionManager} from "./ISubscriptionManager.sol";
20import {ErrorLibrary} from "./ErrorLibrary.sol";
21
22contract Subscription {
23    ISubscriptionManager public subscriptionManager;
24
25    event SubscriptionManagerSet(address indexed addr);
26
27    address private _subscriptionOwner;
28
29    constructor() {
30        _subscriptionOwner = msg.sender;
31    }
32
33    modifier onlySubscriptionOwner() {
34        if (msg.sender != _subscriptionOwner) {
35            revert ErrorLibrary.OwnableInvalidOwner(msg.sender);
36        }
37        _;
38    }
39
40    function setSubscriptionManager(address addr) public onlySubscriptionOwner {
41        if (addr == address(0)) revert ErrorLibrary.EmptyAddress();
42        subscriptionManager = ISubscriptionManager(addr);
43        emit SubscriptionManagerSet(addr);
44    }
45}
46