Smart Contract

RoyaltiesOverride

A.3cdbb3d569211ff3.RoyaltiesOverride

Deployed

1w ago
Feb 20, 2026, 04:31:30 AM UTC

Dependents

0 imports
1import MetadataViews from 0x1d7e57aa55817448
2
3access(all) contract RoyaltiesOverride {
4    access(all) entitlement Administrator
5
6    access(all) let StoragePath: StoragePath
7
8    access(all) resource Ledger {
9        access(account) let overrides: {Type: Bool}
10
11        access(Administrator) fun set(_ type: Type, _ b: Bool) {
12            self.overrides[type] = b
13        }
14
15        access(all) view fun get(_ type: Type): Bool {
16            return self.overrides[type] ?? false
17        }
18
19        access(Administrator) fun remove(_ type: Type) {
20            self.overrides.remove(key: type)
21        }
22
23        init() {
24            self.overrides = {}
25        }
26    }
27
28    access(all) view fun get(_ type: Type): Bool {
29        return self.account.storage.borrow<&Ledger>(from: RoyaltiesOverride.StoragePath)!.get(type)
30    }
31
32    init() {
33        self.StoragePath = /storage/RoyaltiesOverride
34        self.account.storage.save(<- create Ledger(), to: self.StoragePath)   
35    }
36}