@@ -66,62 +66,6 @@ export class Origin {
66
66
return this . securityStatus ;
67
67
}
68
68
69
- /*private getSelectedScript(): ScriptInfo {
70
- const selectedTokenId = this.tokenScript.getSourceInfo().selectionId;
71
- const scriptSource = this.tokenScript.getSourceInfo();
72
-
73
- for (let i = 0; i < scriptSource?.scriptData.length; i++) {
74
- if (scriptSource.scriptData[i].tokenId == selectedTokenId) {
75
- return scriptSource.scriptData[i];
76
- }
77
- }
78
-
79
- return null;
80
- }*/
81
-
82
- /*private async validateByScriptRegistry(securityInfo: Partial<ISecurityInfo>) {
83
-
84
- //1. Discover which tokenId this is
85
- //2. Match the address in URL to the script in the sources
86
- //3. If IPFS, and script is authenticated, treat as trusted
87
- //4. If not IPFS, then validate from signature
88
- //const selectedElement = this.getSelectedScript();
89
- //const ipfsCid: string = securityInfo.ipfsCid;
90
-
91
- // now ensure the IPFS fetch matches
92
- const matches = this.tokenScript.getSourceInfo().sourceUrl.includes(ipfsCid);
93
-
94
- const sourceInfo = this.tokenScript.getSourceInfo();
95
-
96
- if (sourceInfo.scriptInfo &&
97
- sourceInfo.scriptInfo.type === ScriptSourceType.SCRIPT_REGISTRY &&
98
- sourceInfo
99
- ) {
100
- this.securityStatus = this.selectAuthenticationType(selectedElement);
101
- }
102
- }
103
-
104
- private selectAuthenticationType(selectedElement: ScriptInfo) {
105
- if (selectedElement.tokenId == 0) {
106
- if (selectedElement.name == '5169') {
107
- return {
108
- type: AuthenticationType.IPFS_CID,
109
- status: SecurityStatus.VALID,
110
- statusText: "The TokenScript IPFS CID matches the scriptURI specified by the contract"
111
- }
112
- } else {
113
- // Launchpad? If so it requires a signature
114
- return null;
115
- }
116
- } else {
117
- return {
118
- type: AuthenticationType.IPFS_REGISTRY,
119
- status: SecurityStatus.VALID,
120
- statusText: "The TokenScript IPFS CID matches the Authenticated scriptURI specified by the Registry"
121
- }
122
- }
123
- }*/
124
-
125
69
private async validateBySignerKey ( authPubKey : string , trustedKey ?: TrustedKey ) {
126
70
127
71
if ( trustedKey ) {
@@ -258,7 +202,7 @@ export class Origin {
258
202
259
203
this . securityStatus = {
260
204
type : AuthenticationType . IPFS_CID ,
261
- status : authenticated ? SecurityStatus . VALID : SecurityStatus . WARNING ,
205
+ status : authenticated ? SecurityStatus . VALID : SecurityStatus . INVALID ,
262
206
statusText :
263
207
( authenticated ?
264
208
"This TokenScript has been set by the contract owner" :
0 commit comments