@0xobelisk/sui-common 1.1.8 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import v from"prettier";import
|
|
1
|
+
import v from"prettier";import X from"prettier-plugin-move-js";async function T(e,t){let r;t&&(r=await v.resolveConfig(t));try{return v.format(e,{plugins:[X],parser:"move-parse",printWidth:120,semi:!0,tabWidth:2,useTabs:!1,bracketSpacing:!0,...r})}catch(a){let n;return a instanceof Error?n=a.message:n=a,console.log(`Error during output formatting: ${n}`),e}}async function C(e){return v.format(e,{parser:"typescript"})}import $ from"node:fs/promises";import R from"node:path";import V from"debug";var b=V("dubhe:common"),Y=V("dubhe:common");b.log=console.debug.bind(console);Y.log=console.error.bind(console);var h=b.extend("codegen"),q=b.extend("codegen");h.log=console.debug.bind(console);q.log=console.error.bind(console);async function c(e,t,r){let a=await T(e),n=` // Copyright (c) Obelisk Labs, Inc.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
#[allow(unused_use)]
|
|
4
4
|
|
|
5
5
|
/* Autogenerated file. Do not edit manually. */
|
|
6
6
|
|
|
7
|
-
`,s="#[test_only]",n
|
|
7
|
+
`,s="#[test_only]",o=n+a,i="#[allow(lint(share_owned))]";t.includes(".toml")||t.includes("system")||t.includes("migrate")?o=a:t.includes("init")?o=s+a:t.includes("genesis")&&(o=i+a),await $.mkdir(R.dirname(t),{recursive:!0}),await $.writeFile(t,o),h(`${r}: ${t}`)}async function Te(e,t,r){let a=await C(e);await $.mkdir(R.dirname(t),{recursive:!0}),await $.writeFile(t,a),h(`${r}: ${t}`)}function Ve(e){return e.replace(/\\/g,"/")}import{existsSync as k}from"fs";import _ from"fs";function x(e){_.existsSync(e)&&(_.readdirSync(e).forEach(t=>{let r=`${e}/${t}`;_.lstatSync(r).isDirectory()?x(r):_.unlinkSync(r)}),_.rmdirSync(e))}function g(e){return Object.entries(e).map(([t,r])=>`${t}`).join(",")}function E(e){return`(${Object.entries(e).map(([t,r])=>`${r}`)})`}function p(e){return Object.entries(e).map(([t,r])=>`${t}: ${r}`)}function U(e){return Object.entries(e).map(([t,r])=>`self.${t}`)}function W(e,t){for(let r in e)if(e.hasOwnProperty(r)){let a=e[r];if(typeof a=="string"&&a===t||typeof a=="string"&&a.includes(t)&&a.includes(">"))return!0}return!1}async function O(e,t){console.log(`
|
|
8
8
|
\u{1F4C4} Starting Move.toml Generation...`),console.log(` \u2514\u2500 Output path: ${t}/contracts/${e.name}/Move.toml`);let r=`[package]
|
|
9
9
|
name = "${e.name}"
|
|
10
10
|
version = "1.0.0"
|
|
@@ -17,49 +17,49 @@ Dubhe = { git = "https://github.com/0xobelisk/dubhe-framework.git", rev = "dubhe
|
|
|
17
17
|
[addresses]
|
|
18
18
|
sui = "0x2"
|
|
19
19
|
${e.name} = "0x0"
|
|
20
|
-
`;await
|
|
21
|
-
`)}function N(e){return e.sort((t,r)=>{let a=t.charAt(0).toLowerCase(),
|
|
20
|
+
`;await c(r,`${t}/contracts/${e.name}/Move.toml`,"formatAndWriteMove"),console.log(`\u2705 Move.toml Generation Complete
|
|
21
|
+
`)}function N(e){return e.sort((t,r)=>{let a=t.charAt(0).toLowerCase(),n=r.charAt(0).toLowerCase();return a<n?-1:a>n?1:0})}function ee(e,t){return Object.entries(t).map(([r,a])=>`public(package) fun set_${r}(self: &mut ${e}, ${r}: ${a}) {
|
|
22
22
|
self.${r} = ${r};
|
|
23
23
|
}`).join(`
|
|
24
|
-
`)}function te(e,t){return`public(package) fun set(self: &mut ${e}, ${
|
|
24
|
+
`)}function te(e,t){return`public(package) fun set(self: &mut ${e}, ${p(t)}) {
|
|
25
25
|
${Object.entries(t).map(([r])=>`self.${r} = ${r};`).join(`
|
|
26
26
|
`)}
|
|
27
|
-
}`}function re(e,t){return`public fun get(self: &${e}): ${
|
|
28
|
-
(${
|
|
27
|
+
}`}function re(e,t){return`public fun get(self: &${e}): ${E(t)} {
|
|
28
|
+
(${U(t)})
|
|
29
29
|
}`}function ae(e,t){return Object.entries(t).map(([r,a])=>`public fun get_${r}(self: &${e}): ${a} {
|
|
30
30
|
self.${r}
|
|
31
31
|
}`).join(`
|
|
32
|
-
`)}function l(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase().replace(/^_/,"")}async function
|
|
33
|
-
\u{1F4E6} Starting Schema Data Generation...`);for(let a of Object.keys(t)){let
|
|
34
|
-
public enum ${
|
|
35
|
-
${
|
|
32
|
+
`)}function l(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase().replace(/^_/,"")}async function j(e,t,r){console.log(`
|
|
33
|
+
\u{1F4E6} Starting Schema Data Generation...`);for(let a of Object.keys(t)){let n=a,s=t[a];console.log(` \u2514\u2500 ${n} ${Array.isArray(s)?"(enum)":"(struct)"}: ${JSON.stringify(s)}`);let o="",i=Object.keys(t).filter(u=>Array.isArray(t[u])).map(u=>u);if(Array.isArray(s)){let u=N(s);o=`module ${e}::${e}_${l(n)} {
|
|
34
|
+
public enum ${n} has copy, drop , store {
|
|
35
|
+
${u}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
${
|
|
39
|
-
${
|
|
40
|
-
}`).join("")}`}else
|
|
38
|
+
${u.map(m=>`public fun new_${l(m)}(): ${n} {
|
|
39
|
+
${n}::${m}
|
|
40
|
+
}`).join("")}`}else o=`module ${e}::${e}_${l(n)} {
|
|
41
41
|
use std::ascii::String;
|
|
42
42
|
|
|
43
|
-
${Object.keys(t).map(
|
|
43
|
+
${Object.keys(t).map(u=>{if(W(s,u))return`use ${e}::${e}_${l(u)}::${u};`}).filter(Boolean).join(`
|
|
44
44
|
`)}
|
|
45
45
|
|
|
46
|
-
public struct ${
|
|
47
|
-
${
|
|
46
|
+
public struct ${n} has copy, drop , store {
|
|
47
|
+
${p(s)}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
public fun new(${
|
|
51
|
-
${
|
|
52
|
-
${
|
|
50
|
+
public fun new(${p(s)}): ${n} {
|
|
51
|
+
${n} {
|
|
52
|
+
${g(s)}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
${re(
|
|
57
|
-
${ae(
|
|
58
|
-
${ee(
|
|
59
|
-
${te(
|
|
60
|
-
}`;await
|
|
56
|
+
${re(n,s)}
|
|
57
|
+
${ae(n,s)}
|
|
58
|
+
${ee(n,s)}
|
|
59
|
+
${te(n,s)}
|
|
60
|
+
}`;await c(o,`${r}/contracts/${e}/sources/codegen/data/${l(n)}.move`,"formatAndWriteMove")}}function se(e,t){return t!=null?Object.keys(t).map(a=>`use ${e}::${e}_${l(a)}::${a};`).join(`
|
|
61
61
|
`):""}async function w(e,t,r,a){console.log(`
|
|
62
|
-
\u{1F528} Starting Schema Structure Generation...`),Object.entries(r).forEach(([s,
|
|
62
|
+
\u{1F528} Starting Schema Structure Generation...`),Object.entries(r).forEach(([s,o])=>{console.log(` \u2514\u2500 ${s}: ${o}`)});let n=`module ${e}::${e}_schema {
|
|
63
63
|
use std::ascii::String;
|
|
64
64
|
use std::ascii::string;
|
|
65
65
|
use sui::package::UpgradeCap;
|
|
@@ -69,16 +69,70 @@ ${e.name} = "0x0"
|
|
|
69
69
|
use dubhe::storage_map::{Self, StorageMap};
|
|
70
70
|
use dubhe::storage_double_map::{Self, StorageDoubleMap};
|
|
71
71
|
use sui::dynamic_field as df;
|
|
72
|
+
use ${e}::${e}_dapp_metadata::DappMetadata;
|
|
72
73
|
|
|
73
74
|
${se(e,t)}
|
|
74
75
|
|
|
75
76
|
public struct Schema has key, store { id: UID }
|
|
77
|
+
|
|
78
|
+
// Default storage
|
|
79
|
+
public fun borrow_dapp__admin(self: &Schema): &StorageValue<address> {
|
|
80
|
+
storage::borrow_field(&self.id, b"dapp__admin")
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public fun borrow_dapp__package_id(self: &Schema): &StorageValue<address> {
|
|
84
|
+
storage::borrow_field(&self.id, b"dapp__package_id")
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public fun borrow_dapp__version(self: &Schema): &StorageValue<u32> {
|
|
88
|
+
storage::borrow_field(&self.id, b"dapp__version")
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
public fun borrow_dapp__metadata(self: &Schema): &StorageValue<DappMetadata> {
|
|
92
|
+
storage::borrow_field(&self.id, b"dapp__metadata")
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public fun borrow_dapp__safe_mode(self: &Schema): &StorageValue<bool> {
|
|
96
|
+
storage::borrow_field(&self.id, b"dapp__safe_mode")
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
public fun borrow_dapp__authorised_schemas(self: &Schema): &StorageValue<vector<address>> {
|
|
100
|
+
storage::borrow_field(&self.id, b"dapp__authorised_schemas")
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
public fun borrow_dapp__schemas(self: &Schema): &StorageValue<vector<address>> {
|
|
104
|
+
storage::borrow_field(&self.id, b"dapp__schemas")
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
public(package) fun dapp__admin(self: &mut Schema): &mut StorageValue<address> {
|
|
108
|
+
storage::borrow_mut_field(&mut self.id, b"dapp__admin")
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
public(package) fun dapp__package_id(self: &mut Schema): &mut StorageValue<address> {
|
|
112
|
+
storage::borrow_mut_field(&mut self.id, b"dapp__package_id")
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
public(package) fun dapp__version(self: &mut Schema): &mut StorageValue<u32> {
|
|
116
|
+
storage::borrow_mut_field(&mut self.id, b"dapp__version")
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
public(package) fun dapp__metadata(self: &mut Schema): &mut StorageValue<DappMetadata> {
|
|
120
|
+
storage::borrow_mut_field(&mut self.id, b"dapp__metadata")
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
public(package) fun dapp__safe_mode(self: &mut Schema): &mut StorageValue<bool> {
|
|
124
|
+
storage::borrow_mut_field(&mut self.id, b"dapp__safe_mode")
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
public(package) fun dapp__authorised_schemas(self: &mut Schema): &mut StorageValue<vector<address>> {
|
|
128
|
+
storage::borrow_mut_field(&mut self.id, b"dapp__authorised_schemas")
|
|
129
|
+
}
|
|
76
130
|
|
|
77
|
-
${Object.entries(r).map(([s,
|
|
131
|
+
${Object.entries(r).map(([s,o])=>`public fun borrow_${s}(self: &Schema) : &${o} {
|
|
78
132
|
storage::borrow_field(&self.id, b"${s}")
|
|
79
133
|
}
|
|
80
134
|
|
|
81
|
-
public(package) fun ${s}(self: &mut Schema): &mut ${
|
|
135
|
+
public(package) fun ${s}(self: &mut Schema): &mut ${o} {
|
|
82
136
|
storage::borrow_mut_field(&mut self.id, b"${s}")
|
|
83
137
|
}
|
|
84
138
|
`).join("")}
|
|
@@ -86,7 +140,7 @@ ${e.name} = "0x0"
|
|
|
86
140
|
|
|
87
141
|
public(package) fun create(ctx: &mut TxContext): Schema {
|
|
88
142
|
let mut id = object::new(ctx);
|
|
89
|
-
${Object.entries(r).map(([s,
|
|
143
|
+
${Object.entries(r).map(([s,o])=>{let i="";return o.includes("StorageValue")?i=`storage_value::new(b"${s}", ctx)`:o.includes("StorageMap")?i=`storage_map::new(b"${s}", ctx)`:o.includes("StorageDoubleMap")&&(i=`storage_double_map::new(b"${s}", ctx)`),`storage::add_field<${o}>(&mut id, b"${s}", ${i});`}).join(`
|
|
90
144
|
`)}
|
|
91
145
|
|
|
92
146
|
Schema { id }
|
|
@@ -100,369 +154,285 @@ ${e.name} = "0x0"
|
|
|
100
154
|
&self.id
|
|
101
155
|
}
|
|
102
156
|
|
|
103
|
-
|
|
157
|
+
public fun migrate(_schema: &mut Schema, _ctx: &mut TxContext) { }
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
public(package) fun upgrade(schema: &mut Schema, new_package_id: address, new_version: u32, ctx: &mut TxContext) {
|
|
161
|
+
assert!(schema.dapp__metadata().contains(), 0);
|
|
162
|
+
assert!(schema.dapp__admin().get() == ctx.sender(), 0);
|
|
163
|
+
schema.dapp__package_id().set(new_package_id);
|
|
164
|
+
let current_version = schema.dapp__version()[];
|
|
165
|
+
assert!(current_version < new_version, 0);
|
|
166
|
+
schema.dapp__version().set(new_version);
|
|
167
|
+
schema.migrate(ctx);
|
|
168
|
+
}
|
|
104
169
|
|
|
105
170
|
|
|
106
171
|
// ======================================== View Functions ========================================
|
|
107
|
-
${Object.entries(r).map(([s,
|
|
108
|
-
self.borrow_${s}().${
|
|
172
|
+
${Object.entries(r).map(([s,o])=>{let i=o.match(/<(.+)>/)[1].split(",").map(P=>P.trim()),u=[],m="",f="";return o.includes("StorageValue")?(u=[],m=`${i[0]}`,f="get()"):o.includes("StorageMap")?(u=[`key: ${i[0]}`],m=`${i[1]}`,f="get(key)"):o.includes("StorageDoubleMap")&&(u=[`key1: ${i[0]}`,`key2: ${i[1]}`],m=`${i[2]}`,f="get(key1, key2)"),`public fun get_${s}(self: &Schema, ${u}) : &${m} {
|
|
173
|
+
self.borrow_${s}().${f}
|
|
109
174
|
}`}).join(`
|
|
110
175
|
`)}
|
|
111
176
|
// =========================================================================================================
|
|
112
|
-
}`;await
|
|
177
|
+
}`;await c(n,`${a}/contracts/${e}/sources/codegen/core/schema.move`,"formatAndWriteMove")}import{existsSync as F}from"fs";async function L(e,t){let r=`${t}/contracts/${e.name}/sources/scripts/deploy_hook.move`;if(!F(r)){let a=`module ${e.name}::${e.name}_deploy_hook {
|
|
113
178
|
use ${e.name}::${e.name}_schema::Schema;
|
|
114
179
|
|
|
115
180
|
public(package) fun run(_schema: &mut Schema, _ctx: &mut TxContext) {
|
|
116
181
|
|
|
117
182
|
}
|
|
118
|
-
}`;await
|
|
183
|
+
}`;await c(a,r,"formatAndWriteMove")}}async function B(e,t){if(!F(`${t}/contracts/${e.name}/sources/scripts/migrate.move`)){let r=`module ${e.name}::${e.name}_migrate {
|
|
119
184
|
const ON_CHAIN_VERSION: u32 = 1;
|
|
120
185
|
|
|
121
186
|
public fun on_chain_version(): u32 {
|
|
122
187
|
ON_CHAIN_VERSION
|
|
123
188
|
}
|
|
124
189
|
}
|
|
125
|
-
`;await
|
|
190
|
+
`;await c(r,`${t}/contracts/${e.name}/sources/scripts/migrate.move`,"formatAndWriteMove")}}function d(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}function oe(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase().replace(/^_/,"")}function I(e,t){return t!=null?Object.keys(t).map(a=>`use ${e}::${e}_${oe(a)}::${a};`).join(`
|
|
126
191
|
`):""}async function D(e,t,r,a){console.log(`
|
|
127
|
-
\u{1F4E6} Starting Schema Event Generation...`);for(let s of Object.keys(r)){let
|
|
192
|
+
\u{1F4E6} Starting Schema Event Generation...`);for(let s of Object.keys(r)){let o=s,i=r[s];console.log(` \u2514\u2500 ${o} event: ${JSON.stringify(i)}`);let u=`module ${e}::${e}_${o}_event {
|
|
128
193
|
use sui::event;
|
|
129
194
|
use std::ascii::String;
|
|
130
|
-
${
|
|
195
|
+
${I(e,t)}
|
|
131
196
|
|
|
132
|
-
public struct ${d(
|
|
133
|
-
${
|
|
197
|
+
public struct ${d(o)}Event has copy, drop {
|
|
198
|
+
${p(i)}
|
|
134
199
|
}
|
|
135
200
|
|
|
136
|
-
public fun new(${
|
|
137
|
-
${d(
|
|
138
|
-
${
|
|
201
|
+
public fun new(${p(i)}): ${d(o)}Event {
|
|
202
|
+
${d(o)}Event {
|
|
203
|
+
${g(i)}
|
|
139
204
|
}
|
|
140
205
|
}
|
|
141
|
-
}`;await
|
|
206
|
+
}`;await c(u,`${a}/contracts/${e}/sources/codegen/data/${o}_event.move`,"formatAndWriteMove")}let n=`module ${e}::${e}_events {
|
|
142
207
|
use std::ascii::{String, string};
|
|
143
|
-
${
|
|
144
|
-
${Object.entries(r).map(([s,
|
|
208
|
+
${I(e,t)}
|
|
209
|
+
${Object.entries(r).map(([s,o])=>`
|
|
145
210
|
use ${e}::${e}_${s}_event::${d(s)}Event;
|
|
146
211
|
use ${e}::${e}_${s}_event;
|
|
147
|
-
public fun ${s}_event(${
|
|
212
|
+
public fun ${s}_event(${p(o)}) {
|
|
148
213
|
dubhe::storage_event::emit_set_record<${d(s)}Event, ${d(s)}Event, ${d(s)}Event>(
|
|
149
214
|
string(b"${s}_event"),
|
|
150
215
|
option::none(),
|
|
151
216
|
option::none(),
|
|
152
|
-
option::some(${e}_${s}_event::new(${
|
|
217
|
+
option::some(${e}_${s}_event::new(${g(o)}))
|
|
153
218
|
)
|
|
154
219
|
}
|
|
155
220
|
`).join(`
|
|
156
221
|
`)}
|
|
157
|
-
}`;await
|
|
222
|
+
}`;await c(n,`${a}/contracts/${e}/sources/codegen/events.move`,"formatAndWriteMove")}import{existsSync as ne}from"fs";import ie from"node:fs/promises";async function G(e,t){ne(`${t}/contracts/${e.name}/sources/systems`)||await ie.mkdir(`${t}/contracts/${e.name}/sources/systems`,{recursive:!0})}async function z(e,t,r){console.log(`
|
|
158
223
|
\u{1F4E6} Starting Schema Error Generation...`);let a=`module ${e}::${e}_errors {
|
|
159
|
-
${Object.entries(t).map(([
|
|
160
|
-
const ${
|
|
161
|
-
public fun ${
|
|
224
|
+
${Object.entries(t).map(([n,s])=>(console.log(` \u2514\u2500 ${n}: ${s}`),`#[error]
|
|
225
|
+
const ${n.toUpperCase()}: vector<u8> = b"${s}";
|
|
226
|
+
public fun ${n}_error(condition: bool) { assert!(condition, ${n.toUpperCase()}) }
|
|
162
227
|
`)).join(`
|
|
163
228
|
`)}
|
|
164
|
-
}`;await
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
public struct DappMetadata has drop, copy, store {
|
|
168
|
-
name: String,
|
|
169
|
-
description: String,
|
|
170
|
-
icon_url: String,
|
|
171
|
-
website_url: String,
|
|
172
|
-
created_at: u64,
|
|
173
|
-
partners: vector<String>,
|
|
174
|
-
}
|
|
229
|
+
}`;await c(a,`${r}/contracts/${e}/sources/codegen/errors.move`,"formatAndWriteMove")}import{existsSync as K}from"fs";async function H(e,t){await ce(e,t),await ue(e,t)}async function ce(e,t){let r=`${t}/contracts/${e.name}/sources/codegen/core/metadata.move`;if(!K(r)){let a=`module ${e.name}::${e.name}_dapp_metadata {
|
|
230
|
+
use std::ascii::String;
|
|
175
231
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
232
|
+
public struct DappMetadata has drop, copy, store {
|
|
233
|
+
name: String,
|
|
234
|
+
description: String,
|
|
235
|
+
cover_url: vector<String>,
|
|
236
|
+
website_url: String,
|
|
237
|
+
created_at: u64,
|
|
238
|
+
partners: vector<String>,
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
public fun new(
|
|
242
|
+
name: String,
|
|
243
|
+
description: String,
|
|
244
|
+
cover_url: vector<String>,
|
|
245
|
+
website_url: String,
|
|
246
|
+
created_at: u64,
|
|
247
|
+
partners: vector<String>,
|
|
248
|
+
): DappMetadata {
|
|
249
|
+
DappMetadata {
|
|
185
250
|
name,
|
|
186
251
|
description,
|
|
187
|
-
|
|
252
|
+
cover_url,
|
|
188
253
|
website_url,
|
|
189
254
|
created_at,
|
|
190
255
|
partners,
|
|
191
256
|
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
public fun set(
|
|
195
|
-
self: &mut DappMetadata,
|
|
196
|
-
name: String,
|
|
197
|
-
description: String,
|
|
198
|
-
icon_url: String,
|
|
199
|
-
website_url: String,
|
|
200
|
-
created_at: u64,
|
|
201
|
-
partners: vector<String>,
|
|
202
|
-
) {
|
|
203
|
-
self.name = name;
|
|
204
|
-
self.description = description;
|
|
205
|
-
self.icon_url = icon_url;
|
|
206
|
-
self.website_url = website_url;
|
|
207
|
-
self.created_at = created_at;
|
|
208
|
-
self.partners = partners;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
public fun set_name(self: &mut DappMetadata, name: String) {
|
|
212
|
-
self.name = name;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
public fun set_description(self: &mut DappMetadata, description: String) {
|
|
216
|
-
self.description = description;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
public fun set_icon_url(self: &mut DappMetadata, icon_url: String) {
|
|
220
|
-
self.icon_url = icon_url;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
public fun set_website_url(self: &mut DappMetadata, website_url: String) {
|
|
224
|
-
self.website_url = website_url;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
public fun set_created_at(self: &mut DappMetadata, created_at: u64) {
|
|
228
|
-
self.created_at = created_at;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
public fun set_partners(self: &mut DappMetadata, partners: vector<String>) {
|
|
232
|
-
self.partners = partners;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
public fun get_name(self: &DappMetadata): String {
|
|
236
|
-
self.name
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
public fun get_description(self: &DappMetadata): String {
|
|
240
|
-
self.description
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
public fun get_icon_url(self: &DappMetadata): String {
|
|
244
|
-
self.icon_url
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
public fun get_website_url(self: &DappMetadata): String {
|
|
248
|
-
self.website_url
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
public fun get_created_at(self: &DappMetadata): u64 {
|
|
252
|
-
self.created_at
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
public fun get_partners(self: &DappMetadata): vector<String> {
|
|
256
|
-
self.partners
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
`;await i(a,r,"formatAndWriteMove")}}async function pe(e,t){let r=`${t}/contracts/${e.name}/sources/codegen/dapp/schema.move`;if(!k(r)){let a=`module ${e.name}::${e.name}_dapp_schema {
|
|
261
|
-
use ${e.name}::${e.name}_dapp_metadata::DappMetadata;
|
|
262
|
-
use dubhe::storage_value;
|
|
263
|
-
use dubhe::storage_value::StorageValue;
|
|
264
|
-
use dubhe::storage;
|
|
265
|
-
use sui::transfer::public_share_object;
|
|
266
|
-
use dubhe::type_info;
|
|
267
|
-
|
|
268
|
-
public struct Dapp has key, store {
|
|
269
|
-
id: UID,
|
|
270
257
|
}
|
|
271
258
|
|
|
272
|
-
public fun
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
259
|
+
public fun set(
|
|
260
|
+
self: &mut DappMetadata,
|
|
261
|
+
name: String,
|
|
262
|
+
description: String,
|
|
263
|
+
cover_url: vector<String>,
|
|
264
|
+
website_url: String,
|
|
265
|
+
created_at: u64,
|
|
266
|
+
partners: vector<String>,
|
|
267
|
+
) {
|
|
268
|
+
self.name = name;
|
|
269
|
+
self.description = description;
|
|
270
|
+
self.cover_url = cover_url;
|
|
271
|
+
self.website_url = website_url;
|
|
272
|
+
self.created_at = created_at;
|
|
273
|
+
self.partners = partners;
|
|
282
274
|
}
|
|
283
275
|
|
|
284
|
-
public
|
|
285
|
-
|
|
276
|
+
public fun set_name(self: &mut DappMetadata, name: String) {
|
|
277
|
+
self.name = name;
|
|
286
278
|
}
|
|
287
279
|
|
|
288
|
-
public fun
|
|
289
|
-
|
|
280
|
+
public fun set_description(self: &mut DappMetadata, description: String) {
|
|
281
|
+
self.description = description;
|
|
290
282
|
}
|
|
291
283
|
|
|
292
|
-
public
|
|
293
|
-
|
|
284
|
+
public fun set_cover_url(self: &mut DappMetadata, cover_url: vector<String>) {
|
|
285
|
+
self.cover_url = cover_url;
|
|
294
286
|
}
|
|
295
287
|
|
|
296
|
-
public fun
|
|
297
|
-
|
|
288
|
+
public fun set_website_url(self: &mut DappMetadata, website_url: String) {
|
|
289
|
+
self.website_url = website_url;
|
|
298
290
|
}
|
|
299
291
|
|
|
300
|
-
public
|
|
301
|
-
|
|
292
|
+
public fun set_created_at(self: &mut DappMetadata, created_at: u64) {
|
|
293
|
+
self.created_at = created_at;
|
|
302
294
|
}
|
|
303
295
|
|
|
304
|
-
public fun
|
|
305
|
-
|
|
296
|
+
public fun set_partners(self: &mut DappMetadata, partners: vector<String>) {
|
|
297
|
+
self.partners = partners;
|
|
306
298
|
}
|
|
307
299
|
|
|
308
|
-
public
|
|
309
|
-
|
|
300
|
+
public fun get_name(self: &DappMetadata): String {
|
|
301
|
+
self.name
|
|
310
302
|
}
|
|
311
|
-
|
|
312
|
-
public(package) fun borrow_schemas(self: &Dapp): &StorageValue<vector<address>> {
|
|
313
|
-
storage::borrow_field(&self.id, b"schemas")
|
|
314
|
-
}
|
|
315
303
|
|
|
316
|
-
public
|
|
317
|
-
|
|
304
|
+
public fun get_description(self: &DappMetadata): String {
|
|
305
|
+
self.description
|
|
318
306
|
}
|
|
319
307
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
let mut id = object::new(ctx);
|
|
323
|
-
storage::add_field<StorageValue<address>>(&mut id, b"admin", storage_value::new(b"admin", ctx));
|
|
324
|
-
storage::add_field<StorageValue<address>>(&mut id, b"package_id", storage_value::new(b"package_id", ctx));
|
|
325
|
-
storage::add_field<StorageValue<u32>>(&mut id, b"version", storage_value::new(b"version", ctx));
|
|
326
|
-
storage::add_field<StorageValue<DappMetadata>>(&mut id, b"metadata", storage_value::new(b"metadata", ctx));
|
|
327
|
-
storage::add_field<StorageValue<bool>>(&mut id, b"safe_mode", storage_value::new(b"safe_mode", ctx));
|
|
328
|
-
storage::add_field<StorageValue<vector<address>>>(&mut id, b"schemas", storage_value::new(b"schemas", ctx));
|
|
329
|
-
Dapp { id }
|
|
308
|
+
public fun get_cover_url(self: &DappMetadata): vector<String> {
|
|
309
|
+
self.cover_url
|
|
330
310
|
}
|
|
331
311
|
|
|
332
|
-
public
|
|
333
|
-
|
|
334
|
-
assert!(dapp.borrow_admin().get() == ctx.sender(), 0);
|
|
335
|
-
let new_package_id = type_info::current_package_id<DappKey>();
|
|
336
|
-
dapp.package_id().set(new_package_id);
|
|
337
|
-
let current_version = dapp.version()[];
|
|
338
|
-
dapp.version().set(current_version + 1);
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
public(package) fun add_schema<Schema: key + store>(dapp: &mut Dapp, schema: Schema) {
|
|
342
|
-
let mut schemas = dapp.schemas()[];
|
|
343
|
-
schemas.push_back(object::id_address<Schema>(&schema));
|
|
344
|
-
dapp.schemas().set(schemas);
|
|
345
|
-
public_share_object(schema);
|
|
312
|
+
public fun get_website_url(self: &DappMetadata): String {
|
|
313
|
+
self.website_url
|
|
346
314
|
}
|
|
347
315
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
public fun create_dapp_for_testing(ctx: &mut TxContext): Dapp {
|
|
351
|
-
create(ctx)
|
|
316
|
+
public fun get_created_at(self: &DappMetadata): u64 {
|
|
317
|
+
self.created_at
|
|
352
318
|
}
|
|
353
319
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
public fun distroy_dapp_for_testing(dapp: Dapp) {
|
|
357
|
-
let Dapp { id } = dapp;
|
|
358
|
-
id.delete();
|
|
320
|
+
public fun get_partners(self: &DappMetadata): vector<String> {
|
|
321
|
+
self.partners
|
|
359
322
|
}
|
|
360
323
|
}
|
|
361
|
-
`;await
|
|
324
|
+
`;await c(a,r,"formatAndWriteMove")}}async function ue(e,t){let r=`${t}/contracts/${e.name}/sources/codegen/core/system.move`;if(!K(r)){let a=`module ${e.name}::${e.name}_dapp_system {
|
|
362
325
|
use std::ascii::String;
|
|
363
326
|
use std::ascii;
|
|
364
327
|
use dubhe::type_info;
|
|
365
328
|
use sui::clock::Clock;
|
|
366
|
-
use
|
|
329
|
+
use sui::transfer::public_share_object;
|
|
330
|
+
use ${e.name}::${e.name}_schema::Schema;
|
|
367
331
|
use ${e.name}::${e.name}_dapp_metadata;
|
|
368
|
-
use ${e.name}::${e.name}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
DappKey { }
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
public(package) fun create(name: String, description: String, clock: &Clock, ctx: &mut TxContext): Dapp {
|
|
376
|
-
let mut dapp = ${e.name}_dapp_schema::create(ctx);
|
|
377
|
-
assert!(!dapp.borrow_metadata().contains(), 0);
|
|
378
|
-
dapp.metadata().set(
|
|
379
|
-
${e.name}_dapp_metadata::new(
|
|
380
|
-
name,
|
|
381
|
-
description,
|
|
382
|
-
ascii::string(b""),
|
|
383
|
-
ascii::string(b""),
|
|
384
|
-
clock.timestamp_ms(),
|
|
385
|
-
vector[]
|
|
386
|
-
)
|
|
387
|
-
);
|
|
388
|
-
let package_id = type_info::current_package_id<DappKey>();
|
|
389
|
-
dapp.package_id().set(package_id);
|
|
390
|
-
dapp.admin().set(ctx.sender());
|
|
391
|
-
dapp.version().set(1);
|
|
392
|
-
dapp.safe_mode().set(false);
|
|
393
|
-
dapp.schemas().set(vector[]);
|
|
394
|
-
dapp
|
|
395
|
-
}
|
|
332
|
+
use ${e.name}::${e.name}_dapp_metadata::DappMetadata;
|
|
333
|
+
use dubhe::storage::add_field;
|
|
334
|
+
use dubhe::storage_value;
|
|
335
|
+
use dubhe::storage_value::StorageValue;
|
|
396
336
|
|
|
397
337
|
public entry fun set_metadata(
|
|
398
|
-
|
|
338
|
+
schema: &mut Schema,
|
|
399
339
|
name: String,
|
|
400
340
|
description: String,
|
|
401
|
-
|
|
341
|
+
cover_url: vector<String>,
|
|
402
342
|
website_url: String,
|
|
403
343
|
partners: vector<String>,
|
|
404
344
|
ctx: &TxContext,
|
|
405
345
|
) {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
let created_at =
|
|
409
|
-
|
|
346
|
+
let admin = schema.dapp__admin().try_get();
|
|
347
|
+
assert!(admin == option::some(ctx.sender()), 0);
|
|
348
|
+
let created_at = schema.dapp__metadata().get().get_created_at();
|
|
349
|
+
schema.dapp__metadata().set(
|
|
410
350
|
${e.name}_dapp_metadata::new(
|
|
411
351
|
name,
|
|
412
352
|
description,
|
|
413
|
-
|
|
353
|
+
cover_url,
|
|
414
354
|
website_url,
|
|
415
355
|
created_at,
|
|
416
356
|
partners
|
|
417
357
|
)
|
|
418
358
|
);
|
|
419
|
-
|
|
359
|
+
}
|
|
420
360
|
|
|
421
|
-
public entry fun transfer_ownership(dapp: &mut Dapp, new_admin: address, ctx: &mut TxContext) {
|
|
422
|
-
let admin = dapp.admin().try_get();
|
|
423
|
-
assert!(admin == option::some(ctx.sender()), 0);
|
|
424
|
-
dapp.admin().set(new_admin);
|
|
425
|
-
}
|
|
426
361
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
362
|
+
public entry fun transfer_ownership(schema: &mut Schema, new_admin: address, ctx: &mut TxContext) {
|
|
363
|
+
let admin = schema.dapp__admin().try_get();
|
|
364
|
+
assert!(admin == option::some(ctx.sender()), 0);
|
|
365
|
+
schema.dapp__admin().set(new_admin);
|
|
366
|
+
}
|
|
432
367
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
368
|
+
public entry fun set_safe_mode(schema: &mut Schema, safe_mode: bool, ctx: &TxContext) {
|
|
369
|
+
let admin = schema.dapp__admin().try_get();
|
|
370
|
+
assert!(admin == option::some(ctx.sender()), 0);
|
|
371
|
+
schema.dapp__safe_mode().set(safe_mode);
|
|
372
|
+
}
|
|
436
373
|
|
|
437
|
-
|
|
438
|
-
assert!(
|
|
439
|
-
|
|
374
|
+
public fun ensure_no_safe_mode(schema: &mut Schema) {
|
|
375
|
+
assert!(!schema.dapp__safe_mode()[], 0);
|
|
376
|
+
}
|
|
440
377
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
378
|
+
public fun ensure_has_authority(schema: &mut Schema, ctx: &TxContext) {
|
|
379
|
+
assert!(schema.dapp__admin().get() == ctx.sender(), 0);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
public fun ensure_has_schema<S: key + store>(schema: &mut Schema, new_schema: &S) {
|
|
383
|
+
let schema_id = object::id_address(new_schema);
|
|
384
|
+
assert!(schema.dapp__authorised_schemas().get().contains(&schema_id), 0);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
public(package) fun create(schema: &mut Schema, name: String, description: String, clock: &Clock, ctx: &mut TxContext){
|
|
388
|
+
add_field<StorageValue<address>>(schema.id(), b"dapp__admin", storage_value::new(b"dapp__admin", ctx));
|
|
389
|
+
add_field<StorageValue<address>>(schema.id(), b"dapp__package_id", storage_value::new(b"dapp__package_id", ctx));
|
|
390
|
+
add_field<StorageValue<u32>>(schema.id(), b"dapp__version", storage_value::new(b"dapp__version", ctx));
|
|
391
|
+
add_field<StorageValue<DappMetadata>>(schema.id(), b"dapp__metadata", storage_value::new(b"dapp__metadata", ctx));
|
|
392
|
+
add_field<StorageValue<bool>>(schema.id(), b"dapp__safe_mode", storage_value::new(b"dapp__safe_mode", ctx));
|
|
393
|
+
add_field<StorageValue<vector<address>>>(schema.id(), b"dapp__authorised_schemas", storage_value::new(b"dapp__authorised_schemas", ctx));
|
|
394
|
+
schema.dapp__metadata().set(
|
|
395
|
+
${e.name}_dapp_metadata::new(
|
|
396
|
+
name,
|
|
397
|
+
description,
|
|
398
|
+
vector[],
|
|
399
|
+
ascii::string(b""),
|
|
400
|
+
clock.timestamp_ms(),
|
|
401
|
+
vector[]
|
|
402
|
+
)
|
|
403
|
+
);
|
|
404
|
+
let package_id = type_info::current_package_id<Schema>();
|
|
405
|
+
schema.dapp__package_id().set(package_id);
|
|
406
|
+
schema.dapp__admin().set(ctx.sender());
|
|
407
|
+
schema.dapp__version().set(1);
|
|
408
|
+
schema.dapp__safe_mode().set(false);
|
|
409
|
+
schema.dapp__authorised_schemas().set(vector[]);
|
|
410
|
+
}
|
|
446
411
|
|
|
412
|
+
public(package) fun add_schema<S: key + store>(schema: &mut Schema, new_schema: S) {
|
|
413
|
+
let mut schemas = schema.dapp__authorised_schemas()[];
|
|
414
|
+
schemas.push_back(object::id_address<S>(&new_schema));
|
|
415
|
+
schema.dapp__authorised_schemas().set(schemas);
|
|
416
|
+
public_share_object(new_schema);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
447
419
|
|
|
448
|
-
`;await
|
|
449
|
-
use ${e.name}::${e.name}_dapp_schema::Dapp;
|
|
420
|
+
`;await c(a,r,"formatAndWriteMove")}}async function Q(e,t){let r=`module ${e.name}::${e.name}_init_test {
|
|
450
421
|
use sui::clock;
|
|
451
422
|
use sui::test_scenario;
|
|
452
423
|
use sui::test_scenario::Scenario;
|
|
453
424
|
|
|
454
|
-
public fun deploy_dapp_for_testing(sender: address):
|
|
425
|
+
public fun deploy_dapp_for_testing(sender: address): Scenario {
|
|
455
426
|
let mut scenario = test_scenario::begin(sender);
|
|
456
427
|
let ctx = test_scenario::ctx(&mut scenario);
|
|
457
428
|
let clock = clock::create_for_testing(ctx);
|
|
458
429
|
${e.name}::${e.name}_genesis::run(&clock, ctx);
|
|
459
430
|
clock::destroy_for_testing(clock);
|
|
460
431
|
test_scenario::next_tx(&mut scenario,sender);
|
|
461
|
-
|
|
462
|
-
(scenario, dapp)
|
|
432
|
+
scenario
|
|
463
433
|
}
|
|
464
434
|
}
|
|
465
|
-
`;await
|
|
435
|
+
`;await c(r,`${t}/contracts/${e.name}/sources/codegen/core/init_test.move`,"formatAndWriteMove");let a=`module ${e.name}::${e.name}_genesis {
|
|
466
436
|
use std::ascii::string;
|
|
467
437
|
|
|
468
438
|
use sui::clock::Clock;
|
|
@@ -470,19 +440,18 @@ use ${e}::${e}_${s}_event;
|
|
|
470
440
|
use ${e.name}::${e.name}_dapp_system;
|
|
471
441
|
|
|
472
442
|
public entry fun run(clock: &Clock, ctx: &mut TxContext) {
|
|
473
|
-
// Create a dapp.
|
|
474
|
-
let mut dapp = ${e.name}_dapp_system::create(string(b"${e.name}"),string(b"${e.description}"), clock , ctx);
|
|
475
443
|
// Create schemas
|
|
476
444
|
let mut schema = ${e.name}::${e.name}_schema::create(ctx);
|
|
445
|
+
// Setup default storage
|
|
446
|
+
${e.name}_dapp_system::create(&mut schema, string(b"${e.name}"),string(b"${e.description}"), clock , ctx);
|
|
477
447
|
// Logic that needs to be automated once the contract is deployed
|
|
478
448
|
${e.name}::${e.name}_deploy_hook::run(&mut schema, ctx);
|
|
479
449
|
// Authorize schemas and public share objects
|
|
480
|
-
|
|
481
|
-
sui::transfer::public_share_object(dapp);
|
|
450
|
+
sui::transfer::public_share_object(schema);
|
|
482
451
|
}
|
|
483
452
|
}
|
|
484
|
-
`;await
|
|
485
|
-
\u{1F680} Starting Schema Generation Process...`),console.log("\u{1F4CB} Project Configuration:"),console.log(` \u2514\u2500 Name: ${e.name}`),console.log(` \u2514\u2500 Description: ${e.description||"No description provided"}`),console.log(` \u2514\u2500 Network: ${r||"testnet"}`);let a=t??process.cwd();
|
|
453
|
+
`;await c(a,`${t}/contracts/${e.name}/sources/codegen/core/genesis.move`,"formatAndWriteMove")}async function gt(e,t,r){console.log(`
|
|
454
|
+
\u{1F680} Starting Schema Generation Process...`),console.log("\u{1F4CB} Project Configuration:"),console.log(` \u2514\u2500 Name: ${e.name}`),console.log(` \u2514\u2500 Description: ${e.description||"No description provided"}`),console.log(` \u2514\u2500 Network: ${r||"testnet"}`);let a=t??process.cwd();k(`${a}/contracts/${e.name}`)&&x(`${a}/contracts/${e.name}/sources/codegen`),k(`${a}/contracts/${e.name}/Move.toml`)||await O(e,a),k(`${a}/contracts/${e.name}/sources/script/deploy_hook.move`)||await L(e,a),e.events&&(e.data?await D(e.name,e.data,e.events,a):await D(e.name,null,e.events,a)),e.data?(await j(e.name,e.data,a),await w(e.name,e.data,e.schemas,a)):await w(e.name,null,e.schemas,a),e.errors&&await z(e.name,e.errors,a),await H(e,a),await Q(e,a),await G(e,a),await B(e,a),console.log(`
|
|
486
455
|
\u2705 Schema Generation Process Complete!
|
|
487
|
-
`)}import{findUp as
|
|
456
|
+
`)}import{findUp as pe}from"find-up";import A from"path";import me from"esbuild";var S=class extends Error{name="NotInsideProjectError";message="You are not inside a Dubhe project"};import{rmSync as de}from"fs";import{pathToFileURL as le}from"url";import _e from"os";var ge=["dubhe.config.js","dubhe.config.mjs","dubhe.config.ts","dubhe.config.mts"],M="dubhe.config.example.mjs";async function Dt(e){e=await Z(e);try{return await me.build({entryPoints:[e],format:"esm",outfile:M,platform:"node",bundle:!0,packages:"external"}),e=await Z(M,!0),(await import(e+`?update=${Date.now()}`)).dubheConfig}finally{de(M,{force:!0})}}async function Z(e,t){return e===void 0?e=await fe():A.isAbsolute(e)||(e=A.join(process.cwd(),e),e=A.normalize(e)),t&&_e.platform()==="win32"?le(e).href:e}async function fe(){let e=await pe(ge);if(e===void 0)throw new S;return e}function Et(...e){if(e.length===1)return`StorageValue<${e[0]}>`;if(e.length===2)return`StorageMap<${e[0]}, ${e[1]}>`;if(e.length===3)return`StorageDoubleMap<${e[0]}, ${e[1]}, ${e[2]}>`;throw new Error("Invalid number of arguments for storage()")}var y=e=>{if(typeof e!="object"||e===null)return e;let t={};for(let r in e)if(e.hasOwnProperty(r)){let a=e[r];typeof a=="object"&&a!==null?Array.isArray(a)?t[r]=J(a):a.hasOwnProperty("variant")?t[r]={[a.variant]:{}}:a.hasOwnProperty("fields")?t[r]=y(a.fields):t[r]=y(a):t[r]=a}return t},J=e=>{let t=[];return e.forEach(r=>{typeof r=="object"&&r!==null?Array.isArray(r)?t.push(J(r)):r.hasOwnProperty("variant")?t.push({[r.variant]:{}}):r.hasOwnProperty("fields")?t.push(y(r.fields)):t.push(y(r)):t.push(r)}),t};var be=(r=>(r.Event="event",r.Schema="schema",r))(be||{});export{be as SubscriptionKind,c as formatAndWriteMove,Te as formatAndWriteTypescript,T as formatMove,C as formatTypescript,Dt as loadConfig,y as parseData,Ve as posixPath,Z as resolveConfigPath,gt as schemaGen,Et as storage};
|
|
488
457
|
//# sourceMappingURL=index.js.map
|