-
Notifications
You must be signed in to change notification settings - Fork 0
/
RetirementCertificatesStorage.sol
55 lines (43 loc) · 1.78 KB
/
RetirementCertificatesStorage.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// SPDX-FileCopyrightText: 2021 Toucan Labs
//
// SPDX-License-Identifier: UNLICENSED
// If you encounter a vulnerability or an issue, please contact <[email protected]> or visit security.toucan.earth
pragma solidity 0.8.14;
abstract contract RetirementCertificatesStorageV1 {
struct Data {
uint256[] retirementEventIds;
uint256 createdAt;
address retiringEntity;
address beneficiary;
string retiringEntityString;
string beneficiaryString;
string retirementMessage;
}
/// @dev a RetirementEvent has a clear ownership relationship.
/// This relation is less clear in an NFT that already has a beneficiary set
struct RetirementEvent {
uint256 createdAt;
address retiringEntity;
/// @dev amount is denominated in 18 decimals, similar to amounts
/// in TCO2 contracts.
uint256 amount;
uint256 projectVintageTokenId;
}
/// @dev id that tracks retirement events
uint256 public retireEventCounter;
/// @dev maps the retireEventCounter to the RetirementEvent data
mapping(uint256 => RetirementEvent) public retirements;
/// @dev mapping that helps ensure retirement events are not claimed multiple times
mapping(uint256 => bool) public claimedEvents;
/// @dev List all the events belonging to user (maybe this could be better inferred via a subgraph)
mapping(address => uint256[]) eventsOfUser;
string public baseURI;
address public contractRegistry;
uint256 internal _tokenIds;
mapping(uint256 => Data) public certificates;
uint256 public minValidRetirementAmount;
}
/// @dev Kept separate from RetirementCertificatesStorageV1 to
/// add ReentrancyGuardUpgradeable in between.
abstract contract RetirementCertificatesStorage {
}