/
BirthCertificateRelic.sol
47 lines (39 loc) · 1.35 KB
/
BirthCertificateRelic.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
/// SPDX-License-Identifier: UNLICENSED
/// (c) Theori, Inc. 2022
/// All rights reserved
pragma solidity >=0.8.12;
import "@openzeppelin/contracts/access/Ownable.sol";
import "../RelicTokenConfigurable.sol";
import "../Reliquary.sol";
/**
* @title Birth Certificate Relic Token
* @author Theori, Inc.
* @notice Configurable soul-bound tokens issued to show an account's
* birth certificate
*/
contract BirthCertificateRelic is RelicTokenConfigurable {
Reliquary immutable reliquary;
FactSignature immutable BIRTH_CERTIFICATE_SIG;
constructor(Reliquary _reliquary) RelicToken() Ownable() {
BIRTH_CERTIFICATE_SIG = Facts.toFactSignature(Facts.NO_FEE, abi.encode("BirthCertificate"));
reliquary = _reliquary;
}
/**
* @inheritdoc RelicToken
* @dev Do not validate data as it may contain URI provider information
*/
function hasToken(
address who,
uint96 /* data */
) internal view override returns (bool result) {
(result, ) = reliquary.verifyFactVersionNoFee(who, BIRTH_CERTIFICATE_SIG);
}
/// @inheritdoc IERC721Metadata
function name() external pure override returns (string memory) {
return "Birth Certificate Relic";
}
/// @inheritdoc IERC721Metadata
function symbol() external pure override returns (string memory) {
return "BCR";
}
}