diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8d40116 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ + +.anchor +.DS_Store +target +**/*.rs.bk +node_modules +test-ledger +.yarn diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..c1a0b75 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,8 @@ + +.anchor +.DS_Store +target +node_modules +dist +build +test-ledger diff --git a/Anchor.toml b/Anchor.toml new file mode 100644 index 0000000..0304d25 --- /dev/null +++ b/Anchor.toml @@ -0,0 +1,18 @@ +[toolchain] + +[features] +seeds = false +skip-lint = false + +[programs.localnet] +netsepio = "HtXkraCSZsMYEpjvyNhCX4JMpMAvykp63vuP8obMfzo2" + +[registry] +url = "https://api.apr.dev" + +[provider] +cluster = "Localnet" +wallet = "/home/soumalya/.config/solana/id.json" + +[scripts] +test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..1cf720e --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1864 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom 0.2.15", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "anchor-attribute-access-control" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" +dependencies = [ + "anchor-syn", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-account" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" +dependencies = [ + "anchor-syn", + "bs58 0.5.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-constant" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-error" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-event" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" +dependencies = [ + "anchor-syn", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-program" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-accounts" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-serde" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" +dependencies = [ + "anchor-syn", + "borsh-derive-internal 0.10.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-space" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-lang" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" +dependencies = [ + "anchor-attribute-access-control", + "anchor-attribute-account", + "anchor-attribute-constant", + "anchor-attribute-error", + "anchor-attribute-event", + "anchor-attribute-program", + "anchor-derive-accounts", + "anchor-derive-serde", + "anchor-derive-space", + "arrayref", + "base64 0.13.1", + "bincode", + "borsh 0.10.4", + "bytemuck", + "getrandom 0.2.15", + "solana-program", + "thiserror", +] + +[[package]] +name = "anchor-syn" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" +dependencies = [ + "anyhow", + "bs58 0.5.1", + "heck", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2 0.10.8", + "syn 1.0.109", + "thiserror", +] + +[[package]] +name = "anyhow" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" + +[[package]] +name = "ark-bn254" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +dependencies = [ + "serde", +] + +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + +[[package]] +name = "blake3" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "digest 0.10.7", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "borsh" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" +dependencies = [ + "borsh-derive 0.9.3", + "hashbrown 0.11.2", +] + +[[package]] +name = "borsh" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115e54d64eb62cdebad391c19efc9dce4981c690c85a33a12199d99bb9546fee" +dependencies = [ + "borsh-derive 0.10.4", + "hashbrown 0.13.2", +] + +[[package]] +name = "borsh" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6362ed55def622cddc70a4746a68554d7b687713770de539e59a739b249f8ed" +dependencies = [ + "borsh-derive 1.5.1", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" +dependencies = [ + "borsh-derive-internal 0.9.3", + "borsh-schema-derive-internal 0.9.3", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831213f80d9423998dd696e2c5345aba6be7a0bd8cd19e31c5243e13df1cef89" +dependencies = [ + "borsh-derive-internal 0.10.4", + "borsh-schema-derive-internal 0.10.4", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" +dependencies = [ + "once_cell", + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.79", + "syn_derive", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65d6ba50644c98714aa2a70d13d7df3cd75cd2b523a2b452bf010443800976b3" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276691d96f063427be83e6692b86148e488ebba9f48f77788724ca027ba3b6d4" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bv" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340" +dependencies = [ + "feature-probe", + "serde", +] + +[[package]] +name = "bytemuck" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcfcc3cd946cb52f0bbfdbbcfa2f4e24f75ebb6c0e1002f7c25904fada18b9ec" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cc" +version = "1.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +dependencies = [ + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "console_log" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" +dependencies = [ + "log", + "web-sys", +] + +[[package]] +name = "constant_time_eq" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" + +[[package]] +name = "cpufeatures" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "serde", + "subtle", + "zeroize", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", + "subtle", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "feature-probe" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "serde", + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash 0.7.8", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.11", +] + +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array", + "hmac", +] + +[[package]] +name = "im" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" +dependencies = [ + "bitmaps", + "rand_core 0.6.4", + "rand_xoshiro", + "rayon", + "serde", + "sized-chunks", + "typenum", + "version_check", +] + +[[package]] +name = "indexmap" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +dependencies = [ + "equivalent", + "hashbrown 0.15.0", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.159" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" + +[[package]] +name = "libsecp256k1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" +dependencies = [ + "arrayref", + "base64 0.12.3", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "light-poseidon" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c9a85a9752c549ceb7578064b4ed891179d20acd85f27318573b64d2d7ee7ee" +dependencies = [ + "ark-bn254", + "ark-ff", + "num-bigint", + "thiserror", +] + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "netsepio" +version = "0.1.0" +dependencies = [ + "anchor-lang", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.15", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +dependencies = [ + "bitflags", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "serde_json" +version = "1.0.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "solana-frozen-abi" +version = "1.18.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45478bad85abd8cc291775463e15bc1031fdbf973d48e2568e8defee3d842a3a" +dependencies = [ + "block-buffer 0.10.4", + "bs58 0.4.0", + "bv", + "either", + "generic-array", + "im", + "lazy_static", + "log", + "memmap2", + "rustc_version", + "serde", + "serde_bytes", + "serde_derive", + "sha2 0.10.8", + "solana-frozen-abi-macro", + "subtle", + "thiserror", +] + +[[package]] +name = "solana-frozen-abi-macro" +version = "1.18.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5cb05f9051446226cd26ea17f6fbe5e28e922ad6a846166db7fb17865090fcb" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.79", +] + +[[package]] +name = "solana-program" +version = "1.18.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a52f4c424433a18b57ae88a35b677c548879a9c4ca1e27e108d1597ff12b95ac" +dependencies = [ + "ark-bn254", + "ark-ec", + "ark-ff", + "ark-serialize", + "base64 0.21.7", + "bincode", + "bitflags", + "blake3", + "borsh 0.10.4", + "borsh 0.9.3", + "borsh 1.5.1", + "bs58 0.4.0", + "bv", + "bytemuck", + "cc", + "console_error_panic_hook", + "console_log", + "curve25519-dalek", + "getrandom 0.2.15", + "itertools", + "js-sys", + "lazy_static", + "libc", + "libsecp256k1", + "light-poseidon", + "log", + "memoffset", + "num-bigint", + "num-derive", + "num-traits", + "parking_lot", + "rand 0.8.5", + "rustc_version", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "sha2 0.10.8", + "sha3", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-sdk-macro", + "thiserror", + "tiny-bip39", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "solana-sdk-macro" +version = "1.18.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed90de8086a0e114ab63454a9d066e0f08eb2c9c8aea149ff60e8a492f165fc" +dependencies = [ + "bs58 0.4.0", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.79", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "thiserror" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "tiny-bip39" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +dependencies = [ + "anyhow", + "hmac", + "once_cell", + "pbkdf2", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.9", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tinyvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" + +[[package]] +name = "toml_edit" +version = "0.22.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "unicode-normalization" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.79", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" + +[[package]] +name = "web-sys" +version = "0.3.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +dependencies = [ + "memchr", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "zeroize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..ef17a63 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,13 @@ +[workspace] +members = [ + "programs/*" +] + +[profile.release] +overflow-checks = true +lto = "fat" +codegen-units = 1 +[profile.release.build-override] +opt-level = 3 +incremental = false +codegen-units = 1 diff --git a/DAO_scam_report/.gitignore b/DAO_scam_report/.gitignore deleted file mode 100644 index 87c0f8d..0000000 --- a/DAO_scam_report/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.idea -build -.aptos -*.toml \ No newline at end of file diff --git a/DAO_scam_report/Move.toml b/DAO_scam_report/Move.toml deleted file mode 100644 index fb0188a..0000000 --- a/DAO_scam_report/Move.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "report_dao_v1" -version = "1.0.1" -upgrade_policy = "compatible" - -[addresses] -admin = "_" - -[dependencies] -AptosTokenObjects = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-token-objects/", rev = "aptos-cli-v2.0.2" } -reviews = {local = "../reviews_NFT" } \ No newline at end of file diff --git a/DAO_scam_report/README.md b/DAO_scam_report/README.md deleted file mode 100644 index 0e170f9..0000000 --- a/DAO_scam_report/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# DAO_NFT -Smart Contract for DAO proposal NFT for scam reports - -Deployed to testnet under contract address: 75bcfe882d1a4d032ead2b47f377e4c95221594d66ab2bd09a61aded4c9d64f9 - -Entry Functions: -- submit_proposal -- resolve_proposal -- delete_proposal - -View Functions: -- total_proposals - -Events: -- ProposalCreatedEvent -- ProposalResolvedEvent -- ProposalDeletedEvent - -## Revisions: -### 1.0.1: \ No newline at end of file diff --git a/DAO_scam_report/sources/governance.move b/DAO_scam_report/sources/governance.move deleted file mode 100644 index 65d5e1a..0000000 --- a/DAO_scam_report/sources/governance.move +++ /dev/null @@ -1,498 +0,0 @@ -module admin::report_dao_v1{ - //============================================================================================== - // Dependencies - //============================================================================================== - - use std::object; - use std::signer; - use aptos_token_objects::token; - use aptos_framework::event::{Self, EventHandle}; - use aptos_framework::account::{Self, SignerCapability}; - use aptos_framework::coin; - use aptos_framework::aptos_coin::{AptosCoin}; - use std::string::{Self, String}; - use aptos_token_objects::collection; - use aptos_framework::timestamp; - use aptos_framework::option; - use std::string_utils; - use aptos_std::simple_map; - use aptos_std::simple_map::SimpleMap; - //use std::debug; - - #[test_only] - use aptos_token_objects::royalty; - - //============================================================================================== - // Errors - //============================================================================================== - - const ERROR_SIGNER_NOT_ADMIN: u64 = 0; - const ERROR_SIGNER_NOT_OPERATOR: u64 = 1; - const ERROR_PROPOSAL_ALREADY_EXISTS: u64 = 2; - const ERROR_PROPOSAL_DOES_NOT_EXIST: u64 = 3; - const ERROR_PROPOSAL_ALREADY_CLOSED: u64 = 4; - const ERROR_OTHERS: u64 = 5; - - //============================================================================================== - // Constants - //============================================================================================== - - // Seed for resource account creation - const SEED: vector = b"dao"; - - - // NFT collection information - const COLLECTION_DESCRIPTION: vector = b"Scam Report DAO Proposals"; - - const NEW_COLLECTION_NAME: vector = b"Report Proposals"; - const NEW_COLLECTION_URI: vector = b"New collection uri"; - - const RESOLVED_COLLECTION_NAME: vector = b"Resolved Proposals"; - const RESOLVED_COLLECTION_URI: vector = b"Resolved collection uri"; - - //============================================================================================== - // Module Structs - //============================================================================================== - - struct NftToken has key { - // Used for editing the token data - mutator_ref: token::MutatorRef, - // Used for burning the token - burn_ref: token::BurnRef, - // Used for transfering the token - transfer_ref: object::TransferRef - } - - struct State has key { - // signer cap of the module's resource account - signer_cap: SignerCapability, - // NFT count - minted: u64, - //metadata, proposal_nft_obj_add - metadatas: SimpleMap, - // proposal_nft_obj_add, true for resolved, false for open - proposal_list: SimpleMap, - // Events - proposal_created_events: EventHandle, - proposal_resolved_events: EventHandle, - proposal_deleted_events: EventHandle - } - //============================================================================================== - // Event structs - //============================================================================================== - - struct ProposalCreatedEvent has store, drop { - // proposer - user: address, - // proposal # - proposal_no: u64, - // prpoposal nft object address - obj_add: address, - // timestamp - timestamp: u64 - } - - struct ProposalResolvedEvent has store, drop { - // resolver - user: address, - // prpoposal nft object address - obj_add: address, - // timestamp - timestamp: u64 - } - - struct ProposalDeletedEvent has store, drop { - // deleter - user: address, - // prpoposal nft object address - obj_add: address, - // timestamp - timestamp: u64 - } - - //============================================================================================== - // Functions - //============================================================================================== - - /* - Initializes the module by creating a resource account, registering with AptosCoin, creating - the token collectiions, and setting up the State resource. - @param account - signer representing the module publisher - */ - fun init_module(admin: &signer) { - assert_admin(signer::address_of(admin)); - let (resource_signer, resource_cap) = account::create_resource_account(admin, SEED); - - coin::register(&resource_signer); - - // Create an NFT collection with an unlimited supply and the following aspects: - collection::create_unlimited_collection( - &resource_signer, - string::utf8(COLLECTION_DESCRIPTION), - string::utf8(NEW_COLLECTION_NAME), - option::none(), - string::utf8(NEW_COLLECTION_URI) - ); - - collection::create_unlimited_collection( - &resource_signer, - string::utf8(COLLECTION_DESCRIPTION), - string::utf8(RESOLVED_COLLECTION_NAME), - option::none(), - string::utf8(RESOLVED_COLLECTION_URI) - ); - - // Create the State global resource and move it to the admin account - let state = State{ - signer_cap: resource_cap, - minted: 0, - metadatas: simple_map::create(), - proposal_list: simple_map::create(), - proposal_created_events: account::new_event_handle(&resource_signer), - proposal_resolved_events: account::new_event_handle(&resource_signer), - proposal_deleted_events: account::new_event_handle(&resource_signer) - }; - move_to(admin, state); - } - - public entry fun submit_proposal(operator: &signer, proposer: address, metadata: String) acquires State{ - assert_operator(admin::reviews::check_role(signer::address_of(operator))); - let state = borrow_global_mut(@admin); - assert_proposal_does_not_already_exists(state.metadatas, metadata); - let current_proposal = state.minted + 1; - let res_signer = account::create_signer_with_capability(&state.signer_cap); - // Create a new named token: - let token_const_ref = token::create_named_token( - &res_signer, - string::utf8(NEW_COLLECTION_NAME), - metadata, - string_utils::format2(&b"{}#{}", string::utf8(b"proposal"), string_utils::to_string_with_integer_types(¤t_proposal)), - option::none(), - string::utf8(NEW_COLLECTION_URI) - ); - - let obj_signer = object::generate_signer(&token_const_ref); - let obj_add = object::address_from_constructor_ref(&token_const_ref); - - // Transfer the token to the reviewer account - object::transfer_raw(&res_signer, object::address_from_constructor_ref(&token_const_ref), proposer); - - // Create the ReviewToken object and move it to the new token object signer - let new_nft_token = NftToken { - mutator_ref: token::generate_mutator_ref(&token_const_ref), - burn_ref: token::generate_burn_ref(&token_const_ref), - transfer_ref: object::generate_transfer_ref(&token_const_ref), - }; - - move_to(&obj_signer, new_nft_token); - - state.minted = current_proposal; - simple_map::add(&mut state.metadatas, metadata, obj_add); - simple_map::add(&mut state.proposal_list, obj_add, false); - - //block transfer between normal users - object::disable_ungated_transfer(&object::generate_transfer_ref(&token_const_ref)); - - // Emit a new ProposalCreatedEvent - event::emit_event( - &mut state.proposal_created_events, - ProposalCreatedEvent { - user: proposer, - proposal_no: current_proposal, - obj_add, - timestamp: timestamp::now_seconds() - }); - } - - public entry fun resolve_proposal(operator: &signer, old_metadata: String, new_metadata: String) acquires State, NftToken{ - assert_operator(admin::reviews::check_role(signer::address_of(operator))); - let obj_add; - { - let state = borrow_global(@admin); - assert_proposal_exists(state.metadatas, old_metadata); - obj_add = *simple_map::borrow(&state.metadatas, &old_metadata); - assert_proposal_is_open(state.proposal_list, obj_add); - }; - let token_obj = object::address_to_object(obj_add); - let token_name = token::name(token_obj); - let token_owner = object::owner(token_obj); - - { - burn_token_internal(old_metadata, obj_add); - }; - - let state = borrow_global_mut(@admin); - let res_signer = account::create_signer_with_capability(&state.signer_cap); - - // Create a new named token: - let token_const_ref = token::create_named_token( - &res_signer, - string::utf8(RESOLVED_COLLECTION_NAME), - new_metadata, - token_name, - option::none(), - string::utf8(RESOLVED_COLLECTION_URI) - ); - - let obj_signer = object::generate_signer(&token_const_ref); - let new_obj_add = object::address_from_constructor_ref(&token_const_ref); - - // Transfer the token to the reviewer account - object::transfer_raw(&res_signer, object::address_from_constructor_ref(&token_const_ref), token_owner); - - // Create the ReviewToken object and move it to the new token object signer - let new_nft_token = NftToken { - mutator_ref: token::generate_mutator_ref(&token_const_ref), - burn_ref: token::generate_burn_ref(&token_const_ref), - transfer_ref: object::generate_transfer_ref(&token_const_ref), - }; - - move_to(&obj_signer, new_nft_token); - - simple_map::add(&mut state.metadatas, new_metadata, new_obj_add); - simple_map::add(&mut state.proposal_list, new_obj_add, true); - - //block transfer between normal users - object::disable_ungated_transfer(&object::generate_transfer_ref(&token_const_ref)); - - // Emit a new ProposalCreatedEvent - event::emit_event( - &mut state.proposal_resolved_events, - ProposalResolvedEvent { - user: signer::address_of(operator), - obj_add, - timestamp: timestamp::now_seconds() - }); - } - - public entry fun delete_proposal(operator: &signer, metadata: String) acquires State, NftToken{ - assert_operator(admin::reviews::check_role(signer::address_of(operator))); - let obj_add; - { - let state = borrow_global(@admin); - assert_proposal_exists(state.metadatas, metadata); - obj_add = *simple_map::borrow(& state.metadatas, &metadata); - assert_proposal_is_open(state.proposal_list, obj_add); - }; - - { - burn_token_internal(metadata, obj_add); - }; - - let state = borrow_global_mut(@admin); - // Emit a new ProposalCreatedEvent - event::emit_event( - &mut state.proposal_deleted_events, - ProposalDeletedEvent { - user: signer::address_of(operator), - obj_add, - timestamp: timestamp::now_seconds() - }); - } - - //============================================================================================== - // Helper functions - //============================================================================================== - - inline fun burn_token_internal(metdata: String, obj_add: address) { - let state = borrow_global_mut(@admin); - let review_token = move_from(obj_add); - let NftToken{mutator_ref: _, burn_ref, transfer_ref: _} = review_token; - - // Burn the the token - token::burn(burn_ref); - simple_map::remove(&mut state.metadatas, &metdata); - simple_map::remove(&mut state.proposal_list, &obj_add); - } - - #[view] - public fun total_proposals(): u64 acquires State { - let state = borrow_global(@admin); - state.minted - } - - #[view] - public fun view_nft_address(metadata: String): address acquires State { - let state = borrow_global(@admin); - *simple_map::borrow(&state.metadatas, &metadata) - } - - #[view] - public fun is_proposal_open(metadata: String): bool acquires State { - let state = borrow_global(@admin); - let obj_add = *simple_map::borrow(&state.metadatas, &metadata); - !*simple_map::borrow(&state.proposal_list, &obj_add) - } - - //============================================================================================== - // Validation functions - //============================================================================================== - - inline fun assert_admin(admin: address) { - assert!(admin == @admin, ERROR_SIGNER_NOT_ADMIN); - } - - inline fun assert_operator(check_role_return: String) { - assert!(check_role_return == string::utf8(b"operator") , ERROR_SIGNER_NOT_OPERATOR); - } - - inline fun assert_proposal_does_not_already_exists(metadatas: SimpleMap, metadata: String) { - assert!(!simple_map::contains_key(&metadatas, &metadata), ERROR_PROPOSAL_ALREADY_EXISTS); - } - - inline fun assert_proposal_exists(metadatas: SimpleMap, metadata: String) { - assert!(simple_map::contains_key(&metadatas, &metadata), ERROR_PROPOSAL_DOES_NOT_EXIST); - } - - inline fun assert_proposal_is_open(proposals: SimpleMap, obj_add: address) { - assert!(!*simple_map::borrow(&proposals, &obj_add), ERROR_PROPOSAL_ALREADY_CLOSED); - } - - //============================================================================================== - // Test functions - //============================================================================================== - - #[test(admin = @admin)] - fun test_init_module_success( - admin: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - account::create_account_for_test(admin_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - let expected_resource_account_address = account::create_resource_address(&admin_address, SEED); - assert!(account::exists_at(expected_resource_account_address), 0); - - let state = borrow_global(admin_address); - assert!( - account::get_signer_capability_address(&state.signer_cap) == expected_resource_account_address, - 0 - ); - - assert!( - coin::is_account_registered(expected_resource_account_address), - 4 - ); - - let expected_collection_address = collection::create_collection_address( - &expected_resource_account_address, - &string::utf8(b"Report Proposals") - ); - let collection_object = object::address_to_object(expected_collection_address); - assert!( - collection::creator(collection_object) == expected_resource_account_address, - 4 - ); - assert!( - collection::name(collection_object) == string::utf8(b"Report Proposals"), - 4 - ); - assert!( - collection::description(collection_object) == string::utf8(b"Scam Report DAO Proposals"), - 4 - ); - assert!( - collection::uri(collection_object) == string::utf8(b"New collection uri"), - 4 - ); - - assert!(event::counter(&state.proposal_created_events) == 0, 5); - } - - #[test(admin = @admin, operator = @0xA, user = @0xB)] - fun test_delegate_mint_success( - admin: &signer, - operator: &signer, - user: &signer, - ) acquires State { - let admin_address = signer::address_of(admin); - let operator_address = signer::address_of(operator); - let user_address = signer::address_of(user); - account::create_account_for_test(admin_address); - account::create_account_for_test(operator_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - admin::reviews::init_module_for_test(admin); - init_module(admin); - - admin::reviews::grant_role( - admin, - operator_address, - string::utf8(b"operator") - ); - - let metadata = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - - let resource_account_address = account::create_resource_address(&@admin, SEED); - - submit_proposal(operator, user_address, metadata); - - let state = borrow_global(admin_address); - - let expected_nft_token_address = token::create_token_address( - &resource_account_address, - &string::utf8(b"Report Proposals"), - &string_utils::format2(&b"{}#{}", string::utf8(b"proposal"), string_utils::to_string_with_integer_types(&state.minted)) - ); - let nft_token_object = object::address_to_object(expected_nft_token_address); - assert!( - object::is_owner(nft_token_object, user_address) == true, - 5 - ); - assert!( - token::creator(nft_token_object) == resource_account_address, - 5 - ); - assert!( - token::name(nft_token_object) == string_utils::format2(&b"{}#{}", string::utf8(b"proposal"), string_utils::to_string_with_integer_types(&state.minted)), - 5 - ); - assert!( - token::description(nft_token_object) == metadata, - 5 - ); - assert!( - token::uri(nft_token_object) == string::utf8(b"New collection uri"), - 5 - ); - assert!( - option::is_none(&token::royalty(nft_token_object)), - 5 - ); - assert!( - simple_map::contains_key(&state.proposal_list, &expected_nft_token_address), - 5 - ); - - assert!(event::counter(&state.proposal_created_events) == 1, 5); - } - - #[test(admin = @admin, user = @0xA)] - #[expected_failure(abort_code = ERROR_SIGNER_NOT_OPERATOR)] - fun test_delegate_mint_failure_not_operator( - admin: &signer, - user: &signer, - ) acquires State { - let admin_address = signer::address_of(admin); - let user_address = signer::address_of(user); - account::create_account_for_test(admin_address); - account::create_account_for_test(user_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - admin::reviews::init_module_for_test(admin); - init_module(admin); - - let metadata = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - - submit_proposal(admin, user_address, metadata); - } - -} diff --git a/EREBRUS_NFT/.gitignore b/EREBRUS_NFT/.gitignore deleted file mode 100644 index 691be8c..0000000 --- a/EREBRUS_NFT/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.idea -build -.aptos -Move.toml \ No newline at end of file diff --git a/EREBRUS_NFT/README.md b/EREBRUS_NFT/README.md deleted file mode 100644 index 08806f7..0000000 --- a/EREBRUS_NFT/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# EREBRUS -Smart Contract for the EREBRUS NFT with supply of 111. - -Where decentralization meets VPN for ultimate internet security. -Anonymous Virtual Private Network for accessing internet in stealth mode bypassing filewalls and filters - -To be deployed to testnet under contract address: - -Entry Functions: -- user_mint -- delegate_mint - -View Functions: -- total_minted_NFTs: Total NFTs minted so far -- owner_of: Accepts tokenId to tell who is its owner - -Events: -- NftMintedEvent - -## Revisions: -### 1.0.1: -### 1.0.2: -### 1.0.3: -- Deployed on mainnet under contract address: \ No newline at end of file diff --git a/EREBRUS_NFT/sources/erebrus.move b/EREBRUS_NFT/sources/erebrus.move deleted file mode 100644 index 13867cc..0000000 --- a/EREBRUS_NFT/sources/erebrus.move +++ /dev/null @@ -1,532 +0,0 @@ -module admin::erebrus{ - //============================================================================================== - // Dependencies - //============================================================================================== - - use std::object; - use std::signer; - use aptos_token_objects::token; - use aptos_framework::event::{Self, EventHandle}; - use aptos_framework::account::{Self, SignerCapability}; - use aptos_framework::coin; - use aptos_framework::aptos_coin::{AptosCoin}; - use std::string::{Self, String}; - use aptos_token_objects::collection; - use aptos_framework::timestamp; - use aptos_framework::option; - use std::string_utils; - use std::vector; - //use std::debug; - use aptos_token_objects::royalty; - use std::bcs; - - #[test_only] - use aptos_framework::aptos_coin::{Self}; - - //============================================================================================== - // Errors - //============================================================================================== - - const ERROR_SIGNER_NOT_ADMIN: u64 = 0; - const ERROR_SUPPLY_EXCEEDED: u64 = 1; - const ERROR_SIGNER_NOT_OPERATOR: u64 = 2; - const ERROR_USER_MINT_EXCEEDED: u64 = 3; - const ERROR_OTHERS: u64 = 4; - const ERROR_INSUFFICIENT_BALANCE: u64 = 5; - - //============================================================================================== - // Constants - //============================================================================================== - - // Contract Version - const VERSION: vector = b"v1.0"; - - // Mint Price - const MINT_PRICE: u64 = 111000000; // 1.11 APT - - // Supply limit - const SUPPLY: u64 = 111; - - // NFT collection information - const COLLECTION_NAME: vector = b"EREBRUS"; - const COLLECTION_DESCRIPTION: vector = b"Erebrus, by NetSepio. 111 innovative utility NFT that offers you access to a blockchain-backed, distributed Anonymous VPN"; - const COLLECTION_URI: vector = b"ipfs://bafybeiakibvianmzrecxzyh6oonapk7fqggburcfsseildhhgrbxh3tz2u/111nft.png"; - - // Token information - const TOKEN_DESCRIPTION: vector = b"EREBRUS NFT"; - const TOKEN_URI: vector = b"ipfs://bafybeieocwztsh2aqhb4vuwlpduw2blamfgsegthyjb3kbbwatqnj6t4hy/"; - - //============================================================================================== - // Module Structs - //============================================================================================== - - struct ErebrusToken has key { - // Used for editing the token data - mutator_ref: token::MutatorRef, - // Used for burning the token - burn_ref: token::BurnRef, - // Used for transfering the token - transfer_ref: object::TransferRef - } - - struct State has key { - // signer cap of the module's resource account - signer_cap: SignerCapability, - // NFT count - minted: u64, - //minter - minter: vector
, - // minted_nft_obj_add - nft_list: vector
, - // Events - nft_minted_events: EventHandle - } - //============================================================================================== - // Event structs - //============================================================================================== - - struct NftMintedEvent has store, drop { - // minter - user: address, - // nft # - nft_no: u64, - // nft object address - obj_add: address, - // timestamp - timestamp: u64 - } - - //============================================================================================== - // Functions - //============================================================================================== - - /* - Initializes the module by creating a resource account, registering with AptosCoin, creating - the token collectiions, and setting up the State resource. - @param account - signer representing the module publisher - */ - fun init_module(admin: &signer) { - assert_admin(signer::address_of(admin)); - // Seed for resource account creation - let seed = bcs::to_bytes(&@VSEED); - let (resource_signer, resource_cap) = account::create_resource_account(admin, seed); - - let royalty = royalty::create(5,10,@wv1); - - // Create an NFT collection with an unlimied supply and the following aspects: - collection::create_fixed_collection( - &resource_signer, - string::utf8(COLLECTION_DESCRIPTION), - SUPPLY, - string::utf8(COLLECTION_NAME), - option::some(royalty), - string::utf8(COLLECTION_URI) - ); - - // Create the State global resource and move it to the admin account - let state = State{ - signer_cap: resource_cap, - minted: 0, - minter: vector::empty(), - nft_list: vector::empty(), - nft_minted_events: account::new_event_handle(&resource_signer) - }; - move_to(admin, state); - } - - public entry fun user_mint(minter: &signer) acquires State{ - let user_add = signer::address_of(minter); - assert_new_minter(user_add); - check_if_user_has_enough_apt(user_add,MINT_PRICE) ; - // Payment - coin::transfer(minter, @wv1, MINT_PRICE); - mint_internal(user_add); - } - - // TODO: Modify operator code - public entry fun delegate_mint(operator: &signer, minter: address) acquires State{ - assert_operator(admin::reviews::check_role(signer::address_of(operator))); - mint_internal(minter); - } - - //============================================================================================== - // Helper functions - //============================================================================================== - - inline fun mint_internal(user: address){ - let state = borrow_global_mut(@admin); - assert_supply_not_exceeded(state.minted); - - - let current_nft = state.minted + 1; - let res_signer = account::create_signer_with_capability(&state.signer_cap); - - // TODO: Check Royalty - let royalty = royalty::create(5,10,@wv1); - let uri = string::utf8(TOKEN_URI); - string::append(&mut uri, string_utils::format1(&b"{}.json", current_nft)); - // Create a new named token: - let token_const_ref = token::create_named_token( - &res_signer, - string::utf8(COLLECTION_NAME), - string::utf8(TOKEN_DESCRIPTION), - string_utils::format1(&b"Erebrus #{}", current_nft), - option::some(royalty), - uri - ); - - let obj_signer = object::generate_signer(&token_const_ref); - let obj_add = object::address_from_constructor_ref(&token_const_ref); - - // Transfer the token to the user account - object::transfer_raw(&res_signer, obj_add, user); - - // Create the ErebrusToken object and move it to the new token object signer - let new_nft_token = ErebrusToken { - mutator_ref: token::generate_mutator_ref(&token_const_ref), - burn_ref: token::generate_burn_ref(&token_const_ref), - }; - - move_to(&obj_signer, new_nft_token); - - state.minted = current_nft; - vector::push_back(&mut state.minter, user); - vector::push_back(&mut state.nft_list, obj_add); - - // Emit a new NftMintedEvent - event::emit_event( - &mut state.nft_minted_events, - NftMintedEvent { - user, - nft_no: current_nft, - obj_add, - timestamp: timestamp::now_seconds() - }); - } - - #[view] - public fun total_minted_NFTs(): u64 acquires State { - let state = borrow_global(@admin); - state.minted - } - - //============================================================================================== - // Validation functions - //============================================================================================== - - inline fun assert_admin(admin: address) { - assert!(admin == @admin, ERROR_SIGNER_NOT_ADMIN); - } - - inline fun assert_operator(check_role_return: String) { - assert!(check_role_return == string::utf8(b"operator") , ERROR_SIGNER_NOT_OPERATOR); - } - - inline fun assert_new_minter(minter: address) { - let state = borrow_global(@admin); - assert!(!vector::contains(&state.minter, &minter), ERROR_USER_MINT_EXCEEDED); - } - - // TODO: Edge case scenario - inline fun assert_supply_not_exceeded(minted: u64) { - assert!(minted < SUPPLY, ERROR_SUPPLY_EXCEEDED); - } - - inline fun check_if_user_has_enough_apt(user: address, amount_to_check_apt: u64) { - assert!(coin::balance(user) >= amount_to_check_apt, ERROR_INSUFFICIENT_BALANCE); - } - - //============================================================================================== - // Test functions - //============================================================================================== - - #[test(admin = @admin)] - fun test_init_module_success( - admin: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - account::create_account_for_test(admin_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - let seed = bcs::to_bytes(&@VSEED); - let expected_resource_account_address = account::create_resource_address(&admin_address, seed); - assert!(account::exists_at(expected_resource_account_address), 0); - - let state = borrow_global(admin_address); - assert!( - account::get_signer_capability_address(&state.signer_cap) == expected_resource_account_address, - 0 - ); - - let expected_collection_address = collection::create_collection_address( - &expected_resource_account_address, - &string::utf8(COLLECTION_NAME) - ); - let collection_object = object::address_to_object(expected_collection_address); - assert!( - collection::creator(collection_object) == expected_resource_account_address, - 4 - ); - assert!( - collection::name(collection_object) == string::utf8(COLLECTION_NAME), - 4 - ); - assert!( - collection::description(collection_object) == string::utf8(COLLECTION_DESCRIPTION), - 4 - ); - assert!( - collection::uri(collection_object) == string::utf8(COLLECTION_URI), - 4 - ); - - assert!(event::counter(&state.nft_minted_events) == 0, 4); - } - - #[test(admin = @admin, user = @0xA, bank = @wv1)] - fun test_mint_success( - admin: &signer, - user: &signer, - bank: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let user_address = signer::address_of(user); - let bank_address = signer::address_of(bank); - account::create_account_for_test(admin_address); - account::create_account_for_test(user_address); - account::create_account_for_test(bank_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - let (burn_cap, mint_cap) = - aptos_coin::initialize_for_test(&aptos_framework); - coin::register(user); - coin::register(bank); - init_module(admin); - aptos_coin::mint(&aptos_framework, user_address, MINT_PRICE); - - let image_uri = string::utf8(TOKEN_URI); - string::append(&mut image_uri, string_utils::format1(&b"{}.json",1)); - - let seed = bcs::to_bytes(&@VSEED); - let resource_account_address = account::create_resource_address(&@admin, seed); - - user_mint(user); - - let state = borrow_global(admin_address); - - let expected_nft_token_address = token::create_token_address( - &resource_account_address, - &string::utf8(COLLECTION_NAME), - &string_utils::format1(&b"nft#{}", state.minted) - ); - let nft_token_object = object::address_to_object(expected_nft_token_address); - assert!( - object::is_owner(nft_token_object, user_address) == true, - 1 - ); - assert!( - token::creator(nft_token_object) == resource_account_address, - 4 - ); - assert!( - token::name(nft_token_object) == string_utils::format1(&b"nft#{}", state.minted), - 4 - ); - assert!( - token::description(nft_token_object) == string::utf8(TOKEN_DESCRIPTION), - 4 - ); - assert!( - token::uri(nft_token_object) == image_uri, - 4 - ); - assert!( - option::is_some(&token::royalty(nft_token_object)), - 4 - ); - assert!( - vector::contains(&state.nft_list, &expected_nft_token_address), - 4 - ); - - coin::destroy_burn_cap(burn_cap); - coin::destroy_mint_cap(mint_cap); - - assert!(event::counter(&state.nft_minted_events) == 1, 4); - - } - - #[test(admin = @admin, user = @0xA, bank = @wv1)] - #[expected_failure(abort_code = ERROR_SUPPLY_EXCEEDED)] - fun test_mint_failed_supply_exceeded( - admin: &signer, - user: &signer, - bank: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let user_address = signer::address_of(user); - let bank_address = signer::address_of(bank); - account::create_account_for_test(admin_address); - account::create_account_for_test(user_address); - account::create_account_for_test(bank_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - let (burn_cap, mint_cap) = - aptos_coin::initialize_for_test(&aptos_framework); - coin::register(user); - coin::register(bank); - - init_module(admin); - aptos_coin::mint(&aptos_framework, user_address, MINT_PRICE); - - { - let state = borrow_global_mut(admin_address); - state.minted = 500; - }; - - user_mint(user); - - coin::destroy_burn_cap(burn_cap); - coin::destroy_mint_cap(mint_cap); - } - - #[test(admin = @admin, user = @0xA, bank = @wv1)] - #[expected_failure(abort_code = ERROR_USER_MINT_EXCEEDED)] - fun test_mint_failed_minter_minted( - admin: &signer, - user: &signer, - bank: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let user_address = signer::address_of(user); - let bank_address = signer::address_of(bank); - account::create_account_for_test(admin_address); - account::create_account_for_test(user_address); - account::create_account_for_test(bank_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - let (burn_cap, mint_cap) = - aptos_coin::initialize_for_test(&aptos_framework); - coin::register(user); - coin::register(bank); - - init_module(admin); - aptos_coin::mint(&aptos_framework, user_address, MINT_PRICE); - - user_mint(user); - user_mint(user); - - coin::destroy_burn_cap(burn_cap); - coin::destroy_mint_cap(mint_cap); - } - - #[test(admin = @admin, user = @0xA, operator = @0xB)] - fun test_delegate_mint_success( - admin: &signer, - operator: &signer, - user: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let user_address = signer::address_of(user); - account::create_account_for_test(admin_address); - account::create_account_for_test(user_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - admin::reviews::init_module_for_test(admin); - - let (burn_cap, mint_cap) = - aptos_coin::initialize_for_test(&aptos_framework); - coin::register(user); - init_module(admin); - aptos_coin::mint(&aptos_framework, user_address, MINT_PRICE); - - admin::reviews::grant_role( - admin, - signer::address_of(operator), - string::utf8(b"operator") - ); - - let image_uri = string::utf8(TOKEN_URI); - string::append(&mut image_uri, string_utils::format1(&b"{}.json",1)); - - let seed = bcs::to_bytes(&@VSEED); - let resource_account_address = account::create_resource_address(&@admin, seed); - - delegate_mint(operator, user_address); - - let state = borrow_global(admin_address); - - let expected_nft_token_address = token::create_token_address( - &resource_account_address, - &string::utf8(COLLECTION_NAME), - &string_utils::format1(&b"nft#{}", state.minted) - ); - let nft_token_object = object::address_to_object(expected_nft_token_address); - assert!( - object::is_owner(nft_token_object, user_address) == true, - 1 - ); - assert!( - token::creator(nft_token_object) == resource_account_address, - 4 - ); - assert!( - token::name(nft_token_object) == string_utils::format1(&b"nft#{}", state.minted), - 4 - ); - assert!( - token::description(nft_token_object) == string::utf8(TOKEN_DESCRIPTION), - 4 - ); - assert!( - token::uri(nft_token_object) == image_uri, - 4 - ); - assert!( - option::is_some(&token::royalty(nft_token_object)), - 4 - ); - assert!( - vector::contains(&state.nft_list, &expected_nft_token_address), - 4 - ); - - coin::destroy_burn_cap(burn_cap); - coin::destroy_mint_cap(mint_cap); - - assert!(event::counter(&state.nft_minted_events) == 1, 4); - } - - #[test(admin = @admin, user = @0xA, operator = @0xB)] - #[expected_failure(abort_code = ERROR_SIGNER_NOT_OPERATOR)] - fun test_delegate_mint_failure_not_operator( - admin: &signer, - operator: &signer, - user: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let user_address = signer::address_of(user); - account::create_account_for_test(admin_address); - account::create_account_for_test(user_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - admin::reviews::init_module_for_test(admin); - init_module(admin); - - delegate_mint(operator, user_address); - } - -} \ No newline at end of file diff --git a/Erebrus_NFT/.gitignore b/Erebrus_NFT/.gitignore deleted file mode 100644 index 87c0f8d..0000000 --- a/Erebrus_NFT/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.idea -build -.aptos -*.toml \ No newline at end of file diff --git a/Erebrus_NFT/LICENSE b/Erebrus_NFT/LICENSE deleted file mode 100644 index bf0c115..0000000 --- a/Erebrus_NFT/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 NetSepio - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/Erebrus_NFT/README.md b/Erebrus_NFT/README.md deleted file mode 100644 index 4a7ed85..0000000 --- a/Erebrus_NFT/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# EREBRUS -Smart Contract for the EREBRUS NFT with supply of 111. - -Where decentralization meets VPN for ultimate internet security. -Anonymous Virtual Private Network for accessing internet in stealth mode bypassing filewalls and filters - -To be deployed to testnet under contract address: - -Entry Functions: -- user_mint -- delegate_mint - -View Functions: -- total_minted_NFTs: Total NFTs minted so far -- owner_of: Accepts tokenId to tell who is its owner - -Events: -- NftMintedEvent - -## Revisions: -### 1.0.1: -### 1.0.2: -### 1.0.3: -- Deployed on mainnet under contract address: \ No newline at end of file diff --git a/Erebrus_NFT/sources/erebrus.move b/Erebrus_NFT/sources/erebrus.move deleted file mode 100644 index cc5e31c..0000000 --- a/Erebrus_NFT/sources/erebrus.move +++ /dev/null @@ -1,577 +0,0 @@ -module admin::erebrus{ - //============================================================================================== - // Dependencies - //============================================================================================== - - use std::object; - use std::signer; - use aptos_token_objects::token; - use aptos_framework::event::{Self, EventHandle}; - use aptos_framework::account::{Self, SignerCapability}; - use aptos_framework::coin; - use aptos_framework::aptos_coin::{AptosCoin}; - use std::string::{Self, String}; - use aptos_token_objects::collection; - use aptos_framework::timestamp; - use aptos_framework::option; - use std::string_utils; - use std::vector; - //use std::debug; - use aptos_token_objects::royalty; - use std::bcs; - use aptos_framework::object::address_to_object; - - #[test_only] - use aptos_framework::aptos_coin::{Self}; - - //============================================================================================== - // Errors - //============================================================================================== - - const ERROR_SIGNER_NOT_ADMIN: u64 = 0; - const ERROR_SUPPLY_EXCEEDED: u64 = 1; - const ERROR_SIGNER_NOT_OPERATOR: u64 = 2; - const ERROR_USER_MINT_EXCEEDED: u64 = 3; - const ERROR_OTHERS: u64 = 4; - const ERROR_INSUFFICIENT_BALANCE: u64 = 5; - const ERROR_ALREADY_OPERATOR: u64 = 6; - - //============================================================================================== - // Constants - //============================================================================================== - - // Contract Version - const VERSION: u64 = 1; - - // Mint Price - const MINT_PRICE: u64 = 111000000; // 1.11 APT - - // Supply limit - const SUPPLY: u64 = 111; - - // NFT collection information - const COLLECTION_NAME: vector = b"EREBRUS"; - const COLLECTION_DESCRIPTION: vector = b"Erebrus, by NetSepio. 111 innovative utility NFT that offers you access to a blockchain-backed, distributed Anonymous VPN."; - const COLLECTION_URI: vector = b"ipfs://bafybeidvpe6xdwribm5qjywrvucqys34rte26uukp6hqq3lolefd7ddjoq/erebrus_collection_uri.gif"; - - // Token information - const TOKEN_DESCRIPTION: vector = b"Erebrus NFT"; - const TOKEN_URI: vector = b"ipfs://bafybeieocwztsh2aqhb4vuwlpduw2blamfgsegthyjb3kbbwatqnj6t4hy/"; - - //============================================================================================== - // Module Structs - //============================================================================================== - - struct ErebrusToken has key { - // Used for editing the token data - mutator_ref: token::MutatorRef, - // Used for burning the token - burn_ref: token::BurnRef - } - - struct State has key { - // signer cap of the module's resource account - signer_cap: SignerCapability, - // NFT count - minted: u64, - operator: vector
, - //minter - minter: vector
, - // minted_nft_obj_add - nft_list: vector
, - // Events - nft_minted_events: EventHandle - } - //============================================================================================== - // Event structs - //============================================================================================== - - struct NftMintedEvent has store, drop { - // minter - user: address, - // nft # - nft_no: u64, - // nft object address - obj_add: address, - // timestamp - timestamp: u64 - } - - //============================================================================================== - // Functions - //============================================================================================== - - /* - Initializes the module by creating a resource account, registering with AptosCoin, creating - the token collectiions, and setting up the State resource. - @param account - signer representing the module publisher - */ - fun init_module(admin: &signer) { - assert_admin(signer::address_of(admin)); - // Seed for resource account creation - let seed = bcs::to_bytes(&@VSEED); - let (resource_signer, resource_cap) = account::create_resource_account(admin, seed); - - let royalty = royalty::create(5,100,@wv1); - - // Create an NFT collection with an unlimied supply and the following aspects: - collection::create_fixed_collection( - &resource_signer, - string::utf8(COLLECTION_DESCRIPTION), - SUPPLY, - string::utf8(COLLECTION_NAME), - option::some(royalty), - string::utf8(COLLECTION_URI) - ); - - // Create the State global resource and move it to the admin account - let state = State{ - signer_cap: resource_cap, - minted: 0, - operator: vector::empty(), - minter: vector::empty(), - nft_list: vector::empty(), - nft_minted_events: account::new_event_handle(&resource_signer) - }; - move_to(admin, state); - } - - public entry fun user_mint(minter: &signer) acquires State{ - let user_add = signer::address_of(minter); - assert_new_minter(user_add); - check_if_user_has_enough_apt(user_add, MINT_PRICE) ; - // Payment - coin::transfer(minter, @wv1, MINT_PRICE); - mint_internal(user_add); - } - - public entry fun delegate_mint(operator: &signer, minter: address) acquires State{ - assert_operator(signer::address_of(operator)); - mint_internal(minter); - } - - /* - Grants operator roles - @param admin - admin signer - @param user - user address - */ - public entry fun grant_role( - admin: &signer, - user: address - ) acquires State { - let state = borrow_global_mut(@admin); - assert_user_does_not_have_role(user); - assert_admin(signer::address_of(admin)); - vector::push_back(&mut state.operator, user); - } - - /* - Revoke operator roles - @param admin - admin signer - @param user - user address - */ - public entry fun revoke_role( - admin: &signer, - user: address - ) acquires State { - let state = borrow_global_mut(@admin); - assert_operator(user); - assert_admin(signer::address_of(admin)); - vector::remove_value(&mut state.operator, &user); - } - - //============================================================================================== - // Helper functions - //============================================================================================== - - inline fun mint_internal(user: address){ - let state = borrow_global_mut(@admin); - assert_supply_not_exceeded(state.minted); - - - let current_nft = state.minted + 1; - let res_signer = account::create_signer_with_capability(&state.signer_cap); - - let royalty = royalty::create(5,100,@wv1); - let uri = string::utf8(TOKEN_URI); - string::append(&mut uri, string_utils::format1(&b"{}.json", current_nft)); - // Create a new named token: - let token_const_ref = token::create_named_token( - &res_signer, - string::utf8(COLLECTION_NAME), - string::utf8(TOKEN_DESCRIPTION), - string_utils::format1(&b"Erebrus #{}", current_nft), - option::some(royalty), - uri - ); - - let obj_signer = object::generate_signer(&token_const_ref); - let obj_add = object::address_from_constructor_ref(&token_const_ref); - - // Transfer the token to the user account - object::transfer_raw(&res_signer, obj_add, user); - - // Create the ErebrusToken object and move it to the new token object signer - let new_nft_token = ErebrusToken { - mutator_ref: token::generate_mutator_ref(&token_const_ref), - burn_ref: token::generate_burn_ref(&token_const_ref), - }; - - move_to(&obj_signer, new_nft_token); - - state.minted = current_nft; - vector::push_back(&mut state.minter, user); - vector::push_back(&mut state.nft_list, obj_add); - - // Emit a new NftMintedEvent - event::emit_event( - &mut state.nft_minted_events, - NftMintedEvent { - user, - nft_no: current_nft, - obj_add, - timestamp: timestamp::now_seconds() - }); - } - - //============================================================================================== - // View functions - //============================================================================================== - - #[view] - public fun total_minted_NFTs(): u64 acquires State { - let state = borrow_global(@admin); - state.minted - } - - #[view] - public fun owner_of(tokenId: u64): address acquires State { - let state = borrow_global(@admin); - object::owner(object::address_to_object(*vector::borrow(&state.nft_list, tokenId-1))) - } - - //============================================================================================== - // Validation functions - //============================================================================================== - - inline fun assert_admin(admin: address) { - assert!(admin == @admin, ERROR_SIGNER_NOT_ADMIN); - } - - inline fun assert_operator(user: address) acquires State { - let state = borrow_global(@admin); - assert!(vector::contains(&state.operator,&user), ERROR_SIGNER_NOT_OPERATOR); - } - - inline fun assert_new_minter(minter: address) { - let state = borrow_global(@admin); - assert!(!vector::contains(&state.minter, &minter), ERROR_USER_MINT_EXCEEDED); - } - - inline fun assert_supply_not_exceeded(minted: u64) { - assert!(minted <= SUPPLY, ERROR_SUPPLY_EXCEEDED); - } - - inline fun assert_user_does_not_have_role(user: address) acquires State { - let state = borrow_global(@admin); - assert!(!vector::contains(&state.operator,&user), ERROR_ALREADY_OPERATOR); - } - - inline fun check_if_user_has_enough_apt(user: address, amount_to_check_apt: u64) { - assert!(coin::balance(user) >= amount_to_check_apt, ERROR_INSUFFICIENT_BALANCE); - } - - //============================================================================================== - // Test functions - //============================================================================================== - - #[test(admin = @admin)] - fun test_init_module_success( - admin: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - account::create_account_for_test(admin_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - let seed = bcs::to_bytes(&@VSEED); - let expected_resource_account_address = account::create_resource_address(&admin_address, seed); - assert!(account::exists_at(expected_resource_account_address), 0); - - let state = borrow_global(admin_address); - assert!( - account::get_signer_capability_address(&state.signer_cap) == expected_resource_account_address, - 0 - ); - - let expected_collection_address = collection::create_collection_address( - &expected_resource_account_address, - &string::utf8(COLLECTION_NAME) - ); - let collection_object = object::address_to_object(expected_collection_address); - assert!( - collection::creator(collection_object) == expected_resource_account_address, - 4 - ); - assert!( - collection::name(collection_object) == string::utf8(COLLECTION_NAME), - 4 - ); - assert!( - collection::description(collection_object) == string::utf8(COLLECTION_DESCRIPTION), - 4 - ); - assert!( - collection::uri(collection_object) == string::utf8(COLLECTION_URI), - 4 - ); - - assert!(event::counter(&state.nft_minted_events) == 0, 4); - } - - #[test(admin = @admin, user = @0xA, bank = @wv1)] - fun test_mint_success( - admin: &signer, - user: &signer, - bank: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let user_address = signer::address_of(user); - let bank_address = signer::address_of(bank); - account::create_account_for_test(admin_address); - account::create_account_for_test(user_address); - account::create_account_for_test(bank_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - let (burn_cap, mint_cap) = - aptos_coin::initialize_for_test(&aptos_framework); - coin::register(user); - coin::register(bank); - init_module(admin); - aptos_coin::mint(&aptos_framework, user_address, MINT_PRICE); - - let image_uri = string::utf8(TOKEN_URI); - string::append(&mut image_uri, string_utils::format1(&b"{}.json",1)); - - let seed = bcs::to_bytes(&@VSEED); - let resource_account_address = account::create_resource_address(&@admin, seed); - - user_mint(user); - - let state = borrow_global(admin_address); - - let expected_nft_token_address = token::create_token_address( - &resource_account_address, - &string::utf8(COLLECTION_NAME), - &string_utils::format1(&b"nft#{}", state.minted) - ); - let nft_token_object = object::address_to_object(expected_nft_token_address); - assert!( - object::is_owner(nft_token_object, user_address) == true, - 1 - ); - assert!( - token::creator(nft_token_object) == resource_account_address, - 4 - ); - assert!( - token::name(nft_token_object) == string_utils::format1(&b"nft#{}", state.minted), - 4 - ); - assert!( - token::description(nft_token_object) == string::utf8(TOKEN_DESCRIPTION), - 4 - ); - assert!( - token::uri(nft_token_object) == image_uri, - 4 - ); - assert!( - option::is_some(&token::royalty(nft_token_object)), - 4 - ); - assert!( - vector::contains(&state.nft_list, &expected_nft_token_address), - 4 - ); - - coin::destroy_burn_cap(burn_cap); - coin::destroy_mint_cap(mint_cap); - - assert!(event::counter(&state.nft_minted_events) == 1, 4); - - } - - #[test(admin = @admin, user = @0xA, bank = @wv1)] - #[expected_failure(abort_code = ERROR_SUPPLY_EXCEEDED)] - fun test_mint_failed_supply_exceeded( - admin: &signer, - user: &signer, - bank: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let user_address = signer::address_of(user); - let bank_address = signer::address_of(bank); - account::create_account_for_test(admin_address); - account::create_account_for_test(user_address); - account::create_account_for_test(bank_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - let (burn_cap, mint_cap) = - aptos_coin::initialize_for_test(&aptos_framework); - coin::register(user); - coin::register(bank); - - init_module(admin); - aptos_coin::mint(&aptos_framework, user_address, MINT_PRICE); - - { - let state = borrow_global_mut(admin_address); - state.minted = 500; - }; - - user_mint(user); - - coin::destroy_burn_cap(burn_cap); - coin::destroy_mint_cap(mint_cap); - } - - #[test(admin = @admin, user = @0xA, bank = @wv1)] - #[expected_failure(abort_code = ERROR_USER_MINT_EXCEEDED)] - fun test_mint_failed_minter_minted( - admin: &signer, - user: &signer, - bank: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let user_address = signer::address_of(user); - let bank_address = signer::address_of(bank); - account::create_account_for_test(admin_address); - account::create_account_for_test(user_address); - account::create_account_for_test(bank_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - let (burn_cap, mint_cap) = - aptos_coin::initialize_for_test(&aptos_framework); - coin::register(user); - coin::register(bank); - - init_module(admin); - aptos_coin::mint(&aptos_framework, user_address, MINT_PRICE); - - user_mint(user); - user_mint(user); - - coin::destroy_burn_cap(burn_cap); - coin::destroy_mint_cap(mint_cap); - } - - #[test(admin = @admin, user = @0xA, operator = @0xB)] - fun test_delegate_mint_success( - admin: &signer, - operator: &signer, - user: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let user_address = signer::address_of(user); - account::create_account_for_test(admin_address); - account::create_account_for_test(user_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - admin::reviews::init_module_for_test(admin); - - let (burn_cap, mint_cap) = - aptos_coin::initialize_for_test(&aptos_framework); - coin::register(user); - init_module(admin); - aptos_coin::mint(&aptos_framework, user_address, MINT_PRICE); - - admin::reviews::grant_role( - admin, - signer::address_of(operator), - string::utf8(b"operator") - ); - - let image_uri = string::utf8(TOKEN_URI); - string::append(&mut image_uri, string_utils::format1(&b"{}.json",1)); - - let seed = bcs::to_bytes(&@VSEED); - let resource_account_address = account::create_resource_address(&@admin, seed); - - delegate_mint(operator, user_address); - - let state = borrow_global(admin_address); - - let expected_nft_token_address = token::create_token_address( - &resource_account_address, - &string::utf8(COLLECTION_NAME), - &string_utils::format1(&b"nft#{}", state.minted) - ); - let nft_token_object = object::address_to_object(expected_nft_token_address); - assert!( - object::is_owner(nft_token_object, user_address) == true, - 1 - ); - assert!( - token::creator(nft_token_object) == resource_account_address, - 4 - ); - assert!( - token::name(nft_token_object) == string_utils::format1(&b"nft#{}", state.minted), - 4 - ); - assert!( - token::description(nft_token_object) == string::utf8(TOKEN_DESCRIPTION), - 4 - ); - assert!( - token::uri(nft_token_object) == image_uri, - 4 - ); - assert!( - option::is_some(&token::royalty(nft_token_object)), - 4 - ); - assert!( - vector::contains(&state.nft_list, &expected_nft_token_address), - 4 - ); - - coin::destroy_burn_cap(burn_cap); - coin::destroy_mint_cap(mint_cap); - - assert!(event::counter(&state.nft_minted_events) == 1, 4); - } - - #[test(admin = @admin, user = @0xA, operator = @0xB)] - #[expected_failure(abort_code = ERROR_SIGNER_NOT_OPERATOR)] - fun test_delegate_mint_failure_not_operator( - admin: &signer, - operator: &signer, - user: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let user_address = signer::address_of(user); - account::create_account_for_test(admin_address); - account::create_account_for_test(user_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - admin::reviews::init_module_for_test(admin); - init_module(admin); - - delegate_mint(operator, user_address); - } - -} \ No newline at end of file diff --git a/OG_NFT/.gitignore b/OG_NFT/.gitignore deleted file mode 100644 index 87c0f8d..0000000 --- a/OG_NFT/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.idea -build -.aptos -*.toml \ No newline at end of file diff --git a/OG_NFT/Move.toml b/OG_NFT/Move.toml deleted file mode 100644 index 007e5a6..0000000 --- a/OG_NFT/Move.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "commemorative" -version = "1.0.1" - -[addresses] -admin = "_" - -[dependencies] -AptosTokenObjects = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-token-objects/", rev = "aptos-cli-v2.0.2" } -reviews = {local = "../reviews_NFT" } \ No newline at end of file diff --git a/OG_NFT/README.md b/OG_NFT/README.md deleted file mode 100644 index 0a49fc6..0000000 --- a/OG_NFT/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# OG_NFT -Smart Contract for the commemorative NFT for first 500 beta testers - -To be deployed to testnet under contract address: - -Entry Functions: -- user_mint_NFT -- delegate_mint_NFT - -View Functions: -- total_minted_NFTs - -Events: -- NftMintedEvent - -## Revisions: -### 1.0.1: \ No newline at end of file diff --git a/OG_NFT/sources/commemorative.move b/OG_NFT/sources/commemorative.move deleted file mode 100644 index c10139b..0000000 --- a/OG_NFT/sources/commemorative.move +++ /dev/null @@ -1,439 +0,0 @@ -module admin::commemorative{ - //============================================================================================== - // Dependencies - //============================================================================================== - - use std::object; - use std::signer; - use aptos_token_objects::token; - use aptos_framework::event::{Self, EventHandle}; - use aptos_framework::account::{Self, SignerCapability}; - use aptos_framework::coin; - use aptos_framework::aptos_coin::{AptosCoin}; - use std::string::{Self, String}; - use aptos_token_objects::collection; - use aptos_framework::timestamp; - use aptos_framework::option; - use std::string_utils; - use std::vector; - //use std::debug; - - #[test_only] - use aptos_token_objects::royalty; - - //============================================================================================== - // Errors - //============================================================================================== - - const ERROR_SIGNER_NOT_ADMIN: u64 = 0; - const ERROR_SUPPLY_EXCEEDED: u64 = 1; - const ERROR_SIGNER_NOT_OPERATOR: u64 = 2; - const ERROR_OTHERS: u64 = 4; - - //============================================================================================== - // Constants - //============================================================================================== - - // Seed for resource account creation - const SEED: vector = b"netsepiogo"; - - // Supply limit - const SUPPLY: u64 = 500; - - // NFT collection information - const COLLECTION_NAME: vector = b"Beta test NFT"; - const COLLECTION_DESCRIPTION: vector = b"Commemorative collection"; - const COLLECTION_URI: vector = b"NFT collection uri"; - - // Token information - const TOKEN_DESCRIPTION: vector = b"NFT token description"; - - //============================================================================================== - // Module Structs - //============================================================================================== - - struct NftToken has key { - // Used for editing the token data - mutator_ref: token::MutatorRef, - // Used for burning the token - burn_ref: token::BurnRef, - // Used for transfering the token - transfer_ref: object::TransferRef - } - - struct State has key { - // signer cap of the module's resource account - signer_cap: SignerCapability, - // NFT count - minted: u64, - // minted_nft_obj_add - nft_list: vector
, - // Events - nft_minted_events: EventHandle - } - //============================================================================================== - // Event structs - //============================================================================================== - - struct NftMintedEvent has store, drop { - // minter - user: address, - // nft # - nft_no: u64, - // nft object address - obj_add: address, - // timestamp - timestamp: u64 - } - - //============================================================================================== - // Functions - //============================================================================================== - - /* - Initializes the module by creating a resource account, registering with AptosCoin, creating - the token collectiions, and setting up the State resource. - @param account - signer representing the module publisher - */ - fun init_module(admin: &signer) { - assert_admin(signer::address_of(admin)); - let (resource_signer, resource_cap) = account::create_resource_account(admin, SEED); - - coin::register(&resource_signer); - - // Create an NFT collection with an unlimied supply and the following aspects: - collection::create_fixed_collection( - &resource_signer, - string::utf8(COLLECTION_DESCRIPTION), - SUPPLY, - string::utf8(COLLECTION_NAME), - option::none(), - string::utf8(COLLECTION_URI) - ); - - // Create the State global resource and move it to the admin account - let state = State{ - signer_cap: resource_cap, - minted: 0, - nft_list: vector::empty(), - nft_minted_events: account::new_event_handle(&resource_signer) - }; - move_to(admin, state); - } - - public entry fun user_mint_NFT(minter: &signer, nft_uri: String) acquires State{ - let user_add = signer::address_of(minter); - mint_internal(user_add, nft_uri); - } - - public entry fun delegate_mint_NFT(operator: &signer, minter: address, nft_uri: String) acquires State{ - assert_operator(admin::reviews::check_role(signer::address_of(operator))); - mint_internal(minter, nft_uri); - } - - //============================================================================================== - // Helper functions - //============================================================================================== - - inline fun mint_internal(user: address, nft_uri: String){ - let state = borrow_global_mut(@admin); - assert_supply_not_exceeded(state.minted); - let current_nft = state.minted + 1; - let res_signer = account::create_signer_with_capability(&state.signer_cap); - // Create a new named token: - let token_const_ref = token::create_named_token( - &res_signer, - string::utf8(COLLECTION_NAME), - string::utf8(TOKEN_DESCRIPTION), - string_utils::format2(&b"{}#{}", string::utf8(b"nft"), string_utils::to_string_with_integer_types(¤t_nft)), - option::none(), - nft_uri - ); - - let obj_signer = object::generate_signer(&token_const_ref); - let obj_add = object::address_from_constructor_ref(&token_const_ref); - - // Transfer the token to the reviewer account - object::transfer_raw(&res_signer, obj_add, user); - - // Create the ReviewToken object and move it to the new token object signer - let new_nft_token = NftToken { - mutator_ref: token::generate_mutator_ref(&token_const_ref), - burn_ref: token::generate_burn_ref(&token_const_ref), - transfer_ref: object::generate_transfer_ref(&token_const_ref), - }; - - move_to(&obj_signer, new_nft_token); - - state.minted = current_nft; - vector::push_back(&mut state.nft_list, obj_add); - - // Emit a new NftMintedEvent - event::emit_event( - &mut state.nft_minted_events, - NftMintedEvent { - user, - nft_no: current_nft, - obj_add, - timestamp: timestamp::now_seconds() - }); - } - - #[view] - public fun total_minted_NFTs(): u64 acquires State { - let state = borrow_global(@admin); - state.minted - } - - //============================================================================================== - // Validation functions - //============================================================================================== - - inline fun assert_admin(admin: address) { - assert!(admin == @admin, ERROR_SIGNER_NOT_ADMIN); - } - - inline fun assert_operator(check_role_return: String) { - assert!(check_role_return == string::utf8(b"operator") , ERROR_SIGNER_NOT_OPERATOR); - } - - inline fun assert_supply_not_exceeded(minted: u64) { - assert!(minted < SUPPLY, ERROR_SUPPLY_EXCEEDED); - } - - //============================================================================================== - // Test functions - //============================================================================================== - - #[test(admin = @admin)] - fun test_init_module_success( - admin: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - account::create_account_for_test(admin_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - let expected_resource_account_address = account::create_resource_address(&admin_address, SEED); - assert!(account::exists_at(expected_resource_account_address), 0); - - let state = borrow_global(admin_address); - assert!( - account::get_signer_capability_address(&state.signer_cap) == expected_resource_account_address, - 0 - ); - - assert!( - coin::is_account_registered(expected_resource_account_address), - 4 - ); - - let expected_collection_address = collection::create_collection_address( - &expected_resource_account_address, - &string::utf8(b"Beta test NFT") - ); - let collection_object = object::address_to_object(expected_collection_address); - assert!( - collection::creator(collection_object) == expected_resource_account_address, - 4 - ); - assert!( - collection::name(collection_object) == string::utf8(b"Beta test NFT"), - 4 - ); - assert!( - collection::description(collection_object) == string::utf8(b"Commemorative collection"), - 4 - ); - assert!( - collection::uri(collection_object) == string::utf8(b"NFT collection uri"), - 4 - ); - - assert!(event::counter(&state.nft_minted_events) == 0, 4); - } - - #[test(admin = @admin, user = @0xA)] - fun test_mint_success( - admin: &signer, - user: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let user_address = signer::address_of(user); - account::create_account_for_test(admin_address); - account::create_account_for_test(user_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - let image_uri = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - - let resource_account_address = account::create_resource_address(&@admin, SEED); - - user_mint_NFT(user, image_uri); - - let state = borrow_global(admin_address); - - let expected_nft_token_address = token::create_token_address( - &resource_account_address, - &string::utf8(b"Beta test NFT"), - &string_utils::format2(&b"{}#{}", string::utf8(b"nft"), string_utils::to_string_with_integer_types(&state.minted)) - ); - let nft_token_object = object::address_to_object(expected_nft_token_address); - assert!( - object::is_owner(nft_token_object, user_address) == true, - 1 - ); - assert!( - token::creator(nft_token_object) == resource_account_address, - 4 - ); - assert!( - token::name(nft_token_object) == string_utils::format2(&b"{}#{}", string::utf8(b"nft"), string_utils::to_string_with_integer_types(&state.minted)), - 4 - ); - assert!( - token::description(nft_token_object) == string::utf8(b"NFT token description"), - 4 - ); - assert!( - token::uri(nft_token_object) == image_uri, - 4 - ); - assert!( - option::is_none(&token::royalty(nft_token_object)), - 4 - ); - assert!( - vector::contains(&state.nft_list, &expected_nft_token_address), - 4 - ); - - assert!(event::counter(&state.nft_minted_events) == 1, 4); - - } - - #[test(admin = @admin, user = @0xA)] - #[expected_failure(abort_code = ERROR_SUPPLY_EXCEEDED)] - fun test_mint_failed( - admin: &signer, - user: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let user_address = signer::address_of(user); - account::create_account_for_test(admin_address); - account::create_account_for_test(user_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - let image_uri = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - - { - let state = borrow_global_mut(admin_address); - state.minted = 500; - }; - - user_mint_NFT(user, image_uri); - } - - #[test(admin = @admin, user = @0xA, operator = @0xB)] - fun test_delegate_mint_success( - admin: &signer, - operator: &signer, - user: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let user_address = signer::address_of(user); - account::create_account_for_test(admin_address); - account::create_account_for_test(user_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - admin::reviews::init_module_for_test(admin); - init_module(admin); - - admin::reviews::grant_role( - admin, - signer::address_of(operator), - string::utf8(b"operator") - ); - - let image_uri = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - - let resource_account_address = account::create_resource_address(&@admin, SEED); - - delegate_mint_NFT(operator, user_address, image_uri); - - let state = borrow_global(admin_address); - - let expected_nft_token_address = token::create_token_address( - &resource_account_address, - &string::utf8(b"Beta test NFT"), - &string_utils::format2(&b"{}#{}", string::utf8(b"nft"), string_utils::to_string_with_integer_types(&state.minted)) - ); - let nft_token_object = object::address_to_object(expected_nft_token_address); - assert!( - object::is_owner(nft_token_object, user_address) == true, - 1 - ); - assert!( - token::creator(nft_token_object) == resource_account_address, - 4 - ); - assert!( - token::name(nft_token_object) == string_utils::format2(&b"{}#{}", string::utf8(b"nft"), string_utils::to_string_with_integer_types(&state.minted)), - 4 - ); - assert!( - token::description(nft_token_object) == string::utf8(b"NFT token description"), - 4 - ); - assert!( - token::uri(nft_token_object) == image_uri, - 4 - ); - assert!( - option::is_none(&token::royalty(nft_token_object)), - 4 - ); - assert!( - vector::contains(&state.nft_list, &expected_nft_token_address), - 4 - ); - - assert!(event::counter(&state.nft_minted_events) == 1, 4); - } - - #[test(admin = @admin, user = @0xA, operator = @0xB)] - #[expected_failure(abort_code = ERROR_SIGNER_NOT_OPERATOR)] - fun test_delegate_mint_failure_not_operator( - admin: &signer, - operator: &signer, - user: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let user_address = signer::address_of(user); - account::create_account_for_test(admin_address); - account::create_account_for_test(user_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - admin::reviews::init_module_for_test(admin); - init_module(admin); - - let image_uri = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - - delegate_mint_NFT(operator, user_address, image_uri); - } - -} \ No newline at end of file diff --git a/README.md b/README.md index f44e012..e944bfc 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,74 @@ -# Smart Contracts +# Erebrus Registry - Solana Anchor Project -_Mainnet Deployment:_ 0xc2047066ac28da8e0e7c0988aaa15c283ca38109c4d8dfc1d60a89a69809608e +This project implements the Erebrus Registry, a decentralized system for managing WiFi and VPN nodes on the Solana blockchain. -_Testnet Deployment:_ 75bcfe882d1a4d032ead2b47f377e4c95221594d66ab2bd09a61aded4c9d64f9 +_Devnet Deployment:_ [dyu7uefnn2Y2bKCDu6uTP4pVBPcBu4RPwsV522rjtbR6B2BJyA4vWC4eLGosDXqPzMpXsaBgzbE8VjqMkaYgf6g](https://explorer.solana.com/tx/dyu7uefnn2Y2bKCDu6uTP4pVBPcBu4RPwsV522rjtbR6B2BJyA4vWC4eLGosDXqPzMpXsaBgzbE8VjqMkaYgf6g?cluster=devnet) -## 1. REVIEW NFT -Smart contract for submit & delete reviews, grant operator/reviewer roles, view functions, etc. +## Features -## 2. EREBRUS NFT -Smart Contract for the EREBRUS Collection with supply of 111 NFTs. +1. **Registry Initialization**: Set up the main registry for managing nodes. +2. **WiFi Node Management**: Register, update, and deactivate WiFi nodes. +3. **VPN Node Management**: Register, update, and deactivate VPN nodes. +4. **Device Checkpoints**: Record checkpoints for registered devices. + +## Smart Contract Structure + +The main program module `erebrus_registry` contains the following key functions: + +- `initialize`: Initialize the Erebrus Registry. +- `register_wifi_node`: Register a new WiFi node. +- `update_wifi_node`: Update an existing WiFi node's information. +- `register_vpn_node`: Register a new VPN node. +- `update_vpn_node`: Update an existing VPN node's information. +- `deactivate_node`: Deactivate a node (can be either WiFi or VPN). +- `device_checkpoint`: Record a checkpoint for a device. + +## Account Structures + +- `ErebrusRegistry`: Main registry account. +- `Node`: Represents a WiFi or VPN node. +- `Checkpoint`: Represents a device checkpoint. + +## Development + +This project uses Anchor, a framework for Solana's Sealevel runtime. + +### Prerequisites + +- Rust +- Solana CLI +- Anchor + +### Setup + +1. Clone the repository +2. Install dependencies: + ``` + npm install + ``` + +### Building + +To build the project, run: + +``` +anchor build +``` + +### Testing + +To run tests, use: + +``` +anchor test +``` + +### Deploying + +To deploy the program to the Solana network, use: + +``` +anchor deploy +``` -## 3. OG NFT -Smart contract for commemorative NFT for first 500 beta testers. -## 4. REPORT NFT -Smart contract for DAO proposal NFT for scam reports. \ No newline at end of file diff --git a/migrations/deploy.ts b/migrations/deploy.ts new file mode 100644 index 0000000..82fb175 --- /dev/null +++ b/migrations/deploy.ts @@ -0,0 +1,12 @@ +// Migrations are an early feature. Currently, they're nothing more than this +// single deploy script that's invoked from the CLI, injecting a provider +// configured from the workspace's Anchor.toml. + +const anchor = require("@coral-xyz/anchor"); + +module.exports = async function (provider) { + // Configure client to use the provider. + anchor.setProvider(provider); + + // Add your deploy script here. +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..cd83bac --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "scripts": { + "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w", + "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check" + }, + "dependencies": { + "@coral-xyz/anchor": "^0.29.0" + }, + "devDependencies": { + "chai": "^4.3.4", + "mocha": "^9.0.3", + "ts-mocha": "^10.0.0", + "@types/bn.js": "^5.1.0", + "@types/chai": "^4.3.0", + "@types/mocha": "^9.0.0", + "typescript": "^4.3.5", + "prettier": "^2.6.2" + } +} diff --git a/programs/netsepio/Cargo.toml b/programs/netsepio/Cargo.toml new file mode 100644 index 0000000..1cd7cac --- /dev/null +++ b/programs/netsepio/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "netsepio" +version = "0.1.0" +description = "Created with Anchor" +edition = "2021" + +[lib] +crate-type = ["cdylib", "lib"] +name = "netsepio" + +[features] +no-entrypoint = [] +no-idl = [] +no-log-ix-name = [] +cpi = ["no-entrypoint"] +default = [] + +[dependencies] +anchor-lang = "0.29.0" diff --git a/programs/netsepio/Xargo.toml b/programs/netsepio/Xargo.toml new file mode 100644 index 0000000..475fb71 --- /dev/null +++ b/programs/netsepio/Xargo.toml @@ -0,0 +1,2 @@ +[target.bpfel-unknown-unknown.dependencies.std] +features = [] diff --git a/programs/netsepio/src/lib.rs b/programs/netsepio/src/lib.rs new file mode 100644 index 0000000..837bc20 --- /dev/null +++ b/programs/netsepio/src/lib.rs @@ -0,0 +1,258 @@ +use anchor_lang::prelude::*; +use std::mem::size_of; + +declare_id!("6adzicpnDv2JmoJxbafKL4GXGMUbsfLUbdz31iwpRotC"); + +#[program] +pub mod erebrus_registry { + use super::*; + + pub fn initialize(ctx: Context) -> Result<()> { + let registry = &mut ctx.accounts.registry; + registry.owner = *ctx.accounts.owner.key; + registry.current_wifi_node = 0; + registry.current_vpn_node = 0; + Ok(()) + } + + pub fn register_wifi_node( + ctx: Context, + device_id: String, + did: String, + ssid: String, + location: String, + price_per_minute: u64, + ) -> Result<()> { + let registry = &mut ctx.accounts.registry; + let node_id = registry.current_wifi_node; + require!(node_id < MAX_NODES as u64, ErrorCode::MaxNodesReached); + + registry.current_wifi_node += 1; + + let wifi_node = &mut ctx.accounts.node; + wifi_node.node_type = NodeType::WiFi; + wifi_node.user = *ctx.accounts.user.key; + wifi_node.device_id = device_id; + wifi_node.did = did; + wifi_node.ssid = Some(ssid); + wifi_node.location = location; + wifi_node.price_per_minute = Some(price_per_minute); + wifi_node.is_active = true; + wifi_node.total_checkpoints = 0; + + Ok(()) + } + + pub fn update_wifi_node( + ctx: Context, + ssid: Option, + location: Option, + price_per_minute: Option, + ) -> Result<()> { + let node = &mut ctx.accounts.node; + require!(node.is_active, ErrorCode::NodeNotActive); + require!(node.user == ctx.accounts.user.key(), ErrorCode::Unauthorized); + require!(node.node_type == NodeType::WiFi, ErrorCode::InvalidNodeType); + + if let Some(new_ssid) = ssid { + node.ssid = Some(new_ssid); + } + if let Some(new_location) = location { + node.location = new_location; + } + if let Some(new_price) = price_per_minute { + node.price_per_minute = Some(new_price); + } + Ok(()) + } + + pub fn deactivate_node(ctx: Context) -> Result<()> { + let node = &mut ctx.accounts.node; + require!(ctx.accounts.registry.owner == ctx.accounts.owner.key(), ErrorCode::Unauthorized); + node.is_active = false; + Ok(()) + } + + pub fn device_checkpoint( + ctx: Context, + data_hash: String, + ) -> Result<()> { + let node = &mut ctx.accounts.node; + let checkpoint = &mut ctx.accounts.checkpoint; + + checkpoint.node = node.key(); + checkpoint.user = *ctx.accounts.user.key; + checkpoint.data_hash = data_hash; + + node.total_checkpoints += 1; + + Ok(()) + } + + pub fn register_vpn_node( + ctx: Context, + device_id: String, + did: String, + node_name: String, + ip_address: String, + isp_info: String, + region: String, + location: String, + ) -> Result<()> { + let registry = &mut ctx.accounts.registry; + let node_id = registry.current_vpn_node; + require!(node_id < MAX_NODES as u64, ErrorCode::MaxNodesReached); + + registry.current_vpn_node += 1; + + let vpn_node = &mut ctx.accounts.node; + vpn_node.node_type = NodeType::VPN; + vpn_node.user = *ctx.accounts.user.key; + vpn_node.device_id = device_id; + vpn_node.did = did; + vpn_node.node_name = Some(node_name); + vpn_node.ip_address = Some(ip_address); + vpn_node.isp_info = Some(isp_info); + vpn_node.region = Some(region); + vpn_node.location = location; + vpn_node.is_active = true; + vpn_node.total_checkpoints = 0; + + Ok(()) + } + + pub fn update_vpn_node( + ctx: Context, + node_name: Option, + ip_address: Option, + isp_info: Option, + region: Option, + location: Option, + ) -> Result<()> { + let node = &mut ctx.accounts.node; + require!(node.is_active, ErrorCode::NodeNotActive); + require!(node.user == ctx.accounts.user.key(), ErrorCode::Unauthorized); + require!(node.node_type == NodeType::VPN, ErrorCode::InvalidNodeType); + + if let Some(new_node_name) = node_name { + node.node_name = Some(new_node_name); + } + if let Some(new_ip_address) = ip_address { + node.ip_address = Some(new_ip_address); + } + if let Some(new_isp_info) = isp_info { + node.isp_info = Some(new_isp_info); + } + if let Some(new_region) = region { + node.region = Some(new_region); + } + if let Some(new_location) = location { + node.location = new_location; + } + Ok(()) + } +} + +#[derive(Accounts)] +pub struct Initialize<'info> { + #[account(init, payer = owner, space = 8 + size_of::())] + pub registry: Account<'info, ErebrusRegistry>, + #[account(mut)] + pub owner: Signer<'info>, + pub system_program: Program<'info, System>, +} + +#[derive(Accounts)] +pub struct RegisterNode<'info> { + #[account(mut)] + pub registry: Account<'info, ErebrusRegistry>, + #[account(init, payer = user, space = 8 + size_of::())] + pub node: Account<'info, Node>, + #[account(mut)] + pub user: Signer<'info>, + pub system_program: Program<'info, System>, +} + +#[derive(Accounts)] +pub struct UpdateNode<'info> { + #[account(mut)] + pub node: Account<'info, Node>, + pub user: Signer<'info>, +} + +#[derive(Accounts)] +pub struct DeactivateNode<'info> { + pub registry: Account<'info, ErebrusRegistry>, + #[account(mut)] + pub node: Account<'info, Node>, + pub owner: Signer<'info>, +} + +#[derive(Accounts)] +pub struct DeviceCheckpoint<'info> { + #[account( + init, + payer = user, + space = 8 + size_of::(), + seeds = [b"checkpoint", node.key().as_ref(), &node.total_checkpoints.to_le_bytes()], + bump + )] + pub checkpoint: Account<'info, Checkpoint>, + #[account(mut)] + pub node: Account<'info, Node>, + #[account(mut)] + pub user: Signer<'info>, + pub system_program: Program<'info, System>, +} + +#[account] +#[derive(Default)] +pub struct ErebrusRegistry { + pub owner: Pubkey, + pub current_wifi_node: u64, + pub current_vpn_node: u64, +} + +#[account] +#[derive(Default)] +pub struct Node { + pub node_type: NodeType, + pub user: Pubkey, + pub device_id: String, + pub did: String, + pub ssid: Option, + pub node_name: Option, + pub ip_address: Option, + pub isp_info: Option, + pub region: Option, + pub location: String, + pub price_per_minute: Option, + pub is_active: bool, + pub total_checkpoints: u64, +} + +#[account] +#[derive(Default)] +pub struct Checkpoint { + pub node: Pubkey, + pub user: Pubkey, + pub data_hash: String, +} + +#[derive(AnchorSerialize, AnchorDeserialize, Clone, PartialEq, Default)] +pub enum NodeType { + #[default] + WiFi, + VPN, +} + +#[error_code] +pub enum ErrorCode { + InvalidNodeId, + NodeNotActive, + Unauthorized, + MaxNodesReached, + InvalidNodeType, +} + +const MAX_NODES: usize = 1000; \ No newline at end of file diff --git a/reviews_NFT/.gitignore b/reviews_NFT/.gitignore deleted file mode 100644 index 87c0f8d..0000000 --- a/reviews_NFT/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.idea -build -.aptos -*.toml \ No newline at end of file diff --git a/reviews_NFT/README.md b/reviews_NFT/README.md deleted file mode 100644 index 7c1b248..0000000 --- a/reviews_NFT/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# Reviews_NFT -Smart Contract for the NetSepio Reviews for Aptos Blockchain - -_Mainnet Deployment:_ 0xc2047066ac28da8e0e7c0988aaa15c283ca38109c4d8dfc1d60a89a69809608e - - -_Testnet Deployment:_ 75bcfe882d1a4d032ead2b47f377e4c95221594d66ab2bd09a61aded4c9d64f9 - -Entry Functions: -- grant_role -- remove_role -- submit_review -- delegate_submit_review -- delete_review -- archive_link - -View Functions: -- check_if_metadata_exists -- check_role -- total_dapps_reviewed -- total_reviews - -Events: -- RoleGrantedEvent -- RoleRemovedEvent -- ArchiveLinkEvent -- ReviewSubmittedEvent -- ReviewDeletedEvent - -## Revisions: -### 1.0.2: -- Deployed to testnet under contract address: 08256c1924e4234c5e5391149a1691bc03eaefeaf059e26a51f8679d4bc109cb -- renamed "total_dapps_reviewed" -> "total_sites_reviewed" -- added "init_module_for_test" for test interaction with other contracts - -### 1.0.3: -- Deployed to testnet under contract address: 0x5fdf39c03b36e9c59387628ca9066c62b2ec41019355c249177a7886e663f4a1 -- delete_review -> access changed to user and operator instead of operator only -- revised error codes - -### 1.0.4: -- Deployed to testnet under contract address: f315eefb17f4ec43cc9fab9123bf96883162984bfb9f716b81491e789199549e -- Changed NFT name system -- Changed Collection and NFT image_uri - -### 1.0.5: -- Deployed to testnet under contract address: 75bcfe882d1a4d032ead2b47f377e4c95221594d66ab2bd09a61aded4c9d64f9 -- Debugged NFT generation issue - -### 1.0.6: -- Deployed to mainnet under contract address: \ No newline at end of file diff --git a/reviews_NFT/sources/reviews.move b/reviews_NFT/sources/reviews.move deleted file mode 100644 index 57031f7..0000000 --- a/reviews_NFT/sources/reviews.move +++ /dev/null @@ -1,1300 +0,0 @@ -module admin::reviews{ - - //============================================================================================== - // Dependencies - //============================================================================================== - - use std::object; - use std::signer; - use aptos_framework::option; - use aptos_token_objects::token; - use aptos_framework::event::{Self, EventHandle}; - use aptos_framework::account::{Self, SignerCapability}; - use std::string::{Self, String}; - use aptos_token_objects::collection; - use aptos_framework::timestamp; - use aptos_framework::coin; - use aptos_framework::aptos_coin::{AptosCoin}; - use aptos_std::simple_map; - use aptos_std::simple_map::SimpleMap; - use std::bcs; - use std::vector; - use aptos_std::string_utils; - - #[test_only] - use aptos_token_objects::royalty; - - //============================================================================================== - // Errors - //============================================================================================== - - const ERROR_SIGNER_NOT_ADMIN: u64 = 0; - const ERROR_SIGNER_NOT_REVIEWER: u64 = 1; - const ERROR_SIGNER_NOT_OPERATOR: u64 = 2; - const ERROR_METADATA_DUPLICATED: u64 = 3; - const ERROR_OTHERS: u64 = 4; - const ERROR_REVIEW_DOES_NOT_EXIST: u64 = 5; - const ERROR_USER_NO_ROLE: u64 = 6; - const ERROR_USER_ALREADY_HAS_ROLE: u64 = 7; - const ERROR_INVALID_ROLE_NAME: u64 = 8; - const ERROR_NOT_REVIEW_OWNER: u64 = 9; - - //============================================================================================== - // Constants - //============================================================================================== - - // Contract Version - const VERSION: u64 = 1; - - // Token collection information - const COLLECTION_NAME: vector = b"NETSEPIO REVIEWS"; - const COLLECTION_DESCRIPTION: vector = b"Share your web3 insight on NetSepio"; - const COLLECTION_URI: vector = b"ipfs://bafybeiejnrheh6inrlkwrafytrpzyy4oqcxmxqqeclci4wmlostah2iw2q/collection_uri.png"; - - // Token information - const TOKEN_DESCRIPTION: vector = b"REVIEW NFT"; - - - //============================================================================================== - // Module Structs - //============================================================================================== - - struct ReviewToken has key { - // Used for editing the token data - mutator_ref: token::MutatorRef, - // Used for burning the token - burn_ref: token::BurnRef - } - - struct Archive has key { - // count - count: u64, - // latest ipfs_hash of website - hash: String, - // latest timestamp - timestamp: u64 - } - - struct Roles has store, copy, drop{ - operator: vector
, - reviewer: vector
- } - - /* - Information to be used in the module - */ - struct State has key { - // signer cap of the module's resource account - signer_cap: SignerCapability, - // reviews minted - count: u128, - // SimpleMap - metadatas: SimpleMap, address>, - // SimpleMap - websites: SimpleMap, - //roles - roles: Roles, - // Events - role_granted_events: EventHandle, - role_revoked_events: EventHandle, - archive_link_events: EventHandle, - review_submitted_events: EventHandle, - review_deleted_events: EventHandle - } - - //============================================================================================== - // Event structs - //============================================================================================== - - struct RoleGrantedEvent has store, drop { - // approver - approver: address, - // role - role: String, - // user address - user: address, - // timestamp - timestamp: u64 - } - - struct RoleRevokedEvent has store, drop { - // executor - executor: address, - // role - role: String, - // user address - user: address, - // timestamp - timestamp: u64 - } - - struct ArchiveLinkEvent has store, drop { - // archive logger - logger: address, - // previous archive link, current archive link - previous_archive_link: String, - current_archive_link: String, - // timestamp - timestamp: u64 - } - - struct ReviewSubmittedEvent has store, drop { - // address of the account submitting the review - reviewer: address, - // token address of review - review_token_address: address, - // review hash - metadata: String, - //output log for frontend - category: String, - domain_address: String, - site_url: String, - site_type: String, - site_tag: String, - site_safety: String, - // timestamp - timestamp: u64 - } - - struct ReviewDeletedEvent has store, drop { - // review_hash - metadata: String, - // address of the account deleting the review - deleter: address, - // address of the account owning the review - reviewer: address, - // timestamp - timestamp: u64 - } - - //============================================================================================== - // Functions - //============================================================================================== - - /* - Initializes the module by creating a resource account, registering with AptosCoin, creating - the token collectiions, and setting up the State resource. - @param account - signer representing the module publisher - */ - fun init_module(admin: &signer) { - assert_admin(signer::address_of(admin)); - - let seed = bcs::to_bytes(&@RSEED); - let (resource_signer, resource_cap) = account::create_resource_account(admin, seed); - - coin::register(&resource_signer); - - // Create a NFT collection with an unlimited supply with the following aspects: - collection::create_unlimited_collection( - &resource_signer, - string::utf8(COLLECTION_DESCRIPTION), - string::utf8(COLLECTION_NAME), - option::none(), - string::utf8(COLLECTION_URI) - ); - - let roles = Roles{ - operator: vector::empty
(), - reviewer: vector::empty
() - }; - - // Create the State global resource and move it to the admin account - let state = State{ - signer_cap: resource_cap, - count: 0, - metadatas: simple_map::new(), - websites: simple_map::new(), - roles, - role_granted_events: account::new_event_handle(&resource_signer), - role_revoked_events: account::new_event_handle(&resource_signer), - archive_link_events: account::new_event_handle(&resource_signer), - review_submitted_events: account::new_event_handle(&resource_signer), - review_deleted_events: account::new_event_handle(&resource_signer) - }; - move_to(admin, state); - } - - /* - Grants reviewer/operator roles - @param admin - admin signer - @param user - user address - @param role - reviewer/operator -*/ - public entry fun grant_role( - admin: &signer, - user: address, - role: String - ) acquires State { - let state = borrow_global_mut(@admin); - assert_appropriate_role(role); - assert_user_does_not_have_role(user, state.roles); - if(role == string::utf8(b"operator")){ - assert_admin(signer::address_of(admin)); - vector::push_back(&mut state.roles.operator, user); - }else{ - assert_admin_or_operator(signer::address_of(admin), state.roles); - vector::push_back(&mut state.roles.reviewer, user); - }; - // Emit a new RoleGrantedEvent - event::emit_event( - &mut state.role_granted_events, - RoleGrantedEvent { - approver: signer::address_of(admin), - role, - user, - timestamp: timestamp::now_seconds() - }); - } - - /* - Revoke reviewer/operator roles - @param admin - admin signer - @param user - user address - @param role - reviewer/operator -*/ - public entry fun revoke_role( - admin: &signer, - user: address - ) acquires State { - let state = borrow_global_mut(@admin); - assert_user_has_role(user, state.roles); - let role; - if(vector::contains(&state.roles.operator, &user)){ - assert_admin(signer::address_of(admin)); - vector::remove_value(&mut state.roles.operator, &user); - role = string::utf8(b"operator"); - }else{ - assert_admin_or_operator(signer::address_of(admin), state.roles); - vector::remove_value(&mut state.roles.reviewer, &user); - role = string::utf8(b"reviewer"); - }; - // Emit a new RoleRevokedEvent - event::emit_event( - &mut state.role_revoked_events, - RoleRevokedEvent { - executor: signer::address_of(admin), - role, - user, - timestamp: timestamp::now_seconds() - }); - } - - /* - Mints a new ReviewToken for the reviewer account - @param admin - admin signer - @param reviewer - signer representing the account reviewing the project -*/ - public entry fun submit_review( - reviewer: &signer, - metadata: String, - category: String, - domain_address: String, - site_url: String, - site_type: String, - site_tag: String, - site_safety: String, - site_ipfs_hash: String - ) acquires State, Archive { - { - let reviewer_address = signer::address_of(reviewer); - { - let state = borrow_global_mut(@admin); - assert_reviewer(reviewer_address, state.roles); - }; - submit_review_internal(reviewer_address, metadata, category, domain_address, site_url, site_type, site_tag, site_safety); - }; - - // add archive only if ipfs_hash is not null - if(!string::is_empty(&site_ipfs_hash)){ - archive_link(reviewer, site_url, site_ipfs_hash); - }; - } - - //delegate mint - will not cost users to mint reviews - public entry fun delegate_submit_review( - operator: &signer, - reviewer_address: address, - metadata: String, - category: String, - domain_address: String, - site_url: String, - site_type: String, - site_tag: String, - site_safety: String, - site_ipfs_hash: String - ) acquires State, Archive { - { - { - let state = borrow_global_mut(@admin); - assert_operator(signer::address_of(operator), state.roles); - }; - submit_review_internal(reviewer_address, metadata, category, domain_address, site_url, site_type, site_tag, site_safety); - }; - - // add archive only if ipfs_hash is not null - if(!string::is_empty(&site_ipfs_hash)){ - archive_link(operator, site_url, site_ipfs_hash); - }; - } - - public entry fun delete_review( - deleter: &signer, - metadata: String - ) acquires State, ReviewToken { - let review_hash = bcs::to_bytes(&metadata); - let state = borrow_global_mut(@admin); - assert_metadata_exists(review_hash, state.metadatas); - let review_token_address = *simple_map::borrow(&state.metadatas, &review_hash); - let review_token_object = object::address_to_object(review_token_address); - let reviewer = object::owner(review_token_object); - let deleter_address = signer::address_of(deleter); - assert_owner(deleter_address, reviewer); - let review_token = move_from(review_token_address); - let ReviewToken{mutator_ref: _, burn_ref} = review_token; - - // Burn the the token - token::burn(burn_ref); - - // Emit a new ReviewDeletedEvent - simple_map::remove(&mut state.metadatas, &review_hash); - event::emit_event( - &mut state.review_deleted_events, - ReviewDeletedEvent { - metadata, - deleter: deleter_address, - reviewer, - timestamp: timestamp::now_seconds() - }); - } - - public entry fun archive_link( - user: &signer, - site_url: String, - site_ipfs_hash: String - ) acquires State, Archive { - let state = borrow_global_mut(@admin); - let previous_archive = string::utf8(b""); - if(!simple_map::contains_key(&state.websites, &site_url)){ - //let site_object_address = object::create_object_address(&@admin, bcs::to_bytes(&site_url)); - let res_Signer = account::create_signer_with_capability(&state.signer_cap); - let obj_signer = object::generate_signer(&object::create_named_object(&res_Signer, bcs::to_bytes(&site_url))); - let new_archive = Archive { - count: 1, - hash: site_ipfs_hash, - timestamp: timestamp::now_seconds() - }; - simple_map::add(&mut state.websites, site_url, signer::address_of(&obj_signer)); - move_to(&obj_signer, new_archive); - }else{ - let archive = borrow_global_mut(*simple_map::borrow(&state.websites, &site_url)); - archive.count = archive.count + 1; - previous_archive = archive.hash; - archive.hash = site_ipfs_hash; - archive.timestamp = timestamp::now_seconds(); - }; - - // Emit a new ArchiveLinkEvent - event::emit_event( - &mut state.archive_link_events, - ArchiveLinkEvent { - logger: signer::address_of(user), - previous_archive_link: previous_archive, - current_archive_link: site_ipfs_hash, - timestamp: timestamp::now_seconds() - }); - } - - //============================================================================================== - // Helper functions - //============================================================================================== - - #[view] - public fun check_if_metadata_exists(metadata: String): bool acquires State { - let state = borrow_global(@admin); - simple_map::contains_key(&state.metadatas, &bcs::to_bytes(&metadata)) - } - - #[view] - public fun check_role(user: address): String acquires State { - let state = borrow_global(@admin); - if(vector::contains(&state.roles.reviewer, &user)){ - string::utf8(b"reviewer") - }else if(vector::contains(&state.roles.operator, &user)){ - string::utf8(b"operator") - }else{ - string::utf8(b"N/A") - } - } - - #[view] - public fun total_reviews(): u64 acquires State { - let state = borrow_global(@admin); - simple_map::length(&state.metadatas) - } - - #[view] - public fun total_sites_reviewed(): u64 acquires State { - let state = borrow_global(@admin); - simple_map::length(&state.websites) - } - - // submit review logic - inline fun submit_review_internal( - reviewer_address: address, - metadata: String, - category: String, - domain_address: String, - site_url: String, - site_type: String, - site_tag: String, - site_safety: String - ) acquires State { - { - let review_hash = bcs::to_bytes(&metadata); - let state = borrow_global_mut(@admin); - assert_metadata_not_duplicated(review_hash, state.metadatas); - let res_signer = account::create_signer_with_capability(&state.signer_cap); - let count = state.count +1; - let name = string_utils::format1(&b"Review #{}", count); - // Create a new named token: - let token_const_ref = token::create_named_token( - &res_signer, - string::utf8(COLLECTION_NAME), - string::utf8(TOKEN_DESCRIPTION), - name, - option::none(), - metadata - ); - - let obj_signer = object::generate_signer(&token_const_ref); - - // Transfer the token to the reviewer account - object::transfer_raw(&res_signer, object::address_from_constructor_ref(&token_const_ref), reviewer_address); - - // Create the ReviewToken object and move it to the new token object signer - let new_review_token = ReviewToken { - mutator_ref: token::generate_mutator_ref(&token_const_ref), - burn_ref: token::generate_burn_ref(&token_const_ref), - }; - - move_to(&obj_signer, new_review_token); - simple_map::add(&mut state.metadatas, review_hash, object::address_from_constructor_ref(&token_const_ref)); - - //block transfer between normal users - object::disable_ungated_transfer(&object::generate_transfer_ref(&token_const_ref)); - - state.count = count; - // Emit a new ReviewSubmittedEvent - event::emit_event( - &mut state.review_submitted_events, - ReviewSubmittedEvent { - reviewer: reviewer_address, - review_token_address: object::address_from_constructor_ref(&token_const_ref), - metadata, - category, - domain_address, - site_url, - site_type, - site_tag, - site_safety, - timestamp: timestamp::now_seconds() - }); - }; - } - - //============================================================================================== - // Validation functions - //============================================================================================== - - inline fun assert_admin(admin: address) { - assert!(admin == @admin, ERROR_SIGNER_NOT_ADMIN); - } - - inline fun assert_metadata_not_duplicated(review_hash: vector, metadatas: SimpleMap, address>) { - assert!(!simple_map::contains_key(&metadatas, &review_hash), ERROR_METADATA_DUPLICATED); - } - - inline fun assert_metadata_exists(review_hash: vector, metadatas: SimpleMap, address>) { - assert!(simple_map::contains_key(&metadatas, &review_hash), ERROR_REVIEW_DOES_NOT_EXIST); - } - - inline fun assert_reviewer(user: address, roles: Roles) { - assert!(vector::contains(&roles.reviewer, &user) , ERROR_SIGNER_NOT_REVIEWER); - } - - inline fun assert_operator(user: address, roles: Roles) { - assert!(vector::contains(&roles.operator, &user) , ERROR_SIGNER_NOT_OPERATOR); - } - - inline fun assert_appropriate_role(role: String) { - assert!(role == string::utf8(b"operator") || role == string::utf8(b"reviewer") , ERROR_INVALID_ROLE_NAME); - } - - inline fun assert_user_has_role(user: address, roles: Roles) { - assert!(vector::contains(&roles.reviewer, &user) || vector::contains(&roles.operator, &user) , ERROR_USER_NO_ROLE); - } - - inline fun assert_user_does_not_have_role(user: address, roles: Roles) { - assert!(!vector::contains(&roles.reviewer, &user) && !vector::contains(&roles.operator, &user) , ERROR_USER_ALREADY_HAS_ROLE); - } - - inline fun assert_admin_or_operator(user: address, roles: Roles) { - assert!(vector::contains(&roles.operator, &user) || user == @admin, ERROR_SIGNER_NOT_OPERATOR); - } - - inline fun assert_owner(user: address, owner: address) { - assert!(user == owner, ERROR_NOT_REVIEW_OWNER); - } - - //============================================================================================== - // Test functions - //============================================================================================== - - #[test_only(admin = @admin)] - public fun init_module_for_test(admin: &signer){ - init_module(admin); - } - - #[test(admin = @admin)] - fun test_init_module_success( - admin: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - account::create_account_for_test(admin_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - let seed = bcs::to_bytes(&@RSEED); - let expected_resource_account_address = account::create_resource_address(&admin_address, seed); - assert!(account::exists_at(expected_resource_account_address), 0); - - let state = borrow_global(admin_address); - assert!( - account::get_signer_capability_address(&state.signer_cap) == expected_resource_account_address, - 0 - ); - assert!( - simple_map::length(&state.metadatas) == 0, - 4 - ); - - assert!( - coin::is_account_registered(expected_resource_account_address), - 4 - ); - - let expected_collection_address = collection::create_collection_address( - &expected_resource_account_address, - &string::utf8(COLLECTION_NAME) - ); - let collection_object = object::address_to_object(expected_collection_address); - assert!( - collection::creator(collection_object) == expected_resource_account_address, - 4 - ); - assert!( - collection::name(collection_object) == string::utf8(COLLECTION_NAME), - 4 - ); - assert!( - collection::description(collection_object) == string::utf8(COLLECTION_DESCRIPTION), - 4 - ); - assert!( - collection::uri(collection_object) == string::utf8(COLLECTION_URI), - 4 - ); - assert!(state.count == 0, 4); - assert!(event::counter(&state.review_submitted_events) == 0, 4); - assert!(event::counter(&state.review_deleted_events) == 0, 4); - } - - #[test(admin = @admin, reviewer = @0xA)] - fun test_reviewer_success( - admin: &signer, - reviewer: &signer - ) acquires State, Archive { - let admin_address = signer::address_of(admin); - let reviewer_address = signer::address_of(reviewer); - account::create_account_for_test(admin_address); - account::create_account_for_test(reviewer_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - grant_role( - admin, - reviewer_address, - string::utf8(b"reviewer") - ); - - let metadata = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - let category = string::utf8(b"Website"); - let domain_address = string::utf8(b"mystic.com"); - let site_url = string::utf8(b"todo.mystic.com"); - let site_type = string::utf8(b"Productivity app"); - let site_tag = string::utf8(b"Web3 Project"); - let site_safety = string::utf8(b"Genuine"); - let site_ipfs_hash = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - - submit_review( - reviewer, - metadata, - category, - domain_address, - site_url, - site_type, - site_tag, - site_safety, - site_ipfs_hash - ); - - let seed = bcs::to_bytes(&@RSEED); - let resource_account_address = account::create_resource_address(&@admin, seed); - - let expected_name = string_utils::format1(&b"Review #{}", 1); - let expected_review_token_address = token::create_token_address( - &resource_account_address, - &string::utf8(COLLECTION_NAME), - &expected_name - ); - let review_token_object = object::address_to_object(expected_review_token_address); - assert!( - object::is_owner(review_token_object, reviewer_address) == true, - 1 - ); - assert!( - token::creator(review_token_object) == resource_account_address, - 4 - ); - assert!( - token::name(review_token_object) == expected_name, - 4 - ); - assert!( - token::description(review_token_object) == string::utf8(TOKEN_DESCRIPTION), - 4 - ); - assert!( - token::uri(review_token_object) == metadata, - 4 - ); - assert!( - option::is_none(&token::royalty(review_token_object)), - 4 - ); - - let state = borrow_global(admin_address); - - assert!(vector::contains(&state.roles.reviewer, &reviewer_address), 4); - assert!(event::counter(&state.role_granted_events) == 1, 4); - - assert!( - simple_map::length(&state.metadatas) == 1, - 4 - ); - - assert!(event::counter(&state.review_submitted_events) == 1, 4); - assert!(event::counter(&state.review_deleted_events) == 0, 4); - } - - #[test(admin = @admin, reviewer = @0xA)] - #[expected_failure(abort_code = ERROR_SIGNER_NOT_REVIEWER)] - fun test_reviewer_failure_not_reviewer_role( - admin: &signer, - reviewer: &signer - ) acquires State, Archive { - let admin_address = signer::address_of(admin); - let reviewer_address = signer::address_of(reviewer); - account::create_account_for_test(admin_address); - account::create_account_for_test(reviewer_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - let metadata = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - let category = string::utf8(b"Website"); - let domain_address = string::utf8(b"mystic.com"); - let site_url = string::utf8(b"todo.mystic.com"); - let site_type = string::utf8(b"Productivity app"); - let site_tag = string::utf8(b"Web3 Project"); - let site_safety = string::utf8(b"Genuine"); - let site_ipfs_hash = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - - submit_review( - reviewer, - metadata, - category, - domain_address, - site_url, - site_type, - site_tag, - site_safety, - site_ipfs_hash - ); - } - - #[test(admin = @admin, reviewer = @0xA)] - #[expected_failure(abort_code = ERROR_METADATA_DUPLICATED)] - fun test_reviewer_failure_duplicated_review( - admin: &signer, - reviewer: &signer - ) acquires State, Archive { - let admin_address = signer::address_of(admin); - let reviewer_address = signer::address_of(reviewer); - account::create_account_for_test(admin_address); - account::create_account_for_test(reviewer_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - grant_role( - admin, - reviewer_address, - string::utf8(b"reviewer") - ); - - let metadata = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - let category = string::utf8(b"Website"); - let domain_address = string::utf8(b"mystic.com"); - let site_url = string::utf8(b"todo.mystic.com"); - let site_type = string::utf8(b"Productivity app"); - let site_tag = string::utf8(b"Web3 Project"); - let site_safety = string::utf8(b"Genuine"); - let site_ipfs_hash = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - - submit_review( - reviewer, - metadata, - category, - domain_address, - site_url, - site_type, - site_tag, - site_safety, - site_ipfs_hash - ); - - submit_review( - reviewer, - metadata, - category, - domain_address, - site_url, - site_type, - site_tag, - site_safety, - site_ipfs_hash - ); - } - - #[test(admin = @admin, reviewer = @0xA, operator = @0xB)] - fun test_delegate_review_success( - admin: &signer, - operator: &signer, - reviewer: &signer - ) acquires State, Archive { - let admin_address = signer::address_of(admin); - let reviewer_address = signer::address_of(reviewer); - let operator_address = signer::address_of(operator); - account::create_account_for_test(admin_address); - account::create_account_for_test(reviewer_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - grant_role( - admin, - operator_address, - string::utf8(b"operator") - ); - - let metadata = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - let category = string::utf8(b"Website"); - let domain_address = string::utf8(b"mystic.com"); - let site_url = string::utf8(b"todo.mystic.com"); - let site_type = string::utf8(b"Productivity app"); - let site_tag = string::utf8(b"Web3 Project"); - let site_safety = string::utf8(b"Genuine"); - let site_ipfs_hash = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - - delegate_submit_review( - operator, - reviewer_address, - metadata, - category, - domain_address, - site_url, - site_type, - site_tag, - site_safety, - site_ipfs_hash - ); - - let seed = bcs::to_bytes(&@RSEED); - let resource_account_address = account::create_resource_address(&@admin, seed); - - let expected_name = string_utils::format1(&b"Review #{}", 1); - let expected_review_token_address = token::create_token_address( - &resource_account_address, - &string::utf8(COLLECTION_NAME), - &expected_name - ); - let review_token_object = object::address_to_object(expected_review_token_address); - assert!( - object::is_owner(review_token_object, reviewer_address) == true, - 1 - ); - assert!( - token::creator(review_token_object) == resource_account_address, - 4 - ); - assert!( - token::name(review_token_object) == expected_name, - 4 - ); - assert!( - token::description(review_token_object) == string::utf8(TOKEN_DESCRIPTION), - 4 - ); - assert!( - token::uri(review_token_object) == metadata, - 4 - ); - assert!( - option::is_none(&token::royalty(review_token_object)), - 4 - ); - - let state = borrow_global(admin_address); - - assert!( - simple_map::length(&state.metadatas) == 1, - 4 - ); - - assert!(vector::contains(&state.roles.operator, &operator_address), 4); - assert!(event::counter(&state.role_granted_events) == 1, 4); - assert!(event::counter(&state.review_submitted_events) == 1, 4); - assert!(event::counter(&state.review_deleted_events) == 0, 4); - } - - #[test(admin = @admin, reviewer = @0xA, operator = @0xB)] - #[expected_failure(abort_code = ERROR_SIGNER_NOT_OPERATOR)] - fun test_delegate_review_failure_not_operator( - admin: &signer, - operator: &signer, - reviewer: &signer - ) acquires State, Archive { - let admin_address = signer::address_of(admin); - let reviewer_address = signer::address_of(reviewer); - account::create_account_for_test(admin_address); - account::create_account_for_test(reviewer_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - let metadata = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - let category = string::utf8(b"Website"); - let domain_address = string::utf8(b"mystic.com"); - let site_url = string::utf8(b"todo.mystic.com"); - let site_type = string::utf8(b"Productivity app"); - let site_tag = string::utf8(b"Web3 Project"); - let site_safety = string::utf8(b"Genuine"); - let site_ipfs_hash = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - - delegate_submit_review( - operator, - reviewer_address, - metadata, - category, - domain_address, - site_url, - site_type, - site_tag, - site_safety, - site_ipfs_hash - ); - } - - #[test(admin = @admin, reviewer = @0xA, operator = @0xB)] - fun test_delete_review_success( - admin: &signer, - operator: &signer, - reviewer: &signer - ) acquires State, ReviewToken, Archive { - let admin_address = signer::address_of(admin); - let reviewer_address = signer::address_of(reviewer); - let operator_address = signer::address_of(operator); - account::create_account_for_test(admin_address); - account::create_account_for_test(reviewer_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - grant_role( - admin, - reviewer_address, - string::utf8(b"reviewer") - ); - - let metadata = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - let category = string::utf8(b"Website"); - let domain_address = string::utf8(b"mystic.com"); - let site_url = string::utf8(b"todo.mystic.com"); - let site_type = string::utf8(b"Productivity app"); - let site_tag = string::utf8(b"Web3 Project"); - let site_safety = string::utf8(b"Genuine"); - let site_ipfs_hash = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - - submit_review( - reviewer, - metadata, - category, - domain_address, - site_url, - site_type, - site_tag, - site_safety, - site_ipfs_hash - ); - - let seed = bcs::to_bytes(&@RSEED); - let resource_account_address = account::create_resource_address(&@admin, seed); - - let expected_name = string_utils::format1(&b"Review #{}", 1); - let expected_review_token_address = token::create_token_address( - &resource_account_address, - &string::utf8(COLLECTION_NAME), - &expected_name - ); - - grant_role( - admin, - operator_address, - string::utf8(b"operator") - ); - - delete_review(reviewer, metadata); - - assert!(!exists(expected_review_token_address), 3); - - let state = borrow_global(admin_address); - - assert!(vector::contains(&state.roles.reviewer, &reviewer_address), 4); - assert!(vector::contains(&state.roles.operator, &operator_address), 4); - assert!(event::counter(&state.role_granted_events) == 2, 4); - assert!(simple_map::length(&state.metadatas) == 0, 4); - assert!(event::counter(&state.review_submitted_events) == 1, 4); - assert!(event::counter(&state.review_deleted_events) == 1, 4); - } - - #[test(admin = @admin, reviewer = @0xA, operator = @0xB)] - #[expected_failure(abort_code = ERROR_NOT_REVIEW_OWNER)] - fun test_delete_review_failure_not_operator_nor_owner( - admin: &signer, - operator: &signer, - reviewer: &signer - ) acquires State, ReviewToken, Archive { - let admin_address = signer::address_of(admin); - let reviewer_address = signer::address_of(reviewer); - account::create_account_for_test(admin_address); - account::create_account_for_test(reviewer_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - grant_role( - admin, - reviewer_address, - string::utf8(b"reviewer") - ); - - { - let state = borrow_global(admin_address); - assert!(vector::contains(&state.roles.reviewer, &reviewer_address), 4); - assert!(event::counter(&state.role_granted_events) == 1, 4); - }; - - let metadata = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - let category = string::utf8(b"Website"); - let domain_address = string::utf8(b"mystic.com"); - let site_url = string::utf8(b"todo.mystic.com"); - let site_type = string::utf8(b"Productivity app"); - let site_tag = string::utf8(b"Web3 Project"); - let site_safety = string::utf8(b"Genuine"); - let site_ipfs_hash = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - - submit_review( - reviewer, - metadata, - category, - domain_address, - site_url, - site_type, - site_tag, - site_safety, - site_ipfs_hash - ); - - { - let state = borrow_global(admin_address); - assert!(simple_map::length(&state.metadatas) == 1, 4); - assert!(event::counter(&state.review_submitted_events) == 1, 4); - }; - - delete_review(operator, metadata); - } - - #[test(admin = @admin, reviewer = @0xA)] - fun test_grant_reviewer_role_success( - admin: &signer, - reviewer: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let reviewer_address = signer::address_of(reviewer); - account::create_account_for_test(admin_address); - account::create_account_for_test(reviewer_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - grant_role( - admin, - reviewer_address, - string::utf8(b"reviewer") - ); - - let state = borrow_global(admin_address); - assert!(vector::contains(&state.roles.reviewer, &reviewer_address), 4); - assert!(event::counter(&state.role_granted_events) == 1, 4); - } - - #[test(admin = @admin, reviewer = @0xA)] - #[expected_failure(abort_code = ERROR_INVALID_ROLE_NAME)] - fun test_grant_role_failure_wrong_role( - admin: &signer, - reviewer: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let reviewer_address = signer::address_of(reviewer); - account::create_account_for_test(admin_address); - account::create_account_for_test(reviewer_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - grant_role( - admin, - reviewer_address, - string::utf8(b"") - ); - } - - #[test(admin = @admin, operator = @0xB)] - fun test_grant_operator_role_success( - admin: &signer, - operator: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let operator_address = signer::address_of(operator); - account::create_account_for_test(admin_address); - account::create_account_for_test(operator_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - grant_role( - admin, - operator_address, - string::utf8(b"operator") - ); - - let state = borrow_global(admin_address); - assert!(vector::contains(&state.roles.operator, &operator_address), 4); - assert!(event::counter(&state.role_granted_events) == 1, 4); - } - - #[test(admin = @admin, operator = @0xB)] - fun test_revoke_operator_role_success( - admin: &signer, - operator: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let operator_address = signer::address_of(operator); - account::create_account_for_test(admin_address); - account::create_account_for_test(operator_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - grant_role( - admin, - operator_address, - string::utf8(b"operator") - ); - - { - let state = borrow_global(admin_address); - assert!(vector::contains(&state.roles.operator, &operator_address), 4); - assert!(event::counter(&state.role_granted_events) == 1, 4); - }; - - revoke_role( - admin, - operator_address - ); - - let state = borrow_global(admin_address); - assert!(!vector::contains(&state.roles.operator, &operator_address), 4); - assert!(event::counter(&state.role_revoked_events) == 1, 4); - } - - #[test(admin = @admin, user = @0xB)] - #[expected_failure(abort_code = ERROR_USER_NO_ROLE)] - fun test_revoke_role_failure_user_has_no_role( - admin: &signer, - user: &signer - ) acquires State { - let admin_address = signer::address_of(admin); - let user_address = signer::address_of(user); - account::create_account_for_test(admin_address); - account::create_account_for_test(user_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - revoke_role( - admin, - user_address - ); - } - - #[test(admin = @admin, user = @0xA)] - fun test_archive( - admin: &signer, - user: &signer - ) acquires State, Archive { - let admin_address = signer::address_of(admin); - let user_address = signer::address_of(user); - account::create_account_for_test(admin_address); - account::create_account_for_test(user_address); - - let aptos_framework = account::create_account_for_test(@aptos_framework); - timestamp::set_time_has_started_for_testing(&aptos_framework); - - init_module(admin); - - grant_role( - admin, - user_address, - string::utf8(b"reviewer") - ); - - let metadata = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - let category = string::utf8(b"Website"); - let domain_address = string::utf8(b"mystic.com"); - let site_url = string::utf8(b"todo.mystic.com"); - let site_type = string::utf8(b"Productivity app"); - let site_tag = string::utf8(b"Web3 Project"); - let site_safety = string::utf8(b"Genuine"); - let site_ipfs_hash = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - - submit_review( - user, - metadata, - category, - domain_address, - site_url, - site_type, - site_tag, - site_safety, - site_ipfs_hash - ); - - let seed = bcs::to_bytes(&@RSEED); - let resource_account_address = account::create_resource_address(&@admin, seed); - - let expected_name = string_utils::format1(&b"Review #{}", 1); - let expected_review_token_address = token::create_token_address( - &resource_account_address, - &string::utf8(COLLECTION_NAME), - &expected_name - ); - let review_token_object = object::address_to_object(expected_review_token_address); - assert!( - object::is_owner(review_token_object, user_address) == true, - 1 - ); - assert!( - token::creator(review_token_object) == resource_account_address, - 4 - ); - assert!( - token::name(review_token_object) == expected_name, - 4 - ); - assert!( - token::description(review_token_object) == string::utf8(TOKEN_DESCRIPTION), - 4 - ); - assert!( - token::uri(review_token_object) == metadata, - 4 - ); - assert!( - option::is_none(&token::royalty(review_token_object)), - 4 - ); - - { - let state = borrow_global(admin_address); - - assert!(vector::contains(&state.roles.reviewer, &user_address), 4); - assert!(event::counter(&state.role_granted_events) == 1, 4); - - assert!( - simple_map::length(&state.metadatas) == 1, - 4 - ); - - assert!(event::counter(&state.review_submitted_events) == 1, 4); - assert!(event::counter(&state.review_deleted_events) == 0, 4); - }; - - let site_ipfs_hash = string::utf8(b"QmSYRXWGGqVDAHKTwfnYQDR74d4bfwXxudFosbGA695AWS"); - archive_link(user, site_url, site_ipfs_hash); - let state = borrow_global(admin_address); - assert!(simple_map::contains_key(&state.websites, &site_url), 4); - let archive = borrow_global(*simple_map::borrow(&state.websites, &site_url)); - assert!(archive.hash == site_ipfs_hash, 4); - assert!(archive.count == 2, 4); - assert!(event::counter(&state.archive_link_events) == 2, 4); - } -} \ No newline at end of file diff --git a/tests/netsepio.ts b/tests/netsepio.ts new file mode 100644 index 0000000..4ac6c46 --- /dev/null +++ b/tests/netsepio.ts @@ -0,0 +1,16 @@ +import * as anchor from "@coral-xyz/anchor"; +import { Program } from "@coral-xyz/anchor"; +import { Netsepio } from "../target/types/netsepio"; + +describe("netsepio", () => { + // Configure the client to use the local cluster. + anchor.setProvider(anchor.AnchorProvider.env()); + + const program = anchor.workspace.Netsepio as Program; + + it("Is initialized!", async () => { + // Add your test here. + const tx = await program.methods.initialize().rpc(); + console.log("Your transaction signature", tx); + }); +}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..558b83e --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "types": ["mocha", "chai"], + "typeRoots": ["./node_modules/@types"], + "lib": ["es2015"], + "module": "commonjs", + "target": "es6", + "esModuleInterop": true + } + } + \ No newline at end of file diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..4cd41f8 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,1175 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/runtime@^7.25.0": + version "7.25.7" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.7.tgz#7ffb53c37a8f247c8c4d335e89cdf16a2e0d0fb6" + integrity sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w== + dependencies: + regenerator-runtime "^0.14.0" + +"@coral-xyz/anchor@^0.29.0": + version "0.29.0" + resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.29.0.tgz#bd0be95bedfb30a381c3e676e5926124c310ff12" + integrity sha512-eny6QNG0WOwqV0zQ7cs/b1tIuzZGmP7U7EcH+ogt4Gdbl8HDmIYVMh/9aTmYZPaFWjtUaI8qSn73uYEXWfATdA== + dependencies: + "@coral-xyz/borsh" "^0.29.0" + "@noble/hashes" "^1.3.1" + "@solana/web3.js" "^1.68.0" + bn.js "^5.1.2" + bs58 "^4.0.1" + buffer-layout "^1.2.2" + camelcase "^6.3.0" + cross-fetch "^3.1.5" + crypto-hash "^1.3.0" + eventemitter3 "^4.0.7" + pako "^2.0.3" + snake-case "^3.0.4" + superstruct "^0.15.4" + toml "^3.0.0" + +"@coral-xyz/borsh@^0.29.0": + version "0.29.0" + resolved "https://registry.yarnpkg.com/@coral-xyz/borsh/-/borsh-0.29.0.tgz#79f7045df2ef66da8006d47f5399c7190363e71f" + integrity sha512-s7VFVa3a0oqpkuRloWVPdCK7hMbAMY270geZOGfCnaqexrP5dTIpbEHL33req6IYPPJ0hYa71cdvJ1h6V55/oQ== + dependencies: + bn.js "^5.1.2" + buffer-layout "^1.2.0" + +"@noble/curves@^1.4.2": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.6.0.tgz#be5296ebcd5a1730fccea4786d420f87abfeb40b" + integrity sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ== + dependencies: + "@noble/hashes" "1.5.0" + +"@noble/hashes@1.5.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.4.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.5.0.tgz#abadc5ca20332db2b1b2aa3e496e9af1213570b0" + integrity sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA== + +"@solana/buffer-layout@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz#b996235eaec15b1e0b5092a8ed6028df77fa6c15" + integrity sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA== + dependencies: + buffer "~6.0.3" + +"@solana/web3.js@^1.68.0": + version "1.95.3" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.95.3.tgz#70b5f4d76823f56b5af6403da51125fffeb65ff3" + integrity sha512-O6rPUN0w2fkNqx/Z3QJMB9L225Ex10PRDH8bTaIUPZXMPV0QP8ZpPvjQnXK+upUczlRgzHzd6SjKIha1p+I6og== + dependencies: + "@babel/runtime" "^7.25.0" + "@noble/curves" "^1.4.2" + "@noble/hashes" "^1.4.0" + "@solana/buffer-layout" "^4.0.1" + agentkeepalive "^4.5.0" + bigint-buffer "^1.1.5" + bn.js "^5.2.1" + borsh "^0.7.0" + bs58 "^4.0.1" + buffer "6.0.3" + fast-stable-stringify "^1.0.0" + jayson "^4.1.1" + node-fetch "^2.7.0" + rpc-websockets "^9.0.2" + superstruct "^2.0.2" + +"@swc/helpers@^0.5.11": + version "0.5.13" + resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.13.tgz#33e63ff3cd0cade557672bd7888a39ce7d115a8c" + integrity sha512-UoKGxQ3r5kYI9dALKJapMmuK+1zWM/H17Z1+iwnNmzcJRnfFuevZs375TA5rW31pu4BS4NoSy1fRsexDXfWn5w== + dependencies: + tslib "^2.4.0" + +"@types/bn.js@^5.1.0": + version "5.1.6" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.6.tgz#9ba818eec0c85e4d3c679518428afdf611d03203" + integrity sha512-Xh8vSwUeMKeYYrj3cX4lGQgFSF/N03r+tv4AiLl1SucqV+uTQpxRcnM8AkXKHwYP9ZPXOYXRr2KPXpVlIvqh9w== + dependencies: + "@types/node" "*" + +"@types/chai@^4.3.0": + version "4.3.20" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.20.tgz#cb291577ed342ca92600430841a00329ba05cecc" + integrity sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ== + +"@types/connect@^3.4.33": + version "3.4.38" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.38.tgz#5ba7f3bc4fbbdeaff8dded952e5ff2cc53f8d858" + integrity sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug== + dependencies: + "@types/node" "*" + +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== + +"@types/mocha@^9.0.0": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" + integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== + +"@types/node@*": + version "22.7.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.7.5.tgz#cfde981727a7ab3611a481510b473ae54442b92b" + integrity sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ== + dependencies: + undici-types "~6.19.2" + +"@types/node@^12.12.54": + version "12.20.55" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" + integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== + +"@types/uuid@^8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc" + integrity sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw== + +"@types/ws@^7.4.4": + version "7.4.7" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" + integrity sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww== + dependencies: + "@types/node" "*" + +"@types/ws@^8.2.2": + version "8.5.12" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.12.tgz#619475fe98f35ccca2a2f6c137702d85ec247b7e" + integrity sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ== + dependencies: + "@types/node" "*" + +"@ungap/promise-all-settled@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" + integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== + +JSONStream@^1.3.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" + integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + +agentkeepalive@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.5.0.tgz#2673ad1389b3c418c5a20c5d7364f93ca04be923" + integrity sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew== + dependencies: + humanize-ms "^1.2.1" + +ansi-colors@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA== + +assertion-error@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base-x@^3.0.2: + version "3.0.10" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.10.tgz#62de58653f8762b5d6f8d9fe30fa75f7b2585a75" + integrity sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ== + dependencies: + safe-buffer "^5.0.1" + +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +bigint-buffer@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/bigint-buffer/-/bigint-buffer-1.1.5.tgz#d038f31c8e4534c1f8d0015209bf34b4fa6dd442" + integrity sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA== + dependencies: + bindings "^1.3.0" + +binary-extensions@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" + integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== + +bindings@^1.3.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + dependencies: + file-uri-to-path "1.0.0" + +bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + +borsh@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.7.0.tgz#6e9560d719d86d90dc589bca60ffc8a6c51fec2a" + integrity sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA== + dependencies: + bn.js "^5.2.0" + bs58 "^4.0.0" + text-encoding-utf-8 "^1.0.2" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@~3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== + dependencies: + fill-range "^7.1.1" + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +bs58@^4.0.0, bs58@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== + dependencies: + base-x "^3.0.2" + +buffer-from@^1.0.0, buffer-from@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +buffer-layout@^1.2.0, buffer-layout@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/buffer-layout/-/buffer-layout-1.2.2.tgz#b9814e7c7235783085f9ca4966a0cfff112259d5" + integrity sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA== + +buffer@6.0.3, buffer@^6.0.3, buffer@~6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +bufferutil@^4.0.1: + version "4.0.8" + resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.8.tgz#1de6a71092d65d7766c4d8a522b261a6e787e8ea" + integrity sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw== + dependencies: + node-gyp-build "^4.3.0" + +camelcase@^6.0.0, camelcase@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + +chai@^4.3.4: + version "4.5.0" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.5.0.tgz#707e49923afdd9b13a8b0b47d33d732d13812fd8" + integrity sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.3" + deep-eql "^4.1.3" + get-func-name "^2.0.2" + loupe "^2.3.6" + pathval "^1.1.1" + type-detect "^4.1.0" + +chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +check-error@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.3.tgz#a6502e4312a7ee969f646e83bb3ddd56281bd694" + integrity sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg== + dependencies: + get-func-name "^2.0.2" + +chokidar@3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +commander@^2.20.3: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +cross-fetch@^3.1.5: + version "3.1.8" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.8.tgz#0327eba65fd68a7d119f8fb2bf9334a1a7956f82" + integrity sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg== + dependencies: + node-fetch "^2.6.12" + +crypto-hash@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/crypto-hash/-/crypto-hash-1.3.0.tgz#b402cb08f4529e9f4f09346c3e275942f845e247" + integrity sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg== + +debug@4.3.3: + version "4.3.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" + integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== + dependencies: + ms "2.1.2" + +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + +deep-eql@^4.1.3: + version "4.1.4" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.4.tgz#d0d3912865911bb8fac5afb4e3acfa6a28dc72b7" + integrity sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg== + dependencies: + type-detect "^4.0.0" + +delay@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/delay/-/delay-5.0.0.tgz#137045ef1b96e5071060dd5be60bf9334436bd1d" + integrity sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw== + +diff@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== + +diff@^3.1.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + +dot-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" + integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +es6-promise@^4.0.3: + version "4.2.8" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" + integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== + +es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ== + dependencies: + es6-promise "^4.0.3" + +escalade@^3.1.1: + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== + +escape-string-regexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eventemitter3@^4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" + integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== + +eventemitter3@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" + integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== + +eyes@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" + integrity sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ== + +fast-stable-stringify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz#5c5543462b22aeeefd36d05b34e51c78cb86d313" + integrity sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag== + +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== + dependencies: + to-regex-range "^5.0.1" + +find-up@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-func-name@^2.0.1, get-func-name@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" + integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== + +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob@7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +humanize-ms@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" + integrity sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ== + dependencies: + ms "^2.0.0" + +ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +isomorphic-ws@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" + integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== + +jayson@^4.1.1: + version "4.1.2" + resolved "https://registry.yarnpkg.com/jayson/-/jayson-4.1.2.tgz#443c26a8658703e0b2e881117b09395d88b6982e" + integrity sha512-5nzMWDHy6f+koZOuYsArh2AXs73NfWYVlFyJJuCedr93GpY+Ku8qq10ropSXVfHK+H0T6paA88ww+/dV+1fBNA== + dependencies: + "@types/connect" "^3.4.33" + "@types/node" "^12.12.54" + "@types/ws" "^7.4.4" + JSONStream "^1.3.5" + commander "^2.20.3" + delay "^5.0.0" + es6-promisify "^5.0.0" + eyes "^0.1.8" + isomorphic-ws "^4.0.1" + json-stringify-safe "^5.0.1" + uuid "^8.3.2" + ws "^7.5.10" + +js-yaml@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +json-stringify-safe@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== + +json5@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== + dependencies: + minimist "^1.2.0" + +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +log-symbols@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + +loupe@^2.3.6: + version "2.3.7" + resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.7.tgz#6e69b7d4db7d3ab436328013d37d1c8c3540c697" + integrity sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA== + dependencies: + get-func-name "^2.0.1" + +lower-case@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" + integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== + dependencies: + tslib "^2.0.3" + +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + +minimatch@4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-4.2.1.tgz#40d9d511a46bdc4e563c22c3080cde9c0d8299b4" + integrity sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g== + dependencies: + brace-expansion "^1.1.7" + +minimatch@^3.0.4: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.0, minimist@^1.2.6: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +mkdirp@^0.5.1: + version "0.5.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" + integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== + dependencies: + minimist "^1.2.6" + +mocha@^9.0.3: + version "9.2.2" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.2.2.tgz#d70db46bdb93ca57402c809333e5a84977a88fb9" + integrity sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g== + dependencies: + "@ungap/promise-all-settled" "1.1.2" + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.5.3" + debug "4.3.3" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.2.0" + growl "1.10.5" + he "1.2.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "4.2.1" + ms "2.1.3" + nanoid "3.3.1" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + which "2.0.2" + workerpool "6.2.0" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@2.1.3, ms@^2.0.0: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +nanoid@3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.1.tgz#6347a18cac88af88f58af0b3594b723d5e99bb35" + integrity sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw== + +no-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" + integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== + dependencies: + lower-case "^2.0.2" + tslib "^2.0.3" + +node-fetch@^2.6.12, node-fetch@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + +node-gyp-build@^4.3.0: + version "4.8.2" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.2.tgz#4f802b71c1ab2ca16af830e6c1ea7dd1ad9496fa" + integrity sha512-IRUxE4BVsHWXkV/SFOut4qTlagw2aM8T5/vnTsmrHJvVoKueJHRc/JaFND7QDDc61kLYUJ6qlZM3sqTSyx2dTw== + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +pako@^2.0.3: + version "2.1.0" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" + integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +pathval@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" + integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== + +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +prettier@^2.6.2: + version "2.8.8" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" + integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +regenerator-runtime@^0.14.0: + version "0.14.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +rpc-websockets@^9.0.2: + version "9.0.4" + resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-9.0.4.tgz#9d8ee82533b5d1e13d9ded729e3e38d0d8fa083f" + integrity sha512-yWZWN0M+bivtoNLnaDbtny4XchdAIF5Q4g/ZsC5UC61Ckbp0QczwO8fg44rV3uYmY4WHd+EZQbn90W1d8ojzqQ== + dependencies: + "@swc/helpers" "^0.5.11" + "@types/uuid" "^8.3.4" + "@types/ws" "^8.2.2" + buffer "^6.0.3" + eventemitter3 "^5.0.1" + uuid "^8.3.2" + ws "^8.5.0" + optionalDependencies: + bufferutil "^4.0.1" + utf-8-validate "^5.0.2" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +serialize-javascript@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + +snake-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" + integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + +source-map-support@^0.5.6: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== + +strip-json-comments@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +superstruct@^0.15.4: + version "0.15.5" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.15.5.tgz#0f0a8d3ce31313f0d84c6096cd4fa1bfdedc9dab" + integrity sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ== + +superstruct@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-2.0.2.tgz#3f6d32fbdc11c357deff127d591a39b996300c54" + integrity sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A== + +supports-color@8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +text-encoding-utf-8@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz#585b62197b0ae437e3c7b5d0af27ac1021e10d13" + integrity sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg== + +"through@>=2.2.7 <3": + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +toml@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" + integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w== + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + +ts-mocha@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/ts-mocha/-/ts-mocha-10.0.0.tgz#41a8d099ac90dbbc64b06976c5025ffaebc53cb9" + integrity sha512-VRfgDO+iiuJFlNB18tzOfypJ21xn2xbuZyDvJvqpTbWgkAgD17ONGr8t+Tl8rcBtOBdjXp5e/Rk+d39f7XBHRw== + dependencies: + ts-node "7.0.1" + optionalDependencies: + tsconfig-paths "^3.5.0" + +ts-node@7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-7.0.1.tgz#9562dc2d1e6d248d24bc55f773e3f614337d9baf" + integrity sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw== + dependencies: + arrify "^1.0.0" + buffer-from "^1.1.0" + diff "^3.1.0" + make-error "^1.1.1" + minimist "^1.2.0" + mkdirp "^0.5.1" + source-map-support "^0.5.6" + yn "^2.0.0" + +tsconfig-paths@^3.5.0: + version "3.15.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4" + integrity sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.2" + minimist "^1.2.6" + strip-bom "^3.0.0" + +tslib@^2.0.3, tslib@^2.4.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01" + integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA== + +type-detect@^4.0.0, type-detect@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.1.0.tgz#deb2453e8f08dcae7ae98c626b13dddb0155906c" + integrity sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw== + +typescript@^4.3.5: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== + +undici-types@~6.19.2: + version "6.19.8" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" + integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== + +utf-8-validate@^5.0.2: + version "5.0.10" + resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.10.tgz#d7d10ea39318171ca982718b6b96a8d2442571a2" + integrity sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ== + dependencies: + node-gyp-build "^4.3.0" + +uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +which@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +workerpool@6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" + integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +ws@^7.5.10: + version "7.5.10" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" + integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== + +ws@^8.5.0: + version "8.18.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" + integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yargs-parser@20.2.4: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + +yargs@16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yn@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" + integrity sha512-uTv8J/wiWTgUTg+9vLTi//leUl5vDQS6uii/emeTb2ssY7vl6QWf2fFbIIGjnhjvbdKlU0ed7QPgY1htTC86jQ== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==